Discord bot for moodle
/help
: See a help page listing all available commands. Dynamically generated./thang
: See all upcoming events for the next month./tuan
: See all upcoming events for the next week
There are 2 options for deploying moodisc:
First, clone this repository, cd
into it and install dependencies
https://github.com/timoxoszt/moodle-discord-bot
cd moodle-discord-bot
npm install
Then get your discord and moodle tokens, and add them to your environnement
export DISCORD_TOKEN=<your discord token here>
export MOODLE_TOKEN=<your moodle token here>
export MOODLE_ID=<your moodle account id here>
export GUILD_ID=<your discord server id here>
export CLIENT_ID=<your discord bot id here>
export MOODLE_URL=<your moodle url here> # example: https://courses.uit.edu.vn/
You may also change the url for your moodle website in getEvents.js
.
After you've added your discord bot to your desired server(s), you can start the bot.
npm run dev
If you want it to run continuously in the background and have forever installed, you can directly start the forever process with
npm start
The restart
and stop
scripts are also available for easily managing the process.
To deploy with docker, you need to install podman
(or docker
but the scripts work with podman)
Create a file called .env
in which you will enter your discord and moodle details. Don't include quotes
DISCORD_TOKEN=<your discord token here>
MOODLE_TOKEN=<your moodle token here>
MOODLE_ID=<your moodle account id here>
GUILD_ID=<your discord server id here>
CLIENT_ID=<your discord bot id here>
MOODLE_URL=<your moodle url here> # example: https://courses.uit.edu.vn/
Start docker container
docker compose up -d --build
- Only UIT moodle
- Truy cập https://courses.uit.edu.vn/calendar/export.php
- Chọn
Các sự kiện được xuất
vàKhoảng thời gian
- Chọn Xuất và theo dõi phần
Network
tạidev tool