---
title: "Registers a command handler for a specific slash command in a Discord guild."
method: POST
path: "/registerCommand"
---

# Registers a command handler for a specific slash command in a Discord guild.

`POST /registerCommand`

This function registers a function to handle a specific slash command in a Discord guild. It allows for the creation of custom commands with various options and permissions. The function returns a Promise that resolves when the command is successfully registered.

## Request body

- object
  - `body` object — Body of the registerCommand 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 successfully registered

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

## Other responses

- `400` — Bad Request - Invalid parameters
- `403` — Forbidden - Insufficient permissions
- `404` — Not Found - Guild not found
- `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)
