From e3be0797be4b25040ce419e93b1af6529f7f341b Mon Sep 17 00:00:00 2001 From: Atridad Lahiji <88056492+atridadl@users.noreply.github.com> Date: Tue, 30 May 2023 01:13:53 -0600 Subject: [PATCH] Added a wryna command --- mod.ts | 2 -- src/commands/wryna.ts | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/commands/wryna.ts diff --git a/mod.ts b/mod.ts index b724658..b08ac54 100644 --- a/mod.ts +++ b/mod.ts @@ -22,8 +22,6 @@ await fastFileLoader(paths).catch((err) => { Deno.exit(1); }); -console.log("EVENTS!: ", events); - export const bot = enableCachePlugin( createBot({ token: Deno.env.get("BOT_TOKEN") || "", diff --git a/src/commands/wryna.ts b/src/commands/wryna.ts new file mode 100644 index 0000000..a822cd7 --- /dev/null +++ b/src/commands/wryna.ts @@ -0,0 +1,40 @@ +import { + ApplicationCommandOptionTypes, + ApplicationCommandTypes, + InteractionResponseTypes, +} from "../../deps.ts"; +import { + humanizeMilliseconds, + snowflakeToTimestamp, +} from "../utils/helpers.ts"; +import { createCommand } from "./mod.ts"; + +createCommand({ + name: "wryna", + description: "What was your nickname in highschool?", + type: ApplicationCommandTypes.ChatInput, + scope: "Global", + options: [ + { + type: ApplicationCommandOptionTypes.String, + name: "input", + description: "Text you would like to send to this command.", + required: true, + }, + ], + execute: async (bot, interaction) => { + const input = interaction.data?.options?.find( + (option) => option.name === "input" + ); + await bot.helpers.sendInteractionResponse( + interaction.id, + interaction.token, + { + type: InteractionResponseTypes.ChannelMessageWithSource, + data: { + content: `${input?.value} was ${interaction.user.username}'s nickname in highschool.`, + }, + } + ); + }, +});