Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aborg-dev/telegrambot
Tutorial on Telegram chatbot on Heroku
https://github.com/aborg-dev/telegrambot
heroku telegram
Last synced: 3 months ago
JSON representation
Tutorial on Telegram chatbot on Heroku
- Host: GitHub
- URL: https://github.com/aborg-dev/telegrambot
- Owner: aborg-dev
- Created: 2017-10-14T18:15:07.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T00:42:07.000Z (about 2 years ago)
- Last Synced: 2024-10-13T19:10:16.915Z (3 months ago)
- Topics: heroku, telegram
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 6
- Watchers: 1
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TelegramBot
This repo guides you through a simple echo Telegram bot example.
## Local Setup
1. Register bot by talking to @BotFather, and save the token
2. Try out using this token to get updates at https://api.telegram.org/bot`TOKEN`/getUpdates
3. Try sending a message to https://api.telegram.org/bot`TOKEN`/sendMessage?chat_id=`ID`&text=`TEXT`
4. Get the code: `git clone https://github.com/akashin/TelegramBot.git`
5. Install dependencies: `pip install -r requirements.txt`
6. Run the bot with: `python bot.py`## Heroku Setup
Complete the steps from the local setup and then:1. Register on https://heroku.com
2. Install heroku command line interface https://devcenter.heroku.com/articles/heroku-cli
3. Create new Heroku application for our bot:
```sh
heroku login
heroku create --region eu appname # create app in eu region, common regions: eu, us
heroku buildpacks:set heroku/python # set python buildpack
git push heroku master # deploy app to heroku
heroku config:set TELEGRAM_TOKEN=123456789:AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLL # set config vars
heroku logs --tail # If for some reason it’s not working, check the logs
```This should automatically start your bot on Heroku.
## Materials
- Good tutorial: http://djangostars.com/blog/how-to-create-and-deploy-a-telegram-bot/
- Useful Heroku commands: https://github.com/Kylmakalle/heroku-telegram-bot