stjohann / DiscordWikiBot

Discord bot for Wikimedia projects and MediaWiki wiki sites
https://w.wiki/4nm
MIT License
40 stars 10 forks source link

Replace CommandsNext with Discord’s slash commands #11

Open fredster33 opened 3 years ago

fredster33 commented 3 years ago

I’m not sure if it’s currently available for the library this bot is using, but a slash command option could be implemented.

stjohann commented 3 years ago

It is not implemented yet in DSharpPlus and I am not sure if it will be on my radar if it gets implemented. There’s not a lot of use for it since most commands are restricted to moderators, so they don’t have to be constantly available.

xKaelyn commented 2 years ago

Added DSharpPlus' official slash command module - see https://github.com/stjohann/DiscordWikiBot/pull/12

stjohann commented 2 years ago

For now I am marking this with wontfix label for the purposes of the issue tracking. I am not closing this issue because it is a valid thing to consider generally.

I am not sure that working on this issue has value to moderators, who are currently (2021) using DiscordWikiBot’s commands most often. If there were more commands for regular users, then wontfix can be easily removed, as they should probably work with slash commands. But right now the only commands for users are !help and !status, and they can be easily entered as text.

(There are also issues with how Discord implemented slash commands, for example requiring new permissions for bots for them to work, so it is tedious to seek to implement them now in any bot that was created before they became a thing.)

Rexogamer commented 2 years ago

One minor step towards adding this - if this might eventually become a thing - would be to start requesting the slash commands permission when adding the bot to new servers. It's not a particularly dangerous addition and would make the transition slightly easier.

stjohann commented 2 years ago

Good idea, yep. The code would still need to support both methods, though, since bot commands should not become unusable on any server just because Discord made a thing. Also, to clarify above a bit: I would be open to slash commands PR if it will be written with all the necessary precautions about adding them. This is why this is not a closed issue.

For future me/others: the stuff I described about authorisation is from the official docs (403 errors will be thrown if bot tries creating commands on servers without necessary permissions)