This is an asynchronous Telegram bot that helps you memorize words while learning a new language in a quiz format.
-
Get your Telegram bot token from BotFather.
-
cd
to an acceptable directory for this project. -
Clone repository to the directory using git:
git clone https://github.com/mdncv/bot_for_m.git
- Add the .env file to the project (.example.env might help you).
Variables of configuration:
Name | Type | Example | Description |
---|---|---|---|
TOKEN | String | "0123456789:SoMeSyMbOlShErE-Q" | Telegram bot token |
POSTGRES_DB | String | "postgres" | Database name |
POSTGRES_USER | String | "postgres" | Database user |
POSTGRES_HOST | String | "postgres" | Database host |
POSTGRES_PASSWORD | String | "1234" | Database password |
REDIS_HOST | String | "redis" | Redis host |
P.S. For the love of God, use strong passwords por favor.
P.P.S. These hosts examples are for docker-compose
use only. Use the standard option
(something like 127.0.0.1 or 0.0.0.0) in case
you are running services separately.
- Run services using docker-compose:
docker-compose up -d --build
P.S. Use sudo
to fix the error with mounting
database volume (or run the terminal as administrator).
-
Find your bot using Telegram search, click
START
button and enjoy! -
In case you want to stop services:
docker-compose stop
P.S. Use down
instead of stop
to remove
containers and networks if needed.
- Select the language you are learning and your native language by typing language codes:
For example: It
and then: En
-
Add words by clicking
add
. -
Remove words by clicking
remove
. -
Start quiz by clicking
quiz
. Choose the correct answer from four possible. The quiz goes on repeatedly. You can return to menu by clickingmenu
. -
See your stats by clicking
stats
. -
You can get back to initial settings by typing
/start
. After choosing the languages you will be asked if you want to reset the database (delete user words/stats).
Bug reports and/or pull requests are welcome :)