Add support to jsk sync
for clearing application commands
#229
+24
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Usage remains largely the same, but prefixing a target with
-
will switch to upserting an empty payload-
alone or-$
can both be used to clear global commands-.
,-*
, or-{guild_id}
all simply clear the commands for the expected targetRationale
Currently, if I want to clear my commands (my use case, btw, is clearing from the beta bot so they don't interfere with the public bot), I have to manually type
bot.tree.clear_commands(guild=guild/None)
, so this just makes it easier to wipe commands from a locale.On a similar note, I wanted to also ask - thoughts on a way to replicate
with
jsk sync
? I was thinking something like+{target}
could handle that for guild ids/*
/.
, and be ignored for$
?Summary of changes made
I created a second set that holds the guilds to be cleared, and changed the cleaned guilds list to be a tuple of [id, clear?], then loop through and set
payload
to an empty list when clear is TrueChecklist