As we are finding ourselves to be kept indoors recently, we have noticed that Discord has been taking up a lot of our time. From gaming to abusing bots with commands, we have realized that our parents will not be proud of us if we kept fooling around. So, we decided to combine the best of both worlds by mixing in Discord with our favorite subject (Math) through the creation of a Calculator!

What it does

Since we are students, we are pretty lazy. Thus, we created the bot to be able to take in a submitted picture by the user which outputs a picture of the solved problem as an image. The bot is able to solve (find roots), simplify, expand, differentiate, and integrate equations - all from just being given a picture! It first displays the received image through LaTeX so users are able to check if your image has been properly converted, then it instantly displays an image to the solution to your problem!

The scope of the problems the bot can find solutions for are very diverse. Give it a problem with exponents, trigonometry, or even with imaginary numbers and it will find a solution!

How we built it

We used a multitude of technologies for the creation of our bot including the Python programming language, Discord Developer Platform, and the Mathpix, Pillow, and Wolfram|Alpha APIs. The Discord Developer Platform was used to create and host the app within Discords servers. Integration of Discord was done through syncing the discord API through our scripts. The Mathpix API was integrated to display images by converting them from an image to LaTeX which was aided by Pillow (also known as PIL) which helps to manipulate the file through saving it in a suitable format. The Wolfram|Alpha API is used by querying the converted LaTeX text alongside a keyword given by the user.

Challenges we ran into

As the API for Wolfram Alpha for Python was not the best, we had very limited options in solving as many problems as we could. Implementation of the Pillow API proved to aid image detection through Mathpix. Problems with the integral and differential keyword were solved through the implementation of proper algorithms. Minor bugs such as the inclusion of trigonometric and exponential variables proved to be too much for the bot to handle at first, but with heavy debugging and experimentation, we had reached completion.

Accomplishments that we're proud of

Usage of the Mathpix API through LaTeX technologies and successful implementation of the discord API made our bot fully functional. WIth PIllow supporting Mathpix, we are able to perfectly display the given picture from the user to the bot assuming the user has reasonably consistent handwriting. We have gotten the commands of the bot functioning, with lightning-fast responses from the bot. Solutions to problems are instant!

What we learned

We have learned how to integrate API's onto a discord bot, which has been created from scratch! This was our first time building a discord bot and using multiple APIs in one project.

What's next for disCalculator

There is still much left to do for this project which displays its immense potential. We are very excited to explore all of the different possibilities of implementing as much math as we can to take this bot to the peak. Sadly, we have realized far too late that Python is limited when it comes to the functionality of the APIs, as they are all originally written in Javascript. However, Javascript was too big of a challenge to master in 24 hours for this hackathon, but transferring languages may be the next goal alongside the implementation of higher-level math. If we find Javascript to be too challenging or understand how to continue with Python implementation, we can improve the functionality of the current system within Python and usher a new age of Python math development with help from the Sympy API.

Note: Due to technical difficulties with, it was not possible to link our registered domain to our website. Our link is

Built With

Share this project: