A bot that monitors Ferdowsi University's virtual learning platform (VU) for new assignments, quizzes, and course updates. It sends notifications to Telegram or Bale channels/groups with deadline reminders and file attachments.
- 🔄 Automatic course monitoring at configurable intervals
- 📝 New assignment notifications with deadline info
- ❓ Quiz notifications with open/close times
- 📎 Automatic file attachment downloads and uploads
- ⏰ Deadline reminders (24 hours before due + last day reminders)
- 📅 Persian (Shamsi/Jalali) date conversion
- 🔐 Captcha handling via admin chat
- 📃 Live-updating deadline overview message
- 📱 Support for both Telegram and Bale messaging platforms
- 🎯 Per-course chat ID routing for separate notification channels
- Node.js 18+
- Chromium/Chrome browser
- Telegram or Bale Bot Token
- Telegram/Bale Group/Channel
- Clone the repository:
git clone https://github.com/AidinShekari/VUBOT-FUM.git
cd VUBOT-FUM- Install dependencies:
npm install- Copy the example environment file and configure it:
cp .env.example .env- Edit
.envwith your credentials:
# Messaging Platform
API_PROVIDER=BALE # TELEGRAM or BALE (default: BALE)
API_BASE_URL= # Optional: custom API URL
# Bot Configuration
BOT_TOKEN=your_bot_token
GLOBAL_CHAT_ID=your_chat_id # Main chat for all notifications
TOPIC_ID= # Optional: for forum groups
ADMIN_CHAT_ID= # For captcha handling
# Course Configuration (JSON format - recommended)
COURSES='[{"url":"https://vu.um.ac.ir/course/view.php?id=12345","chatId":"optional_specific_chat"}]'
# Or legacy format (comma-separated)
COURSE_URLS=https://vu.um.ac.ir/course/view.php?id=12345
COURSE_CHAT_IDS= # Optional: per-course chat IDs
# Other Settings
CHECK_INTERVAL=5 # Minutes between checks (default: 5)
DEBUG_MODE=false
CHROME_PATH= # Optional: Chrome executable path
HTTP_PROXY= # Optional: proxy for bot requestsCOURSES='[
{"url": "https://vu.um.ac.ir/course/view.php?id=123"},
{"url": "https://vu.um.ac.ir/course/view.php?id=456", "chatId": "-100123456789"}
]'COURSE_URLS=https://vu.um.ac.ir/course/view.php?id=123,https://vu.um.ac.ir/course/view.php?id=456
COURSE_CHAT_IDS=,-100123456789Run the bot:
node app.jsFor production, use PM2:
npm install -g pm2
pm2 start app.js --name vubot
pm2 save| Variable | Description |
|---|---|
API_PROVIDER |
Messaging platform: TELEGRAM or BALE (default: BALE) |
API_BASE_URL |
Custom API URL (auto-set based on provider) |
BOT_TOKEN |
Bot token from @BotFather or Bale |
GLOBAL_CHAT_ID |
Main chat/group ID for all notifications |
TOPIC_ID |
Topic ID for forum groups (optional) |
ADMIN_CHAT_ID |
Admin chat ID for captcha handling |
COURSES |
JSON array of course objects with url and optional chatId |
COURSE_URLS |
Legacy: comma-separated course URLs |
COURSE_CHAT_IDS |
Legacy: comma-separated per-course chat IDs |
CHECK_INTERVAL |
Check interval in minutes (default: 5) |
DEBUG_MODE |
Enable debug logging (true/false) |
CHROME_PATH |
Chrome/Chromium executable path (optional) |
HTTP_PROXY |
Proxy URL for bot requests (optional) |
The bot creates these files to persist state:
course_data.json- Course sections and activity datamessage_ids.json- Telegram message IDs for editingdeadline_message_id.json- Deadline overview message IDreminders.json- Sent reminder historylast_day_reminders.json- Last day reminder history
MIT
Aidin Shekari