Code made more compact

This commit is contained in:
Dotwood Media 2023-01-17 14:38:55 +01:00 committed by GitHub
parent 9736b26658
commit 6fc4e18bec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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