You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
907 B
28 lines
907 B
import { createSlashCommand, sendInteractionResponse } from "@wackford/mod.ts";
|
|
|
|
const dirname = new URL(".", import.meta.url).pathname;
|
|
|
|
const helpMessage: string[] = [
|
|
"/help - helps your idiot ass", // we do this manually because fuck you too
|
|
];
|
|
|
|
export default async function initLocalCommands() {
|
|
for await (const file of Deno.readDir(dirname)) {
|
|
if (file.name !== "index.ts") {
|
|
const mod = (await import(dirname + file.name)).default;
|
|
helpMessage.push(`/${mod.name} - ${mod.description}`);
|
|
createSlashCommand(mod);
|
|
}
|
|
}
|
|
createSlashCommand({
|
|
name: "help",
|
|
description: "helps your idiot ass",
|
|
execute: async (bot, interaction) => {
|
|
await sendInteractionResponse(bot, interaction, {
|
|
content: helpMessage.join("\n"),
|
|
private: true,
|
|
});
|
|
},
|
|
});
|
|
}
|