FlavorBot banner

FlavorBot

24 devlogs
30h 53m 18s

A fun project to bring flavortown to discord and slack. It is a simple discord.py/bolt bot that integrates with the flavourTown API. This is a fun project to help expand my knowledge of discord/slack bots and put it on my portfolio.

This project uses AI

Used claude ai for code review after the whole project was done. Just to iron out any bugs that I may have missed during the process and testing

Demo Repository

Loading README...

georgegk

Shipped this project!

Hours: 17.07
Cookies: 🍪 208
Multiplier: 12.19 cookies/hr

I ported( more like rebuilt) the flavorbot from discord to slack, since this website is primarily slack based. Now It was my first slack bot ever but I think it turned out incredibly well especially thanks to my friend the block kit builder, the single best bot development tool I have ever seen (They should make that for discord). I had to basically rewrite every single program to accommodate slack and I am very proud. I did encounter a lot of issues when trying to push to AWS Lambda but you can see all about that on my latest devlog. The truth is that this project helped me grow and learn a lot as a developer allowing me to approach API integration from a new view point. I hope you find this project as useful and fun as I did, signing off!

georgegk

I know I haven’t updated in a while but I had a good reason. First I tried to change the db to dynamo db which took around 30m due to some small permissions troubles but then… I had to finally push the bot to lambda and let me tell you it was incredibly tedious/hard. First my libraries weren’t recognized fixed that, then I was told that some of libraries were compiled for windows and not linux so it took me an hour to figure out how to use layers. Then the handler didn’t work, it refused to be imported so I had to rewrite the bot to use sync and make lambda not exit out after the ack() was called which took another hour. And lastly the buttons refused to work, so I did a lot debugging, changed a lot of stuff and then realized that I was updating the wrong url and that’s why it was 404ing 🤦‍♂️. But I am happy to say that this project is officially ready! I hope you find as useful and fun as I did.

Attachment
0
georgegk

So basically I completed this feature that allows you to view and search up users. I added some QOL like maintaining the page after navigating menus and returning and allowing you to modify your query instead of having to rewrite it. It is a very nice feature I wonder why vanilla flavortown doesn’t allow you to do that. That’s mostly it, other than that I fixed a few stubborn bugs and started preparing for the push to production.

Attachment
Attachment
0
georgegk

So I did some refactoring of the codebase to split the files a bit so I don’t have a 1500 line app.py, mostly into 2 big scripts, app.py and structures.py. The first one just has all the button and menu interaction logic while the second one has the build menus that compile all the info in the json schemes slack requires. Now I want to work on a fifth feature that allows you to view and search for users using their username. After that I will work into porting everything to the structure aws lambda demands. That’s it for now signing off

Attachment
Attachment
0
georgegk

Ok so I nade the leaderboard using mostly the same logic as the discord version but adding an icon for each entry cause it looks way better. After that I decided to also include the page number so when you press back you return to the page of the leaderboard you left from. It was a bit hell routing it through the values of the buttons but I pulled through. I think I am mostly done with the port now that 4/4 features are here.

Attachment
Attachment
Attachment
0
georgegk

Last quick devlog of the day! Ok so I added the item specific page for the shop which was relatively easy since I ported most of the logic from the discord bot. This thing is really starting to take shape but it is getting way too late and I have to get up early tomorrow. I hope to ship within the day since 3/4 features are done! Goodnight

Attachment
0
georgegk

quick devlog time. I got the main page of the shop working with all the sort modes, page pagination, reverse… using a similar system to the back buttons. Most of the sorting logic was l ported from the discord bot, I just designed a new ui and hooked it to this classless system. That’s the big difference between this and discord.py since with discord I can just store any info I need in the classes and pass it on with tables but now I need to encode everything into strings and pass it using input values, but I am slowly getting there.

Attachment
Attachment
1

Comments

Joe
Joe 28 days ago

nice

georgegk

Nice I actually implemented the second feature extremely fast since I had ready basically all the build functions from the first feature. The back button was a bit complicated but I settled on encoding it into the button’s value and using .split(” “) when receiving the event to extract all the info. We are 2/4 done and are making great progress!!! I can’t wait to see the finished product it will look amazing!

Attachment
Attachment
Attachment
0
georgegk

I just finished building the devlog menu and I think I have gotten all the features I realistically want into this first option (explore). I am going to move on to the second option (projects) where I will finally have to confront that back button issue (let’s hope it won’t be too big of a problem this time cause last time it broke me a bit). I will get back to you with any updates I may have.

Attachment
Attachment
0
georgegk

I continued working on the explore tab adding the per project display. It wasn’t too difficult just a lot of messing around with blocks until I got smt that was both aesthetically pleasing and functional. Now I obviously need to get that menu down there to link to the devlogs and then I can continue to the other 3 features that hopefully with this setup will be absolutely no problem (I think I am just coping). Now I remember the the back button menu issue from the original version but I have decided that that is a future me problem and I won’t be paying any attention to it for the foreseeable future.

Attachment
Attachment
0
georgegk

I started work on the explore tab, it looks pretty good if you ask me, way better than the discord one. The banners where a huge addition that improved the quality of the whole bot. Now it is a bit annoying to build blocks cause even with the block kit builder sometimes it fails silently for no reason and I have to scramble to try and fix it but I think I am doing well. I got the search feature and the back button to work but not the project selector, on to that now!

Attachment
0
georgegk

Ok so I did some stuff over the past 1.5h. I changed the slack bot from sync to async to help with responses and tried to get the database to work. I spent like 5m trying to figure out why it did not save the keys and then I realized that I forgot to call init_db()🤦‍♂️. So the login system is finally working and I managed to get some basic interaction with flavortown. Now all that remains is to port the rest of the bot… (once again block kit builder is a live saver)

Attachment
Attachment
0
georgegk

Woah slack bot development is amazing! I can’t stress enough how useful block kit builder is. In discord every time you want to test an embed you gotta restart the program and do the command but with slack you have the preview right next to your editor and it updates dynamically. I have to say I am falling in love with slack it is a very good platform. Now back to our topic I managed to recreate my homepage with slack’s blocks and added icons that I host using the hackclub CDN ( thank you to whoever created that you are a godsend). Now I will look into doing the basic login stuff.

Attachment
0
georgegk

So I tried switching the slack bot’s mode from socket to http, since I want to look into deploying it with aws lambda (Those railway prices are starting to become a bit much). I got it to work after some trial and error which gives me hope I am going to get this to work. I also went from message commands to slash interactions to hopefully give users an easier way of triggering the interaction and made the response only visible to the user that requested it. I got this!

Attachment
0
georgegk

I saw some feedback asking for this bot to also be added on slack, so I decided that was a great idea and got started on that. Now have I ever created a slack bot before? No. Does that mean I won’t try to anyways? Also no. For now I have just managed to get this example working for my bot but it does have some good bones. I am sure this port won’t be too hard… right??

Attachment
0
cskartikey

Tagged your project as well cooked!

🔥 cskartikey marked your project as well cooked! As a prize for your nicely cooked project, look out for a bonus prize in the mail :)

georgegk

Shipped this project!

Hours: 13.82
Cookies: 🍪 283
Multiplier: 20.45 cookies/hr

Second time writing this (first one bugged out)
I made a discord.py bot for interacting with the flavortown platform. Browse projects, manage your own, explore items in the shop and see the leaderboard, all with one discord command. It was overall a somewhat challenging project, I really got to get into the menu navigation side of discord bot development, a thing I don’t do to often, and keeping track of every single menu and edge case while still trying to reuse functions was definitely a challenge. I implemented all the features I could think of as well as optimized the code and deployed it to railway. In total I had a lot of fun designing this project and I can’t wait to see what I will make next!
TLDR: Had a lot of fun, challenging but rewarding

georgegk

Finally wrote up the readme.md, I am excited to ship this project. I have setup the project on railway and invited the bot to my discord server so people can easily check it out. I had some difficulties with the build (it’s my first time on railway) but I got it all to work after adding the req.txt file. This project was incredibly fun (even if I took a long break in between) and I can’t wait to see what else I can make.

Attachment
0
georgegk

I am happy to announce that this project is officially ready. I just finished some last code checks, testing, formatting and passed the code through claude to make sure I didn’t miss anything. All that is left is to now deploy the project, write up the repo and ship!

Attachment
0
georgegk

Just here to make a big update. I mostly focused on adding the ability to create and modify projects through the ui and adding sorting modes, regions and reverse direction in the shop. The rest of the time I spent was polishing the code to make it more presentable, remove repetitions, fix weird behaviors, improve performance and overall prepare it for production. I think I have added all the features I need and ironed out the major problems with the code all that remains on that part is to add proper logging and replace requests with async sessions. After that all that will be left is the readme files, improving some of the previous logs, deploying the project and shipping it!

Attachment
0
georgegk

Started working on the shop interface, got some basic sorting, region setting, page pagination and item lists. I also looked into the API docs and couldn’t find any way to connect an item id to it’s upgrades without getting rate limited so I had to give up on that idea. Right now I am trying to get a menu to show each item in more detail which shouldn’t be too difficult.

Attachment
0
georgegk

I added a menu to view specific users from the leaderboard, which I will probably reuse to just let you explore and find users, which was harder than I thought since I needed to properly use my existing functions, that needed some heavy modification to have that multiuse capacity. Along the way I encountered several bugs that slowed me down, both from the new menu and from old short sightings of me, but I managed to resolve them.

Attachment
0
georgegk

I focused on making a few final bug fixes and changing all the responses to defer first since discord enforces a strict 3 second response time without it. I mostly did that and added some page pagination on the leaderboard as well as some setup to be able to view info on specific users. That’s it for the night, logging off.

Attachment
0
georgegk

Fixed a lot of bugs, added a search feature to the projects tab, finished the my projects section(for now more to come later) and finally created the first prototype of the leaderboard

Attachment
0
georgegk

I added a way to view the devlogs and made menu navigation easier by creating return buttons

Attachment
0
georgegk

I created the explore tab that shows different projects on the platform. I also made a menu to select specific projects and see the details and I am planning to also show devlogs!

Attachment
Attachment
0
georgegk

Here is our start. I have made some progress. I outlined the basic features an structure and made a menu to submit your user id and api key, which is stored and used for any requests that are made in the future. This is starting to look like a great project! (NOTE: I just saw the API update and found out that there is a @me endpoint, will integrate that for ease of use)

Attachment
0