/telegram-bots

Collection of multiple bots accessed via the same flask interface using flask-blueprints

Primary LanguagePythonApache License 2.0Apache-2.0

telegram-bots

These bots are deployed at heroku, where only one so-called dyno is for free. Hence one backend is used for all my bots.

local testing

  1. First of all, update pipenv and start the local heroku server.

    # update pipenv
    source ./utils/prepare_deployment.sh "<telegram-bot-api branch>"
    
     # start local heroku server
     pipenv run heroku local
  2. Then make the local heroku server available via ngrok:

    ngrok http 5000
  3. Update the telegram bots' webhooks using environment variables. pipenv is used for the right environment variables, which can be set in a local .env file.

    # update webhook in .env
    
    pipenv run python utils/set_webhook_to_ngrok.py

deploying to heroku

  1. Update pipenv using the following script.

    # update pipenv
    source ./utils/prepare_deployment.sh "master"
  2. Set the webhook to heroku, not to ngrok.

    pipenv run python utils/set_webhook_to_heroku.py
  3. Push to master since heroku automatically deploys from github.

TODO

  • clean up utils script