unstale

npm / @chat-adapter/discord

@chat-adapter/discord

What changed in @chat-adapter/discord 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

4 breaking4 security27 new APIs and options10 behavior and defaults19 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@chat-adapter/discord 464 changes

Breaking changes 4

  • The interaction field is now typed as APIApplicationCommandInteraction for TypeScript consumers.

    4.41.0release notes

  • The user field is now typed as APIUser; user.avatar and user.global_name are string | null instead of optional strings.

    4.41.0release notes

  • Discord attachment downloads refuse private and internal addresses, including after DNS resolution and redirects, cap responses at 25 MB, and time out after 30 seconds.

    4.39.0release notes

  • Gateway mode ignores @everyone and @here pings by default; enable this option to restore the old behavior.

    4.34.0release notes

Security 4

  • Discord now uses parseIncoming() for incoming messages, parsing each message once and applying limits to avoid slow or unsafe markdown parsing. When a limit is hit, content is kept but formatted markdown structure is lost.

    4.44.0release notes

  • Callback tokens are consumed once.

    4.40.0release notes

  • External link metadata is marked as untrusted.

    4.40.0release notes

  • Adds custom webhook verification to the Discord adapter.

    4.38.0release notes

New APIs and options 27

  • Converters can override this method to check rewritten text before parsing.

    4.44.0release notes

  • Converters can override this method to clean up text when incoming parsing falls back.

    4.44.0release notes

  • Converters can override this limit; parsing falls back to verbatim text when input has more than 512 angle brackets.

    4.44.0release notes

  • Incoming parsing falls back to verbatim text when the resulting AST is deeper than 128 levels.

    4.44.0release notes

  • Converters can override this limit; parsing falls back to verbatim text when input has more than 128 closing brackets.

    4.44.0release notes

  • Converters can override this limit; parsing falls back to verbatim text when lines are nested more than 32 levels deep.

    4.44.0release notes

  • Converters can override this limit; parsing falls back to verbatim text when input has more than 2,048 emphasis markers.

    4.44.0release notes

  • Converters can override this limit; parsing falls back to verbatim text when a word contains more than 8 www. links.

    4.44.0release notes

  • Adds scaffolding for Discord bots through the --connect option.

    4.38.0release notes

  • Adds Vercel Connect credential resolvers to the Discord adapter.

    4.38.0release notes

  • Adds an opt-in channel allowlist that treats non-bot Discord messages as directed to the bot without requiring a mention; configure it with respondToChannelIds or DISCORD_RESPOND_TO_CHANNEL_IDS.

    4.35.0release notes

  • Opt in to Discord Components v2 rendering for Chat SDK cards with DiscordContentFormat.ComponentsV2.

    4.34.0release notes

  • Forwarded gateway messages can opt in to responding to global mentions via the mention_everyone field.

    4.34.0release notes

  • Adds support for renaming native Discord thread channels.

    4.34.0release notes

  • The Discord adapter implements rehydrateAttachment, rebuilding fetchData from the serialized CDN URL so consumers can download inbound attachments after deserialization.

    4.33.0release notes

  • Adds a Discord adapter callback for setting flags on ephemeral slash command responses.

    4.32.0release notes

  • Adapter internals are now protected rather than private, allowing consumers to subclass an adapter and override or extend behavior such as processUpdate.

    4.29.0release notes

  • Adds a disabled prop to Button() for Discord, allowing developers to mark buttons as disabled.

    4.16.0release notes

  • Adds Discord slash command support by dispatching application command interactions to chat.processSlashCommand(...) while sending an immediate deferred interaction ACK.

    4.16.0release notes

  • Adds Partials.Channel to the gateway client to support DMs.

    4.16.0release notes

  • Adds table markdown rendering, allowing developers to render markdown tables through the adapter.

    4.16.0release notes

  • Adds the CardLink element.

    4.15.0release notes

  • Cards now support inline Select components and Radio buttons.

    4.11.0release notes

  • Adds the LinkButton component.

    4.6.0release notes

  • Adds Serde support.

    4.4.1release notes

  • Adds support for modals, modal events, text inputs and selectors in the Discord adapter.

    4.4.0release notes

  • Adds Discord support through the Discord chat adapter.

    4.3.0release notes

Behavior and default changes 10

  • Failed channel or user lookups during forwarding are logged at warn instead of being silently dropped.

    4.41.0release notes

  • Forwarded reaction events now include channel_type, the resolved thread for thread reactions, and the reacting user for DM reactions, avoiding a second channel lookup on the webhook side.

    4.41.0release notes

  • AI tools are more tightly scoped.

    4.40.0release notes

  • Direct-message conversations are isolated.

    4.40.0release notes

  • Queued messages are more tightly scoped.

    4.40.0release notes

  • Slash commands and button interactions are handled in Discord gateway-only mode.

    4.29.0release notes

  • The adapter now declares chat as a full dependency rather than an optional dependency, so it is installed automatically.

    4.21.0release notes

  • Adapters have overhauled fallback-render behavior.

    4.16.0release notes

  • Markdown rendering is fully streaming, including for Slack, which has native streaming.

    4.16.0release notes

  • Values are now loaded automatically from environment variables.

    4.13.4release notes

Fixes and other changes 19

  • Every line in a Discord blockquote now receives the quote prefix, and quoted blank lines separate blocks, preventing later lines and blocks from falling out of the quote.

    4.45.0release notes

  • Forwards the Discord gateway packet as it arrived on the wire, preventing discord.js mutations from adding a member.user field Discord never sent.

    4.42.0release notes

  • Events for the same channel are forwarded in Gateway delivery order, preventing quick add-then-remove reactions from racing.

    4.41.0release notes

  • Discord reports true for real pings, role mentions, @everyone, or allowlisted channels, and leaves other cases undetermined so SDK text detection can still recognize literal @botname text.

    4.41.0release notes

  • Legacy Gateway mode falls back to channel_id for slash commands and button clicks in channels discord.js has not cached, such as a first DM.

    4.41.0release notes

  • Ephemeral follow-ups are preserved.

    4.40.0release notes

  • Edits, deletes, and reactions try the thread first and fall back to the parent channel when Discord reports the starter message as unknown. Deleting a text-channel thread's starter message also deletes the thread.

    4.39.0release notes

  • Restores attachment downloads across Discord inbound message paths.

    4.38.0release notes

  • Preserves content and attachments from forwarded Discord message snapshots.

    4.38.0release notes

  • Preserves Discord's angle-bracket syntax when rendering markdown so link previews can be suppressed.

    4.35.0release notes

  • Mention conversion no longer mangles email addresses, @handles inside URLs, or mentions inside code spans, and does not double-wrap already-formatted <@id> tokens.

    4.33.0release notes

  • Preserves surrounding text, email addresses, and word@word handles; avoids double-wrapping formatted mentions while still converting mentions after a period.

    4.32.0release notes

  • Renders bare URLs and autolinks as bare URLs instead of masked links, which Discord only renders inside embeds.

    4.32.0release notes

  • Expanded npm keywords for adapter and state packages to improve discoverability, adding chat-sdk, chatbot, ai-agent, ai-sdk, vercel, and platform-specific terms.

    4.30.0release notes

  • When Discord returns error code 160004 because a thread already exists for a message, the adapter reuses that thread instead of falling back to a standalone channel message.

    4.24.0release notes

  • Thread starter parsing now uses referenced_message content so thread roots preserve the original parent message text and metadata.

    4.17.0release notes

  • Fixes nested list rendering during Markdown-to-platform conversion so child items retain indentation and newline separation.

    4.16.1release notes

  • Fixes reaction events that were missing thread context.

    4.16.0release notes

  • Fixes the thread channel ID used for reactions and delete operations.

    4.16.0release notes