discord-grok/register-slash-commands.ts
2026-01-03 21:59:49 +02:00

32 lines
721 B
TypeScript

import { REST, Routes } from "discord.js";
const commands = [
{
name: "mention",
description: "Ask Grok",
options: [
{
name: "message",
description: "The message you wanna ask grok",
type: 3,
required: true,
},
],
integration_types: [0, 1],
contexts: [0, 1, 2],
},
];
const rest = new REST({ version: "10" }).setToken(process.env.TOKEN!);
try {
console.log("Started refreshing application (/) commands.");
Routes.applicationCommands;
await rest.put(Routes.applicationCommands(process.env.CLIENT_ID!), {
body: commands,
});
console.log("Successfully reloaded application (/) commands.");
} catch (error) {
console.error(error);
}