Please sign in to access this page

Discord Slash Commands

Discord Slash Commands

10 devlogs
32h 9m
Created by Kapios

(boomer take) Making commands for Discord bots used to be simple. You scan the content of messages for your commands and then you reply. Granted, this wasn't exactly efficient, but now you have to do a whole thing with registering commands (and you don't even get a GUI for it!), and then handling each one.
I don't want to do that and chances are that neither do you. This tool will give you the option to write fewer lines of code when writing slash commands and a simple Terminal command to register them.

Timeline

Kapios
Kapios
3h 44m 3 days ago

Started making the SlashCommandBuilder! There's stuff still missing like localizations, but I think I'm about halfway done with the builder!

Update attachment

All of the individual option types have been implemented! As a bonus, I also learned the basics of semantic commit names and github projects! I'm gonna move on now to making the main command builder or tests idk yet!

Update attachment
Kapios
Kapios
3h 49m 9 days ago

I know on the outside it doesn't look like much has changed, but building options for commands is pretty much ready; I just need to implement each option type given by Discord. Then I can move to creating the actual command builder.

Update attachment

Managed to add a choices builder that's used for string, integer and number command options, so that the choices are the only available options as said in the Discord documentation

Update attachment

Progress! (i don't know what i'm doing)

Update attachment

Made a builder class for options, but so far the type inference doesn't really work. I might need to rethink this again.

Update attachment

I redid this another way where the type that converts Discord types into TS types (UsableOptionsType) doesn't take in an array of objects but rather a Record<string, DeliverableOptionData>, because TS couldn't infer types the previous way. But it works!

Update attachment

Type inference from an array works! The DeliverableOptionData interface isn't final of course as Discord also requires stuff like the description of an option, but I'm happy that I got this working!

Update attachment

I'm figuring out TS conditional types and it's very exciting and very confusing at the same time! (mostly confusing)

Update attachment

Set up the repository with 2 packages - the CLI and the Builder. Created the Builder class with a basic function for setting and validating the name of the command.

Update attachment