Inspiration
In the wake of the COVID-19 pandemic, many schools and colleges have resorted to an online medium, limiting the social interaction of students. As a result, many students have started using Discord to connect and study together, but there are still limited tools to assist them. Thus, I came up with EdBot - an all-round homework helper on Discord.
What it does
EdBot solves a variety of mathematics questions and any other queries that you may have. It also allows developers to easily find solutions to the errors in their code through StackOverflow. Thus, EdBot allows Discord to become an all-encompassing environment for studying with your friends, as it equips you with many of the tools you need to learn. By helping you learn with your friends, EdBot enables a definite impact on education by bridging that gap of connection (between students) in education amidst the COVID-19 pandemic.
Maths Commands for EdBot:
!factor (expression): factorize an expression
!simplify (expression): simplifies an expression
!solve (equation): solves for a given variable in an equation
!domain (function): find all the possible values of x in a function
!range (function): find all the possible values of y in a function
!roots (function): find the roots of a quadratic function (works for both real and complex roots)
Other Commands for EdBot:
!search-summary (search term): provides a concise outline of anything you'd want to know
!tell-me (question): ask any question (from chemistry, physics, economics, anything under the sun at all!) and expect a reliable answer back
!poll (description): make any conversation interactive with live polls
!stack-search (query): search for any errors in your code on StackOverflow
How I built it
I used the Discord.py package to make the bot compatible with Discord and create the !poll command entirely. To resolve the Maths commands and questions from the !tell-me command, I used the WolframAlpha API for python. Alongside that, for !search-summary, I used the Wikipedia API, and for !stack-search, I used the Google Search python package and limited the search to the StackOverflow site.
Challenges I ran into
1. Finding an appropriate API for calculations and question resolution
I wanted the bot to be at least somewhat useful to IB students, and as a result, it became difficult to find an API that was all-encompassing of my needs. Many of the available APIs for mathematical calculations tended to be extremely limited in their functionality, and thus, it was difficult at first to find an appropriate API for mathematical calculations that was expansive and reliable in its functionality. For question resolution, too, I was unsure of what API to use: I had first begun with the Google Search python package, but realized that it would often given me muddled and inaccurate results and it was difficult (as well as time-consuming) to find the most appropriate result. Upon doing more research, nonetheless, I came across the WolframAlpha API which caught two fish with one worm.
2. Implementing the StackOverflow Search
At first, I tried implementing the StackOverflow Search from the StackExchange API, but this was increasing my code's cognitive complexity to the point of no return. Moreover, to use the StackExchange API, I would have to learn to use the RegEx package from scratch, which would have been difficult. Therefore, upon further brooding, I realized that I could easily, instead, use the Google Search python package, which I had previously reserved for question answering. While this would not be as seamless as the StackExchange API, I realized that this would make for a good starting point.
Accomplishments that I'm proud of
The bot largely works well and would be an asset to any studying environment on Discord!
What I learned
While I had worked with the Discord.js package before, this was my first time working with the Discord.py package. Although there was some familiarity due to the JS package, I still had to learn working with the Discord.py package from scratch.
What's next for EdBot
Hosting it 24/7 on Heroku and adding additional features like support for calculus (I didn't add it, even though it was available on the WolframAlpha API, because I am unfamiliar with calculus and would not want to add a feature that I couldn't vouch for) and playing music for studying.
Built With
- discord.py
- googlesearch
- python
- stackoverflow
- wikipedia
- wolfram-technologies
Log in or sign up for Devpost to join the conversation.