-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Register slash commands #148
base: main
Are you sure you want to change the base?
Conversation
It's easier to remove it from commandsList as it can't be registered as a slash command.
This makes it easier to register them as both our existing ! commands and slash commands.
Commands with arguments make implementing slash commands in a back compatible way more challenging, so I'll fix them later.
I've pushed my slash command registration code if anyone would like to review or test it. For some reason the bot commands keep disappearing from Discord, so I'm still trying to work out some bugs. |
@nickmccurdy what help testing do you need? I can smoke test, but I see there are some conflicts. Do you want to resolve or should I take a look? I think it's because of the |
@@ -54,6 +62,18 @@ bot | |||
|
|||
if (bot.application) { | |||
const { id } = bot.application; | |||
|
|||
await api.put(Routes.applicationCommands(id), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something else we may want to add, this is update-only. Might want to make sure we handle deleted commands too, by comparing api.get(Routes.applicationCommands(id))
with the list of commands in the code
I'm aware of the conflicts, I'll fix them. I was referring to manually testing the slash commands on Discord. They seem to be pretty unpredictable. Specifically, if you try to list commands, the Reactibot commands will rapidly flash on and off. I'm guessing it's either a Discord bug or undefined behavior in the API. You can experiment with it in another branch if you want, but I have some ideas I'll be trying as well. |
The commands show up consistently when typing My guess is that it will fix itself in an hour (the TTL of Discord's slash commands) but I don't have the time to wait right now. |
No description provided.