This bot implements the process save words and they translate. Also it can translate word and return pronocuation this word. MongoDB is a database, main models which it manage are word and user objects. In databse keeping user models that containe following fields: telegram_id, username or first name, language code, and list of word list models. Word list model in it case has following field: created time and list of words. Finally word model containe: english word and translate fields. These models introduce in below.
User |
---|
telegram ID |
username |
language code |
words |
Word |
---|
english word |
translate |
List of words |
---|
created time |
words |
- Adding new word
- Translating words
- Showing list of words by date
- Tracking chats updates
- Limiting on use
- Scheduling and sending learn reminders
- Controlling updates
/start
- Greeting command/cancel
- Resetting all works processes , for example if user is writing new word and want save, but then change his mind, he can use this command. In this case word will be not save./new
- Creation of a new word and its translation. At the beginning of this process, the bot requests a word in English, only letters of the English alphabet are accepted. Then the bot asks to translate this word into Russian, but the bot does not check the correctness of the translation, the user is responsible for this, and only Russian letters are accepted./words
- Show a list of saved words./translate <word or phrase>
- Translates word specifite after /translate command, you must enter the word or phrase to translate after the command. If after thetranslate
command a phrase/word is entered in Russian, the bot will respond with an English translation and vice versa. Responce containe transalte and pronunciation word./info
- Description commands
git clone https://github.com/IlyaBulatau/Eng-Bot.git
poetry install
poetry shell
touch .env
Note
All fields in the env file are required. Also, you need a token of bot
make app
For more comfortable development and tracking of the bot, there are user interfaces for MongoDB, RabbitMQ and Celery. You can use them if you open them in a browser on your localhost.
Important
If you set DEBUG=0 as your environment variable. When launched, the bot will read the .env.prod file, but not the .env file. And if you don't have the file, the bot won't be able to work. Check the config.py file.