A simple yet moderator-bot for Telegram chats with speech recognition, can translate voice messages to text.
- Python 3.11 or higher
- Linux (if you want to run bot with systemd and have ffmpeg in your PATH)
- Systemd (to run bot as service);
- Docker (to build your own image with better vosk model or to run bot with docker compose).
- Any vosk model you want (and you can get it here https://alphacephei.com/vosk/models)
- Model for NudeNet (https://github.com/notAI-tech/NudeNet/releases/download/v0/classifier_model.onnx)
- git clone https://github.com/krystlepalace/Akaii-Telegram-bot
- cd Akaii-Tekegram-bot && python -m venv .venv
- source .venv/bin/activate (or .venv/Scripts/activate on windows)
- pip install -r requirements.txt
- replace '.env.example' with just '.env' and fill all the variables.
- put your vosk model folder in utils/neuro/vosk/ and rename model folder as 'model'
- put nudenet model in $HOME/.Nudenet/
- python main.py
- Make sure to complete steps 1-6 from basic startup
- Replace 'akaii-bot.service.example' with just 'akaii-bot.service' and fill the WorkingDirectory and ExecStart variables
- Copy 'akaii-bot.service' to '/etc/systemd/system/'
- sudo systemctl enable akaii-bot.service and sudo systemctl start akaii-bot.service
- Now service should work, you can check it by systemctl status akaii-bot.service
- Replace 'docker-compose.example.yml' with just 'docker-compose.yml'
- Edit '.env':
- model path in docker container is '/app/utils/neuro/vosk/model'
- media path is 'app/media/'
- redis is just 'redis'
- 'bot_token' is your bot's token
- Run 'docker compose up -d'
- Check container with docker compose ps
- Also you may want to use stronger vosk models to get better speech recognition, so you will need to build new docker image.
- To do this just download any vosk model you want and replace old model with it.
- Before 'docker build' edit .env and fill variables like this:
MODEL_FULL_PATH='/app/utils/neuro/vosk/model'
MEDIA_FULL_PATH='/app/media/'
- Then simply run docker build -t akaii-bot:1.0 .
- And that's it, after build you can run bot in the container with command docker run akaii-bot
- Localization using i18n (for en, ru and ukrainian)