Discord has recently seen a growth in its number of users. Along with the new users, the popularity of bots that simplify the users' lives have also risen as well. We have not yet seen a Discord bot which can quickly provide specific answers to a variety of environmental questions which was also easy to use, so we decided to make one.

What it does

CarbonBot is a discord bot that can automatically answer text-based questions related to the environment in a discord server. Currently, we've given it three main functionalities. It can calculate the carbon footprints from activities such as driving cars, eating food, and flying in planes. The bot can also tell the user whether or not a certain material is recyclable. Lastly, it can give the user a quick summary of the coronavirus statistics in a given country.

How we built it

We mostly used Javascript and the Discord Developer Portal for writing the code. We used a carbon footprint and coronavirus API to do calculations and retrieve numbers.

Challenges we ran into

None of us have heard about APIs before doing this project, so it was a challenge for us to figure out how to make API calls and processing their responses. We also encountered challenges with implementing the processed responses within the discord bot so that it can make creative use of the API responses.

Accomplishments that we're proud of

Being able to create a fully functioning discord bot without any prior knowledge of discord bot coding and the Discord Developer Portal. Making use of fetch requests and promises in Javascript to give numerical answers to a discord bot through API calls.

What we learned

We learned how to code Discord bots that can read messages in text channels and send messages and emojis in response to them. We also learned how to call APIs and process their responses within JavaScript, which allowed the bot to use data from other websites in creative ways.

What's next for CarbonBot

Implementing more commands for the CarbonBot so it can answer more questions and educating Discord users of their environmental impact!

Built With

Share this project: