A Telegram bot for learning Polish language with interactive features, language level testing, and a daily notification system for learning new words.
- Language Level Testing: Determine your current Polish language proficiency
- Interview Trainer: Practice conversational Polish through interview simulation
- Topic-based Word Learning: Subscribe to daily notifications with new words by chosen topics
- AI Integration: Using AI for generating contextual examples and explanations
- Smart Notifications: Notification system considering user-convenient time (9:00-21:00)
- Python 3.x
- aiogram 3.0+ (Telegram Bot API)
- MongoDB (via motor)
- Pydantic for data validation
- AI integration for content generation
- Python 3.x
- MongoDB
- Telegram Bot Token
- AI API key (for content generation)
- Clone the repository:
git clone <repository-url>
cd <project-directory>
- Create and activate virtual environment:
python -m venv .myenv
source .myenv/bin/activate # for Linux/Mac
# or
.myenv\Scripts\activate # for Windows
- Install dependencies:
pip install -r requirements.txt
- Create .env file based on .env.example and fill in the required variables:
TOKEN=your_telegram_bot_token
MONGODB_URL=your_mongodb_url
AI_API_KEY=your_ai_api_key
- Launch the bot:
python main.py
/start
- Start working with the bot/info
- Get information about the bot/test
- Take a language level test/interview
- Start a practice interview/word
- Subscribe to words by chosen topic/stopword
- Unsubscribe from topic words
The bot sends daily notifications with new words at a convenient time for the user:
- Time range: 9:00 - 21:00
- Random time within the selected range
- Considers user's language level
- Tracks learned words
- Contextual usage examples
├── ai/ # AI integration
├── db/ # Database operations
├── handlers/ # Command handlers
├── states/ # Dialog states
├── utils/ # Helper functions
├── main.py # Entry point
├── scheduler.py # Notification scheduler
├── config.py # Configuration
└── requirements.txt # Dependencies
MIT
- Project Developer
- Contributors
We welcome contributions to the project! Please create issues and pull requests.
/start
- Start the bot and get welcome message/info
- Get detailed information about bot features/interview
- Start Polish Card interview preparation/test
- Take a language level test
The project uses MongoDB with the following collection structure:
This collection stores user data and their learning preferences.
Field | Type | Description |
---|---|---|
user_id | Integer | Telegram user ID |
username | String | Telegram username |
language_level | String | Current Polish language level (e.g., "A1") |
learned_words | Array[String] | List of words the user has learned |
word_topics | Array[String] | Topics user is subscribed to for daily words |
notifications_enabled | Boolean | Whether user wants to receive notifications |
next_notification | DateTime | Scheduled time for next word notification |
Example document:
{
"user_id": 123456789,
"username": "john_doe",
"language_level": "A1",
"learned_words": ["kot", "pies", "dom"],
"word_topics": ["animals", "family"],
"notifications_enabled": true,
"next_notification": "2024-03-17T10:00:00Z"
}