Skip to content

mrc2rules/Octavia

 
 

Repository files navigation


Octavia

Octavia

Email verification and AI-powered event feed for the UTM Johor Bahru Community Discord.

Build Status License Forks Stars

Join Discord


About

The official bot for the UTMJBC Discord server. It delivers three core features:

  1. Email Verification - Students enter their official university email (@graduate.utm.my), receive a secure 6-digit OTP via nodemailer, and are automatically assigned Discord roles based on domain verification.
  2. Telegram Event Scraper - It scrapes public UTM related Telegram channels and utilizes Gemini models via Google's @google/genai SDK to classify campus events.

    Message's are passed through a multilayer filter to prevent duplication. Event details are extracted via structured JSON mapping, and then published in a Discord forum channel. If required, the posts are also translated from Malay to English.
  3. Grounded Assistant (/askai) - An interactive Discord AI assistant that answers student queries strictly grounded in authoritative institutional sources (utm.my and utm.gitbook.io), with sources linked at the end of each message. (No AI slop responses...)
---
config:
  layout: fixed
---
flowchart TB
 subgraph TP["Telegram Pipeline"]
        F["Scraper.js"]
        E["TelegramListener"]
        G["GeminiAnalyser.js"]
        H["DiscordPublisher.js"]
  end
    A["sharder.js <br>(Discord ShardingManager)"] -- spawns --> B["EmailBot.js <br>(Main Discord process)"]
    B --> C["Email System (MailSender)"] & D["Gemini Query (/askai)"] & TP
    E --> F & G & H

    style F fill:#3a3a3a,stroke:#888,color:#fff
    style E fill:#3a3a3a,stroke:#888,color:#fff
    style G fill:#3a3a3a,stroke:#888,color:#fff
    style H fill:#3a3a3a,stroke:#888,color:#fff
    style A fill:#5c1a3c,stroke:#a83a6b,color:#fff
    style B fill:#5c1a3c,stroke:#a83a6b,color:#fff
    style C fill:#3a3a3a,stroke:#888,color:#fff
    style D fill:#3a3a3a,stroke:#888,color:#fff
    style TP fill:#2a2f3a,stroke:#555,color:#ccc
Loading

Note

UTMJBC is an independent student-run community and is not affiliated with or endorsed by Universiti Teknologi Malaysia (UTM).


Documentation

Full documentation is available at the project docs site:


Self Hosting

Docker (Recommended)

mkdir utmjbc-bot && cd utmjbc-bot
mkdir config data

Create config/config.json:

{
  "token":    "<Discord Bot Token>",
  "clientId": "<Discord Bot Client ID>",
  "email":    "<Sender Email Address>",
  "username": "<SMTP Username>",
  "password": "<SMTP Password or App Password>",
  "smtpHost": "<SMTP Server, e.g. smtp.gmail.com>",
  "isGoogle": false
}

Create docker-compose.yml:

version: '3'
services:
  utmjbc-bot:
    image: ghcr.io/mrc2rules/utmjbc-bot:latest
    environment:
      - GEMINI_API_KEY=your_gemini_key
    volumes:
      - ./config:/usr/app/config
      - ./data:/usr/app/data
    ports:
      - "8181:8181"
    restart: unless-stopped
docker compose up -d

Manual Installation

Requirements: Node.js v18+

git clone https://github.com/mrc2rules/UTMJBC-Bot.git
cd UTMJBC-Bot
npm install
# fill in config/config.json (see above)
export GEMINI_API_KEY=your_key_here
npm start

Configuration Reference

Field Description
token Discord Bot Token from the Developer Portal
clientId Discord Bot Client ID
email Email address that sends verification codes
username SMTP username (usually the same as email)
password SMTP password or Gmail App Password
smtpHost SMTP server (e.g. smtp.gmail.com)
isGoogle true if using Gmail
botDbPath Directory for persistent bot.db (recommended for hosted environments)
telegramApiId From my.telegram.org — required for the event scraper
telegramApiHash From my.telegram.org
telegramPhone Phone number associated with the Telegram account
telegramSession Save the session string here after first login (printed in logs)
discordEventForumId Discord forum channel ID where events are posted
GEMINI_API_KEY (env var) Google AI API key for Gemini features

[NOTE!] Gmail: Create an App Password and set isGoogle: true.

Debugging

Type email in the console to toggle verbose SMTP error logging.


Contributors

UTMJBC Development

Original Project

Based on EmailVerify by Lars Kaesberg.


Made with ❤️ for the UTM Johor Bahru Community

Join Discord   Community Guide   Email

About

Email verification, event scraping and specialized AI powered query bot for UTM JBC Discord

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 80.7%
  • HTML 19.0%
  • Dockerfile 0.3%