Added a wryna command
This commit is contained in:
parent
5279cc22c2
commit
e3be0797be
2 changed files with 40 additions and 2 deletions
2
mod.ts
2
mod.ts
|
@ -22,8 +22,6 @@ await fastFileLoader(paths).catch((err) => {
|
||||||
Deno.exit(1);
|
Deno.exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("EVENTS!: ", events);
|
|
||||||
|
|
||||||
export const bot = enableCachePlugin(
|
export const bot = enableCachePlugin(
|
||||||
createBot({
|
createBot({
|
||||||
token: Deno.env.get("BOT_TOKEN") || "",
|
token: Deno.env.get("BOT_TOKEN") || "",
|
||||||
|
|
40
src/commands/wryna.ts
Normal file
40
src/commands/wryna.ts
Normal file
|
@ -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.`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
Loading…
Add table
Reference in a new issue