Bulk upgrade commands to remove unregistered ones
Hellow
How we bulk update commands (slash but also contectuals) with sapphire ? or in more general deleting unregeistered commands ? i tried register behavior as BULK_OVERWRITE but i didn't work
4 Replies
iirc this only works if you specify guild id. if you want to setup app commands (global) you need to first remove them all and then update with current state
at least that's how I done so...
Setting the global registry behaviour to bulk overwrite will work, share code of what you tried.
To unregister use the DiscordJS methods:
client.application.commands
https://discord.js.org/docs/packages/discord.js/14.15.3/ApplicationCommandManager:Classi did
ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.BulkOverwrite);
in https://github.com/Skript-MC/Swan/blob/dev/src/structures/commands/SwanCommand.ts (it's a contribution to a french open-source bot) below REGISTRY_OPTIONSGitHub
Swan/src/structures/commands/SwanCommand.ts at dev · Skript-MC/Swan
Bot du discord Skript-MC. Contribute to Skript-MC/Swan development by creating an account on GitHub.
Solution
ok mb environment issue, idk why docker wasn't rebuild image