Fix admin permission check
This commit is contained in:
parent
5d6746a233
commit
162a91ca48
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
import { SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, PermissionFlagsBits } from 'discord.js';
|
||||
import { SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, PermissionFlagsBits, PermissionsBitField } from 'discord.js';
|
||||
import os from 'node:os';
|
||||
import fs from 'node:fs';
|
||||
|
||||
|
@ -51,7 +51,7 @@ export default {
|
|||
|
||||
if (args.remove) {
|
||||
if (tag) {
|
||||
if (tag.get('ownerID') == interaction.user.id || interaction.member.permissionsIn(interaction.channel).has('ADMINISTRATOR') || interaction.user.id == ownerId) {
|
||||
if (tag.get('ownerID') == interaction.user.id || interaction.member.permissionsIn(interaction.channel).has(PermissionsBitField.Flags.Administrator) || interaction.user.id == ownerId) {
|
||||
db.Tag.destroy({ where: { trigger: args.trigger, serverID: interaction.guild.id } });
|
||||
return interaction.editReply('successfully deleted the following tag: ' + args.trigger);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue