TelegramAktienBot/telegram_bot
2022-04-26 12:07:56 +02:00
..
api_handling added set admin function 2022-04-25 19:56:41 +02:00
deploy Update Dockerfile 2022-04-26 09:46:13 +02:00
news added comments 2022-04-25 17:45:47 +02:00
shares Welcome message for updates and change in json 2022-03-16 17:49:57 +01:00
.env.example updated env example with bot creds 2022-03-29 08:44:40 +02:00
bot_updates.py more commenting and error correction in updater 2022-04-26 12:07:56 +02:00
bot.py more commenting and error correction in updater 2022-04-26 12:07:56 +02:00
Dockerfile Update Dockerfile #2 2022-04-26 09:48:34 +02:00
README.md Updated README files, .gitignore and .env.example 2022-03-17 23:49:39 +01:00
requirements.txt Merge pull request #72 from WebEngineering2/dependabot/pip/telegram_bot/pytelegrambotapi-approx-eq-4.5.0 2022-04-25 17:04:10 +02: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>