TelegramAktienBot/telegram_bot
2022-03-28 18:55:52 +02:00
..
deploy Use 2 docker containers for bot and webservice 2022-03-12 20:02:39 +01:00
news added auto sources for news 2022-03-16 13:32:26 +01:00
shares Welcome message for updates and change in json 2022-03-16 17:49:57 +01:00
.env.example Updated README files, .gitignore and .env.example 2022-03-17 23:49:39 +01:00
api_handler.py api_handler functions completed (tbd: testing) 2022-03-28 18:55:52 +02:00
bot.py github spinnt 2022-03-17 14:09:35 +01:00
db_handler.py created db_handler and fetchers 2022-03-15 08:55:12 +01:00
Dockerfile Use python:3.10-slim 2022-03-16 10:41:13 +01:00
README.md Updated README files, .gitignore and .env.example 2022-03-17 23:49:39 +01:00
requirements.txt Update python-dotenv requirement in /telegram_bot 2022-03-27 18:43:37 +00:00

Telegram bot

Aktienbot telegram bot

Development

  1. Create virtual environment python -m venv venv env/Scripts/activate
  2. Install requirements pip install -r telegram_bot/requirements.txt
  3. Set environment variables (see list below)
    1. Use .env-file in api directory like .env.example
    2. Or set variables using export or set commands. (Windows set, Linux export)
  4. Run api python telegram_bot/bot.py

Environment variables

    # Telegram bot api key
    BOT_API_KEY=
    
    # News api key
    NEWS_API_KEY=

Docker

docker run -d \
    --name aktienbot_bot \
    --hostname aktienbot_bot \
    --publish 80:80 \
    --env "BOT_API_KEY=" \
    --env "NEWS_API_KEY=" \
    --restart unless-stopped \
    registry.flokaiser.com/aktienbot/bot:latest

or load environment variables from file by using --env-file <filename>