#Not a Problem but more a best-practice question

1 messages · Page 1 of 1 (latest)

gloomy sequoia
#

I was wondering how you guys declare your slash commands.
First i was clearing all SlashCommands for my Application everytime i start the bot, and declare every Command once more. I thought that might be the best practice. In this way i made sure the api matched my implementation of that command.

**But everything changed when the api attacked **

Yeah i noticed theres a limit of 200 declarations a day.
So i stopped doing this and implemented a "slash command declaration" mode. Only if active it will purge all old definitions and update them.

I probably could fetch the definition for each command and check if they have changed and update them if so. But i was wondern whats the best practice?

weary trail
#

We basically recommend just having a separate deployment script

tame thicketBOT
#

guide Interactions: Registering slash commands
read more

weary trail
#

And yeah, run that file whenever you need to make changes

gloomy sequoia
#

well yes i saw that aswell but im not happy with that

#

since its not looking right

#

right now i do it like this

        let command = new SlashCommandBuilder()
        .setDescription('Do stuff')
         // set everything you want here
        CommandService.getInstance().createSlashCommand('commandName`, command, this.handleHandoutCommand.bind(this))
weary trail
#

cant really provide much help outside of our guides if you want to do it your own way

#

But you're generally on the right track, the best practice is to find a way to only update when you actually need to