The bot uses priorities when searching and generating answers for users:
filters (handler) aiogram (highest priority)
ready-made responses for specific users (greeting at the user’s first message, once a day)
own database of ready-made answers using FuzzyWuzzy (Levenshtein distance) for fuzzy matching of questions and answers (set to 80% match)
OpenAI API (only works if you contact the bot by name)
Any filter located below works only if all those located above have been skipped.
Create and run a container:
$ export BOT_TOKEN=<BOT_TOKEN>$ export AI_KEY=<AI_KEY>$ export VCHAT_ID=<VCHAT_ID>$ export DCHAT_ID=<DCHAT_ID>$ export SCHAT_ID=<SCHAT_ID>$ docker-compose up -d
Stop a running container:
$ docker-compose stop
Start a stopped container:
$ docker-compose start
Stop and remove container and network:
$ docker-compose down
Remove docker image:
$ docker rmi lariska_bot
Clear logs:
$ sudo rm -rf logs/*
BOT_TOKEN
- Telegram bot token
CHAT_ID
- ID of the chat in which the bot is allowed to work.
AI_KEY
- OpenAI API token
DOMAIN
- URL containing the application name. After deployment, go to the project settings ( Settings
) and copy the domain from the Domains
section. It should be similar to worker-production-XXXX.up.railway.app
. This will be the value for the DOMAIN
variable.