This Telegram Bot receives a url from the user and shorten it using cleanuri.com's API. This Bot works under the name @url_shortener_apdbot.
You have to initialize by /start
command. Enter /help
for list all command. To shorten the URL enter the command /shorturl
.
It is presumed that you have obtained an API token with @BotFather. We will call this token TOKEN
.
Furthermore, you have basic knowledge of the Python programming language and more importantly the Cleanuri.com API.
You need to install two python package : python-telegram-bot
, requests
.
pip install python-telegram-bot requests
You should modifiy this line with respect to your bot TOKEN
updater = Updater(<YOUR BOT TOKEN>, use_context=True)
and also remove this line.
import os
I wrote this script to be executed by GitHub Action. If you tend run script in your mechine make the above changes.
If you wish to run on GitHub, Fork this repository and then just add a Repository Secrets.
Your secrets name must be BOT_TOKEN
and value to be of your bot Token
.
There is a limitation for everything. GitHub Action cancels a run after 6 hrs. However you can increase the run time by having multiple run in a workflow.
Your also limited by GitHub Actions run time which differ for each product
(for Pro
it is 3000 mins/month). Make sure you use your time wisely.
Copyright © 2021 Dharun A P.
This project is MIT licensed.