mctantwerp / Canvas-Student-Announcement-Discord-Bot

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.
Apache License 2.0
28 stars 9 forks source link
canvas canvas-lms discord discord-bot discord-js


Canvas Student Announcement Discord Bot

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

Table of Contents

  1. About The Project
  2. Getting Started
  3. Commands
  4. Make Your Own Command?
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

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.

Built With

Getting Started

To get up and running follow these simple steps.

Prerequisites

Installation

  1. Clone the repo
    git clone https://github.com/NxT-Media-Technology/Canvas-Student-Announcement-Discord-Bot/
  2. Navigate into your cloned folder
    cd "Drive:/folder/folder/canvas-student-discord-bot"
  3. Install NPM packages
    npm install

Usage

Before you can actually use your bot you'll have to fill in some parameters in the .env file:

  1. Rename the .env.example to .env
  2. 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_'
  3. Run the node server
    node bot.js

Commands

Make Your Own Command?

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.

Add bot to server

https://discordjs.guide/preparations/adding-your-bot-to-servers.html#bot-invite-links

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Apache License. See LICENSEfor more information.

Contact

Noah Gillard - LinkedIn - Twitter - noah.gillard@telenet.be

Wouter Thys - LinkedIn - wouter.thys@student.kdg.be

Acknowledgements