bra1n / judgebot

Discord Bot for Magic: The Gathering / Judge related content
https://discord.com/api/oauth2/authorize?client_id=240537940378386442&permissions=274878187520&scope=applications.commands%20bot
GNU General Public License v3.0
34 stars 17 forks source link

Support slash commands #146

Closed multimeric closed 2 years ago

multimeric commented 3 years ago

Discord recently added "slash commands", which is a platform-supported method of defining bot commands, subcommands and arguments. It gives features like command completion, a better UI and discoverability for commands: https://discord.com/developers/docs/interactions/slash-commands.

I think this would be a great feature for judgebot. I'm happy to implement this once I get time. Currently this isn't natively supported by discord.js, so it's probably not worth starting until this PR is merged: https://github.com/discordjs/discord.js/pull/5106 https://github.com/discordjs/discord.js/pull/5448.

thetayloredman commented 3 years ago

One thing: you are limited to 50 guild commands and 50 global commands.

multimeric commented 3 years ago

Why is this a problem? Judgebot has like 14 commands as is. If it ever grows to beyond 50 I think that subcommands could be used to shrink this number.

thetayloredman commented 3 years ago

Ah, okay

On Dec 16, 2020, 8:16 PM -0800, Michael Milton notifications@github.com, wrote:

Why is this a problem? Judgebot has like 14 commands as is. If it ever grows to beyond 50 I think that subcommands could be used to shrink this number. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

bra1n commented 3 years ago

Ooh, nice feature! Thanks for the heads-up, when they finish the linked PR I think it could be used for judgebot. However, it looks like it would need a lot of rewriting and at least the webhook approach won't work with Emoji reactions, if I'm not mistaken. So we'll have to see how an "INTERACTION_CREATE" gateway event will be handled by Discord.JS.

multimeric commented 3 years ago

I think the bot can respond to the interaction with a regular message sent to the channel, at which point you can listen for reactions in the normal way. So I don't think this will be a huge issue.

bra1n commented 3 years ago

Let's hope that's going to be the case. :-)

thetayloredman commented 3 years ago

It appears so.

On Dec 18, 2020, 6:30 AM -0800, Steffen notifications@github.com, wrote:

Let's hope that's going to be the case. :-) — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

multimeric commented 3 years ago

Okay slash commands are now enabled since discord.js 13.0.0 on August 6. So this feature is unblocked.

multimeric commented 2 years ago

Closed by #159.