Inspiration
We are both gamers that use Discord regularly and Matthew has extensive practice with making Discord bots. Through that, we thought it would be awesome if we could integrate Canvas's API with a bot to make reminders through Discord.
What it does
The Canvas Discord Bot reads information from the Canvas API and stores it in a database, where the user can then use several different commands to retrieve desired information from the bot.
How we built it
We built the reader for the Canvas API using Python to extract the necessary information, and then store it in a MySQL database. Afterwards, we used Node.js to handle the events for the Discord bot and send all of the messages we needed, as well as adjust user settings as necessary.
Challenges we ran into
At first, we attempted to use PostgreSQL. No matter what we did, our Python program simply would not connect to the database, thus causing us to swap to MySQL after about six hours. In our first interaction with the API, we spent a lot of time trying to figure out why we were only getting 10 responses on certain queries, only to find out there was a hidden parameter we needed to edit. Additionally, we also ran into several issues with the bot commands. Some of them include, but are certainly not limited to the following: database timeouts, incorrect handling of hex color codes, configuring a .env file, and most detrimental of them all was inadvertently spawning new cron tasks every time we sent a message, resulting in stack overflows.
Accomplishments that we're proud of
We finished the project.
What we learned
- 24 hours is a lot less time than we thought it was.
- Learned how to utilize module.exports() in Node.js to keep main script small
- Learned how to use new Python modules
- Learned how to get information from an API
- Learned how to interact with MySQL
- Learned how to iterate through arrays inside of arrays inside of objects
What's next for Canvas Discord Bot
- Improving security
- Improving speed
- Addition of more features including, displaying to-do items, editing course nicknames, and automatic reminders for upcoming assignments
Log in or sign up for Devpost to join the conversation.