Skip to content

A Telegram bot for learning English words based on Aiogram 3

License

Notifications You must be signed in to change notification settings

kkonstantin182/tg-language-bot

Repository files navigation

Telegram language bot

This is a simple Telegram bot designed to help users learn new English words. It is written using Aiogram 3 and utilizes Postgres as a database. In addition, for every saved word, it provides an example of usage, leveraging the WordsAPI.

Getting Started

The project was written in Python 3.10. To run it, you need to install PostgreSQL. Alternatively, you can use Docker to lift a container with the database.

Additionally, you need to obtain the tokens:

Installing

  1. Clone this reprository.
git clone https://github.com/kkonstantin182/tg-language-bot.git
  1. Create .env file and specify the tokens and credentials for the database (see the .env.example):
  • BOT_TOKEN: Telegram bot authentication token.
  • WORDS_API_TOKEN: API key for the WordsAPI service.
  • DB_HOST: Hostname or IP address of the PostgreSQL server.
  • DB_USER: Username for PostgreSQL database authentication
  • DB_PASSWORD: Password for PostgreSQL database authentication.
  • DATABASE: Name of the PostgreSQL database.
  1. If you are using Docker, lift the container with the database in the project folder (or start the Postgres):
docker compose up
  1. Create a virtual environment and install dependencies from requirements.txt.

  2. Run the bot:

python app.py
  1. Once started, type in Telegram:
/start

To see the description of available commands, type in Telegram:

/help

(!) Keep in mind that the first (original word) should be in English, otherwise it won't be possible to get the examples from WordsAPI.

Built With

  • Aiogram 3 - Asynchronous framework for Telegram Bot API.
  • Asyncpg - Database interface library for PostgreSQL for use with Python’s asyncio framework.

Status

More features may be added :)

About

A Telegram bot for learning English words based on Aiogram 3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages