Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Latest commit

 

History

History
51 lines (36 loc) · 961 Bytes

README.md

File metadata and controls

51 lines (36 loc) · 961 Bytes

Running locally with polling

  1. Create file bot.ini with following content:
[Common]
DATABASE_URL = '/tmp/avatar-decorator-bot.sqlite'  # Or wherever you want to put your database
TOKEN = 'your-token-from-@BotFather'
USE_WEBHOOK = no
  1. Create virtualenv and install dependencies:
python3 -m virtualenv venv -p python3 && source ./venv/bin/activate && python -m pip install -r requirements.txt
  1. Run tests:
python -m nose .
  1. Run bot in the current console:
python main.py

Running on Heroku

  1. Initialize an app:
heroku login && heroku create && heroku addons:create heroku-postgresql:hobby-dev
  1. Set environment variables:
heroku config:set TOKEN=your-token-from-@BotFather
heroku config:set WEBHOOK_URL=$(heroku info -s | grep web_url | cut -d= -f2)
  1. Deploy:
git push heroku master && heroku ps:scale web=1