BlocksDiscord
Get Bot Guilds
Retrieve a list of all Discord servers where your Bot is currently present.
The Get Bot Guilds block allows you to see all the servers (Guilds) your Bot has joined. This is useful for managing multiple communities, verifying where your Bot is active, or building multi-tenant Discord integrations.
Core Concept
Imagine your Bot is a "Brand Ambassador" visiting different clubs. This block generates a complete itinerary of every club the Ambassador is currently signed into.
Configuration
| Field | Required | Description |
|---|---|---|
| Bot Token | ✅ | The secret variable containing your Discord Bot Token. |
| Limit | — | The maximum number of servers to return (Range: 1-200, Default: 200). |
| Output Variable | ✅ | The name of the variable to store the list of servers. |
Output Data
The output variable will contain an array of server objects:
[
{
"id": "123456789012345678",
"name": "My Community Server",
"icon": "8342729096ea3675442027381ff50fd2",
"owner": false,
"permissions": "2147483647"
},
{
"id": "987654321098765432",
"name": "Dev Sandbox",
"icon": null,
"owner": true,
"permissions": "8"
}
]You can access the first server's name using {your_variable[0].name}.
Error Handling
FIELD_MISSING— Triggered if the Bot Token is missing.SECRET_RETRIEVE_ERROR— Triggered if the Bot Token secret cannot be retrieved.API_REQUEST_FAILED— Triggered if the Discord API cannot be reached.DISCORD_ERROR_[code]— Triggered if Discord returns an error (e.g.,401 Unauthorizedfor an invalid token).
Example
- Setup Block:
- Bot Token:
{SEC_DISCORD_BOT}. - Limit:
10. - Output Variable:
active_servers.
- Bot Token:
- Usage: Use the
active_serverslist to populate a dropdown in your own dashboard or to log which communities are using your integration.
