Skip to content

Jaswanth-arjun/Telegram-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

📚 Engineering Library Telegram Bot

Python Version Telegram Bot API License: MIT

A powerful, interactive Telegram bot designed to provide engineering students with instant, unit-wise access to their study materials (notes, PDFs, and resources). Built with python-telegram-bot, this bot provides a seamless user interface using inline keyboard buttons and handles member verification before granting access.


✨ Features

  • 📂 Structured Catalog: Materials organized hierarchically by DepartmentSemesterSubjectUnit.
  • 🎓 Comprehensive Department Support:
    • Computer Science & Engineering (C.S.E)
    • Electronics & Communication Engineering (E.C.E)
    • Electrical & Electronics Engineering (E.E.E)
    • Civil Engineering (CIVIL)
    • Mechanical Engineering (MECH)
  • 🔐 Channel Membership Verification: Automatically checks if a user is subscribed to the official Telegram channel (@EngineeringLibrary12) before granting access, helping grow your channel audience.
  • ⚡ Inline Keyboards: Smooth, button-based navigation for selecting departments, semesters, subjects, and units.
  • 🛠 File ID Helper: A built-in /file command to extract and print Telegram file_ids for newly uploaded PDFs, making it easy to expand the bot's database.

🛠 Tech Stack

  • Language: Python 3.8+
  • Framework: python-telegram-bot (v20.x, asyncio-based)
  • Networking: aiohttp and requests

🚀 Setup & Installation

1. Prerequisites

  • Python 3.8 or higher installed on your system.
  • A Telegram bot token obtained from @BotFather.
  • A public Telegram Channel where you upload your PDF materials.

2. Clone the Repository

git clone https://github.com/Jaswanth-arjun/Telegram-Bot.git
cd Telegram-Bot

3. Install Dependencies

Install the required packages using pip:

pip install -r requirements.txt

4. Configuration

Open bot.py and customize the following constants:

  • CHANNEL_ID: Update @EngineeringLibrary12 to your actual channel username (include the @ prefix).
  • token: Set your actual bot token obtained from @BotFather inside the main() function:
    token = 'YOUR_BOT_TOKEN'

📖 How It Works & Usage

User Flow

  1. /start: Users initiate contact with the bot. The bot checks their channel subscription status.
    • If not subscribed, they are prompted with a "Join Channel" link and a "Joined" confirmation button.
    • If subscribed, they are greeted and instructed to use /department.
  2. /department: Displays an inline keyboard listing all available departments.
  3. Semester Selection: Displays semesters belonging to the chosen department.
  4. Subject Selection: Lists all subjects registered for the chosen semester.
  5. Unit Selection: Lists units (Unit I to V/VI) for the selected subject.
  6. Delivery: The bot fetches the corresponding Telegram file_id and forwards the PDF document directly to the user.

Administrative: Adding New PDFs

To populate the bot's menu with new study materials:

  1. Send the /file command to the bot.
  2. Upload/send any PDF document to the bot.
  3. The bot will respond with the unique Telegram file_id for that document.
  4. Copy the file_id and map it into the department_subjects dictionary in bot.py under the appropriate department, semester, subject, and unit keys.

🤝 Contributing

Contributions are welcome! If you find bugs, have feature requests, or want to add support for more departments or subjects:

  1. Fork this repository.
  2. Create a feature branch (git checkout -b feature/NewFeature).
  3. Commit your changes (git commit -m 'Add some NewFeature').
  4. Push to the branch (git push origin feature/NewFeature).
  5. Open a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

using this anyone can access their engineering study materials easily.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages