Skip to content

Commit

Permalink
Add guard clause in /pin command against members without the `MANAG…
Browse files Browse the repository at this point in the history
…E_MESSAGES` permission.
  • Loading branch information
Ale32bit committed Oct 25, 2023
1 parent bbcd2d9 commit 9e4f86d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/forum_pinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ module.exports = {

async execute(interaction) {

if(!interaction.memberPermissions.has("MANAGE_MESSAGES")) {
await interaction.reply({
content: `You do not have permissions to use this command!`,
ephemeral: true
});
return;
}

let channel = interaction.channel;

if (channel.type !== "GUILD_PUBLIC_THREAD") {
Expand Down

0 comments on commit 9e4f86d

Please sign in to comment.