Permission

const hasManageMessagesPermission = interaction.member.permissions.has('PermissionFlagsBits.ManageMessages');

if (!hasManageMessagesPermission) {
interaction.reply({
content: `**Nie masz uprawnienia do zarządzania wnioskami.**`,
ephemeral: true,
});
return;
}
const hasManageMessagesPermission = interaction.member.permissions.has('PermissionFlagsBits.ManageMessages');

if (!hasManageMessagesPermission) {
interaction.reply({
content: `**Nie masz uprawnienia do zarządzania wnioskami.**`,
ephemeral: true,
});
return;
}
4 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Yoqurt
YoqurtOP12mo ago
why is it not works? (that's interaction on button)
xx_lavaboy_xx123
xx_lavaboy_xx12312mo ago
you put the PermissionFlagsBits.ManageMessages enum between quotation marks which made it a string, use the enum correctly or if u wanna use a string instead of an enum just pass ManageMessages without the PermissionFlagsBits part into has method
d.js docs
d.js docs12mo ago
property ButtonInteraction#memberPermissions The permissions of the member, if one exists, in the channel this interaction was executed in
Want results from more Discord servers?
Add your server