Code made more compact

This commit is contained in:
Dotwood Media 2023-01-17 14:43:45 +01:00 committed by GitHub
parent 7ef3ebf196
commit 7c2b8eb27b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}