Docs/API Reference/Sync Commands

Sync Commands

Sync your bot's slash commands to DiscordForge.

Sync your bot's slash commands to DiscordForge. This replaces all existing commands with the provided list. Synced commands appear on your bot's profile page with filterable categories.

POSThttps://discordforge.org/api/external/bots/commands

Headers

1Authorization: <YOUR_API_KEY>
2Content-Type: application/json

Request Body (Custom Format)

1{
2 "commands": [
3 {
4 "name": "ban",
5 "description": "Ban a member from the server",
6 "usage": "/ban @user [reason]",
7 "category": "Moderation"
8 },
9 {
10 "name": "play",
11 "description": "Play a song in voice channel",
12 "usage": "/play <url|search>",
13 "category": "Music"
14 }
15 ]
16}

Discord API Format

You can also send commands in the native Discord API format – the endpoint auto-detects the format per command.

1{
2 "commands": [
3 {
4 "name": "ban",
5 "description": "Ban a member",
6 "type": 1,
7 "options": [
8 {
9 "name": "user",
10 "description": "The user to ban",
11 "type": 6,
12 "required": true
13 }
14 ]
15 }
16 ]
17}

Limits

  • Max 200 commands per sync request
  • Each sync replaces all previously synced commands (full overwrite, not merge)
  • Categories are freeform strings – use whatever makes sense for your bot
  • Commands can also be managed manually via Dashboard → Slash Commands

SDK Usage

sync-commands.ts
1import { ForgeClient } from "discordforge-sdk";
2 
3const forge = new ForgeClient(process.env.FORGE_API_KEY, process.env.FORGE_BOT_ID);
4 
5// Sync on bot startup
6await forge.syncCommands([
7 {
8 name: "help",
9 description: "Show all available commands",
10 category: "General",
11 },
12 {
13 name: "ban",
14 description: "Ban a member from the server",
15 usage: "/ban @user [reason]",
16 category: "Moderation",
17 },
18 {
19 name: "play",
20 description: "Play a song in voice channel",
21 usage: "/play <url|search>",
22 category: "Music",
23 },
24]);