💡 Add comment to credit modules

This commit is contained in:
Axel Olausson Holtenäs 2022-10-22 16:11:52 +02:00
parent 9abde1c710
commit 364f07dd7c
No known key found for this signature in database
GPG key ID: BEDBB4D61E6C8462
5 changed files with 10 additions and 1 deletions

View file

@ -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":

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);