achicha / telegram-bot

async server, which receive HTTP requests and resent messages to Telegram channel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HowTo:

  1. Create your own bot using Telegram's BotFather and grab your TOKEN
  2. Clone this repository
    • git clone https://github.com/achicha/telegram-bot
  3. Virtual Environment (optional):
    • cd telegram-bot
    • pip install pipenv
  4. Install all dependencies:
    • pipenv install or pip install -r Pipfile
  5. Try local heroku
    • install Heroku CLI: wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh
    • create entry point. touch Procfile with web: python run.py inside it.
    • login: heroku login
    • create app: heroku create
    • create .env file and add there config vars from settings.py
    • run local heroku: heroku local web
  6. Deploy to remote heroku:
    • add heroku remote branch: heroku git:remote -a MyHerokuAppName if it is not there git remote -v
    • copy .env params to the server: heroku config:push
    • deploy: git push heroku master
    • check logs: heroku logs -n 10
    • restart app if needed: heroku restart MyHerokuAppName

todo:

  • add telegram bot links
  • resend errors
  • block wrong messages like /start or others
  • several api links
  • store all requests to local heroku DB

Links:

About

async server, which receive HTTP requests and resent messages to Telegram channel.


Languages

Language:Python 100.0%