Skip to content

feat(bridge): extract text from interactive WhatsApp messages#197

Open
ulisseshen wants to merge 1 commit intolharries:mainfrom
ulisseshen:feat/interactive-message-support
Open

feat(bridge): extract text from interactive WhatsApp messages#197
ulisseshen wants to merge 1 commit intolharries:mainfrom
ulisseshen:feat/interactive-message-support

Conversation

@ulisseshen
Copy link
Copy Markdown

Summary

Interactive WhatsApp messages (buttons, flows, lists) were stored with empty content in the SQLite database, making them completely invisible to MCP tools like list_messages. This PR adds text extraction for all interactive message types.

Changes

The extractTextContent() function in the Go bridge now handles:

  • InteractiveMessage: body text + footer (bot-sent buttons, flows, carousels)
  • ButtonsMessage: content text (legacy button format)
  • ButtonsResponseMessage: selected display text (user button taps)
  • ListMessage: title + description
  • ListResponseMessage: selected title
  • Image/Video captions: extracts caption text from media messages

Also updates whatsmeow API calls to use context.Background() for compatibility with the latest library version.

Before

[2026-04-01 00:03:14] Chat: bot From: bot: (null - invisible)

After

[2026-04-01 00:41:12] Chat: bot From: bot: ✅ Anotei "Ouvir playlist de louvor" na categoria Entretenimento! 🎧

Test plan

  • Send message to WhatsApp bot, verify interactive reply (buttons) is readable via list_messages
  • Verify plain text messages still work as before
  • Verify media captions are extracted
  • Bridge builds and connects successfully after restart

* Interactive messages (buttons, flows, lists) were stored with empty content, making them invisible to MCP tools

- Extract body + footer text from InteractiveMessage (bot buttons, flows)
- Extract content text from ButtonsMessage (legacy button format)
- Extract selected text from ButtonsResponseMessage (user button taps)
- Extract title/description from ListMessage and ListResponseMessage
- Extract captions from image and video messages
- Update whatsmeow API calls to use context.Background() for latest version
@ulisseshen
Copy link
Copy Markdown
Author

@lharries, will you continue maintaining this MCP?

Use AI to help you review all opened PRs.

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.

1 participant