Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.99 KB

README.md

File metadata and controls

59 lines (42 loc) · 1.99 KB

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 :)