A discord bot linked with the Canvas Student API that gives the possibility to watch specific courses and embed posts when there are new announcements for these courses.
Report Bug
·
Request Feature
This project has been made for our school discord server, we use discord as our main communication platform in these times of COVID-19. That's why we decided to make it a little bit easier for every one to follow-up their courses on the same platform.
To get up and running follow these simple steps.
https://nodejs.org/en/
git clone https://github.com/NxT-Media-Technology/Canvas-Student-Announcement-Discord-Bot/
cd "Drive:/folder/folder/canvas-student-discord-bot"
npm install
Before you can actually use your bot you'll have to fill in some parameters in the .env file:
In the .env file replace all the text between < > by your parameter values :heavy_exclamation_mark: Make sure that the Canvas Token has access to all the available courses :heavy_exclamation_mark:
DISCORD_TOKEN='<https://discord.com/developers/applications>'
CANVAS_TOKEN='<https://<YOUR CANVAS DOMAIN>/profile/settings>'
CANVAS_API_COURSES_URL='https://<YOUR CANVAS DOMAIN>/api/v1/courses?enrollment_state=active&'
CANVAS_API_COURSE_URL='https://<YOUR CANVAS DOMAIN>/api/v1/courses/'
CANVAS_API_ANN_URL='https://<YOUR CANVAS DOMAIN>/api/v1/announcements?context_codes[]=course_'
node bot.js
.courses <page>
or .cs <page>
- List all the courses that the bot has access to..watchlist
or .wl
- List all the courses that are being tracked in the current textchannel..addCourse <course_id>
or .ac <course_id>
- Add the selected course to the watchlist of this channel..remove <course_id>
or .rm <course_id>
- Remove course from the watchlist of this channel..poll
- Create a poll on the latest post (with Thumb Emojis)..ping
- Responds with pong message, indicates if the bot is online.In the Commands folder you will find a js file named template.js. If you want to make your own command just copy and paste this file inside the commands folder.
commands: ["template", "t"]
- Name and Alias Of your command.expectedArgs: ["<arg1> <arg2> <arg3>"]
- Expected arguments for your command.permissionError: "You Have no permissions to run this command",
- The permission error it returns if the person running the command doesn't have the permission to use the command.minArgs: 1
- Minimum required arguments. Example: !template arg1
maxArgs: 3
- Maximum required arguments. Example: !template arg1 arg2 arg3
callback: (message, arguments, text) => {}
- This is what is called when u run the command.permissions: []
- Only allows users with certain permission to run this command. Example: permissions: ["ADMINISTRATOR"]
-> This wil only allow server admins.requiredRoles: []
- Only allows users with certain roles to run this command. Example: requiredRoles: ["Ping"]
-> This wil only allow users with role Ping.https://discordjs.guide/preparations/adding-your-bot-to-servers.html#bot-invite-links
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the Apache License. See LICENSE
for more information.
Noah Gillard - LinkedIn - Twitter - noah.gillard@telenet.be
Wouter Thys - LinkedIn - wouter.thys@student.kdg.be