- 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
- Create virtualenv and install dependencies:
python3 -m virtualenv venv -p python3 && source ./venv/bin/activate && python -m pip install -r requirements.txt
- Run tests:
python -m nose .
- Run bot in the current console:
python main.py
- Initialize an app:
heroku login && heroku create && heroku addons:create heroku-postgresql:hobby-dev
- 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)
- Deploy:
git push heroku master && heroku ps:scale web=1