grok
This commit is contained in:
commit
c892ebe7db
8 changed files with 348 additions and 0 deletions
32
register-slash-commands.ts
Normal file
32
register-slash-commands.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue