Skip to content

extractText() doesn't include quoted message content #47

Description

@arun-8687

Description
When a user quotes/replies to a message in a WhatsApp group chat and tags Clawdis, the bot cannot see the content of the quoted message. Only the user's reply text is extracted.

Steps to Reproduce
User A sends a message: "What's the weather in Tokyo?"
User B quotes that message and adds "@clawdis summarize this"
Clawdis only sees "@clawdis summarize this" - not the quoted message content

Expected Behavior
Clawdis should see:

[Quoted: "What's the weather in Tokyo?"]
@clawdis summarize this

Root Cause
The extractText() function in src/web/inbound.ts extracts text from:

message.conversation
message.extendedTextMessage.text
message.imageMessage.caption / message.videoMessage.caption

But it does not extract message.extendedTextMessage.contextInfo.quotedMessage.

Proposed Fix
Modify extractText() to check for contextInfo.quotedMessage and prepend its text content with a [Quoted: "..."] prefix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions