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

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