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 +