Inspiration
We were motivated by personal experience – in sharing one fridge among 4 roommates who love to cook and cook often, there’s often way too much food taking up space in fridge, some of it getting shoved to the back and forgotten about, which is very wasteful and can sometimes get gross or messy. We wanted to find a simple way to make use of things like the forgotten veggies in the crispers, the unopened jar of jam in the back corner of the bottom shelf, and all the in-between to both reduce the clutter in the fridge and reduce the amount of food being wasted. We chose a Discord bot because some of our members had experience either using the platform itself or developing a Discord bot previously. From experience, it’s relatively straightforward to develop and add functionality to, and with Discord being such a widespread platform, it’d be accessible and familiar to many users. Our target audience is university students (mainly because of our personal motivations) and we know that some classes already require being engaged in course Discord, so people would already have that familiarity. Our bot, Meal Manager makes meal planning and cooking easier, while also being a platform to help reduce waste and clutter in the kitchen. People can spend less time thinking about what to cook, and more time making what they want to eat
What it does
Meal Manager is a custom-developed Discord bot made in JavaScript created from Discord’s Developer Portal designed to enhance meal planning experiences and make cooking easier. For all commands implemented, the bot fetches data from the Spoonacular Open API to piece together the necessary information per command. It can generate a personalized meal plan, with additional parameters like duration (a day or a week), target calorie count, and dietary preference. It can assemble possible recipes if given a list of varying ingredients as well and for any recipe particularly of interest, users can enter in that recipe ID for more detailed information like measured out ingredients, cooking steps, etc. We also implemented a wine-pairing feature where you can enter in a specific dish or cultural cuisine and the bot will suggest the perfect wine to complement your meal while also providing general ratings and prices.
How we built it
We were able to build the bot using frameworks like Discord.js for the core bot functions, and Spoonacular for the recipe APIs. The main language used was JavaScript, and we were able to contribute collaboratively using git and GitHub. The main functions come from using the discord.js features to call bot slash application commands, which would trigger a call to the Spoonacular API’s endpoints, and then having the discord bot display those results.
Challenges we ran into
The main challenge we ran into was spending a numerous amount of time with trial and error. At first, our plan was to use WordPress. However, we ran into problems with its compatibility and functionality with MacOS. In addition, the software was not as collaborative as we originally thought as we were having trouble getting the site to update with the most recent version on multiple devices. Our next plan was to use QT Creator/Designer. The main problem with this approach was the setup. At the time, we wanted to implement Python; however, when creating a new project, it would not let us select the Python option for the software kit, which included important components such as the compiler and debugger. The only option was to download and use the C++ kit, which was something we did not want to do. Because of these challenges, we had to revise our plan and implementation. In the end, we resorted to using Javascript and switched to the Discord platform. Another challenge we faced was the request limit on the Spoonacular API. For the free version of the API, we were limited to 150 requests per day for a single API key. This limit was not feasible because the bot had to go through rigorous testing and trial and error to ensure accurate results being fetched. As a result, our number of requests exceeded the request limitations. Our solution in the end was creating multiple accounts to the API to retrieve more API keys as a way to give us the ability to make requests beyond the restricted number.
Accomplishments that we're proud of
We were most proud about our recipes function. Being the flagship feature of our bot, we wanted this function to be as functional as possible, and easy to use. We wanted everything to be handled within Discord with the bot, so that the user didn’t have to click away and can just get everything in the same place. This led to the recipes displaying a cover image, being able to scroll through different recipes in the same interaction, and getting a details page on the recipes you want. Once we got everything working, it quickly became the pride and joy of our project.
What we learned
Javascript was a fairly new language for all of us, and we didn’t have a lot of time on it before this, so this project gave us a nice opportunity to work with it some more and get another language under our belts. Another big thing is working with APIs and frameworks. There was a lot of documentation to shift through, and getting everything to work nicely with each other proved to be more difficult than we thought, but it was a great learning experience to be able to take the API and run with it.
What's next for Meal Manager
If we were to continue working on Meal Manager, we would want to expand upon it and make it more appealing. We would mainly want to implement a feature where the user can save a recipe they like to some personalized profile or recipe log. This could be done by using the built-in discord database within the discord.js library, or through some 3rd party external means. In addition, we also want to make it more collaborative and allow the user to upload their own recipes to their profile or recipe log. In addition to functionality additions, we also want to make it more interactive for the user and maybe transition some of the slash-specific commands to being more embedded into the actual chat via buttons, menu drop downs, etc. so it’s not solely instruction-based design.
Built With
- discord.js
- github
- javascript
- json
- spoonacular
Log in or sign up for Devpost to join the conversation.