Check if guild member can use slash command.

I want to send ephemeral reply message with listed only slash commands (commands mentions), that guild member can use, and skip slash commands that member can not use in specific guild. That message is supposed to look different for every member, base on role and member permission overrides set up by guild administrator. My goal is to create command check similar to this chart: https://cdn.discordapp.com/attachments/697138785317814292/1042878162901672048/flowchart-for-new-permissions.png I figured out i can fetch command overrides like this:
interaction.guild.commands.permissions.fetch()
interaction.guild.commands.permissions.fetch()
but it returns collection of overrides for channels, roles and users. Is there any better way to check if member has permission to use slash command, instead of check if any member's role has permission to use slash command, and then if that specific member has permission?
5 Replies
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
monbrey
monbrey•2y ago
No, there's really no better way. The whole point of the new slash command UI is that you don't need separate help commands
MD
MDOP•2y ago
yes, i know that Discord do this automatically, but i dont want to send to the user commands that he can not use 🤔 Maybe would be good to implement some automatization of that process to d.js? If i will make it work, i can create PR if d.js devs consider it useful.
monbrey
monbrey•2y ago
We tend not to build a heap of helper functions into our library, no
MD
MDOP•2y ago
ok, i remember v11 and v12 had that kind of helpers
Want results from more Discord servers?
Add your server