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-10-18.

4 breaking3 security13 new APIs and options9 behavior and defaults18 fixes and other

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

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

@chat-adapter/discord 447 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 3

New APIs and options 13

  • 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

Behavior and default changes 9

  • 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

Fixes and other changes 18

  • 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