From a5a4aa93b8b2c31551c5e53c2ece7ad7ab4f6f76 Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Fri, 14 Oct 2022 12:52:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fix=20more?= =?UTF-8?q?=20code=20smells?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/commands/config/index.ts | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/plugins/commands/config/index.ts b/src/plugins/commands/config/index.ts index 5d9fd42..783219b 100644 --- a/src/plugins/commands/config/index.ts +++ b/src/plugins/commands/config/index.ts @@ -1,6 +1,5 @@ import { SlashCommandBuilder } from "@discordjs/builders"; import { ChatInputCommandInteraction } from "discord.js"; - import modules from "./modules"; export const builder = new SlashCommandBuilder() @@ -20,18 +19,27 @@ export const moduleData = modules; export const execute = async (interaction: ChatInputCommandInteraction) => { switch (interaction.options?.getSubcommand()) { case "cpgg": - return modules.cpgg.execute(interaction); + await modules.cpgg.execute(interaction); + break; case "credits": - return modules.credits.execute(interaction); + await modules.credits.execute(interaction); + break; case "points": - return modules.points.execute(interaction); + await modules.points.execute(interaction); + break; case "welcome": - return modules.welcome.execute(interaction); + await modules.welcome.execute(interaction); + break; case "audits": - return modules.audits.execute(interaction); + await modules.audits.execute(interaction); + break; case "shop": - return modules.shop.execute(interaction); + await modules.shop.execute(interaction); + break; case "embeds": - return modules.embeds.execute(interaction); + await modules.embeds.execute(interaction); + break; + default: + throw new Error("No module found for that specific command."); } };