Skip to content

mr-u0b0dy/telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortner Bot

License: MIT

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.

✨ How it Works

You have to initialize by /start command. Enter /help for list all command. To shorten the URL enter the command /shorturl.

demo

🚀 Usage

Prerequisites

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.

Installation

You need to install two python package : python-telegram-bot, requests.

pip install python-telegram-bot requests

Things to Change

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

Note:

I wrote this script to be executed by GitHub Action. If you tend run script in your mechine make the above changes.

or

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.

Note:

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.

📝 License

Copyright © 2021 Dharun A P.
This project is MIT licensed.