diff --git a/src/commands/fun/index.ts b/src/commands/fun/index.ts index 8c166f0..e010d5d 100644 --- a/src/commands/fun/index.ts +++ b/src/commands/fun/index.ts @@ -2,21 +2,20 @@ import { SlashCommandBuilder } from "@discordjs/builders"; import { ChatInputCommandInteraction } from "discord.js"; import logger from "../../middlewares/logger"; -import modules from "./modules"; +// Modules +import moduleMeme from "./modules/meme"; export const builder = new SlashCommandBuilder() .setName("fun") .setDescription("Fun commands.") - .addSubcommand(modules.meme.builder); - -export const moduleData = modules; + .addSubcommand(moduleMeme.builder); export const execute = async (interaction: ChatInputCommandInteraction) => { const { options } = interaction; if (options.getSubcommand() === "meme") { - await modules.meme.execute(interaction); + await moduleMeme.execute(interaction); } else { logger.silly(`Unknown subcommand ${options.getSubcommand()}`); } diff --git a/src/commands/fun/modules/index.ts b/src/commands/fun/modules/index.ts deleted file mode 100644 index 53aeddc..0000000 --- a/src/commands/fun/modules/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import meme from "./meme"; - -export default { - meme, -}; diff --git a/src/commands/fun/modules/meme/index.ts b/src/commands/fun/modules/meme/index.ts index b5c3db3..1ed1ea0 100644 --- a/src/commands/fun/modules/meme/index.ts +++ b/src/commands/fun/modules/meme/index.ts @@ -1,16 +1,20 @@ import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; import axios from "axios"; import { CommandInteraction, EmbedBuilder } from "discord.js"; +import { command as CooldownCommand } from "../../../../handlers/cooldown"; +import deferReply from "../../../../handlers/deferReply"; import getEmbedConfig from "../../../../helpers/getEmbedData"; export default { - metadata: { guildOnly: false, ephemeral: false, cooldown: 15 }, - builder: (command: SlashCommandSubcommandBuilder) => { return command.setName("meme").setDescription("Get a meme from r/memes)"); }, execute: async (interaction: CommandInteraction) => { + await deferReply(interaction, false); + + await CooldownCommand(interaction, 15); + const { guild } = interaction; const embedConfig = await getEmbedConfig(guild);