feat: add a slash command
Node.js CI / Lint and Test (push) Failing after 33s

This commit is contained in:
2025-08-13 19:59:45 -07:00
parent 543a0101b1
commit 2e254bbf82
2 changed files with 76 additions and 1 deletions
+9 -1
View File
@@ -4,7 +4,8 @@
* @author Naomi Carrigan
*/
import { Client, GatewayIntentBits, Events } from "discord.js";
import { Client, GatewayIntentBits, Events, MessageFlags } from "discord.js";
import { blocks } from "./config/blocks.js";
import { checkAltText } from "./modules/checkAltText.js";
import { instantiateServer } from "./server/serve.js";
import { logger } from "./utils/logger.js";
@@ -25,5 +26,12 @@ client.on(Events.MessageCreate, (message) => {
void checkAltText(message);
});
client.on(Events.InteractionCreate, (interaction) => {
if (!interaction.isChatInputCommand()) {
return;
}
void interaction.reply({ components: blocks, flags: MessageFlags.IsComponentsV2 });
})
await client.login(process.env.BOT_TOKEN);
instantiateServer();