fix/remove allowed channels
This commit is contained in:
2 files changed
+5
-5
No files matched your search
+4
-4
@@ -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';
|
||||
|
||||
+1
-1
@@ -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": {
|
||||
|
||||
Reference in new issue
Block a user