From 038b8070f9165e2a2ff15e90c3719b3259b3d5c3 Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Fri, 14 Oct 2022 12:50:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fixed=20som?= =?UTF-8?q?e=20code=20smells?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commands/manage/modules/credits/index.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/plugins/commands/manage/modules/credits/index.ts b/src/plugins/commands/manage/modules/credits/index.ts index 0ed9837..bf6f578 100644 --- a/src/plugins/commands/manage/modules/credits/index.ts +++ b/src/plugins/commands/manage/modules/credits/index.ts @@ -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"); } };