diff --git a/src/commands/setup/fun.js b/src/commands/setup/fun.js index f009188..e1ca849 100644 --- a/src/commands/setup/fun.js +++ b/src/commands/setup/fun.js @@ -9,26 +9,16 @@ const StarBoard = require("../../database/models/starboardChannels"); module.exports = async (client, interaction, args) => { const choice = interaction.options.getString('setup'); const channel = interaction.options.getChannel('channel'); + + const choices = { + birthdays : Birthdays, + chatbot : Chatbot, + reviews : Review, + suggestions : Suggestion, + starboard : StarBoard + }; - if (choice == "birthdays") { - client.createChannelSetup(Birthdays, channel, interaction) - } - - if (choice == "chatbot") { - client.createChannelSetup(Chatbot, channel, interaction) - } - - if (choice == "reviews") { - client.createChannelSetup(Review, channel, interaction) - } - - if (choice == "suggestions") { - client.createChannelSetup(Suggestion, channel, interaction) - } - - if (choice == "starboard") { - client.createChannelSetup(StarBoard, channel, interaction) - } + client.createChannelSetup(choices[choice], channel, interaction); } - \ No newline at end of file + diff --git a/src/commands/setup/logs.js b/src/commands/setup/logs.js index 7e06f78..205bdfa 100644 --- a/src/commands/setup/logs.js +++ b/src/commands/setup/logs.js @@ -7,18 +7,14 @@ const levelLogs = require("../../database/models/levelChannels"); module.exports = async (client, interaction, args) => { const choice = interaction.options.getString('setup'); const channel = interaction.options.getChannel('channel'); + + const choices = { + serverLogs : logs, + levelLogs : levelLogs, + boostLogs : boostLogs + }; - if (choice == "serverLogs") { - client.createChannelSetup(logs, channel, interaction) - } - - if (choice == "levelLogs") { - client.createChannelSetup(levelLogs, channel, interaction) - } - - if (choice == "boostLogs") { - client.createChannelSetup(boostLogs, channel, interaction) - } + client.createChannelSetup(choices[choice], channel, interaction); } - \ No newline at end of file + diff --git a/src/commands/setup/welcomechannels.js b/src/commands/setup/welcomechannels.js index 356ec82..f27ca16 100644 --- a/src/commands/setup/welcomechannels.js +++ b/src/commands/setup/welcomechannels.js @@ -7,13 +7,12 @@ module.exports = async (client, interaction, args) => { const choice = interaction.options.getString('setup'); const channel = interaction.options.getChannel('channel'); - if (choice == "welcomechannel") { - client.createChannelSetup(welcomeChannel, channel, interaction) - } + const choices = { + welcomechannel : welcomeChannel, + leavechannel : leaveChannel + }; - if (choice == "leavechannel") { - client.createChannelSetup(leaveChannel, channel, interaction) - } + client.createChannelSetup(choices[choice], channel, interaction); } - \ No newline at end of file +