Inspiration
Our inspiration came from the fact that the timetable often got confusing (especially in lockdowns, when concepts 'Monday' and 'Tuesday' seemed to blur into 'awake time' and 'asleep time'), so to rectify that our initial idea was to create a bot that automatically did the attendance for us. We ran into some issues with this (see below) and decided to modify the idea slightly to be more suitable
What it does
The bot sits in the server created for Computer Systems Engineering (CSE) students, and runs a background task every 30 minutes to check if the current time is the start time of a lecture (subtract 3 minutes) and uses the discord mention feature (@) to remind every student that the lecture applies to that the lecture is in 3 minutes First you have to add your timetable to it (using the $timetable) command, and then it adds you to the list of recognised users
How we built it
We built it in python, using the 'discord.py' API. This allowed us access into creating a bot, and administering commands and events to said bot. To link our coded bot to a physical bot in the server, the 'discord developer portal' was used to create that physical bot and give it the necessary permissions
Challenges we ran into
One challenge with the initial idea was that it would require web access and the sensitive email and password information of each student- which we decided would not be safe (as even though the bot would encrypt it, we would know how to decrypt it- having made the encryption). To combat this, we decided that instead it would remind you based on a timetable upload This brought in its own issues however- like "how to convert from an icalendar file to a suitable python dictionary", "what information is necessary and what is not", "how to keep the task running"
Accomplishments that we're proud of
We're very proud of the system that converts from an icalendar file to a python dictionary. It only stores relevant information, and only overwrites duplicate lectures (as the lectures aren't scheduled to repeat, but rather each week has a new set of lectures with a different date), while also deleting old lectures (such as when a timetable change occured early within the term, that lecture still exists as an event, but isn't used) We're also proud of the error handling within the bot. It only accepts the '.ics' file with a certain file name (to help with data extraction)
What we learned
We learned how to use the discord.py API, and some multi-threading asynchronous functions. Furthermore, we also learnt the basics of function decorators, and how to create and utilise discord bots
What's next for Discord Computer Systems Engineering attendance bot
The next step is to rename the actual bot and move it into the proper server instead of the test server
Built With
- discord
- discord.py
- python
Log in or sign up for Devpost to join the conversation.