Merge pull request #87 from DotwoodMedia/patch-1

Removed redundant code
This commit is contained in:
Corwin 2023-01-17 14:45:53 +01:00 committed by GitHub
commit 0e8996e6f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 39 deletions

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

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

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