XaverStiensmeier / ilarisdiscordbot

A discord bot for the ilaris ttrpg
GNU General Public License v3.0
0 stars 0 forks source link

slash commands instead of prefixed #81

Open lukruh opened 3 months ago

lukruh commented 3 months ago

Right now the bot seems to use only prefix commands (basically all messages starting with specific letter will be parsed by bot and interpreted as command). Is that intended or was it just the easiest way to start?

There are some advantages if we would switch to slash commands, which include:

The downside is that they need to be registered in discord API (true) [and cannot dynamically change (wrong)]. Update: there are no downsides I can see right now..

lukruh commented 3 months ago

here is an example with autocomplete for the ban command.. would be nice to have something similar for choosing groups or players to add/remove etc.. but requires to switch to slash commands.

lukruh commented 3 months ago

it is possible to use localize in slash commands.. its actually supported by the library: https://fallendeity.github.io/discord.py-masterclass/slash-commands/#localization

and the suggestions/choices/autocompletes can be changed during runtime (but requires an API call obviously)

lukruh commented 3 months ago

another cool thing with /commands: They generate their help messages and parameter description directly from the function doc string or can be customized with decorators.

Need to be enabled in developer portal (Probably through user install(?))