Note: This project was created during my early days at FCIT (2021-2022) and may not follow the cleanest code practices or best software engineering principles. It serves as a functional WhatsApp bot but could benefit from refactoring and improvements.
A WhatsApp bot designed for FCIT (Faculty of Computing and Information Technology) students and groups. The bot provides various academic services, note management, and group administration features.
- Study Plans: Get study plans for CS, IT, and IS majors
- Academic Calendar: Access current academic calendar
- Transfer Conditions: Information about transferring to FCIT
- Major Differences: Comparison between different majors
- Tracks: Available tracks in the faculty
- Elective Courses: List of elective courses for each major
- Classrooms: Links to classroom schedules
- Allowance Tracker: Check remaining time until next allowance
- Schedule Tools: Links to BetterKAU and FCIT Groups websites
- Kick Members: Remove members from groups (admin only)
- Mention All: Mention all group members (admin only)
- Report Messages: Report inappropriate messages to admins
- Notes System: Save, retrieve, and delete group-specific notes
All commands start with ! (exclamation mark):
!الأوامر- Show all available commands!خطة [CS/IT/IS]- Get study plan for specified major!التقويم الأكاديمي- Get academic calendar!شروط التحويل- Get transfer conditions!الفرق بين التخصصات- Get differences between majors!المسارات- Get faculty tracks!المواد الاختيارية- Get elective courses!المكافأة- Check time remaining until next allowance!القاعات- Get classroom links!الجدول- Get BetterKAU link!القروبات- Get FCIT Groups link!احفظ [name]- Save a note (admin only)!هات [name]- Retrieve a note!احذف [name]- Delete a note (admin only)!الملاحظات- List all saved notes!اطرد- Kick a member (admin only)!منشن الكل- Mention all members (admin only)!تبليغ- Report a message to admins!اقتراحات- Contact developer
- Go 1.23 or higher
- PostgreSQL database
- WhatsApp account for the bot
- Clone the repository:
git clone <repository-url>
cd FCITBot- Install dependencies:
go mod download- Set up PostgreSQL databases:
CREATE DATABASE wadb;
CREATE DATABASE groupnotes;
CREATE DATABASE fcitbotmisc;
-- Connect to fcitbotmisc and create tables:
\c fcitbotmisc;
CREATE TABLE allowance (month INT, year INT);
CREATE TABLE vacations (name VARCHAR(255), date TIMESTAMP, duration VARCHAR(255));- Configure environment:
cp config.env.example config.env
# Edit config.env with your database URL and WhatsApp numbers- Run the bot:
go run main.go# Build the binary
go build -o fcitbot main.go
# Run the bot
./fcitbot# Build and run
docker build -t fcitbot .
docker run -d --name fcitbot \
-e DB_URL="postgres://user:pass@host:5432/" \
-e OWNER_NUMBER="966591234567@s.whatsapp.net" \
-e BOT_NUMBER="966551234567@s.whatsapp.net" \
fcitbotThe bot requires the following environment variables in config.env:
DB_URL: PostgreSQL connection stringOWNER_NUMBER: WhatsApp number of the bot owner (with full format)BOT_NUMBER: WhatsApp number of the bot account (with full format)
The bot uses three PostgreSQL databases:
wadb: WhatsApp session storagegroupnotes: Group-specific notes storagefcitbotmisc: Miscellaneous data (allowance tracking, vacations)
├── main.go # Main application entry point
├── config.env.example # Environment configuration template
├── cmds.txt # Available commands list
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
├── files/ # PDF documents for academic resources
│ ├── CS_PLAN.pdf
│ ├── IT_PLAN.pdf
│ ├── IS_PLAN.pdf
│ └── ...
└── lib/
├── helper/
│ └── helper.go # Utility functions
└── msgHandler/
└── msghandler.go # Message processing logic
- Add the bot to your WhatsApp group
- The bot will automatically create a notes table for the group
- Use
!الأوامرto see all available commands - Admins can use administrative commands like
!اطردand!منشن الكل
- Add the command logic in
lib/msgHandler/msghandler.go - Update the commands list in
cmds.txt - Add any required helper functions in
lib/helper/helper.go