Skip to content

Commit

Permalink
Fix error on 'trivia stop'
Browse files Browse the repository at this point in the history
Fix permissions check using discord.js 13.x method, resulting in error
  • Loading branch information
LakeYS committed Sep 2, 2023
1 parent 8d311ff commit 84bc941
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions triviabot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { ButtonBuilder, ChannelType, ActionRowBuilder, ButtonStyle } = require("discord.js");
const { ButtonBuilder, ChannelType, ActionRowBuilder, ButtonStyle, PermissionsBitField } = require("discord.js");
const entities = require("html-entities").AllHtmlEntities;
const fs = require("fs");
const JSON = require("circular-json");
Expand Down Expand Up @@ -1606,7 +1606,7 @@ Trivia.parse = (str, msg) => {
var isAdmin;
if(getConfigVal("disable-admin-commands", msg.channel) !== true) {
// Admin if there is a valid member object and they have permission.
if(msg.member !== null && msg.member.permissions.has("MANAGE_GUILD")) {
if(msg.member !== null && msg.member.permissions.has(PermissionsBitField.Flags.ManageGuild)) {
isAdmin = true;
}
else if(msg.channel.type === ChannelType.DM) {
Expand Down

0 comments on commit 84bc941

Please sign in to comment.