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.
- 📂 Structured Catalog: Materials organized hierarchically by Department ➔ Semester ➔ Subject ➔ Unit.
- 🎓 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
/filecommand to extract and print Telegramfile_ids for newly uploaded PDFs, making it easy to expand the bot's database.
- Language: Python 3.8+
- Framework: python-telegram-bot (v20.x, asyncio-based)
- Networking:
aiohttpandrequests
- 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.
git clone https://github.com/Jaswanth-arjun/Telegram-Bot.git
cd Telegram-BotInstall the required packages using pip:
pip install -r requirements.txtOpen bot.py and customize the following constants:
CHANNEL_ID: Update@EngineeringLibrary12to your actual channel username (include the@prefix).token: Set your actual bot token obtained from@BotFatherinside themain()function:token = 'YOUR_BOT_TOKEN'
/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.
/department: Displays an inline keyboard listing all available departments.- Semester Selection: Displays semesters belonging to the chosen department.
- Subject Selection: Lists all subjects registered for the chosen semester.
- Unit Selection: Lists units (Unit I to V/VI) for the selected subject.
- Delivery: The bot fetches the corresponding Telegram
file_idand forwards the PDF document directly to the user.
To populate the bot's menu with new study materials:
- Send the
/filecommand to the bot. - Upload/send any PDF document to the bot.
- The bot will respond with the unique Telegram
file_idfor that document. - Copy the
file_idand map it into thedepartment_subjectsdictionary inbot.pyunder the appropriate department, semester, subject, and unit keys.
Contributions are welcome! If you find bugs, have feature requests, or want to add support for more departments or subjects:
- Fork this repository.
- Create a feature branch (
git checkout -b feature/NewFeature). - Commit your changes (
git commit -m 'Add some NewFeature'). - Push to the branch (
git push origin feature/NewFeature). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.