CopilotKitDocs
  • Docs
  • Reference
  • Cookbook
Get Enterprise Intelligence free
CopilotKitDocs
DocsReferenceCookbook
DocsReferenceCookbook

@copilotkit/bot

@copilotkit/bot-slack

@copilotkit/bot-discord

discordrenderComponentsdefaultDiscordToolsdefaultDiscordContextDISCORD_LIMITS
ReferencebotDiscord

DISCORD_LIMITS

Per-element ceilings the Discord API enforces — the renderer degrades (truncate/clamp) rather than failing when a limit is hit.


Overview

DISCORD_LIMITS is the typed constant the renderer (renderComponents) uses to enforce every Discord API ceiling in one place. Import it when you need to validate or pre-truncate data yourself before passing it to the renderer.

import { DISCORD_LIMITS } from "@copilotkit/bot-discord";

Limits table

KeyValueApplies to
componentsPerMessage40total components (nested counted) in a Components V2 message
textDisplayChars2000chars per TextDisplay component
totalTextChars4000total text chars summed across the message
buttonsPerRow5buttons per action row
actionRows5action rows per message
selectOptions25options per StringSelectMenu
selectPlaceholder150chars per select placeholder
customId100custom_id chars (buttons and selects)
buttonLabel80button label chars
headerText256header line chars (a TextDisplay rendered with # prefix)

Degradation behavior

The renderer degrades instead of failing when a limit is hit:

  • Text truncation — over-long text in TextDisplay, button labels, and custom_id values is truncated with a trailing … so the output never exceeds the limit.
  • Array clamping — sub-collections (select options, action rows, buttons per row) are sliced to their cap. Overflow items are dropped without a marker.
  • Unknown intrinsics — component types the renderer does not recognise are silently skipped; nothing ever throws.

Related

  • renderComponents — the renderer that enforces these limits
  • discord() — the adapter
027b1de