From a0661ef3478da928d798f52ff5af2cb45317a59f Mon Sep 17 00:00:00 2001 From: SowinskiBraeden Date: Tue, 13 Dec 2022 13:49:51 -0800 Subject: [PATCH] debug last commit --- commands/config.js | 11 +++++++---- package.json | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/commands/config.js b/commands/config.js index f7d1f65..d222e12 100644 --- a/commands/config.js +++ b/commands/config.js @@ -124,7 +124,7 @@ module.exports = { let canUseCommand = false; if (permissions.includes("MANAGE_GUILD")) canUseCommand = true; - if (client.exists(GuildDB.botAdmin) && interaction.member.roles.includes(GuildDB.botAdmin)) canUseCommand = true; + if (GuildDB.hasBotAdmin && interaction.member.roles.filter(e => GuildDB.botAdminRoles.indexOf(e) !== -1).length > 0) canUseCommand = true; if (!canUseCommand) return interaction.send({ content: 'You don\'t have the permissions to use this command.' }); if (args[0].name == 'allowed_channels') { @@ -269,8 +269,11 @@ module.exports = { } else if (args[0].name == 'view') { const channelsInfo = GuildDB.customChannelStatus ? '\n╚➤ \`/channels\` to view' : ''; const channelColor = GuildDB.customChannelStatus ? '+ ' : '- '; - const botAdminRole = GuildDB.botAdmin ? `\n╚➤ <@&${GuildDB.botAdmin}>` : ''; - const botAdminRoleColor = GuildDB.botAdmin ? `+ ` : '- '; + let botAdminRoles = ''; + for (let i = 0; i < GuildDB.botAdminRoles.length; i++) { + botAdminRoles += `\n╚➤ <@&${GuildDB.botAdminRoles[i]}>`; + } + const botAdminRoleColor = GuildDB.hasBotAdmin ? `+ ` : '- '; const excludedRolesColor = GuildDB.excludedRoles.length > 0 ? `+ ` : '- '; const excludedRolesInfo = GuildDB.excludedRoles.length > 0 ? '\n╚➤ \`/excluded\` to view' : ''; @@ -280,7 +283,7 @@ module.exports = { .addFields( { name: 'Guild ID', value: `\`\`\`arm\n${GuildDB.serverID}\`\`\``, inline: true }, { name: 'Has Allowed Channels?', value: `\`\`\`diff\n${channelColor}${GuildDB.customChannelStatus}\`\`\`${channelsInfo}`, inline: true }, - { name: 'Has bot admin role?', value: `\`\`\`diff\n${botAdminRoleColor}${client.exists(GuildDB.botAdmin)}\`\`\`${botAdminRole}`, inline: true }, + { name: 'Has bot admin role?', value: `\`\`\`diff\n${botAdminRoleColor}${client.exists(GuildDB.botAdmin)}\`\`\`${botAdminRoles}`, inline: true }, { name: 'Excluded roles?', value: `\`\`\`diff\n${excludedRolesColor}${GuildDB.excludedRoles.length > 0}\`\`\`${excludedRolesInfo}` }, ); diff --git a/package.json b/package.json index a068cc9..3647d5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayz-armbands", - "version": "4.6.0", + "version": "4.6.1", "description": "A Discord Bot to handle DayZ server flags and armbands for in game factions.", "main": "index.js", "nodemonConfig": {