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."); } }; diff --git a/src/plugins/commands/credits/modules/gift/index.ts b/src/plugins/commands/credits/modules/gift/index.ts index 0f36ee9..ca2f554 100644 --- a/src/plugins/commands/credits/modules/gift/index.ts +++ b/src/plugins/commands/credits/modules/gift/index.ts @@ -3,7 +3,7 @@ import { ChatInputCommandInteraction, EmbedBuilder, - SlashCommandSubcommandBuilder + SlashCommandSubcommandBuilder, } from "discord.js"; import mongoose from "mongoose"; // Configurations @@ -201,7 +201,9 @@ export default { await session.abortTransaction(); session.endSession(); - thorw new Error("An error occurred while trying to gift credits. Please try again later.") + throw new Error( + "An error occurred while trying to gift credits. Please try again later." + ); } finally { // ending the session session.endSession(); 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"); } };