Skip to content

Fix Discord duplicate content#256

Open
haydenbleasel wants to merge 2 commits intomainfrom
246-discord-is-doing-text-embed-when-you-use-card-components
Open

Fix Discord duplicate content#256
haydenbleasel wants to merge 2 commits intomainfrom
246-discord-is-doing-text-embed-when-you-use-card-components

Conversation

@haydenbleasel
Copy link
Contributor

Resolves #246

@haydenbleasel haydenbleasel linked an issue Mar 16, 2026 that may be closed by this pull request
@vercel
Copy link
Contributor

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview, Comment, Open in v0 Mar 20, 2026 5:03am
chat-sdk-nextjs-chat Ready Ready Preview, Comment, Open in v0 Mar 20, 2026 5:03am

Copy link
Contributor

@bensabic bensabic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the duplicate content issue on create paths. I think there’s still one gap on editMessage.

In packages/adapter-discord/src/index.ts, the card branch now omits payload.content entirely when PATCHing an existing message. Discord’s Edit Message API treats fields as optional and nullable, so leaving content out does not reliably clear the previous body. If a normal text message is edited into a card, the old text can still remain alongside the embed/components.

I think this should explicitly clear content in the edit path ("" or null, depending on what we want to standardize on), and the test should cover editing a non-empty text message into a card rather than only asserting that the outgoing payload omits content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord is doing text + embed when you use card components

2 participants