pocc / bga_discord

Discord bot to create games on Board Game Arena
Apache License 2.0
11 stars 5 forks source link

Support for slash commands #34

Open mavit opened 3 years ago

mavit commented 3 years ago

Discord has a new Slash Commands feature which provides command-line auto-completion for bots. To me, this seems more promising than the multi-message interactive menu-driven approach currently being pursued by bga_discord.

Discord.py does not (yet?) support this feature, but thereʼs a work-in-progress extension at https://github.com/eunwoo1104/discord-py-slash-command which could be worth investigating.

pocc commented 3 years ago

Slash commands seem like a UI improvement over the current means of calling commands. They also require servers that this bot is already on to reinvite it because it now needs this new "slash" permission. I agree that slash commands would make the interactive approach moot.

I'd be happy to add this when discord.py implements them, or would welcome PRs with the mentioned library.

mavit commented 3 years ago

I did some investigation, and found that the Discord slash command API currently dictates that commands can have options only, not arguments, and that options can have only a single value, not a list of values. Unless this improves in a future version of the API, it will make inviting multiple people pretty cumbersome.

mavit commented 3 years ago

I did some investigation, and found that the Discord slash command API currently dictates that commands can have options only, not arguments, and that options can have only a single value, not a list of values. Unless this improves in a future version of the API, it will make inviting multiple people pretty cumbersome.

I thought about this again, and realised that we can pass multiple usernames in a single option of type string. Discord will auto-complete anything starting with @ as a username even within a string, so this is probably a reasonable experience for the user.