From b852a2732557983365a03fffb2e6e89169d80c0b Mon Sep 17 00:00:00 2001 From: codefactor-io Date: Sun, 13 Mar 2022 18:01:24 +0000 Subject: [PATCH] [CodeFactor] Apply fixes --- src/commands/admin/counter/addons/add.js | 27 ++++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/commands/admin/counter/addons/add.js b/src/commands/admin/counter/addons/add.js index 98a5a99..154adfc 100644 --- a/src/commands/admin/counter/addons/add.js +++ b/src/commands/admin/counter/addons/add.js @@ -46,14 +46,14 @@ module.exports = async (interaction) => { const counterExist = await counters.findOne({ guildId: member.guild.id, channelId: channel.id, - word: word, + word, }); if (!counterExist) { await counters.create({ guildId: member.guild.id, channelId: channel.id, - word: word, + word, counter: start || 0, }); // Create embed object @@ -72,19 +72,18 @@ module.exports = async (interaction) => { `Guild: ${member.guild.id} User: ${member.id} added ${channel.id} as a counter using word "${word}" for counting.` ); - // Send interaction reply - return await interaction.editReply({ embeds: [embed] }); - } else { - // Create embed object - const embed = { - title: 'Admin - Counter', - description: `${channel} is already a counting channel.`, - timestamp: new Date(), - color: config.colors.error, - footer: { iconURL: config.footer.icon, text: config.footer.text }, - }; - // Send interaction reply return await interaction.editReply({ embeds: [embed] }); } + // Create embed object + const embed = { + title: 'Admin - Counter', + description: `${channel} is already a counting channel.`, + timestamp: new Date(), + color: config.colors.error, + footer: { iconURL: config.footer.icon, text: config.footer.text }, + }; + + // Send interaction reply + return await interaction.editReply({ embeds: [embed] }); };