---
title: "Registers a global command handler for Discord slash commands."
method: POST
path: "/registerGlobalCommand"
---

# Registers a global command handler for Discord slash commands.

`POST /registerGlobalCommand`

This function registers a function to handle a specific global slash command in Discord. It takes a command handler object as a parameter and returns a Promise that resolves when the command is successfully registered. The function allows developers to define custom global commands that can be used across all guilds where the bot is present.

## Request body

- object
  - `body` object — Body of the registerGlobalCommand sls call
    - `arguments` unknown[], required
      - unknown
    - `auth` object — Authentication object
      - `strategy` 'apikey' — Authentication strategy
      - `variables` unknown[] — Variables for the authentication strategy
        - unknown
    - `packageName` string — @microfox/discord

## Response `200`

Command registered successfully

- object
  - `success` boolean — Indicates if the command was registered successfully
  - `message` string — A message confirming the registration

## Other responses

- `400` — Bad request - invalid command data
- `500` — Internal server error

---

[API](https://skmtc.net/microfox-ai/apis/microfox-discord-sdk-api.md) · [All operations](https://skmtc.net/microfox-ai/apis/microfox-discord-sdk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/microfox-ai/microfox-discord-sdk-api/versions/7cb5b64ae924/schema)
