Skip to content

feat(discord): include reply and forwarded message context in prompt#183

Open
BCDel89 wants to merge 2 commits intomoazbuilds:masterfrom
BCDel89:feature/discord-reply-context
Open

feat(discord): include reply and forwarded message context in prompt#183
BCDel89 wants to merge 2 commits intomoazbuilds:masterfrom
BCDel89:feature/discord-reply-context

Conversation

@BCDel89
Copy link
Copy Markdown
Contributor

@BCDel89 BCDel89 commented May 3, 2026

Summary

  • Injects replied-to message content into the Claude prompt as [In reply to <user>]: <text>
  • Injects forwarded message snapshot content as [Forwarded message from <user>]: <text>
  • Attachments on referenced/forwarded messages are noted by filename but not downloaded
  • Adds DiscordMessageSnapshot interface and extends DiscordMessage with message_reference and message_snapshots fields

Test plan

  • Reply to a message in a Discord guild channel — verify the bot's response reflects the replied-to content
  • Forward a message into a channel where the bot is listening — verify the forwarded content appears in the bot's context
  • Send a plain message (no reply, no forward) — verify no regression
  • Reply to a message that has attachments — verify attachment filenames are noted in the prompt

Closes BCD-89

BCDel89 and others added 2 commits May 3, 2026 10:46
When a user replies to a message, the referenced message's author and
content are injected into the prompt as "[In reply to <user>]: <text>".
When a user forwards a message (message_reference.type=1), the snapshot
content is injected as "[Forwarded message from <user>]: <text>".
Attachments on either are noted by filename but not downloaded.

Closes BCD-89

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@TerrysPOV TerrysPOV left a comment

Choose a reason for hiding this comment

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

Reviewed the current PR head against master. I did not find any blocking issues.

The reply and forwarded-message context is added only as prompt context, and referenced/forwarded attachments are noted by filename without being downloaded, which keeps the change appropriately scoped.

Local validation passed: git diff --check origin/master...HEAD, bun install, bun test, and bunx tsc --noEmit --pretty false.

Looks merge-ready from my side and will go in with the next cherry pick bulk merge.

Copy link
Copy Markdown
Collaborator

@TerrysPOV TerrysPOV left a comment

Choose a reason for hiding this comment

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

sorry approved.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants