From f5c988b77bdeda9bf03aa99136a2680ab50dcc02 Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Fri, 21 Oct 2022 16:18:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20DNS=20Commands=20is=20now=20usin?= =?UTF-8?q?g=20guard=20classes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/dns/index.ts | 9 +++++---- src/commands/dns/modules/index.ts | 3 --- src/commands/dns/modules/lookup/index.ts | 5 +++-- 3 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 src/commands/dns/modules/index.ts diff --git a/src/commands/dns/index.ts b/src/commands/dns/index.ts index 551814b..cd5f9ec 100644 --- a/src/commands/dns/index.ts +++ b/src/commands/dns/index.ts @@ -1,20 +1,21 @@ import { SlashCommandBuilder } from "@discordjs/builders"; import { ChatInputCommandInteraction } from "discord.js"; -import modules from "./modules"; -export const moduleData = modules; +// Modules +import moduleLookup from "./modules/lookup"; export const builder = new SlashCommandBuilder() .setName("dns") .setDescription("DNS commands.") - .addSubcommand(modules.lookup.builder); + // Modules + .addSubcommand(moduleLookup.builder); // Execute the command export const execute = async (interaction: ChatInputCommandInteraction) => { switch (interaction.options.getSubcommand()) { case "lookup": - await modules.lookup.execute(interaction); + await moduleLookup.execute(interaction); break; default: throw new Error( diff --git a/src/commands/dns/modules/index.ts b/src/commands/dns/modules/index.ts deleted file mode 100644 index 92a80ac..0000000 --- a/src/commands/dns/modules/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import lookup from "./lookup"; - -export default { lookup }; diff --git a/src/commands/dns/modules/lookup/index.ts b/src/commands/dns/modules/lookup/index.ts index afa51a6..b64c18f 100644 --- a/src/commands/dns/modules/lookup/index.ts +++ b/src/commands/dns/modules/lookup/index.ts @@ -1,11 +1,10 @@ import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; import axios from "axios"; import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js"; +import deferReply from "../../../../handlers/deferReply"; import getEmbedConfig from "../../../../helpers/getEmbedData"; export default { - metadata: { guildOnly: false, ephemeral: false }, - builder: (command: SlashCommandSubcommandBuilder) => { return command .setName("lookup") @@ -20,6 +19,8 @@ export default { ); }, execute: async (interaction: ChatInputCommandInteraction) => { + await deferReply(interaction, false); + const { errorColor, successColor, footerText, footerIcon } = await getEmbedConfig(interaction.guild); const embedTitle = "[:hammer:] Utility (Lookup)";