How to add multiple slash commands to Discord bot

I got one slash command working for my Discord bot but I’m stuck trying to add more commands. Here’s what I have working right now:

{
    "name": "pets",
    "description": "Display cute pet images",
    "options": [
        {
            "name": "creature",
            "description": "Which pet to show",
            "type": 3,
            "required": true,
            "choices": [
                {
                    "name": "Puppy",
                    "value": "pet_puppy"
                },
                {
                    "name": "Kitten",
                    "value": "pet_kitten"
                },
                {
                    "name": "Hamster",
                    "value": "pet_hamster"
                }
            ]
        },
        {
            "name": "cute_only",
            "description": "Show only the cutest ones",
            "type": 5,
            "required": false
        }
    ]
}

I tried putting this inside an array to add more commands but Discord rejects it. I also tried making separate JSON objects but that doesn’t work either. What’s the correct way to register multiple slash commands?

You can’t register multiple commands in one API call - that’s your problem. Discord requires separate requests for each command. I ran into this exact issue with my first bot and wasted hours figuring it out. Just loop through your commands and make individual POST requests for each one. Watch out for rate limits though - Discord will throttle you if you spam requests too fast. Also double-check your bot has the right permissions and you’re using the correct application ID.

This is super common when you move from one command to multiple. Discord’s API wants individual command objects, not arrays. I ran into this exact issue - you need a command manager that registers each one separately through individual API calls. Build your command definitions (like that pets example) then hit the commands endpoint for each one. Here’s what nobody else mentioned: check for name conflicts. Discord rejects duplicates even if you’re registering them separately. Also make sure your bot token has the applications.commands scope. I spent hours debugging silent failures because of missing permissions.

yeah, discord’s api wants individual command registrations, not arrays. had the same headache when i started. make sure you’re hitting the right endpoint - use guild commands (/applications/{app_id}/guilds/{guild_id}/commands) for instant updates instead of global ones. global commands take forever to update.

Managing multiple slash commands manually sucks, especially with API rate limits and different endpoints.

I had this same problem until I automated everything. It’s not just about separate requests - you need to manage the whole workflow.

What actually works is automation that handles registration, updates, and monitors failures. I built something that reads command definitions from JSON, validates them, then registers with built-in rate limiting.

It tracks which commands exist so it only updates what changed. Saves me hours when I’m constantly tweaking command structures during development.

You can extend it for different environments (dev/prod guilds) and auto-deploy command updates when you push code.

Check out Latenode for Discord bot automation - handles API calls and rate limiting perfectly: https://latenode.com

Discord’s API wants one command per registration call - no batch submissions. I made this exact mistake with my first multi-command bot, trying to send everything at once. You need a registration function that loops through your command definitions and sends individual requests. Don’t forget error handling for each attempt - one failed command shouldn’t kill the others. Quick heads up: if you’re updating existing commands, the API overwrites them completely, so keep your definitions consistent. Your JSON looks good, just send each command separately.

Your registration approach is the problem. You need to send each command separately to Discord’s API endpoint. I made the exact same mistake when building my moderation bot last year - tried bundling everything together and it didn’t work. Create individual command objects (which you’ve already done), then register them one by one with PUT requests to /applications/{application.id}/commands. Don’t mix guild-specific and global commands - global ones take up to an hour to update, guild commands are instant. If you’re still getting rejections, double-check your command structure against Discord’s latest API docs. They sometimes update schema requirements without much warning.