Commit Graph

109 Commits

Author SHA1 Message Date
Renato Alcara b48dbd7038 fix(types): resolve TypeScript compilation errors in interactive messages
Fixes type incompatibility error when processing buttons with media:
- Extract only media properties before passing to prepareWAMessageMedia
- Remove problematic interactiveMessage type from AnyRegularMessageContent
- Move Carouselable to text message type as Partial

This resolves the compilation error:
  error TS2345: Argument of type '...' is not assignable to parameter
  of type 'AnyMediaMessageContent'

Changes:
- src/Utils/messages.ts: Extract media content explicitly for type safety
- src/Types/Message.ts: Simplify type definitions, add Carouselable to text messages

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-23 01:14:58 -03:00
Renato Alcara 90db2512d9 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>
2026-01-23 00:51:33 -03:00
vini b4863b624e refactor(retry): improve message encryption and retry logic (#2055) 2025-11-19 15:13:51 +02:00
Bob f9abf44994 Feat: limitSharing (advanced conversation privacy) (#1899)
* Update messages.ts

* Update Message.ts

* lint

* lint
2025-10-11 13:46:03 +03:00
Rajeh Taher c5b0001b61 *group: parse @lids properly when processing group notifications
*This commit is breaking, it changes the format of participants in group-participants.update.
2025-10-05 23:56:14 +03:00
Rajeh Taher 334977f983 general: revert #1665 2025-10-03 18:14:30 +03:00
João Lucas de Oliveira Lopes fb12f6d9d3 refactor: replace axios with fetch API and update related types (#1666) 2025-09-28 05:52:43 +03:00
Rajeh Taher d9fed62d00 message: Add addressing mode 2025-09-26 11:13:22 +03:00
Rajeh Taher 20693a59d0 lid, wip: Support LIDs in Baileys (#1747)
* lid-mapping: get missing lid from usync

* lid-mapping, jid-utils: change to isPnUser and store multiple mappings

* process-message: parse protocolMsg mapping, and store from new msgs

* types: lid-mapping event, addressing enum, alt, contact, group types

* validate, decode: use lid for identity, better logic

* lid: final commit

* linting

* linting

* linting

* linting

* misc: fix testing and also remove version json

* lint: IDE fucking up lint

* lid-mapping: fix build error on NPM

* message-retry: fix proto import
2025-09-08 10:03:28 +03:00
Rajeh Taher 076daae89d types: fix circular import
closes #1746
2025-09-07 14:51:13 +03:00
vini 50fc83b008 feat(business): change profile/cover photo and manage quick replies (#1724) 2025-09-07 14:08:26 +03:00
vini 084761dc31 feat: eventMessage sending / call link creation (#1677) 2025-09-07 14:08:18 +03:00
Nurutomo cdd2f0d53f fix: correcting if logic for contextInfo (#1628) (#1629)
* fix: correcting if logic for contextInfo

* fix: typing of the logic
[BUG] Can't mention number/someone
Fixes #1628

* lint: whitespace issues
2025-07-27 00:58:14 +03:00
Rajeh Taher 8dc852ee89 proto: fix proto generation, tsc: fix node imports of compiled code 2025-07-19 23:16:35 +03:00
Rajeh Taher 787aed88b8 project: Move to ESM Modules 2025-07-17 13:54:17 +03:00
Cassio Santos 9b5afc8c6b fix: add lid sutff to message.key type (#1586)
* fix: add lid sutff to message.key type

* feat: add view once information to msg key
2025-07-03 17:08:58 -03:00
João Lucas de Oliveira Lopes 8391c02e0b [READY FOR MERGE] Implement newsletter (#1532)
* feat: implement basic newsletter functionality with socket integration and event handling

* feat: enhance media handling for newsletters with raw media upload support

* feat: working updatePicture, removePicure, adminCount, mute, Unmute

* fix: fetchMessages

* chore: cleanup

* fix: update newsletter metadata path and query ID for consistency. newsletterMetadata works now

* chore: enhance newsletter metadata parsing and error handling

* fix: correct DELETE QueryId value in Newsletter.ts

* chore: split mex stuffs to own file

* chore: remove as any
2025-06-30 23:22:09 -03:00
Alι Aryαɴ 42112ac389 chore: add participantPn to WAMessageKey (#1540) 2025-06-25 09:35:56 -03:00
Cassio Santos 6b4dce897d feat: add lid to message key (#1510)
* feat: add lid to message key

* chore: review suggestion
2025-06-11 08:39:19 -03:00
canove ae0de94307 chore: fix format 2025-05-28 22:44:21 -03:00
canove eb6c6c8ba9 Merge branch 'master' of https://github.com/WhiskeySockets/Baileys into fix-eslint-prettier-editorconfig-rules 2025-05-28 22:42:28 -03:00
canove fa706d0b50 chore: format everything 2025-05-06 12:10:19 -03:00
canove f58a38fde9 fix: allow media upload retries 2025-05-06 08:06:05 -03:00
João Lucas de Oliveira Lopes c2cf49cd68 refactor: remove unused dependencies and clean up type exports (#1319) 2025-04-09 02:51:33 +03:00
contato.mateusfr@gmail.com 21f8431e61 Dependency Inversion for Logger (#1153)
* feat: interface "ILogger" created
feat: interface "ILogger" used instead of pino logger
feat: "PinoLoggerAdapter" created to implement "ILogger" interface

* feat: PinoLoggerAdapter removed
feat: ILogger mapping the features we're using from pino

* fix: sort imports

---------

Co-authored-by: Mateus Franchini de Freitas <contato.mateusfr@outlook.com>
Co-authored-by: Mateus Franchini de Freitas <mfranchini@domtec.com.br>
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2025-03-01 18:30:51 +02:00
Rajeh Taher 18ac07df8e lint: 0 warnings left 2024-10-14 05:15:10 +03:00
Rajeh Taher 7c9f2ebd46 feat(feature/group-invite-v4): initial/final commit (#958) 2024-08-14 12:10:37 +03:00
Rajeh Taher 020add8b9b feature(feature/pin-message): initial/final commit (#959) 2024-08-14 12:09:29 +03:00
Bob 2dc1afa4ff Fix: cachedGroupMetadata (#846)
* Update Socket.ts

* Update Message.ts

* Update messages-send.ts

* Update index.ts

* Update messages-send.ts

* Update messages-send.ts

* Update messages-send.ts

* Update messages-send.ts

* Update Message.ts

* Update Socket.ts

* Update messages-send.ts

* Update messages-send.ts

---------

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2024-08-14 12:08:36 +03:00
Rajeh Taher 35f6d75cf8 fix(fix/buttons-deprecation): initial/final commit (#956) 2024-08-14 12:07:12 +03:00
Rajeh Taher e91501026c feat(feature/poll-v3): initial/final commit (#957) 2024-08-14 12:06:32 +03:00
Bob 27d42652d7 Fix: Broadcast option is not present in the message options (#762) 2024-05-06 17:42:01 +03:00
arthur simas 111601bc73 feat: add support to ptvMessage in sendMessage method (#738)
* add support to ptvMessage in sendMessage method

* fix(ptv-sendmessage): Eslint

---------

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2024-04-28 14:00:49 +03:00
Rajeh Taher 7cc604a9b5 share, receive, request, all you want 2023-10-01 21:43:00 +00:00
Davidson Gomes cba9827851 feat: Send Status (status@broadcast) {text, media, audio(with waveform)} (#249)
Co-authored-by: Davidson Gomes <contato@agenciadgcode.com>
2023-07-18 10:25:16 -03:00
Hisoka775 13c3b91852 feat: add contextInfo support 2023-06-15 20:02:39 -03:00
Rajeh Taher 66c2e9c0b6 Update Message.ts 2023-05-06 01:44:29 +03:00
Rajeh Taher f5742ae33c Update Message.ts 2023-05-06 01:31:07 +03:00
Adhiraj Singh fe1d0649b5 feat: add signal repository + tests 2023-03-18 12:25:47 +05:30
Adhiraj Singh cd42881201 feat: allow messageSecret as param to poll create 2023-03-02 17:42:34 +05:30
Adhiraj Singh 3052398cd0 Merge branch 'master' into pr/2472 2023-03-02 15:22:46 +05:30
Adhiraj Singh 06f2d354bf chore: lint files 2023-03-02 15:22:43 +05:30
Adhiraj Singh 79aa2e5176 feat: narrower definition of cachestore 2023-02-21 11:56:27 +05:30
Adhiraj Singh 34f8f60d31 chore: lint 2023-02-21 11:49:59 +05:30
Adhiraj Singh ca24608dc8 chore: pass axios options to downloading remote media 2023-02-18 13:03:47 +05:30
Alan Mosko 78f04d8714 wip 2023-01-11 23:58:29 -03:00
Adhiraj Singh 7f2384a058 feat: support caption in document 2022-11-22 17:18:37 +05:30
Adhiraj Singh 47900eae14 feat: add listReply 2022-11-13 12:23:22 +05:30
Adhiraj Singh 586db48d2b feat: pass original thumbnail url in WAUrlInfo 2022-09-15 18:50:23 +05:30
Adhiraj Singh f0bdb12e56 feat: generate high quality thumbs on link preview 2022-09-15 18:40:22 +05:30