diff --git a/commands/config.js b/commands/config.js index c4021b9..ccf13fa 100644 --- a/commands/config.js +++ b/commands/config.js @@ -433,11 +433,11 @@ module.exports = { const optRemoveChannel = new ActionRowBuilder() .addComponents( new ButtonBuilder() - .setCustomId(`RemoveAllowedChannels-yes-${interaction.member.user.id}`) + .setCustomId(`RemoveAllowedChannels-yes-${channelid}-${interaction.member.user.id}`) .setLabel("Yes") .setStyle(ButtonStyle.Danger), new ButtonBuilder() - .setCustomId(`RemoveAllowedChannels-no-${interaction.member.user.id}`) + .setCustomId(`RemoveAllowedChannels-no-${channelid}-${interaction.member.user.id}`) .setLabel("No") .setStyle(ButtonStyle.Success) ) @@ -829,7 +829,7 @@ module.exports = { RemoveAllowedChannels: { run: async (client, interaction, GuildDB) => { - if (!queryString.endsWith(interaction.member.user.id)) { + if (!interaction.customId.endsWith(interaction.member.user.id)) { return ButtonInteraction.reply({ content: "This button is not for you", flags: (1 << 6) @@ -838,7 +838,7 @@ module.exports = { let action = '' if (interaction.customId.split('-')[1]=='yes') { action = 'removed'; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull:{"server.allowedChannels": channelid}}, (err, res) => { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull:{"server.allowedChannels": interaction.customId.split('-')[2]}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } else if (interaction.customId.split('-')[1]=='no') action = 'kept'; diff --git a/package.json b/package.json index 548a6c4..672b975 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayzr-bot", - "version": "13.0.11", + "version": "13.0.12", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "main": "index.js", "nodemonConfig": {