Updated README files, .gitignore and .env.example

This commit is contained in:
2022-03-17 23:49:39 +01:00
parent 135206b3ad
commit d13ba5f5ef
5 changed files with 82 additions and 11 deletions

View File

@@ -0,0 +1,8 @@
# Telegram bot api key
BOT_API_KEY=
# News api key
NEWS_API_KEY=
# Flask secret key
SECRET_KEY=

View File

@@ -1,6 +1,33 @@
## Local setup for telegram bot
0. optional: build virtual env by ``python -m venv venv``
``env/Scripts/activate``
2. create .env and set API keys etc. (use .env.example as a layout)
3. install required libs via ``pip install -r ./telegram_bot/requirements.txt``
4. run bot.py via ``python ./telegram_bot/bot.py``
# 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>`