---
title: "Fetches all slash commands for a specific guild."
method: POST
path: "/fetchSlashCommands"
---

# Fetches all slash commands for a specific guild.

`POST /fetchSlashCommands`

This function retrieves a list of all slash commands registered for the bot in a specified guild. It takes the guild ID as a parameter and returns a Promise that resolves to an array of slash command objects. This allows developers to inspect and manage the bot's slash commands for a particular guild.

## Request body

- object
  - `body` object — Body of the fetchSlashCommands 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`

Successfully fetched slash commands

- object[]
  - `id` string — The unique identifier of the slash command
  - `name` string — The name of the slash command
  - `description` string — A description of what the slash command does
  - `options` object[] — An array of command options

## Other responses

- `400` — Bad request - Invalid guild ID provided
- `403` — Forbidden - Bot does not have permission to access guild commands
- `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)
