Skip to content

Elektrich/LearningPL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

README: Telegram Bot for Learning Python πŸ“Œ Project Description This Telegram bot was created as a final project for a 9th-grade computer science class. The bot provides educational materials on the Python programming language, including text, images, and links to additional resources. The project is developed in Python using the python-telegram-bot library and SQLite for database management.

🌟 Key Features Educational Material Selection: Users can choose chapters and topics to study.

Content Parsing: The bot extracts text and images from web pages.

User-Friendly Navigation: Buttons for deleting messages and navigating between topics.

Formatting Support: Text is sent with HTML markup for better readability.

πŸ›  Technologies and Tools Programming Language: Python

Libraries:

python-telegram-bot β€” for interacting with the Telegram API.

sqlite3 β€” for database operations.

requests and BeautifulSoup β€” for web scraping.

html β€” for escaping special characters.

Development Environment: PyCharm

Database: SQLite

πŸ“‚ Project Structure Copy . β”œβ”€β”€ main.py # Bot core: command and message handling β”œβ”€β”€ dbwork.py # Database operations β”œβ”€β”€ parsework.py # Parsing educational content β”œβ”€β”€ config.py # Configuration data (e.g., bot token) └── README.md # Usage instructions πŸš€ Installation and Setup Clone the Repository:

bash Copy git clone https://github.com/your-username/your-repository.git cd your-repository Install Dependencies:

bash Copy pip install python-telegram-bot requests beautifulsoup4 Configure the Bot Token:

Create a bot via BotFather and obtain the token.

Save the token in config.py:

python Copy TOKEN = "your-token-here" Run the Bot:

bash Copy python main.py πŸ’‘ Usage Examples Start Command:

The user sends /start, and the bot responds with a welcome message and topic selection options.

Topic Selection:

The bot displays a list of chapters and topics with navigation buttons.

Message Deletion:

Users can delete all messages in a topic by clicking the "Delete All" button.

πŸ› Common Issues and Solutions Error can't parse entities: Caused by improper text formatting. Solution: Use HTML markup.

Error message too long: Text exceeds Telegram's 4096-character limit. Solution: Split the text into smaller parts.

Image Issues: Ensure image URLs are correct and complete.

πŸ“ˆ Future Enhancements Add support for other programming languages.

Include video and audio materials.

Integrate APIs for automatic content updates.

Implement usage statistics collection.

πŸ“š References Geek Brains β€” What is a Chatbot?

Mailfit β€” Chatbots in Marketing

Habr β€” Evolution of Chatbots

βœ‰οΈ Contact Author: Mark Nesterov, 9th-grade student.

Project Supervisor: Yulia Barybina, Computer Science Teacher.

Β© 2024-2025 Academic Year, MBOU Secondary School, Korfovsky

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages