diff --git a/commands/moderation/clearLeaderboard.js b/commands/moderation/clearLeaderboard.js index 7251f1c..b38fb64 100644 --- a/commands/moderation/clearLeaderboard.js +++ b/commands/moderation/clearLeaderboard.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder } = require("discord.js"); +const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); const Leaderboard = require("../../models/Leaderboard"); module.exports = { @@ -10,7 +10,9 @@ module.exports = { async execute(interaction) { try { // Check if the user has the Manage Server permission - if (!interaction.member.permissions.has("ManageGuild")) { + if ( + !interaction.member.permissions.has(PermissionFlagsBits.ManageGuild) + ) { await interaction.reply({ content: "You do not have permission to use this command!", ephemeral: true, diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 7a5f0f2..128e817 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -1,4 +1,8 @@ -const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"); +const { + SlashCommandBuilder, + EmbedBuilder, + PermissionFlagsBits, +} = require("discord.js"); const KickedUser = require("../../models/KickedUser"); module.exports = { @@ -22,7 +26,9 @@ module.exports = { async execute(interaction) { try { // Check if the user has the Kick Members permission - if (!interaction.member.permissions.has("KickMembers")) { + if ( + !interaction.member.permissions.has(PermissionFlagsBits.KickMembers) + ) { await interaction.reply({ content: "You do not have permission to use this command!", ephemeral: true, diff --git a/commands/moderation/purge.js b/commands/moderation/purge.js index 1b20467..6a547f1 100644 --- a/commands/moderation/purge.js +++ b/commands/moderation/purge.js @@ -1,4 +1,8 @@ -const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"); +const { + SlashCommandBuilder, + EmbedBuilder, + PermissionFlagsBits, +} = require("discord.js"); module.exports = { data: new SlashCommandBuilder() @@ -27,7 +31,9 @@ module.exports = { async execute(interaction) { try { // Check if the user has the Manage Messages permission - if (!interaction.member.permissions.has("ManageMessages")) { + if ( + !interaction.member.permissions.has(PermissionFlagsBits.ManageMessages) + ) { await interaction.reply({ content: "You do not have permission to use this command!", ephemeral: true,