From 8199b9ba239ee7e75200af576055c03f687f5a88 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Wed, 3 Aug 2022 10:13:56 -0700 Subject: [PATCH] debug settings --- commands/settings.js | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/commands/settings.js b/commands/settings.js index 791bae6..73fe181 100644 --- a/commands/settings.js +++ b/commands/settings.js @@ -263,17 +263,6 @@ module.exports = { if (!GuildDB.allowedChannels.includes(channelid)) return interaction.send({ embeds: [embed] }); - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull:{"server.allowedChannels": channelid}}, function (err, res) { - if (err) { - client.log(err); - const embed = new MessageEmbed() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) - .setColor("RED") - - return interaction.send({ embeds: [embed] }); - } - }); - const prompt = new MessageEmbed() .setTitle(`Are you sure you want to remove this channel from allowed channels?`) .setColor(client.config.EmbedColor) @@ -318,7 +307,7 @@ module.exports = { const successEmbed = new MessageEmbed() .setColor("GREEN") - .setTitle(`Successfully ${action} channel.`) + .setTitle(`Success: You ${action} the channel.`) return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] }); }); @@ -329,8 +318,7 @@ module.exports = { const channelid = args[0].options[1].value; if (args[0].options[0].value == 'set') { - const guild = await client.dbo.collection("guilds").findOne({"server.serverID":interaction.guild.id}).then(guild => guild); - const channelSetting = guild.server.actionChannel; + const channelSetting = GuildDB.actionChannel; const presetEmbed = new MessageEmbed() .setColor(client.config.EmbedColor) @@ -350,7 +338,7 @@ module.exports = { const successEmbed = new MessageEmbed() .setColor("GREEN") - .setTitle(`Successfully set <#${channelid}> for actions.`) + .setDescription(`**Success:** Set <#${channelid}> as the action channel.`); return interaction.send({ embeds: [successEmbed] }); } else if (args[0].options[0].value == 'remove') { @@ -398,7 +386,7 @@ module.exports = { const successEmbed = new MessageEmbed() .setColor("GREEN") - .setTitle(`Successfully ${action} channel.`) + .setTitle(`Success: You ${action} the channel.`) return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] }); }); @@ -409,8 +397,7 @@ module.exports = { const channelid = args[0].options[1].value; if (args[0].options[0].value == 'set') { - const guild = await client.dbo.collection("guilds").findOne({"server.serverID":interaction.guild.id}).then(guild => guild); - const channelSetting = guild.server.tweetChannel; + const channelSetting = GuildDB.tweetChannel; const presetEmbed = new MessageEmbed() .setColor(client.config.EmbedColor) @@ -430,7 +417,7 @@ module.exports = { const successEmbed = new MessageEmbed() .setColor("GREEN") - .setTitle(`Successfully set <#${channelid}> for tweets.`) + .setDescription(`**Success:** Set <#${channelid}> as the tweet channel.`); return interaction.send({ embeds: [successEmbed] }); } else if (args[0].options[0].value == 'remove') { @@ -478,7 +465,7 @@ module.exports = { const successEmbed = new MessageEmbed() .setColor("GREEN") - .setTitle(`Successfully ${action} channel.`) + .setTitle(`Success: You ${action} the channel.`) return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] }); }); @@ -489,8 +476,7 @@ module.exports = { const channelid = args[0].options[1].value; if (args[0].options[0].value == 'set') { - const guild = await client.dbo.collection("guilds").findOne({"server.serverID":interaction.guild.id}).then(guild => guild); - const channelSetting = guild.server.tweetChannel; + const channelSetting = GuildDB.advertsChannel; const presetEmbed = new MessageEmbed() .setColor(client.config.EmbedColor) @@ -558,7 +544,7 @@ module.exports = { const successEmbed = new MessageEmbed() .setColor("GREEN") - .setTitle(`Successfully ${action} channel.`) + .setTitle(`Success: You ${action} the channel.`) return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] }); });