Théo
Théo
DIAdiscord.js - Imagine an app
Created by Théo on 8/15/2023 in #djs-questions
Check if a user have the permission to execute a command.
Hello, I'm working on a ticket bot and I would like to have the same permissions for the close command and button. So I would like to check if the user have the permission in the integration tab, in the settings of discord server. But, it's only return true when a permission exist for that specific user. It's doesn't use everyone or role permisison. Did you have other alternative for me ? https://old.discordjs.dev/#/docs/discord.js/main/class/ApplicationCommandPermissionsManager?scrollTo=has
interaction.guild.commands.permissions.has({ command: '1125040422184570990', permissionId: interaction.user.id })
.then(console.log)
.catch(console.error);
interaction.guild.commands.permissions.has({ command: '1125040422184570990', permissionId: interaction.user.id })
.then(console.log)
.catch(console.error);
2 replies