diff --git a/src/commands/credits/index.ts b/src/commands/credits/index.ts index 96eea7c..1a103ba 100644 --- a/src/commands/credits/index.ts +++ b/src/commands/credits/index.ts @@ -9,6 +9,7 @@ import { builder as GiftBuilder, execute as GiftExecute } from "./modules/gift"; import { builder as TopBuilder, execute as TopExecute } from "./modules/top"; import { builder as WorkBuilder, execute as WorkExecute } from "./modules/work"; +// 1. Export a builder function. export const builder = new SlashCommandBuilder() .setName("credits") .setDescription("Manage your credits.") @@ -20,7 +21,7 @@ export const builder = new SlashCommandBuilder() .addSubcommand(TopBuilder) .addSubcommand(WorkBuilder); -// Execute function +// 2. Export an execute function. export const execute = async (interaction: ChatInputCommandInteraction) => { switch (interaction.options.getSubcommand()) { case "balance": diff --git a/src/commands/credits/modules/balance/index.ts b/src/commands/credits/modules/balance/index.ts index bbe287c..95e1dfd 100644 --- a/src/commands/credits/modules/balance/index.ts +++ b/src/commands/credits/modules/balance/index.ts @@ -5,6 +5,7 @@ import deferReply from "../../../../handlers/deferReply"; import { success as BaseEmbedSuccess } from "../../../../helpers/baseEmbeds"; import logger from "../../../../middlewares/logger"; +// 1. Export a builder function. export const builder = (command: SlashCommandSubcommandBuilder) => { return command .setName("balance") @@ -16,6 +17,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { ); }; +// 2. Export an execute function. export const execute = async (interaction: CommandInteraction) => { // 1. Defer reply as ephemeral. await deferReply(interaction, true); diff --git a/src/commands/credits/modules/gift/index.ts b/src/commands/credits/modules/gift/index.ts index 325cdf5..ac87de5 100644 --- a/src/commands/credits/modules/gift/index.ts +++ b/src/commands/credits/modules/gift/index.ts @@ -7,6 +7,7 @@ import deferReply from "../../../../handlers/deferReply"; import { success as BaseEmbedSuccess } from "../../../../helpers/baseEmbeds"; import transferCredits from "../../../../helpers/transferCredits"; +// 1. Export a builder function. export const builder = (command: SlashCommandSubcommandBuilder) => { return command .setName("gift") @@ -28,6 +29,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { ); }; +// 2. Export an execute function. export const execute = async (interaction: ChatInputCommandInteraction) => { // 1. Defer reply as ephemeral. await deferReply(interaction, true); diff --git a/src/commands/credits/modules/top/index.ts b/src/commands/credits/modules/top/index.ts index a498122..52444e2 100644 --- a/src/commands/credits/modules/top/index.ts +++ b/src/commands/credits/modules/top/index.ts @@ -10,10 +10,12 @@ import deferReply from "../../../../handlers/deferReply"; import { success as BaseEmbedSuccess } from "../../../../helpers/baseEmbeds"; import logger from "../../../../middlewares/logger"; +// 1. Export a builder function. export const builder = (command: SlashCommandSubcommandBuilder) => { return command.setName("top").setDescription(`View the top users`); }; +// 2. Export an execute function. export const execute = async (interaction: CommandInteraction) => { // 1. Defer reply as permanent. await deferReply(interaction, false); diff --git a/src/commands/credits/modules/work/index.ts b/src/commands/credits/modules/work/index.ts index 55b3856..bca9dc4 100644 --- a/src/commands/credits/modules/work/index.ts +++ b/src/commands/credits/modules/work/index.ts @@ -8,10 +8,12 @@ import deferReply from "../../../../handlers/deferReply"; import { success as BaseEmbedSuccess } from "../../../../helpers/baseEmbeds"; import logger from "../../../../middlewares/logger"; +// 1. Export a builder function. export const builder = (command: SlashCommandSubcommandBuilder) => { return command.setName("work").setDescription(`Work to earn credits`); }; +// 2. Export an execute function. export const execute = async (interaction: CommandInteraction) => { // 1. Defer reply as ephemeral. await deferReply(interaction, true);