Option to disabled application commands override
teanup opened this issue ยท 2 comments
Why?
With DiscordSRV's current API, all application (slash) commands registered for the Discord bot are cleared on plugin load, and that can be annoying.
I have had my own bot running aside from DiscordSRV's instance (with the same token) for over a year and it can be really well integrated. DiscordSRV deals with the sync chat, linked role and so on, and my app is running other custom features (a lot more complex than canned responses).
But on every reload, DiscordSRV will clear all register commands by my custom app:
[DiscordSRV] Cleared all pre-existing slash commands in 1/1 guilds (0 cancelled)
So it'd be great if we could set up the override by DiscordSRV, to prevent this behavior from happening in cases where it's not wanted.
What and How?
I understand the plugin's API supporting application commands sounds like a great feature, but it should at least be an option, because DiscordSRV can be a great addition to a server even without this plugin-set command system.
This could be fixed by adding an option in the config.yml
file that would prevent or not this loop to be executed.
Are there alternatives?
I can technically run my bot as a different user, but this would affect a lot the way my Discord server has been built, the current bot is supposed to be a helper with linking accounts (DiscordSRV part) and a helper with other features (my part). I don't feel like telling players they have to use this bot in this situation then that other bot in another situation.
Otherwise, restarting the bot after DiscordSRV is loaded works too, but DiscordSRV wipes out the permission config in Server Settings > Integrations > (the bot) > Command Permissions. So I'd have to go set it again every time.
Checks
- I have used the search at least once to check if my idea has already been suggested and perhaps already implemented.
Anything else
No response
Update
As ANutley#0646 pointed out on Discord, a nice workaround is to register global commands instead of guild commands, since DiscordSRV only clears the guild ones.
For my use of it, that solves the whole issue. But maybe some people might still need/be interested in an option to disable the plugin's override on application commands.
This is necessary to allow plugins which use our slash command API to change their command set.
If a plugin that provides slash commands through our API were disabled, there would be no other mechanism to get rid of those old commands which would no longer work and give an error.
You shouldn't be running your bot on the same application as DiscordSRV. The plugin isn't designed that way and never will be.
Using global commands as a workaround is the best option, but you should really make a separate bot for your application.