VoxelBotUtils
VoxelBotUtils copied to clipboard
Implement permission handling for slash commands
I'm entirely sure there's some way I can parse the checks system to allow this, but from there I think I can make up some permission handles on the slashies.
Since opening this PR I've had a look at how the permissions for slash commands are actually handled and I genuinely can't think of a good system for how I would implement permissions because they're so weird.
https://discord.com/developers/docs/interactions/slash-commands#applicationcommandpermissions
You can add a permission for a given user or role to run a command, but this isn't something you can do for a permission check, for example. I can't say "any user with manage guild", I'd need to subscribe to role update events in that guild and then intermittently send updated permission payloads to Discord.
Nothing has happened with this for a while, so I'm just putting this out here: Discord are working on better permission systems for slash commands. While still not knowing how to handle slashies with permissions here, I'll wait for their update and hope it adds support for what we have inbuilt already.
https://msciotti.notion.site/msciotti/Command-Permissions-V2-4d113cb49090409f998f3bd80a06c3bd