🧑‍💻 Fixed some code smells

This commit is contained in:
Axel Olausson Holtenäs 2022-10-14 12:50:16 +02:00
parent 1d04890c92
commit 038b8070f9

View file

@ -1,6 +1,5 @@
import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
import { ChatInputCommandInteraction } from "discord.js";
import modules from "./modules";
export const moduleData = modules;
@ -19,14 +18,21 @@ export const builder = (group: SlashCommandSubcommandGroupBuilder) => {
export const execute = async (interaction: ChatInputCommandInteraction) => {
switch (interaction.options.getSubcommand()) {
case "give":
return modules.give.execute(interaction);
await modules.give.execute(interaction);
break;
case "set":
return modules.set.execute(interaction);
await modules.set.execute(interaction);
break;
case "take":
return modules.take.execute(interaction);
await modules.take.execute(interaction);
break;
case "transfer":
return modules.transfer.execute(interaction);
await modules.transfer.execute(interaction);
break;
case "giveaway":
return modules.giveaway.execute(interaction);
await modules.giveaway.execute(interaction);
break;
default:
throw new Error("No module found for that specific command");
}
};