Slash commands not supported
Opened this issue · 4 comments
Slash command support is the primary obstacle to verifying the bot, which would remove the limit on how many servers it can be added to. I haven't looked too deeply into how feasible this is, but I do want to put in some effort before throwing in the towel completely. Will close the issue if I give up.
Discord.py version not recent enough to include app_commands which is needed to handle interactions. requirements.txt lists version 1.5.1, updating it in pip goes to 1.7.3, app_commands is included in 2.0.0 or later. Project may need a more recent version of python to use updated library.
Thanks for the heads up! Updating discord.py is definitely an important step (though to be honest I am very worried about breaking things haha).
More broadly, I think I've more or less settled on how to approach this refactor. The main idea is to treat "discord slash commands" as a third platform and override on_interaction, which I think most closely preserves the current structure of the project. Other parts include:
- Giving each command a schema since options in slash commands can have types
- Having a separate method to sync slash commands with discord (should be fairly boilerplate, but the gotcha is that this is apparently heavily rate-limited)
- Moving documentation into the command definitions (maybe as a doc-string?), which would also help for auto-generating the help documentation and maybe a !help command.
I've done basically no research on Discord slash commands. Your proposal seems reasonable.
Having a separate method to sync slash commands with discord (should be fairly boilerplate, but the gotcha is that this is apparently heavily rate-limited)
Maybe this should be a separate manage.py
script (in management/commands/
) that we should run as part of the deploy script
Good news! It turns out that the production bot is *actually* using python 3.8, which includes discord 2.0.0 and above! As an additional bonus, all of the pip nightmares i've had before just work with python3.8, so i'll update the docs to tell people to install 3.8 instead of 3.7, and this process should now be substantially easier.