Some checks are pending
Deploy RIT Freshers Hub to VPS / Deploy to Live VPS (push) Waiting to run
This is a lightweight Python microservice that acts as an intermediary between the student Q&A forum and registered helper accounts (Seniors/Staff) on Telegram.
🚀 How It Works
- Student submits a question on the web portal.
- Spring Boot Backend saves the question and triggers an HTTP POST request to the Python bot:
/send_question. - Telegram Bot broadcasts the question with a
force_replyprompt to all configured helper accounts. - Helpers reply directly to the Telegram message.
- Telegram Bot captures the reply, maps it back to the original question ID, and pushes the answer back to the Spring Boot REST endpoint (
POST /api/questions/{id}/answers).
🛠️ Installation & Setup
1. Install Dependencies
Run this in the telegram-bot/ directory:
pip install -r requirements.txt
2. Configure the Bot
Update config.json:
{
"telegram_bot_token": "YOUR_TELEGRAM_BOT_TOKEN",
"helper_chat_ids": [
971749136
],
"spring_backend_url": "http://localhost:8080"
}
How to find your Telegram Chat ID:
- Search for the bot username on Telegram and click Start (or send
/start). - The bot will automatically reply with your exact Chat ID.
- Add this ID to the
helper_chat_idsarray inconfig.json. The bot dynamically reloads configuration changes on the fly!
🏃 Running the Bot
Start the server:
python telegram_bot.py
- Bot Server Port:
8082 - Local Mappings Store:
bot_mappings.db(SQLite) is created automatically to persist message mappings so that replies continue to map to the correct questions even if the bot is restarted.