You are browsing as a guest. Sign up (or log in) to start making projects!

Ship #1 Pending review

I made a discord bot!
This is a general utility bot, aimed at a server. In future I’ll add more server-centric features. It can do as shown in the screenshot, and all the commands detailed in the repo.
DEFS the hardest part was setting up modmail. It’s also the most code out of anything, and I still have a relatively lazy solution. I decided, instead of doing straight threads like everyone else, my tickets are going to be channels and when done, archived to threads. This caused some headaches: the whole archive-to-threads thing was because i remembered discord had a 50-channel limit :/
a major problem in that was parsing and storing the messages in a modmail ticket. I cannot download all attachments and store it permanently: this will veeery quickly put a strain on storage. I’d rather not resend attachments by downloading and uploading them: this will use a lot of bandwith. and I can’t just forward every single message: this will have me very quickly hit my API rate limit. (archiving the channel can be done in bulk so I don’t hit the limit as easy there) so the solve i came up with is only messages with attachments are forwarded, and everything else is sent in the form of a .md file. You should be able to see how it looks yourself in the test server :D
i did a whooole lot of refactoring lol and I sure ain’t done. i went from single file to cogs, i went from .json to .toml, i went from single file config to multi file, and i went from writing to config as permanent storage to having a separate persistent.json file.
i hope i gave enough guidance to help you set up this bot myself! it is a bit hands-off: I don’t handhold through parts for which there are already guides (registering a discord bot, making a server and adding roles, cloning a git repo, etc) but i hope i did a good enough job on that which needs guidance. Otherwise, feel very free to try it out in the demo server, and just look at the config files without having to edit them :)
i hope you enjoy this bot, i had a lot of fun making it :D

  • 4 devlogs
  • 17h
Try project → See source code →
Open comments for this post

2h 15m 44s logged

final log before ship! :D did a whole bunch of things, namely:
a lot of refactoring.

  • renamed main.py to bot.py
  • changed checks to use the role id
  • changed config to use toml (still using json for inter-run storage, gotta do a database at some point…)
    and some other stuff
  • you can now configure the bot description and help note if you’re attaching the code to your own bot
  • there is now a command to set the bot’s nickname
    and more, check my commits! :)
0
0
2
Open comments for this post

1h 0m 44s logged

slash commands woooo!

main thing: now have slash commands :) other things: changed help command substitution to occur just after cog load instead of every time help on a command is asked, more efficient. slash commands are added as hybrid commands so prefix commands are not lost :D

0
0
5
Open comments for this post

57m 9s logged

been a while since i updated sbeve… mainly doc stuff. fixed a thing where the id wasn’t being parsed in a modmail thread header (forgot the f of an f string) added help command stuff to readme, and added a modmail logs example dir (realised that people pulling the code will get errors with that when trying to use modmail if they don’t make the modmail-logs directory). hopefully gonna change this all ’round to use a database soon

0
0
11
Open comments for this post

12h 19m 46s logged

ignore these hours if i can’t count them ig… putting the project back on here after i flunked outta terra. for a summary of what i’ve done so far, i think my project commit history is pretty legible :)

0
0
21

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…