Skip to main content
Glama
register-commands.ts944 B
import { REST, Routes } from "discord.js"; import { config } from "dotenv"; config(); // Define your commands const commands = [ { name: "ask", description: "Ask the MCP bot a question about Mastra", options: [ { name: "question", description: "What would you like to ask?", type: 3, // STRING type required: true, }, ], }, { name: "cleardm", description: "Clear bot messages in DM", }, ]; // Create REST instance const rest = new REST({ version: "10" }).setToken( process.env.DISCORD_BOT_TOKEN! ); async function registerCommands() { try { console.log("Started refreshing application (/) commands."); await rest.put(Routes.applicationCommands(process.env.DISCORD_CLIENT_ID!), { body: commands, }); console.log("Successfully reloaded application (/) commands."); } catch (error) { console.error(error); } } registerCommands();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mastra-ai/discord-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server