mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2024-11-25 02:05:56 +00:00
mod commands: update mod commands to use the PermissionFlagsBits rather than specifying manually
This commit is contained in:
parent
afd2c9f6a4
commit
c06a7cd73e
3 changed files with 20 additions and 6 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue