Code made more compact

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

View file

@ -10,25 +10,15 @@ module.exports = async (client, interaction, args) => {
const choice = interaction.options.getString('setup'); const choice = interaction.options.getString('setup');
const channel = interaction.options.getChannel('channel'); const channel = interaction.options.getChannel('channel');
if (choice == "birthdays") { const choices = {
client.createChannelSetup(Birthdays, channel, interaction) birthdays : Birthdays,
} chatbot : Chatbot,
reviews : Review,
suggestions : Suggestion,
starboard : StarBoard
};
if (choice == "chatbot") { client.createChannelSetup(choices[choice], channel, interaction);
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)
}
} }