feat(experimental): add interactive messages support (buttons, lists, templates, carousel)
⚠️ EXPERIMENTAL FEATURE - Use only for testing with disposable accounts Implements full support for WhatsApp interactive messages including: - Simple text buttons (up to 3 buttons) - Buttons with images/videos - List messages (up to 10 items in sections) - Template buttons (quick reply, URL, call actions) - Carousel messages (up to 10 scrollable cards) Features: - Feature flag 'enableInteractiveMessages' (default: true for dev/testing) - Prometheus metrics for tracking sends, successes, failures, and latency - Comprehensive TypeScript types for all interactive message formats - Extensive logging with warnings about potential account bans - Automatic 'biz' node injection when feature is enabled CRITICAL WARNINGS: - These features may NOT work on non-business WhatsApp accounts - Can cause temporary or permanent account BANS - WhatsApp actively blocks this functionality since April 2022 - Messages may be rejected or fail silently - Use ONLY in dev environment with test accounts Architecture: - Added ButtonInfo, Templatable, Listable, Carouselable types to Message.ts - Extended AnyMediaMessageContent and AnyRegularMessageContent - Implemented message generation in messages.ts - Added getButtonType() and getButtonArgs() helpers in messages-send.ts - Injected 'biz' node in stanza construction with metrics tracking - Added 4 new Prometheus metrics: interactiveMessagesSent, Success, Failures, Latency Documentation: - Complete usage guide in INTERACTIVE_MESSAGES.md - Examples for all interactive message types - Metrics monitoring queries - Troubleshooting guide - Migration path to WhatsApp Business API Related issues: - https://github.com/WhiskeySockets/Baileys/issues/56 - https://github.com/WhiskeySockets/Baileys/issues/25 - https://github.com/WhiskeySockets/Baileys/pull/2291 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -133,6 +133,28 @@ export type SocketConfig = {
|
||||
*/
|
||||
enableCTWARecovery: boolean
|
||||
|
||||
/**
|
||||
* ⚠️ EXPERIMENTAL: Enable interactive messages (buttons, lists, templates, carousel).
|
||||
*
|
||||
* **WARNING**: These features MAY NOT WORK and can cause ACCOUNT BANS.
|
||||
*
|
||||
* WhatsApp actively blocks non-business accounts from sending interactive messages.
|
||||
* Using this feature can result in:
|
||||
* - Messages not being delivered
|
||||
* - Temporary account restrictions
|
||||
* - Permanent account bans
|
||||
*
|
||||
* Use ONLY for:
|
||||
* - Testing in DEV environment
|
||||
* - DISPOSABLE test accounts
|
||||
* - Experimental research
|
||||
*
|
||||
* @default true (for dev/testing)
|
||||
* @see https://github.com/WhiskeySockets/Baileys/issues/56
|
||||
* @see https://github.com/WhiskeySockets/Baileys/issues/25
|
||||
*/
|
||||
enableInteractiveMessages: boolean
|
||||
|
||||
/**
|
||||
* Returns if a jid should be ignored,
|
||||
* no event for that jid will be triggered.
|
||||
|
||||
Reference in New Issue
Block a user