@pontalabs/baileys 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +267 -839
- package/WAProto/GenerateStatics.sh +3 -4
- package/WAProto/WAProto.proto +1215 -511
- package/WAProto/fix-imports.js +85 -0
- package/WAProto/index.d.ts +14017 -55
- package/WAProto/index.js +97689 -29
- package/engine-requirements.js +10 -0
- package/lib/Defaults/index.d.ts +72 -74
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +94 -108
- package/lib/Defaults/index.js.map +1 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +8 -7
- package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
- package/lib/Signal/Group/ciphertext-message.js +9 -16
- package/lib/Signal/Group/ciphertext-message.js.map +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +11 -13
- package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
- package/lib/Signal/Group/group-session-builder.js +19 -61
- package/lib/Signal/Group/group-session-builder.js.map +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +14 -16
- package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
- package/lib/Signal/Group/group_cipher.js +41 -70
- package/lib/Signal/Group/group_cipher.js.map +1 -0
- package/lib/Signal/Group/index.d.ts +12 -11
- package/lib/Signal/Group/index.d.ts.map +1 -0
- package/lib/Signal/Group/index.js +12 -61
- package/lib/Signal/Group/index.js.map +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +9 -14
- package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
- package/lib/Signal/Group/keyhelper.js +10 -58
- package/lib/Signal/Group/keyhelper.js.map +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +13 -13
- package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-chain-key.js +13 -34
- package/lib/Signal/Group/sender-chain-key.js.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -16
- package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +28 -36
- package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +18 -18
- package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-message.js +38 -45
- package/lib/Signal/Group/sender-key-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +14 -15
- package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-name.js +20 -31
- package/lib/Signal/Group/sender-key-name.js.map +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +24 -25
- package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-record.js +18 -35
- package/lib/Signal/Group/sender-key-record.js.map +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +29 -34
- package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-state.js +37 -100
- package/lib/Signal/Group/sender-key-state.js.map +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +11 -10
- package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-message-key.js +15 -22
- package/lib/Signal/Group/sender-message-key.js.map +1 -0
- package/lib/Signal/libsignal.d.ts +5 -8
- package/lib/Signal/libsignal.d.ts.map +1 -0
- package/lib/Signal/libsignal.js +279 -121
- package/lib/Signal/libsignal.js.map +1 -0
- package/lib/Signal/lid-mapping.d.ts +23 -28
- package/lib/Signal/lid-mapping.d.ts.map +1 -0
- package/lib/Signal/lid-mapping.js +277 -184
- package/lib/Signal/lid-mapping.js.map +1 -0
- package/lib/Socket/Client/index.d.ts +3 -2
- package/lib/Socket/Client/index.d.ts.map +1 -0
- package/lib/Socket/Client/index.js +3 -22
- package/lib/Socket/Client/index.js.map +1 -0
- package/lib/Socket/Client/types.d.ts +15 -15
- package/lib/Socket/Client/types.d.ts.map +1 -0
- package/lib/Socket/Client/types.js +8 -15
- package/lib/Socket/Client/types.js.map +1 -0
- package/lib/Socket/Client/websocket.d.ts +12 -12
- package/lib/Socket/Client/websocket.d.ts.map +1 -0
- package/lib/Socket/Client/websocket.js +29 -37
- package/lib/Socket/Client/websocket.js.map +1 -0
- package/lib/Socket/business.d.ts +208 -178
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +91 -127
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/chats.d.ts +120 -93
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +727 -652
- package/lib/Socket/chats.js.map +1 -0
- package/lib/Socket/communities.d.ts +273 -0
- package/lib/Socket/communities.d.ts.map +1 -0
- package/lib/Socket/communities.js +431 -0
- package/lib/Socket/communities.js.map +1 -0
- package/lib/Socket/dugong.js +261 -0
- package/lib/Socket/dugong.js.bak +204 -0
- package/lib/Socket/groups.d.ts +143 -111
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +165 -177
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +252 -183
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +38 -18
- package/lib/Socket/index.js.bak +44 -0
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +196 -167
- package/lib/Socket/messages-recv.d.ts.map +1 -0
- package/lib/Socket/messages-recv.js +1443 -1563
- package/lib/Socket/messages-recv.js.map +1 -0
- package/lib/Socket/messages-send.d.ts +192 -158
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +1102 -1208
- package/lib/Socket/messages-send.js.bak +1400 -0
- package/lib/Socket/messages-send.js.map +1 -0
- package/lib/Socket/mex.d.ts +3 -0
- package/lib/Socket/mex.d.ts.map +1 -0
- package/lib/Socket/mex.js +42 -0
- package/lib/Socket/mex.js.map +1 -0
- package/lib/Socket/newsletter.d.ts +163 -138
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +153 -249
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/socket.d.ts +50 -36
- package/lib/Socket/socket.d.ts.map +1 -0
- package/lib/Socket/socket.js +749 -820
- package/lib/Socket/socket.js.map +1 -0
- package/lib/Store/index.d.ts +4 -4
- package/lib/Store/index.d.ts.map +1 -0
- package/lib/Store/index.js +4 -24
- package/lib/Store/index.js.map +1 -0
- package/lib/Store/make-in-memory-store.d.ts +44 -104
- package/lib/Store/make-in-memory-store.d.ts.map +1 -0
- package/lib/Store/make-in-memory-store.js +199 -213
- package/lib/Store/make-in-memory-store.js.map +1 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -12
- package/lib/Store/make-ordered-dictionary.d.ts.map +1 -0
- package/lib/Store/make-ordered-dictionary.js +38 -45
- package/lib/Store/make-ordered-dictionary.js.map +1 -0
- package/lib/Store/object-repository.d.ts +11 -10
- package/lib/Store/object-repository.d.ts.map +1 -0
- package/lib/Store/object-repository.js +9 -16
- package/lib/Store/object-repository.js.map +1 -0
- package/lib/Types/Auth.d.ts +93 -97
- package/lib/Types/Auth.d.ts.map +1 -0
- package/lib/Types/Auth.js +2 -3
- package/lib/Types/Auth.js.map +1 -0
- package/lib/Types/Bussines.d.ts +25 -0
- package/lib/Types/Bussines.d.ts.map +1 -0
- package/lib/Types/Bussines.js +2 -3
- package/lib/Types/Bussines.js.map +1 -0
- package/lib/Types/Call.d.ts +14 -13
- package/lib/Types/Call.d.ts.map +1 -0
- package/lib/Types/Call.js +2 -3
- package/lib/Types/Call.js.map +1 -0
- package/lib/Types/Chat.d.ts +78 -97
- package/lib/Types/Chat.d.ts.map +1 -0
- package/lib/Types/Chat.js +8 -9
- package/lib/Types/Chat.js.map +1 -0
- package/lib/Types/Contact.d.ts +12 -9
- package/lib/Types/Contact.d.ts.map +1 -0
- package/lib/Types/Contact.js +2 -3
- package/lib/Types/Contact.js.map +1 -0
- package/lib/Types/Events.d.ts +206 -176
- package/lib/Types/Events.d.ts.map +1 -0
- package/lib/Types/Events.js +2 -3
- package/lib/Types/Events.js.map +1 -0
- package/lib/Types/GroupMetadata.d.ts +53 -48
- package/lib/Types/GroupMetadata.d.ts.map +1 -0
- package/lib/Types/GroupMetadata.js +2 -3
- package/lib/Types/GroupMetadata.js.map +1 -0
- package/lib/Types/Label.d.ts +13 -14
- package/lib/Types/Label.d.ts.map +1 -0
- package/lib/Types/Label.js +24 -30
- package/lib/Types/Label.js.map +1 -0
- package/lib/Types/LabelAssociation.d.ts +15 -20
- package/lib/Types/LabelAssociation.d.ts.map +1 -0
- package/lib/Types/LabelAssociation.js +6 -12
- package/lib/Types/LabelAssociation.js.map +1 -0
- package/lib/Types/Message.d.ts +248 -412
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +17 -19
- package/lib/Types/Message.js.map +1 -0
- package/lib/Types/Mex.d.ts +141 -0
- package/lib/Types/Mex.d.ts.map +1 -0
- package/lib/Types/Mex.js +37 -0
- package/lib/Types/Mex.js.map +1 -0
- package/lib/Types/Product.d.ts +58 -71
- package/lib/Types/Product.d.ts.map +1 -0
- package/lib/Types/Product.js +2 -3
- package/lib/Types/Product.js.map +1 -0
- package/lib/Types/RichType.d.ts +3 -0
- package/lib/Types/RichType.d.ts.map +1 -0
- package/lib/Types/RichType.js +23 -0
- package/lib/Types/RichType.js.bak +23 -0
- package/lib/Types/RichType.js.map +1 -0
- package/lib/Types/Signal.d.ts +71 -82
- package/lib/Types/Signal.d.ts.map +1 -0
- package/lib/Types/Signal.js +2 -3
- package/lib/Types/Signal.js.map +1 -0
- package/lib/Types/Socket.d.ts +76 -81
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +3 -3
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +75 -19
- package/lib/Types/State.d.ts.map +1 -0
- package/lib/Types/State.js +56 -14
- package/lib/Types/State.js.map +1 -0
- package/lib/Types/USync.d.ts +8 -8
- package/lib/Types/USync.d.ts.map +1 -0
- package/lib/Types/USync.js +2 -3
- package/lib/Types/USync.js.map +1 -0
- package/lib/Types/index.d.ts +47 -62
- package/lib/Types/index.d.ts.map +1 -0
- package/lib/Types/index.js +26 -50
- package/lib/Types/index.js.map +1 -0
- package/lib/Utils/auth-utils.d.ts +13 -10
- package/lib/Utils/auth-utils.d.ts.map +1 -0
- package/lib/Utils/auth-utils.js +213 -454
- package/lib/Utils/auth-utils.js.map +1 -0
- package/lib/Utils/browser-utils.d.ts +4 -0
- package/lib/Utils/browser-utils.d.ts.map +1 -0
- package/lib/Utils/browser-utils.js +28 -0
- package/lib/Utils/browser-utils.js.map +1 -0
- package/lib/Utils/business.d.ts +14 -20
- package/lib/Utils/business.d.ts.map +1 -0
- package/lib/Utils/business.js +110 -134
- package/lib/Utils/business.js.map +1 -0
- package/lib/Utils/chat-utils.d.ts +88 -70
- package/lib/Utils/chat-utils.d.ts.map +1 -0
- package/lib/Utils/chat-utils.js +466 -403
- package/lib/Utils/chat-utils.js.map +1 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +17 -0
- package/lib/Utils/companion-reg-client-utils.d.ts.map +1 -0
- package/lib/Utils/companion-reg-client-utils.js +35 -0
- package/lib/Utils/companion-reg-client-utils.js.map +1 -0
- package/lib/Utils/crypto.d.ts +27 -46
- package/lib/Utils/crypto.d.ts.map +1 -0
- package/lib/Utils/crypto.js +117 -188
- package/lib/Utils/crypto.js.map +1 -0
- package/lib/Utils/decode-wa-message.d.ts +58 -45
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +213 -303
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +14 -17
- package/lib/Utils/event-buffer.d.ts.map +1 -0
- package/lib/Utils/event-buffer.js +321 -296
- package/lib/Utils/event-buffer.js.map +1 -0
- package/lib/Utils/generics.d.ts +66 -92
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +270 -436
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/history.d.ts +24 -23
- package/lib/Utils/history.d.ts.map +1 -0
- package/lib/Utils/history.js +106 -76
- package/lib/Utils/history.js.map +1 -0
- package/lib/Utils/identity-change-handler.d.ts +44 -0
- package/lib/Utils/identity-change-handler.d.ts.map +1 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/identity-change-handler.js.map +1 -0
- package/lib/Utils/index.d.ts +24 -21
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +24 -41
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +12 -14
- package/lib/Utils/link-preview.d.ts.map +1 -0
- package/lib/Utils/link-preview.js +40 -75
- package/lib/Utils/link-preview.js.map +1 -0
- package/lib/Utils/logger.d.ts +10 -11
- package/lib/Utils/logger.d.ts.map +1 -0
- package/lib/Utils/logger.js +3 -7
- package/lib/Utils/logger.js.map +1 -0
- package/lib/Utils/lt-hash.d.ts +8 -14
- package/lib/Utils/lt-hash.d.ts.map +1 -0
- package/lib/Utils/lt-hash.js +3 -53
- package/lib/Utils/lt-hash.js.map +1 -0
- package/lib/Utils/make-mutex.d.ts +7 -7
- package/lib/Utils/make-mutex.d.ts.map +1 -0
- package/lib/Utils/make-mutex.js +28 -44
- package/lib/Utils/make-mutex.js.map +1 -0
- package/lib/Utils/message-retry-manager.d.ts +115 -88
- package/lib/Utils/message-retry-manager.d.ts.map +1 -0
- package/lib/Utils/message-retry-manager.js +265 -160
- package/lib/Utils/message-retry-manager.js.map +1 -0
- package/lib/Utils/messages-media.d.ts +105 -107
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +548 -619
- package/lib/Utils/messages-media.js.bak +786 -0
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +52 -66
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +1730 -1558
- package/lib/Utils/messages.js.backup +1768 -0
- package/lib/Utils/messages.js.bak +1809 -0
- package/lib/Utils/messages.js.bak2 +893 -0
- package/lib/Utils/messages.js.bak3 +1183 -0
- package/lib/Utils/messages.js.map +1 -0
- package/lib/Utils/noise-handler.d.ts +18 -18
- package/lib/Utils/noise-handler.d.ts.map +1 -0
- package/lib/Utils/noise-handler.js +176 -130
- package/lib/Utils/noise-handler.js.map +1 -0
- package/lib/Utils/offline-node-processor.d.ts +17 -0
- package/lib/Utils/offline-node-processor.d.ts.map +1 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/offline-node-processor.js.map +1 -0
- package/lib/Utils/pre-key-manager.d.ts +28 -0
- package/lib/Utils/pre-key-manager.d.ts.map +1 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/pre-key-manager.js.map +1 -0
- package/lib/Utils/process-message.d.ts +43 -32
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +484 -282
- package/lib/Utils/process-message.js.map +1 -0
- package/lib/Utils/reporting-utils.d.ts +11 -0
- package/lib/Utils/reporting-utils.d.ts.map +1 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/reporting-utils.js.map +1 -0
- package/lib/Utils/rich-message-utils.d.ts +49 -0
- package/lib/Utils/rich-message-utils.d.ts.map +1 -0
- package/lib/Utils/rich-message-utils.js +1220 -724
- package/lib/Utils/rich-message-utils.js.backup +706 -0
- package/lib/Utils/rich-message-utils.js.bak +246 -0
- package/lib/Utils/rich-message-utils.js.map +1 -0
- package/lib/Utils/rich-message-utils.js.original +1332 -0
- package/lib/Utils/signal.d.ts +37 -32
- package/lib/Utils/signal.d.ts.map +1 -0
- package/lib/Utils/signal.js +140 -105
- package/lib/Utils/signal.js.map +1 -0
- package/lib/Utils/stanza-ack.d.ts +11 -0
- package/lib/Utils/stanza-ack.d.ts.map +1 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/stanza-ack.js.map +1 -0
- package/lib/Utils/sync-action-utils.d.ts +19 -0
- package/lib/Utils/sync-action-utils.d.ts.map +1 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/sync-action-utils.js.map +1 -0
- package/lib/Utils/tc-token-utils.d.ts +37 -0
- package/lib/Utils/tc-token-utils.d.ts.map +1 -0
- package/lib/Utils/tc-token-utils.js +163 -0
- package/lib/Utils/tc-token-utils.js.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +5 -5
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +70 -120
- package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +11 -13
- package/lib/Utils/use-single-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-single-file-auth-state.js +92 -66
- package/lib/Utils/use-single-file-auth-state.js.map +1 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-sqlite-auth-state.js +109 -0
- package/lib/Utils/use-sqlite-auth-state.js.map +1 -0
- package/lib/Utils/validate-connection.d.ts +11 -13
- package/lib/Utils/validate-connection.d.ts.map +1 -0
- package/lib/Utils/validate-connection.js +128 -113
- package/lib/Utils/validate-connection.js.map +1 -0
- package/lib/WABinary/constants.d.ts +25 -27
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +1451 -1292
- package/lib/WABinary/constants.js.bak +1373 -0
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +7 -9
- package/lib/WABinary/decode.d.ts.map +1 -0
- package/lib/WABinary/decode.js +163 -189
- package/lib/WABinary/decode.js.map +1 -0
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.d.ts.map +1 -0
- package/lib/WABinary/encode.js +110 -155
- package/lib/WABinary/encode.js.map +1 -0
- package/lib/WABinary/generic-utils.d.ts +14 -27
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +177 -105
- package/lib/WABinary/generic-utils.js.map +1 -0
- package/lib/WABinary/index.d.ts +6 -5
- package/lib/WABinary/index.d.ts.map +1 -0
- package/lib/WABinary/index.js +6 -25
- package/lib/WABinary/index.js.map +1 -0
- package/lib/WABinary/jid-utils.d.ts +41 -51
- package/lib/WABinary/jid-utils.d.ts.map +1 -0
- package/lib/WABinary/jid-utils.js +83 -120
- package/lib/WABinary/jid-utils.js.map +1 -0
- package/lib/WABinary/types.d.ts +10 -13
- package/lib/WABinary/types.d.ts.map +1 -0
- package/lib/WABinary/types.js +2 -3
- package/lib/WABinary/types.js.map +1 -0
- package/lib/WAM/BinaryInfo.d.ts +8 -15
- package/lib/WAM/BinaryInfo.d.ts.map +1 -0
- package/lib/WAM/BinaryInfo.js +7 -14
- package/lib/WAM/BinaryInfo.js.map +1 -0
- package/lib/WAM/constants.d.ts +30 -37
- package/lib/WAM/constants.d.ts.map +1 -0
- package/lib/WAM/constants.js +19193 -11711
- package/lib/WAM/constants.js.map +1 -0
- package/lib/WAM/encode.d.ts +3 -3
- package/lib/WAM/encode.d.ts.map +1 -0
- package/lib/WAM/encode.js +95 -109
- package/lib/WAM/encode.js.map +1 -0
- package/lib/WAM/index.d.ts +4 -3
- package/lib/WAM/index.d.ts.map +1 -0
- package/lib/WAM/index.js +4 -23
- package/lib/WAM/index.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +37 -21
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +19 -22
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +18 -26
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +11 -12
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +12 -20
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +11 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +16 -24
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +26 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +6 -6
- package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/index.js +6 -26
- package/lib/WAUSync/Protocols/index.js.map +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +27 -28
- package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
- package/lib/WAUSync/USyncQuery.js +68 -62
- package/lib/WAUSync/USyncQuery.js.map +1 -0
- package/lib/WAUSync/USyncUser.d.ts +15 -10
- package/lib/WAUSync/USyncUser.d.ts.map +1 -0
- package/lib/WAUSync/USyncUser.js +20 -19
- package/lib/WAUSync/USyncUser.js.map +1 -0
- package/lib/WAUSync/index.d.ts +4 -3
- package/lib/WAUSync/index.d.ts.map +1 -0
- package/lib/WAUSync/index.js +4 -23
- package/lib/WAUSync/index.js.map +1 -0
- package/lib/index.d.ts +11 -12
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -39
- package/lib/index.js.map +1 -0
- package/package.json +86 -42
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
<br><br>
|
|
31
31
|
|
|
32
|
-
<p><em>Extended from <code>@whiskeysockets/baileys</code> —
|
|
32
|
+
<p><em>Extended from <code>@whiskeysockets/baileys</code> — dengan lapisan AI rich-message, patch grup/lokasi/order, dan API sendiri yang <strong>bukan</strong> sekadar rename dari fork lain.</em></p>
|
|
33
33
|
|
|
34
34
|
</div>
|
|
35
35
|
|
|
@@ -45,7 +45,9 @@
|
|
|
45
45
|
- [Connecting](#-connecting)
|
|
46
46
|
- [Events](#-events)
|
|
47
47
|
- [Sending Messages](#-sending-messages)
|
|
48
|
-
- [
|
|
48
|
+
- [Location + Buttons](#-location--buttons)
|
|
49
|
+
- [Order Status](#-order-status)
|
|
50
|
+
- [AI Rich Messages](#-ai-rich-messages)
|
|
49
51
|
- [Newsletter](#-newsletter)
|
|
50
52
|
- [Groups](#-groups)
|
|
51
53
|
- [Privacy](#-privacy)
|
|
@@ -59,34 +61,32 @@
|
|
|
59
61
|
|
|
60
62
|
## ✨ Why This Fork?
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
Fork ini dibangun di atas Baileys asli, dengan penekanan khusus pada satu hal: **API AI rich-message punya nama field sendiri**, bukan tempelan ulang dari fork lain. Kalau kamu pernah pakai fork "AI-message" lain dan lihat field seperti `richResponse` / `headerText` / `footerText` / `disclaimerText` / `richTip` — di sini semua itu dipetakan ulang jadi nama yang berbeda (`aiBlocks`, `topText`, `bottomText`, `aiNotice`, `tip`, dst), lengkap dengan struktur data yang juga disesuaikan.
|
|
63
65
|
|
|
64
66
|
| # | Patch | Description |
|
|
65
67
|
|:---:|:---|:---|
|
|
66
|
-
| 01 | 🤖 **
|
|
67
|
-
| 02 | 💻 **
|
|
68
|
-
| 03 | 📊 **
|
|
69
|
-
| 04 | 🖼️ **Rich
|
|
70
|
-
| 05 | 🎥 **Rich Video** | Video
|
|
71
|
-
| 06 | 💡 **
|
|
72
|
-
| 07 | 🔣 **
|
|
73
|
-
| 08 | 🛍️ **Rich Product** |
|
|
74
|
-
| 09 | 📰 **Rich Post** |
|
|
75
|
-
| 10 | 🎬 **
|
|
76
|
-
| 11 | 🔍 **
|
|
77
|
-
| 12 | 📌 **
|
|
78
|
-
| 13 | 🔀 **
|
|
79
|
-
| 14 | 🔗 **
|
|
80
|
-
| 15 |
|
|
81
|
-
| 16 |
|
|
82
|
-
| 17 |
|
|
83
|
-
| 18 |
|
|
84
|
-
| 19 |
|
|
85
|
-
| 20 |
|
|
86
|
-
| 21 |
|
|
87
|
-
| 22 |
|
|
88
|
-
| 23 | 📢 **Group Status** | Styled group status (text/media) with audience control |
|
|
89
|
-
| 24 | 📦 **Order Status** | Interactive order tracking cards with native `order_status` flow |
|
|
68
|
+
| 01 | 🤖 **AI Blocks (`aiBlocks`)** | Array campuran text/code/table/image/video/product/post/reels/tip/suggest dalam satu pesan |
|
|
69
|
+
| 02 | 💻 **Code Block** | Syntax-highlighted code block via `code` + `language` |
|
|
70
|
+
| 03 | 📊 **Table** | Tabel data via `table` (rows) + `title` |
|
|
71
|
+
| 04 | 🖼️ **Rich Image** | Grid gambar AI via `richImage` |
|
|
72
|
+
| 05 | 🎥 **Rich Video** | Video embed animasi AI via `richVideo` |
|
|
73
|
+
| 06 | 💡 **Suggest** | Follow-up prompt pills via `suggest` |
|
|
74
|
+
| 07 | 🔣 **LaTeX** | Render rumus matematika via `latex` |
|
|
75
|
+
| 08 | 🛍️ **Rich Product** | Kartu produk (single / carousel) via `richProduct` |
|
|
76
|
+
| 09 | 📰 **Rich Post** | Kartu post carousel via `richPost` |
|
|
77
|
+
| 10 | 🎬 **Reels** | Carousel reels via `reels` |
|
|
78
|
+
| 11 | 🔍 **Source** | Daftar sumber pencarian dengan favicon via `source` |
|
|
79
|
+
| 12 | 📌 **Header / Footer / Disclaimer** | `topText`, `bottomText`, `aiNotice` — bukan `headerText`/`footerText`/`disclaimerText` |
|
|
80
|
+
| 13 | 🔀 **Mixed Blocks** | Semua tipe di atas bisa digabung bebas lewat `aiBlocks` |
|
|
81
|
+
| 14 | 🔗 **Inline Citation** | Kutipan inline lewat `links` |
|
|
82
|
+
| 15 | 🐛 **LID Bug Fixes** | Resolusi penuh untuk participant, sender, dan admin LID |
|
|
83
|
+
| 16 | 📦 **makeInMemoryStore Fix** | Session handling dan store behavior lebih stabil |
|
|
84
|
+
| 17 | 📣 **Newsletter Support** | Create, follow, react, dan admin tools untuk channel/newsletter |
|
|
85
|
+
| 18 | 📊 **Logger Buffer Clear** | Mencegah memory buildup dari log buffer |
|
|
86
|
+
| 19 | 🔁 **LID → JID Conversion** | Auto-convert mention/sender/member LID ke JID |
|
|
87
|
+
| 20 | 📍 **Location + Buttons** | Pesan lokasi dengan native list menu (`buttonLocation.sections`) dan extra buttons |
|
|
88
|
+
| 21 | 📢 **Group Status** | `groupStatusMessage` dengan `audienceType`, `backgroundColor`, `textColor`, `font` |
|
|
89
|
+
| 22 | 📦 **Order Status** | Kartu order tracking interaktif via flow native `order_status` |
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
|
|
@@ -95,7 +95,7 @@ This fork builds on top of the original Baileys library with **targeted, product
|
|
|
95
95
|
```
|
|
96
96
|
✔ Multi-Device Support ✔ End-to-End Encryption
|
|
97
97
|
✔ Real-Time Messaging ✔ Session Persistence
|
|
98
|
-
✔
|
|
98
|
+
✔ AI Rich Messages (aiBlocks) ✔ Newsletter Management
|
|
99
99
|
✔ Group & Channel Management ✔ Inline Citations & LaTeX
|
|
100
100
|
✔ Poll, Album, Carousel ✔ LID → JID Auto-Conversion
|
|
101
101
|
✔ Product / Post / Reels Cards ✔ Math Formula Rendering
|
|
@@ -168,8 +168,6 @@ const sock = makeWASocket({
|
|
|
168
168
|
if (!sock.authState.creds.registered) {
|
|
169
169
|
const number = '62xxxx'
|
|
170
170
|
const code = await sock.requestPairingCode(number)
|
|
171
|
-
// Or custom 8-digit code:
|
|
172
|
-
const customCode = await sock.requestPairingCode(number, 'PONTASOCKETS')
|
|
173
171
|
console.log(code)
|
|
174
172
|
}
|
|
175
173
|
```
|
|
@@ -229,13 +227,11 @@ await sock.sendMessage(jid, { text: 'Reply!' }, { quoted: message })
|
|
|
229
227
|
<summary><b>🖼️ Image</b></summary>
|
|
230
228
|
|
|
231
229
|
```js
|
|
232
|
-
// From file
|
|
233
230
|
await sock.sendMessage(jid, {
|
|
234
231
|
image: fs.readFileSync('image.jpg'),
|
|
235
232
|
caption: 'Caption here'
|
|
236
233
|
})
|
|
237
234
|
|
|
238
|
-
// From URL
|
|
239
235
|
await sock.sendMessage(jid, {
|
|
240
236
|
image: { url: 'https://example.com/image.jpg' },
|
|
241
237
|
caption: 'Downloaded image'
|
|
@@ -252,7 +248,6 @@ await sock.sendMessage(jid, {
|
|
|
252
248
|
caption: 'Funny clip!'
|
|
253
249
|
})
|
|
254
250
|
|
|
255
|
-
// View Once
|
|
256
251
|
await sock.sendMessage(jid, {
|
|
257
252
|
video: fs.readFileSync('secret.mp4'),
|
|
258
253
|
viewOnce: true
|
|
@@ -264,10 +259,8 @@ await sock.sendMessage(jid, {
|
|
|
264
259
|
<summary><b>🎵 Audio / PTT</b></summary>
|
|
265
260
|
|
|
266
261
|
```js
|
|
267
|
-
// Regular audio
|
|
268
262
|
await sock.sendMessage(jid, { audio: fs.readFileSync('audio.mp3'), ptt: false })
|
|
269
263
|
|
|
270
|
-
// Push-to-talk
|
|
271
264
|
await sock.sendMessage(jid, {
|
|
272
265
|
audio: fs.readFileSync('voice.ogg'),
|
|
273
266
|
ptt: true,
|
|
@@ -311,8 +304,7 @@ await sock.sendMessage(jid, {
|
|
|
311
304
|
|
|
312
305
|
```js
|
|
313
306
|
await sock.sendMessage(jid, { react: { text: '👍', key: message.key } })
|
|
314
|
-
//
|
|
315
|
-
await sock.sendMessage(jid, { react: { text: '', key: message.key } })
|
|
307
|
+
await sock.sendMessage(jid, { react: { text: '', key: message.key } }) // hapus reaksi
|
|
316
308
|
```
|
|
317
309
|
</details>
|
|
318
310
|
|
|
@@ -333,11 +325,15 @@ await sock.sendMessage(jid, {
|
|
|
333
325
|
<details>
|
|
334
326
|
<summary><b>📸 Album</b></summary>
|
|
335
327
|
|
|
328
|
+
> Minimal 2 media (gabungan gambar/video). Gunakan key `album`, bukan method terpisah.
|
|
329
|
+
|
|
336
330
|
```js
|
|
337
|
-
await sock.
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
331
|
+
await sock.sendMessage(jid, {
|
|
332
|
+
album: [
|
|
333
|
+
{ image: { url: 'https://example.com/1.jpg' }, caption: 'First' },
|
|
334
|
+
{ video: { url: 'https://example.com/clip.mp4' }, caption: 'Second' }
|
|
335
|
+
]
|
|
336
|
+
}, { quoted: message })
|
|
341
337
|
```
|
|
342
338
|
</details>
|
|
343
339
|
|
|
@@ -345,12 +341,11 @@ await sock.sendAlbumMessage(jid, [
|
|
|
345
341
|
<summary><b>👨💻 Interactive (Native Flow & Carousel)</b></summary>
|
|
346
342
|
|
|
347
343
|
```js
|
|
348
|
-
// Native Flow
|
|
344
|
+
// Native Flow — key-nya "nativeFlow", bukan "interactive"
|
|
349
345
|
await sock.sendMessage(jid, {
|
|
350
346
|
text: 'Choose an option:',
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
interactive: [{
|
|
347
|
+
footer: '© Pontact Baileys',
|
|
348
|
+
nativeFlow: [{
|
|
354
349
|
name: 'quick_reply',
|
|
355
350
|
buttonParamsJson: JSON.stringify({ display_text: 'Quick Reply', id: '123' })
|
|
356
351
|
}]
|
|
@@ -359,14 +354,13 @@ await sock.sendMessage(jid, {
|
|
|
359
354
|
// Carousel
|
|
360
355
|
await sock.sendMessage(jid, {
|
|
361
356
|
text: 'Check out our collection!',
|
|
362
|
-
|
|
363
|
-
footer: '© PONTASOCKETS Baileys',
|
|
357
|
+
footer: '© Pontact Baileys',
|
|
364
358
|
cards: [{
|
|
365
359
|
image: { url: 'https://example.com/image.jpg' },
|
|
366
360
|
title: 'Product Name',
|
|
367
|
-
|
|
368
|
-
footer: '©
|
|
369
|
-
|
|
361
|
+
caption: 'Product description',
|
|
362
|
+
footer: '© PontaCT',
|
|
363
|
+
nativeFlow: [{
|
|
370
364
|
name: 'quick_reply',
|
|
371
365
|
buttonParamsJson: JSON.stringify({ display_text: 'Select', id: '1' })
|
|
372
366
|
}]
|
|
@@ -391,7 +385,7 @@ await sock.sendMessage(jid, { keep: { key: message.key, type: 1 } })
|
|
|
391
385
|
|
|
392
386
|
### 📍 Location + Buttons
|
|
393
387
|
|
|
394
|
-
>
|
|
388
|
+
> Pesan lokasi dengan list menu native (`single_select`) dan extra buttons — semuanya dalam satu `buttonLocation`. Perhatikan: strukturnya pakai `sections` (bukan `listMenu` flat).
|
|
395
389
|
|
|
396
390
|
<details>
|
|
397
391
|
<summary><b>Location + List Menu</b></summary>
|
|
@@ -407,11 +401,15 @@ await sock.sendMessage(jid, {
|
|
|
407
401
|
footer: '© PontaCT',
|
|
408
402
|
thumbnail: 'https://example.com/map-preview.jpg',
|
|
409
403
|
listButtonText: 'Pilih Layanan',
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
404
|
+
sections: [
|
|
405
|
+
{
|
|
406
|
+
title: 'Layanan Tersedia',
|
|
407
|
+
rows: [
|
|
408
|
+
{ id: 'cs', title: 'Customer Service', description: 'Lantai 1, Senin–Jumat 08.00–17.00' },
|
|
409
|
+
{ id: 'kasir', title: 'Kasir & Pembayaran', description: 'Lantai 2, buka setiap hari' },
|
|
410
|
+
{ id: 'gudang', title: 'Gudang & Pengiriman', description: 'Gedung B, pintu belakang' }
|
|
411
|
+
]
|
|
412
|
+
}
|
|
415
413
|
]
|
|
416
414
|
}
|
|
417
415
|
})
|
|
@@ -441,51 +439,23 @@ await sock.sendMessage(jid, {
|
|
|
441
439
|
```
|
|
442
440
|
</details>
|
|
443
441
|
|
|
444
|
-
<details>
|
|
445
|
-
<summary><b>Location + List Menu + Extra Buttons</b></summary>
|
|
446
|
-
|
|
447
|
-
```js
|
|
448
|
-
await sock.sendMessage(jid, {
|
|
449
|
-
buttonLocation: {
|
|
450
|
-
latitude: -6.2088,
|
|
451
|
-
longitude: 106.8456,
|
|
452
|
-
name: 'Plaza PontaCT',
|
|
453
|
-
address: 'Jl. MH Thamrin No. 5, Jakarta',
|
|
454
|
-
text: 'Selamat datang di pusat layanan kami.',
|
|
455
|
-
footer: 'Buka setiap hari 09.00–21.00',
|
|
456
|
-
thumbnail: 'https://example.com/plaza.jpg',
|
|
457
|
-
listButtonText: 'Pilih Tujuan',
|
|
458
|
-
listSectionTitle: 'Area Tersedia',
|
|
459
|
-
listMenu: [
|
|
460
|
-
{ title: 'Food Court', description: 'Lt. 1 — lebih dari 30 tenant', id: 'food' },
|
|
461
|
-
{ title: 'Cinema', description: 'Lt. 4 — 8 studio', id: 'cinema' },
|
|
462
|
-
{ title: 'Customer Care', description: 'Lt. 2 — sebelah eskalator', id: 'care' }
|
|
463
|
-
],
|
|
464
|
-
extraButtons: [
|
|
465
|
-
{ id: 'navigate', displayText: '🧭 Navigasi' },
|
|
466
|
-
{ id: 'promo', displayText: '🎁 Promo Hari Ini' }
|
|
467
|
-
]
|
|
468
|
-
}
|
|
469
|
-
})
|
|
470
|
-
```
|
|
471
|
-
</details>
|
|
472
|
-
|
|
473
442
|
<details>
|
|
474
443
|
<summary><b>📋 Fields Reference</b></summary>
|
|
475
444
|
|
|
476
445
|
| Field | Type | Required | Default | Description |
|
|
477
446
|
|:---|:---|:---:|:---|:---|
|
|
478
|
-
| `latitude` | `number` |
|
|
479
|
-
| `longitude` | `number` |
|
|
480
|
-
| `name` | `string` | — | `'Location'` |
|
|
481
|
-
| `address` | `string` | — | `''` |
|
|
482
|
-
| `text` | `string` | — | `''` |
|
|
483
|
-
| `footer` | `string` | — | `''` |
|
|
484
|
-
| `thumbnail` | `Buffer / URL / path` |
|
|
485
|
-
| `listButtonText` | `string` | — | `'Pilih Menu'` |
|
|
486
|
-
| `
|
|
487
|
-
| `
|
|
488
|
-
|
|
447
|
+
| `latitude` | `number` | ✅ | — | Latitude coordinate |
|
|
448
|
+
| `longitude` | `number` | ✅ | — | Longitude coordinate |
|
|
449
|
+
| `name` | `string` | — | `'Location'` | Nama tempat |
|
|
450
|
+
| `address` | `string` | — | `''` | Alamat teks |
|
|
451
|
+
| `text` | `string` | — | `''` | Isi pesan |
|
|
452
|
+
| `footer` | `string` | — | `''` | Teks footer |
|
|
453
|
+
| `thumbnail` | `Buffer / URL / path` | — | — | Gambar preview peta |
|
|
454
|
+
| `listButtonText` | `string` | — | `'📄 Pilih Menu'` | Label tombol list |
|
|
455
|
+
| `sections` | `array<{title, rows[]}>` | — | — | Section list menu, tiap `row` wajib punya `id` & `title` |
|
|
456
|
+
| `extraButtons` | `array<{id, displayText}>` | — | — | Tombol tambahan |
|
|
457
|
+
|
|
458
|
+
> Wajib ada minimal 1 `sections` **atau** 1 `extraButtons`.
|
|
489
459
|
|
|
490
460
|
</details>
|
|
491
461
|
|
|
@@ -493,7 +463,7 @@ await sock.sendMessage(jid, {
|
|
|
493
463
|
|
|
494
464
|
### 📦 Order Status
|
|
495
465
|
|
|
496
|
-
>
|
|
466
|
+
> Kartu order tracking interaktif menggunakan native flow button `order_status`.
|
|
497
467
|
|
|
498
468
|
<details>
|
|
499
469
|
<summary><b>Basic Order Status</b></summary>
|
|
@@ -504,7 +474,7 @@ await sock.sendMessage(jid, {
|
|
|
504
474
|
image: 'https://example.com/order-banner.jpg',
|
|
505
475
|
title: 'Status Pesanan',
|
|
506
476
|
text: 'Pesanan kamu sedang diproses oleh penjual.',
|
|
507
|
-
referenceId: 'ORD-
|
|
477
|
+
referenceId: 'ORD-20260629-001',
|
|
508
478
|
status: 'PROCESSING',
|
|
509
479
|
currency: 'IDR'
|
|
510
480
|
}
|
|
@@ -519,10 +489,10 @@ await sock.sendMessage(jid, {
|
|
|
519
489
|
await sock.sendMessage(jid, {
|
|
520
490
|
orderStatus: {
|
|
521
491
|
image: 'https://example.com/order.jpg',
|
|
522
|
-
title: 'Update Pesanan #ORD-
|
|
492
|
+
title: 'Update Pesanan #ORD-2026-001',
|
|
523
493
|
text: 'Pesananmu sedang dalam perjalanan! 🚚',
|
|
524
494
|
footer: 'Estimasi tiba: 2–3 hari kerja',
|
|
525
|
-
referenceId: 'ORD-
|
|
495
|
+
referenceId: 'ORD-2026-001',
|
|
526
496
|
status: 'SHIPPED',
|
|
527
497
|
subtotalValue: 15000000,
|
|
528
498
|
subtotalOffset: 100,
|
|
@@ -534,40 +504,22 @@ await sock.sendMessage(jid, {
|
|
|
534
504
|
```
|
|
535
505
|
</details>
|
|
536
506
|
|
|
537
|
-
<details>
|
|
538
|
-
<summary><b>Local Image File</b></summary>
|
|
539
|
-
|
|
540
|
-
```js
|
|
541
|
-
const fs = require('fs')
|
|
542
|
-
await sock.sendMessage(jid, {
|
|
543
|
-
orderStatus: {
|
|
544
|
-
image: fs.readFileSync('./assets/order-confirm.jpg'),
|
|
545
|
-
title: 'Pesanan Dikonfirmasi ✅',
|
|
546
|
-
text: 'Terima kasih telah berbelanja!',
|
|
547
|
-
referenceId: 'ORD-LOCAL-001',
|
|
548
|
-
status: 'PROCESSING',
|
|
549
|
-
currency: 'IDR'
|
|
550
|
-
}
|
|
551
|
-
})
|
|
552
|
-
```
|
|
553
|
-
</details>
|
|
554
|
-
|
|
555
507
|
<details>
|
|
556
508
|
<summary><b>📋 Fields Reference</b></summary>
|
|
557
509
|
|
|
558
510
|
| Field | Type | Required | Default | Description |
|
|
559
511
|
|:---|:---|:---:|:---|:---|
|
|
560
|
-
| `image` | `Buffer / URL / path` | ✅ | — |
|
|
561
|
-
| `title` | `string` | — | `'Order Status'` |
|
|
562
|
-
| `text` | `string` | — | `'Silakan cek status pesanan Anda.'` |
|
|
563
|
-
| `footer` | `string` | — | `'Powered by
|
|
564
|
-
| `referenceId` | `string` |
|
|
565
|
-
| `status` | `string` | — | `'PROCESSING'` |
|
|
566
|
-
| `subtotalValue` | `number` | — | `0` |
|
|
567
|
-
| `subtotalOffset` | `number` | — | `100` |
|
|
568
|
-
| `taxValue` | `number` | — | `0` |
|
|
569
|
-
| `taxOffset` | `number` | — | `100` |
|
|
570
|
-
| `currency` | `string` | — | `'IDR'` |
|
|
512
|
+
| `image` | `Buffer / URL / path` | ✅ | — | Gambar header kartu |
|
|
513
|
+
| `title` | `string` | — | `'Order Status'` | Judul header |
|
|
514
|
+
| `text` | `string` | — | `'Silakan cek status pesanan Anda.'` | Isi body |
|
|
515
|
+
| `footer` | `string` | — | `'Powered by @pontalabs/baileys'` | Teks footer |
|
|
516
|
+
| `referenceId` | `string` | ✅ | — | ID referensi order |
|
|
517
|
+
| `status` | `string` | — | `'PROCESSING'` | Status order |
|
|
518
|
+
| `subtotalValue` | `number` | — | `0` | Nilai subtotal (dalam satuan offset) |
|
|
519
|
+
| `subtotalOffset` | `number` | — | `100` | Pembagi nilai |
|
|
520
|
+
| `taxValue` | `number` | — | `0` | Nilai pajak |
|
|
521
|
+
| `taxOffset` | `number` | — | `100` | Pembagi pajak |
|
|
522
|
+
| `currency` | `string` | — | `'IDR'` | Kode mata uang |
|
|
571
523
|
|
|
572
524
|
> **Status values:** `PROCESSING` · `SHIPPED` · `DELIVERED` · `CANCELLED` · `REFUNDED`
|
|
573
525
|
|
|
@@ -575,75 +527,60 @@ await sock.sendMessage(jid, {
|
|
|
575
527
|
|
|
576
528
|
---
|
|
577
529
|
|
|
578
|
-
### 🤖 Rich Messages
|
|
530
|
+
### 🤖 AI Rich Messages
|
|
579
531
|
|
|
580
|
-
>
|
|
532
|
+
> Semua rich message dikirim lewat `sendMessage` biasa dan dirender sebagai AI bot message di WhatsApp. **Field-nya sengaja berbeda dari fork lain** — bukan `richResponse`/`headerText`/`footerText`/`disclaimerText`, tapi `aiBlocks`/`topText`/`bottomText`/`aiNotice`.
|
|
581
533
|
|
|
582
|
-
**Quick jump:** [
|
|
534
|
+
**Quick jump:** [AI Blocks](#-ai-blocks--aiblocks) · [Code](#-code-block) · [Table](#-table) · [Rich Image](#-rich-image) · [Rich Video](#-rich-video) · [Suggest](#-suggest) · [LaTeX](#-latex) · [Rich Product](#-rich-product) · [Rich Post](#-rich-post) · [Reels](#-reels) · [Source](#-source) · [Header / Footer / Disclaimer](#-header--footer--disclaimer) · [Links & Citations](#-links--citations)
|
|
583
535
|
|
|
584
536
|
---
|
|
585
537
|
|
|
586
|
-
####
|
|
587
|
-
|
|
588
|
-
> AI bot-styled markdown text rendered in `richResponseMessage`.
|
|
538
|
+
#### 🔀 AI Blocks — `aiBlocks`
|
|
589
539
|
|
|
590
|
-
|
|
591
|
-
<summary><b>Simple Text</b></summary>
|
|
592
|
-
|
|
593
|
-
```js
|
|
594
|
-
await sock.sendMessage(jid, { richText: 'Halo! Ini pesan dari bot.' }, { quoted: message })
|
|
595
|
-
```
|
|
596
|
-
</details>
|
|
597
|
-
|
|
598
|
-
<details>
|
|
599
|
-
<summary><b>Markdown (bold, italic, inline code)</b></summary>
|
|
540
|
+
> Mode array — campur bebas semua tipe block dalam satu pesan. Ini pengganti pola `items`/`richResponse` di fork lain.
|
|
600
541
|
|
|
601
542
|
```js
|
|
602
543
|
await sock.sendMessage(jid, {
|
|
603
|
-
|
|
544
|
+
aiBlocks: [
|
|
545
|
+
{ text: 'Ini teks dari AI dengan *markdown* dan _italic_.' },
|
|
546
|
+
{ code: 'console.log("Hello World")', language: 'javascript' },
|
|
547
|
+
{ table: [['id', 'name', 'score'], ['1', 'Ponta', '98'], ['2', 'Yue', '87']], title: 'Leaderboard' },
|
|
548
|
+
{ suggest: ['Lihat selengkapnya', 'Bagikan', 'Simpan'] }
|
|
549
|
+
],
|
|
550
|
+
topText: 'Judul',
|
|
551
|
+
bottomText: 'Footer',
|
|
552
|
+
aiNotice: 'Generated by AI'
|
|
604
553
|
}, { quoted: message })
|
|
605
554
|
```
|
|
606
|
-
</details>
|
|
607
555
|
|
|
608
|
-
|
|
609
|
-
<summary><b>Multiple Paragraphs (Array)</b></summary>
|
|
556
|
+
**Valid keys di dalam array `aiBlocks`:**
|
|
610
557
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
558
|
+
| Key | Keterangan |
|
|
559
|
+
|:---|:---|
|
|
560
|
+
| `{ text, inlineEntities? }` | Teks (opsional dengan citation) |
|
|
561
|
+
| `{ code, language }` | Code block |
|
|
562
|
+
| `{ table, title?, noHeading? }` | Tabel — `table` = array of rows |
|
|
563
|
+
| `{ richImage }` | Grid gambar |
|
|
564
|
+
| `{ richVideo }` | Video embed |
|
|
565
|
+
| `{ latex }` | Formula matematika |
|
|
566
|
+
| `{ richProduct }` | Kartu produk |
|
|
567
|
+
| `{ richPost }` | Kartu post |
|
|
568
|
+
| `{ reels }` | Carousel reels |
|
|
569
|
+
| `{ source }` | Daftar sumber pencarian |
|
|
570
|
+
| `{ tip }` | Teks metadata kecil |
|
|
571
|
+
| `{ suggest }` | Suggestion pills |
|
|
572
|
+
| `{ gridImage, inlineImage, dynamic, map, contentItems }` | Tipe legacy (masih didukung) |
|
|
617
573
|
|
|
618
574
|
---
|
|
619
575
|
|
|
620
|
-
#### 💻
|
|
621
|
-
|
|
622
|
-
> Syntax-highlighted code. Use `code` for single block, `codes` for multiple.
|
|
623
|
-
|
|
624
|
-
<details>
|
|
625
|
-
<summary><b>Single Block</b></summary>
|
|
626
|
-
|
|
627
|
-
```js
|
|
628
|
-
await sock.sendMessage(jid, {
|
|
629
|
-
code: 'console.log("Hello World")',
|
|
630
|
-
language: 'javascript'
|
|
631
|
-
}, { quoted: message })
|
|
632
|
-
```
|
|
633
|
-
</details>
|
|
634
|
-
|
|
635
|
-
<details>
|
|
636
|
-
<summary><b>Multiple Blocks</b></summary>
|
|
576
|
+
#### 💻 Code Block
|
|
637
577
|
|
|
638
578
|
```js
|
|
639
579
|
await sock.sendMessage(jid, {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
{ code: '{ "id": 1, "name": "Ponta", "role": "admin" }', language: 'json' }
|
|
643
|
-
]
|
|
580
|
+
code: 'SELECT * FROM users WHERE id = 1;',
|
|
581
|
+
language: 'sql'
|
|
644
582
|
}, { quoted: message })
|
|
645
583
|
```
|
|
646
|
-
</details>
|
|
647
584
|
|
|
648
585
|
<details>
|
|
649
586
|
<summary><b>Supported Languages</b></summary>
|
|
@@ -666,373 +603,141 @@ await sock.sendMessage(jid, {
|
|
|
666
603
|
|
|
667
604
|
---
|
|
668
605
|
|
|
669
|
-
#### 📊
|
|
670
|
-
|
|
671
|
-
> Structured table with `title`, `headers`, and `rows`.
|
|
606
|
+
#### 📊 Table
|
|
672
607
|
|
|
673
|
-
|
|
674
|
-
<summary><b>Simple Table</b></summary>
|
|
675
|
-
|
|
676
|
-
```js
|
|
677
|
-
await sock.sendMessage(jid, {
|
|
678
|
-
table: {
|
|
679
|
-
title: 'Daftar User',
|
|
680
|
-
headers: ['Name', 'Role', 'Status'],
|
|
681
|
-
rows: [
|
|
682
|
-
['Ponta', 'Admin', 'Active'],
|
|
683
|
-
['Yue', 'Member', 'Idle'],
|
|
684
|
-
['Frieren', 'Guest', 'Offline']
|
|
685
|
-
]
|
|
686
|
-
}
|
|
687
|
-
}, { quoted: message })
|
|
688
|
-
```
|
|
689
|
-
</details>
|
|
690
|
-
|
|
691
|
-
<details>
|
|
692
|
-
<summary><b>Table without Title</b></summary>
|
|
608
|
+
> `table` diisi array of rows (bukan object `{headers, rows}`). Baris pertama otomatis jadi heading kecuali `noHeading: true`.
|
|
693
609
|
|
|
694
610
|
```js
|
|
695
611
|
await sock.sendMessage(jid, {
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
]
|
|
703
|
-
}
|
|
704
|
-
}, { quoted: message })
|
|
705
|
-
```
|
|
706
|
-
</details>
|
|
707
|
-
|
|
708
|
-
<details>
|
|
709
|
-
<summary><b>Data Only (no header)</b></summary>
|
|
710
|
-
|
|
711
|
-
```js
|
|
712
|
-
await sock.sendMessage(jid, {
|
|
713
|
-
table: {
|
|
714
|
-
rows: [
|
|
715
|
-
['RAM', '512 MB'],
|
|
716
|
-
['CPU', '4 Core'],
|
|
717
|
-
['Uptime', '99.9%']
|
|
718
|
-
]
|
|
719
|
-
}
|
|
612
|
+
title: 'Daftar User',
|
|
613
|
+
table: [
|
|
614
|
+
['Name', 'Role', 'Status'],
|
|
615
|
+
['Ponta', 'Admin', 'Active'],
|
|
616
|
+
['Yue', 'Member', 'Idle']
|
|
617
|
+
]
|
|
720
618
|
}, { quoted: message })
|
|
721
619
|
```
|
|
722
|
-
</details>
|
|
723
620
|
|
|
724
621
|
---
|
|
725
622
|
|
|
726
|
-
#### 🖼️ Rich
|
|
727
|
-
|
|
728
|
-
> AI image grid. Single URL = single image, multiple URLs = carousel.
|
|
729
|
-
|
|
730
|
-
<details>
|
|
731
|
-
<summary><b>Single Image</b></summary>
|
|
623
|
+
#### 🖼️ Rich Image
|
|
732
624
|
|
|
733
625
|
```js
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
</details>
|
|
626
|
+
// Satu gambar
|
|
627
|
+
await sock.sendMessage(jid, { richImage: 'https://example.com/photo.jpg' }, { quoted: message })
|
|
737
628
|
|
|
738
|
-
|
|
739
|
-
<summary><b>Multiple Images (Grid)</b></summary>
|
|
740
|
-
|
|
741
|
-
```js
|
|
629
|
+
// Beberapa gambar (grid)
|
|
742
630
|
await sock.sendMessage(jid, {
|
|
743
|
-
|
|
631
|
+
richImage: [
|
|
744
632
|
'https://example.com/photo1.jpg',
|
|
745
633
|
'https://example.com/photo2.jpg',
|
|
746
634
|
'https://example.com/photo3.jpg'
|
|
747
635
|
]
|
|
748
636
|
}, { quoted: message })
|
|
749
637
|
```
|
|
750
|
-
</details>
|
|
751
|
-
|
|
752
|
-
<details>
|
|
753
|
-
<summary><b>Inside items / richResponse</b></summary>
|
|
754
|
-
|
|
755
|
-
```js
|
|
756
|
-
// items
|
|
757
|
-
await sock.sendMessage(jid, {
|
|
758
|
-
items: [
|
|
759
|
-
{ text: 'Hasil foto hari ini:' },
|
|
760
|
-
{ images: ['https://example.com/1.jpg', 'https://example.com/2.jpg'] }
|
|
761
|
-
]
|
|
762
|
-
}, { quoted: message })
|
|
763
|
-
|
|
764
|
-
// richResponse
|
|
765
|
-
await sock.sendMessage(jid, {
|
|
766
|
-
richResponse: [
|
|
767
|
-
{ text: 'Lihat gambarnya:' },
|
|
768
|
-
{ images: 'https://example.com/banner.jpg' }
|
|
769
|
-
]
|
|
770
|
-
}, { quoted: message })
|
|
771
|
-
```
|
|
772
|
-
</details>
|
|
773
638
|
|
|
774
639
|
---
|
|
775
640
|
|
|
776
641
|
#### 🎥 Rich Video
|
|
777
642
|
|
|
778
|
-
>
|
|
779
|
-
|
|
780
|
-
<details>
|
|
781
|
-
<summary><b>Shorthand URL</b></summary>
|
|
782
|
-
|
|
783
|
-
```js
|
|
784
|
-
await sock.sendMessage(jid, { richVideo: 'https://example.com/clip.mp4' }, { quoted: message })
|
|
785
|
-
```
|
|
786
|
-
</details>
|
|
787
|
-
|
|
788
|
-
<details>
|
|
789
|
-
<summary><b>Full Options</b></summary>
|
|
790
|
-
|
|
791
|
-
```js
|
|
792
|
-
await sock.sendMessage(jid, {
|
|
793
|
-
richVideo: {
|
|
794
|
-
url: 'https://example.com/clip.mp4',
|
|
795
|
-
mimeType: 'video/mp4', // default: 'video/mp4'
|
|
796
|
-
duration: 15, // seconds, default: 10
|
|
797
|
-
fallbackText: 'Preview video' // default: '[ VIDEO - PontaCT ]'
|
|
798
|
-
}
|
|
799
|
-
}, { quoted: message })
|
|
800
|
-
```
|
|
801
|
-
</details>
|
|
802
|
-
|
|
803
|
-
<details>
|
|
804
|
-
<summary><b>Inside items / richResponse</b></summary>
|
|
643
|
+
> Format `url|durasiDetik`, bisa string tunggal atau array.
|
|
805
644
|
|
|
806
645
|
```js
|
|
807
|
-
// items
|
|
808
|
-
await sock.sendMessage(jid, {
|
|
809
|
-
items: [
|
|
810
|
-
{ text: 'Cek videonya:' },
|
|
811
|
-
{ videoUrl: 'https://example.com/clip.mp4', duration: 20 }
|
|
812
|
-
]
|
|
813
|
-
}, { quoted: message })
|
|
814
|
-
|
|
815
|
-
// richResponse
|
|
816
646
|
await sock.sendMessage(jid, {
|
|
817
|
-
|
|
818
|
-
{ text: 'Tutorial:' },
|
|
819
|
-
{ video: { url: 'https://example.com/tutorial.mp4', duration: 30 } }
|
|
820
|
-
]
|
|
647
|
+
richVideo: 'https://example.com/clip.mp4|15'
|
|
821
648
|
}, { quoted: message })
|
|
822
649
|
```
|
|
823
|
-
</details>
|
|
824
650
|
|
|
825
651
|
---
|
|
826
652
|
|
|
827
|
-
#### 💡
|
|
828
|
-
|
|
829
|
-
> Follow-up prompt pills — like native AI chat buttons.
|
|
830
|
-
|
|
831
|
-
<details>
|
|
832
|
-
<summary><b>Shorthand</b></summary>
|
|
833
|
-
|
|
834
|
-
```js
|
|
835
|
-
await sock.sendMessage(jid, {
|
|
836
|
-
richSuggestions: ['Coba lagi', 'Lihat detail', 'Batalkan']
|
|
837
|
-
}, { quoted: message })
|
|
838
|
-
```
|
|
839
|
-
</details>
|
|
840
|
-
|
|
841
|
-
<details>
|
|
842
|
-
<summary><b>Inside items / richResponse</b></summary>
|
|
653
|
+
#### 💡 Suggest
|
|
843
654
|
|
|
844
655
|
```js
|
|
845
|
-
// items
|
|
846
656
|
await sock.sendMessage(jid, {
|
|
847
|
-
|
|
848
|
-
{ text: 'Mau lanjut ke mana?' },
|
|
849
|
-
{ suggestions: ['Halaman utama', 'Bantuan', 'Hubungi admin'] }
|
|
850
|
-
]
|
|
851
|
-
}, { quoted: message })
|
|
852
|
-
|
|
853
|
-
// richResponse
|
|
854
|
-
await sock.sendMessage(jid, {
|
|
855
|
-
richResponse: [
|
|
856
|
-
{ text: 'Hasil pencarian ditemukan.' },
|
|
857
|
-
{ suggestions: ['Tampilkan semua', 'Filter ulang', 'Export'] }
|
|
858
|
-
]
|
|
657
|
+
suggest: ['Coba lagi', 'Lihat detail', 'Batalkan']
|
|
859
658
|
}, { quoted: message })
|
|
860
659
|
```
|
|
861
|
-
</details>
|
|
862
660
|
|
|
863
661
|
---
|
|
864
662
|
|
|
865
|
-
#### 🔣
|
|
866
|
-
|
|
867
|
-
> Math formula rendering as `GenAILatexItem` inline entity. `url` points to a rendered formula image (PNG/JPG from external LaTeX renderer).
|
|
663
|
+
#### 🔣 LaTeX
|
|
868
664
|
|
|
869
|
-
|
|
870
|
-
<summary><b>Shorthand URL</b></summary>
|
|
665
|
+
> `latex.expressions[].url` di-generate otomatis lewat `latex.codecogs.com` kalau tidak diisi.
|
|
871
666
|
|
|
872
667
|
```js
|
|
873
668
|
await sock.sendMessage(jid, {
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
<details>
|
|
880
|
-
<summary><b>Full Options</b></summary>
|
|
881
|
-
|
|
882
|
-
```js
|
|
883
|
-
await sock.sendMessage(jid, {
|
|
884
|
-
richLatex: {
|
|
885
|
-
url: 'https://latex.codecogs.com/png.latex?E%3Dmc%5E2',
|
|
886
|
-
text: 'E = mc²', // label & fallback
|
|
887
|
-
width: 120, // default: 100
|
|
888
|
-
height: 60, // default: 100
|
|
889
|
-
font_height: 83.33, // default: 83.33
|
|
890
|
-
padding: 15 // default: 15
|
|
669
|
+
latex: {
|
|
670
|
+
text: 'E = mc²',
|
|
671
|
+
expressions: [
|
|
672
|
+
{ expression: 'E=mc^2', width: 120, height: 40 }
|
|
673
|
+
]
|
|
891
674
|
}
|
|
892
675
|
}, { quoted: message })
|
|
893
676
|
```
|
|
894
|
-
</details>
|
|
895
|
-
|
|
896
|
-
<details>
|
|
897
|
-
<summary><b>Inside items / richResponse</b></summary>
|
|
898
|
-
|
|
899
|
-
```js
|
|
900
|
-
// items
|
|
901
|
-
await sock.sendMessage(jid, {
|
|
902
|
-
items: [
|
|
903
|
-
{ text: 'Rumus energi kinetik:' },
|
|
904
|
-
{
|
|
905
|
-
latexUrl: 'https://latex.codecogs.com/png.latex?E_k%3D%5Cfrac%7B1%7D%7B2%7Dmv%5E2',
|
|
906
|
-
latexText: 'Ek = ½mv²',
|
|
907
|
-
latexWidth: 150,
|
|
908
|
-
latexHeight: 60
|
|
909
|
-
}
|
|
910
|
-
]
|
|
911
|
-
}, { quoted: message })
|
|
912
|
-
|
|
913
|
-
// richResponse
|
|
914
|
-
await sock.sendMessage(jid, {
|
|
915
|
-
richResponse: [
|
|
916
|
-
{ text: 'Solusi integral:' },
|
|
917
|
-
{ latex: { url: 'https://latex.codecogs.com/png.latex?%5Cint%20x%5E2%20dx', text: '∫x² dx = x³/3 + C' } }
|
|
918
|
-
]
|
|
919
|
-
}, { quoted: message })
|
|
920
|
-
```
|
|
921
|
-
</details>
|
|
922
677
|
|
|
923
678
|
---
|
|
924
679
|
|
|
925
680
|
#### 🛍️ Rich Product
|
|
926
681
|
|
|
927
|
-
> Product card(s) as `GenAIProductItemCardPrimitive`. Object = single card, Array = horizontal scroll carousel.
|
|
928
|
-
|
|
929
|
-
<details>
|
|
930
|
-
<summary><b>Single Product</b></summary>
|
|
931
|
-
|
|
932
682
|
```js
|
|
683
|
+
// Single
|
|
933
684
|
await sock.sendMessage(jid, {
|
|
934
685
|
richProduct: {
|
|
935
686
|
title: 'Sepatu Adidas Samba',
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
687
|
+
brand: 'Adidas',
|
|
688
|
+
price: 'Rp 1.200.000',
|
|
689
|
+
product_url: 'https://example.com/produk/adidas-samba',
|
|
690
|
+
image_url: 'https://example.com/adidas.jpg'
|
|
940
691
|
}
|
|
941
692
|
}, { quoted: message })
|
|
942
|
-
```
|
|
943
|
-
</details>
|
|
944
|
-
|
|
945
|
-
<details>
|
|
946
|
-
<summary><b>Product Carousel</b></summary>
|
|
947
693
|
|
|
948
|
-
|
|
694
|
+
// Carousel — cukup kirim array
|
|
949
695
|
await sock.sendMessage(jid, {
|
|
950
696
|
richProduct: [
|
|
951
|
-
{
|
|
952
|
-
|
|
953
|
-
price_display_string: 'Rp 500.000',
|
|
954
|
-
thumbnail: { url: 'https://example.com/a.jpg', mime_type: 'image/jpeg', width: 300, height: 300 }
|
|
955
|
-
},
|
|
956
|
-
{
|
|
957
|
-
title: 'Sepatu B',
|
|
958
|
-
price_display_string: 'Rp 750.000',
|
|
959
|
-
thumbnail: { url: 'https://example.com/b.jpg', mime_type: 'image/jpeg', width: 300, height: 300 }
|
|
960
|
-
}
|
|
697
|
+
{ title: 'Sepatu A', price: 'Rp 500.000', product_url: 'https://example.com/a', image_url: 'https://example.com/a.jpg' },
|
|
698
|
+
{ title: 'Sepatu B', price: 'Rp 750.000', product_url: 'https://example.com/b', image_url: 'https://example.com/b.jpg' }
|
|
961
699
|
]
|
|
962
700
|
}, { quoted: message })
|
|
963
701
|
```
|
|
964
|
-
</details>
|
|
965
702
|
|
|
966
703
|
<details>
|
|
967
|
-
<summary><b
|
|
704
|
+
<summary><b>📋 Fields Reference</b></summary>
|
|
968
705
|
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
]
|
|
976
|
-
}, { quoted: message })
|
|
706
|
+
| Field | Description |
|
|
707
|
+
|:---|:---|
|
|
708
|
+
| `title`, `brand`, `price`, `sale_price` | Info produk |
|
|
709
|
+
| `product_url` (alias `url`) | **Wajib** diawali `http(s)://` |
|
|
710
|
+
| `image_url` (alias `image`) | Gambar utama |
|
|
711
|
+
| `icon_url` (alias `icon`) | Gambar tambahan/ikon |
|
|
977
712
|
|
|
978
|
-
// richResponse
|
|
979
|
-
await sock.sendMessage(jid, {
|
|
980
|
-
richResponse: [
|
|
981
|
-
{ text: 'Pilih produkmu:' },
|
|
982
|
-
{ product: [{ title: 'A' }, { title: 'B' }] }
|
|
983
|
-
]
|
|
984
|
-
}, { quoted: message })
|
|
985
|
-
```
|
|
986
713
|
</details>
|
|
987
714
|
|
|
988
715
|
---
|
|
989
716
|
|
|
990
717
|
#### 📰 Rich Post
|
|
991
718
|
|
|
992
|
-
> Post card(s) as `GenAIPostPrimitive`. Object = single post, Array = carousel.
|
|
993
|
-
|
|
994
|
-
<details>
|
|
995
|
-
<summary><b>Single Post</b></summary>
|
|
996
|
-
|
|
997
719
|
```js
|
|
998
720
|
await sock.sendMessage(jid, {
|
|
999
721
|
richPost: {
|
|
1000
722
|
title: 'Caption post ini',
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
723
|
+
username: '@pontalabs',
|
|
724
|
+
profile_picture_url: 'https://example.com/avatar.jpg',
|
|
725
|
+
thumbnail_url: 'https://example.com/post.jpg',
|
|
726
|
+
likes_count: 120,
|
|
727
|
+
comments_count: 8,
|
|
728
|
+
source_app: 'INSTAGRAM'
|
|
1005
729
|
}
|
|
1006
730
|
}, { quoted: message })
|
|
1007
731
|
```
|
|
1008
|
-
</details>
|
|
1009
|
-
|
|
1010
|
-
<details>
|
|
1011
|
-
<summary><b>Post Carousel</b></summary>
|
|
1012
|
-
|
|
1013
|
-
```js
|
|
1014
|
-
await sock.sendMessage(jid, {
|
|
1015
|
-
richPost: [
|
|
1016
|
-
{ title: 'Post 1', author_display_name: '@user1', media_url: 'https://example.com/1.jpg' },
|
|
1017
|
-
{ title: 'Post 2', author_display_name: '@user2', media_url: 'https://example.com/2.jpg' }
|
|
1018
|
-
]
|
|
1019
|
-
}, { quoted: message })
|
|
1020
|
-
```
|
|
1021
|
-
</details>
|
|
1022
732
|
|
|
1023
733
|
---
|
|
1024
734
|
|
|
1025
|
-
#### 🎬
|
|
1026
|
-
|
|
1027
|
-
> Reels carousel as `GenAIReelPrimitive` with `contentItemsMetadata`. Auto-injects `richResponseSourcesMetadata` with `provider: 'PontaCT'`.
|
|
1028
|
-
|
|
1029
|
-
<details>
|
|
1030
|
-
<summary><b>Single Reel</b></summary>
|
|
735
|
+
#### 🎬 Reels
|
|
1031
736
|
|
|
1032
737
|
```js
|
|
1033
738
|
await sock.sendMessage(jid, {
|
|
1034
|
-
|
|
1035
|
-
|
|
739
|
+
reels: {
|
|
740
|
+
username: '@creator_name',
|
|
1036
741
|
profileIconUrl: 'https://example.com/avatar.jpg',
|
|
1037
742
|
thumbnailUrl: 'https://example.com/thumb.jpg',
|
|
1038
743
|
videoUrl: 'https://example.com/reel.mp4',
|
|
@@ -1045,330 +750,72 @@ await sock.sendMessage(jid, {
|
|
|
1045
750
|
}
|
|
1046
751
|
}, { quoted: message })
|
|
1047
752
|
```
|
|
1048
|
-
</details>
|
|
1049
|
-
|
|
1050
|
-
<details>
|
|
1051
|
-
<summary><b>Reels Carousel</b></summary>
|
|
1052
|
-
|
|
1053
|
-
```js
|
|
1054
|
-
await sock.sendMessage(jid, {
|
|
1055
|
-
richReels: [
|
|
1056
|
-
{
|
|
1057
|
-
title: '@creator1',
|
|
1058
|
-
profileIconUrl: 'https://example.com/av1.jpg',
|
|
1059
|
-
thumbnailUrl: 'https://example.com/th1.jpg',
|
|
1060
|
-
videoUrl: 'https://example.com/r1.mp4',
|
|
1061
|
-
likes_count: 5000,
|
|
1062
|
-
reel_source: 'IG'
|
|
1063
|
-
},
|
|
1064
|
-
{
|
|
1065
|
-
title: '@creator2',
|
|
1066
|
-
profileIconUrl: 'https://example.com/av2.jpg',
|
|
1067
|
-
thumbnailUrl: 'https://example.com/th2.jpg',
|
|
1068
|
-
videoUrl: 'https://example.com/r2.mp4',
|
|
1069
|
-
likes_count: 8200,
|
|
1070
|
-
reel_source: 'TT'
|
|
1071
|
-
}
|
|
1072
|
-
]
|
|
1073
|
-
}, { quoted: message })
|
|
1074
|
-
```
|
|
1075
|
-
</details>
|
|
1076
753
|
|
|
1077
754
|
<details>
|
|
1078
755
|
<summary><b>📋 Fields Reference</b></summary>
|
|
1079
756
|
|
|
1080
|
-
| Field |
|
|
1081
|
-
|
|
1082
|
-
| `
|
|
1083
|
-
| `profileIconUrl` |
|
|
1084
|
-
| `thumbnailUrl` |
|
|
1085
|
-
| `videoUrl` |
|
|
1086
|
-
| `reels_title` | `
|
|
1087
|
-
| `likes_count`
|
|
1088
|
-
| `
|
|
1089
|
-
| `
|
|
1090
|
-
| `reel_source` | `string` | `'IG'` | Source platform |
|
|
1091
|
-
| `is_verified` | `boolean` | `false` | Verified badge |
|
|
1092
|
-
|
|
1093
|
-
</details>
|
|
1094
|
-
|
|
1095
|
-
---
|
|
1096
|
-
|
|
1097
|
-
#### 🔍 Rich Sources
|
|
1098
|
-
|
|
1099
|
-
> Search result source list as `GenAISearchResultPrimitive`. Accepts full objects **or** shorthand `[faviconUrl, sourceUrl, displayName]`.
|
|
1100
|
-
|
|
1101
|
-
<details>
|
|
1102
|
-
<summary><b>Shorthand Array</b></summary>
|
|
1103
|
-
|
|
1104
|
-
```js
|
|
1105
|
-
await sock.sendMessage(jid, {
|
|
1106
|
-
richSources: [
|
|
1107
|
-
['https://wikipedia.org/favicon.ico', 'https://wikipedia.org/wiki/Node.js', 'Wikipedia'],
|
|
1108
|
-
['https://nodejs.org/favicon.ico', 'https://nodejs.org/en/docs', 'Node.js Docs'],
|
|
1109
|
-
['https://github.com/favicon.ico', 'https://github.com/nodejs/node', 'GitHub']
|
|
1110
|
-
]
|
|
1111
|
-
}, { quoted: message })
|
|
1112
|
-
```
|
|
1113
|
-
</details>
|
|
1114
|
-
|
|
1115
|
-
<details>
|
|
1116
|
-
<summary><b>Full Object</b></summary>
|
|
1117
|
-
|
|
1118
|
-
```js
|
|
1119
|
-
await sock.sendMessage(jid, {
|
|
1120
|
-
richSources: [
|
|
1121
|
-
{
|
|
1122
|
-
source_type: 'THIRD_PARTY',
|
|
1123
|
-
source_display_name: 'Wikipedia',
|
|
1124
|
-
source_subtitle: 'wikipedia.org',
|
|
1125
|
-
source_url: 'https://wikipedia.org/wiki/Node.js',
|
|
1126
|
-
favicon: { url: 'https://wikipedia.org/favicon.ico', mime_type: 'image/jpeg', width: 16, height: 16 }
|
|
1127
|
-
}
|
|
1128
|
-
]
|
|
1129
|
-
}, { quoted: message })
|
|
1130
|
-
```
|
|
1131
|
-
</details>
|
|
1132
|
-
|
|
1133
|
-
<details>
|
|
1134
|
-
<summary><b>Mixed Format</b></summary>
|
|
757
|
+
| Field | Default | Description |
|
|
758
|
+
|:---|:---:|:---|
|
|
759
|
+
| `username` (alias `title`) | — | Nama creator |
|
|
760
|
+
| `profileIconUrl` | — | Avatar URL |
|
|
761
|
+
| `thumbnailUrl` | — | Thumbnail cover |
|
|
762
|
+
| `videoUrl` | — | Sumber video |
|
|
763
|
+
| `reels_title` | `''` | Judul reel |
|
|
764
|
+
| `likes_count`, `shares_count`, `view_count` | `0` | Statistik |
|
|
765
|
+
| `reel_source` | `'IG'` | Platform sumber |
|
|
766
|
+
| `is_verified` | `false` | Badge verified |
|
|
1135
767
|
|
|
1136
|
-
```js
|
|
1137
|
-
await sock.sendMessage(jid, {
|
|
1138
|
-
richSources: [
|
|
1139
|
-
['https://wikipedia.org/fav.ico', 'https://wikipedia.org', 'Wikipedia'],
|
|
1140
|
-
{ source_type: 'THIRD_PARTY', source_display_name: 'Docs', source_url: 'https://docs.example.com' }
|
|
1141
|
-
]
|
|
1142
|
-
}, { quoted: message })
|
|
1143
|
-
```
|
|
1144
768
|
</details>
|
|
1145
769
|
|
|
1146
770
|
---
|
|
1147
771
|
|
|
1148
|
-
####
|
|
1149
|
-
|
|
1150
|
-
> `richTip` — small metadata text above/center of message.
|
|
1151
|
-
> `richFooter` — metadata text below message (disclaimer / branding).
|
|
1152
|
-
|
|
1153
|
-
<details>
|
|
1154
|
-
<summary><b>Rich Tip</b></summary>
|
|
1155
|
-
|
|
1156
|
-
```js
|
|
1157
|
-
await sock.sendMessage(jid, {
|
|
1158
|
-
richTip: 'Dihasilkan oleh AI · pontalabs v0.3.4'
|
|
1159
|
-
}, { quoted: message })
|
|
1160
|
-
```
|
|
1161
|
-
</details>
|
|
1162
|
-
|
|
1163
|
-
<details>
|
|
1164
|
-
<summary><b>Rich Footer</b></summary>
|
|
772
|
+
#### 🔍 Source
|
|
1165
773
|
|
|
1166
774
|
```js
|
|
1167
775
|
await sock.sendMessage(jid, {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
</details>
|
|
1172
|
-
|
|
1173
|
-
<details>
|
|
1174
|
-
<summary><b>Inside items / richResponse</b></summary>
|
|
1175
|
-
|
|
1176
|
-
```js
|
|
1177
|
-
// items
|
|
1178
|
-
await sock.sendMessage(jid, {
|
|
1179
|
-
items: [
|
|
1180
|
-
{ text: 'Hasil pencarian:' },
|
|
1181
|
-
{ sources: [['https://fav.ico', 'https://example.com', 'Example']] },
|
|
1182
|
-
{ tip: 'AI-generated content' },
|
|
1183
|
-
{ footer: '© PontaCT Baileys' }
|
|
1184
|
-
]
|
|
1185
|
-
}, { quoted: message })
|
|
1186
|
-
|
|
1187
|
-
// richResponse
|
|
1188
|
-
await sock.sendMessage(jid, {
|
|
1189
|
-
richResponse: [
|
|
1190
|
-
{ text: 'Summary di sini.' },
|
|
1191
|
-
{ footer: '© PontaCT · pontalabs' }
|
|
776
|
+
source: [
|
|
777
|
+
{ url: 'https://wikipedia.org/wiki/Node.js', title: 'Node.js', favicon: 'https://wikipedia.org/favicon.ico' },
|
|
778
|
+
{ url: 'https://nodejs.org/en/docs', title: 'Node.js Docs', favicon: 'https://nodejs.org/favicon.ico' }
|
|
1192
779
|
]
|
|
1193
780
|
}, { quoted: message })
|
|
1194
781
|
```
|
|
1195
|
-
</details>
|
|
1196
782
|
|
|
1197
783
|
---
|
|
1198
784
|
|
|
1199
|
-
####
|
|
1200
|
-
|
|
1201
|
-
> Combine all rich types in any order. Array order = display order.
|
|
1202
|
-
|
|
1203
|
-
**Valid keys in `items`:**
|
|
1204
|
-
|
|
1205
|
-
| Key | Type |
|
|
1206
|
-
|:---|:---|
|
|
1207
|
-
| `{ text }` | Rich text |
|
|
1208
|
-
| `{ code, language }` | Code block |
|
|
1209
|
-
| `{ table }` | Table |
|
|
1210
|
-
| `{ images }` | Image grid |
|
|
1211
|
-
| `{ videoUrl, mimeType?, duration? }` | Video embed |
|
|
1212
|
-
| `{ suggestions }` | Suggestion pills |
|
|
1213
|
-
| `{ latexUrl, latexText?, latexWidth?, latexHeight? }` | LaTeX formula |
|
|
1214
|
-
| `{ product }` | Product card(s) |
|
|
1215
|
-
| `{ post }` | Post card(s) |
|
|
1216
|
-
| `{ reels }` | Reels carousel |
|
|
1217
|
-
| `{ sources }` | Search sources |
|
|
1218
|
-
| `{ tip }` | Tip metadata |
|
|
1219
|
-
| `{ footer }` | Footer metadata |
|
|
1220
|
-
|
|
1221
|
-
<details>
|
|
1222
|
-
<summary><b>Text + Code + Table</b></summary>
|
|
1223
|
-
|
|
1224
|
-
```js
|
|
1225
|
-
await sock.sendMessage(jid, {
|
|
1226
|
-
items: [
|
|
1227
|
-
{ text: 'Query yang dijalankan:' },
|
|
1228
|
-
{ code: 'SELECT id, name, score FROM users ORDER BY score DESC LIMIT 3', language: 'sql' },
|
|
1229
|
-
{ text: 'Hasil:' },
|
|
1230
|
-
{
|
|
1231
|
-
table: {
|
|
1232
|
-
headers: ['id', 'name', 'score'],
|
|
1233
|
-
rows: [
|
|
1234
|
-
['1', 'Ponta', '98'],
|
|
1235
|
-
['2', 'Yue', '87'],
|
|
1236
|
-
['3', 'Frieren', '75']
|
|
1237
|
-
]
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
]
|
|
1241
|
-
}, { quoted: message })
|
|
1242
|
-
```
|
|
1243
|
-
</details>
|
|
1244
|
-
|
|
1245
|
-
<details>
|
|
1246
|
-
<summary><b>Text + Images + Video + Suggestions</b></summary>
|
|
785
|
+
#### 📌 Header / Footer / Disclaimer
|
|
1247
786
|
|
|
1248
|
-
|
|
1249
|
-
await sock.sendMessage(jid, {
|
|
1250
|
-
items: [
|
|
1251
|
-
{ text: '*Konten hari ini*' },
|
|
1252
|
-
{ images: ['https://example.com/1.jpg', 'https://example.com/2.jpg'] },
|
|
1253
|
-
{ videoUrl: 'https://example.com/preview.mp4', duration: 15 },
|
|
1254
|
-
{ suggestions: ['Lihat selengkapnya', 'Bagikan', 'Simpan'] }
|
|
1255
|
-
]
|
|
1256
|
-
}, { quoted: message })
|
|
1257
|
-
```
|
|
1258
|
-
</details>
|
|
1259
|
-
|
|
1260
|
-
<details>
|
|
1261
|
-
<summary><b>Full Mixed (all types)</b></summary>
|
|
787
|
+
> `topText` tampil di paling atas, `bottomText` selalu tampil paling bawah (setelah semua media), `aiNotice` tampil sebagai badge disclaimer bawaan WhatsApp — **ini yang membedakan dari fork lain** yang biasanya memakai `headerText` / `footerText` / `disclaimerText`.
|
|
1262
788
|
|
|
1263
789
|
```js
|
|
1264
790
|
await sock.sendMessage(jid, {
|
|
1265
|
-
|
|
1266
|
-
{ text: '*
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
latexText: 'U = (tu/tt) × 100'
|
|
1273
|
-
},
|
|
1274
|
-
{ sources: [['https://example.com/fav.ico', 'https://example.com', 'Dashboard']] },
|
|
1275
|
-
{ suggestions: ['Refresh', 'Export PDF'] },
|
|
1276
|
-
{ footer: 'Auto-generated · PontaCT' }
|
|
1277
|
-
]
|
|
1278
|
-
}, { quoted: message })
|
|
791
|
+
aiBlocks: [
|
|
792
|
+
{ text: 'Ini teks dari AI dengan *markdown* dan **bold**.' }
|
|
793
|
+
],
|
|
794
|
+
topText: 'Judul',
|
|
795
|
+
bottomText: 'Footer',
|
|
796
|
+
aiNotice: 'Generated by AI'
|
|
797
|
+
})
|
|
1279
798
|
```
|
|
1280
|
-
</details>
|
|
1281
799
|
|
|
1282
800
|
---
|
|
1283
801
|
|
|
1284
|
-
#### 🔗
|
|
802
|
+
#### 🔗 Links & Citations
|
|
1285
803
|
|
|
1286
|
-
>
|
|
1287
|
-
|
|
1288
|
-
**Valid keys in `richResponse`:**
|
|
1289
|
-
|
|
1290
|
-
| Key | Type |
|
|
1291
|
-
|:---|:---|
|
|
1292
|
-
| `{ text, inlineEntities? }` | Text + optional citation/hyperlink |
|
|
1293
|
-
| `{ code, language }` | Code block |
|
|
1294
|
-
| `{ table, title? }` | Table |
|
|
1295
|
-
| `{ images }` | Image grid |
|
|
1296
|
-
| `{ video }` | Video embed |
|
|
1297
|
-
| `{ suggestions }` | Suggestion pills |
|
|
1298
|
-
| `{ latex }` | LaTeX formula |
|
|
1299
|
-
| `{ product }` | Product card(s) |
|
|
1300
|
-
| `{ post }` | Post card(s) |
|
|
1301
|
-
| `{ reels }` | Reels carousel |
|
|
1302
|
-
| `{ sources }` | Search sources |
|
|
1303
|
-
| `{ tip }` | Tip metadata |
|
|
1304
|
-
| `{ footer }` | Footer metadata |
|
|
1305
|
-
|
|
1306
|
-
<details>
|
|
1307
|
-
<summary><b>Inline Citation</b></summary>
|
|
804
|
+
> `links` bisa digabung dengan tipe lain di mode flat, dan otomatis diubah jadi teks bernomor + citation.
|
|
1308
805
|
|
|
1309
806
|
```js
|
|
1310
807
|
await sock.sendMessage(jid, {
|
|
1311
|
-
|
|
808
|
+
links: [
|
|
1312
809
|
{
|
|
1313
|
-
text: 'Node.js
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
metadata: {
|
|
1318
|
-
reference_id: 1,
|
|
1319
|
-
reference_url: 'https://nodejs.org',
|
|
1320
|
-
reference_title: 'Node.js Official',
|
|
1321
|
-
reference_display_name: 'nodejs.org',
|
|
1322
|
-
sources: [{
|
|
1323
|
-
source_type: 'THIRD_PARTY',
|
|
1324
|
-
source_display_name: 'nodejs.org',
|
|
1325
|
-
source_subtitle: 'nodejs.org',
|
|
1326
|
-
source_url: 'https://nodejs.org'
|
|
1327
|
-
}],
|
|
1328
|
-
__typename: 'GenAISearchCitationItem'
|
|
1329
|
-
}
|
|
1330
|
-
},
|
|
1331
|
-
{
|
|
1332
|
-
key: 'SS_1',
|
|
1333
|
-
metadata: {
|
|
1334
|
-
reference_id: 2,
|
|
1335
|
-
reference_url: 'https://wikipedia.org/wiki/Ryan_Dahl',
|
|
1336
|
-
reference_title: 'Ryan Dahl - Wikipedia',
|
|
1337
|
-
reference_display_name: 'Wikipedia',
|
|
1338
|
-
sources: [{
|
|
1339
|
-
source_type: 'THIRD_PARTY',
|
|
1340
|
-
source_display_name: 'Wikipedia',
|
|
1341
|
-
source_subtitle: 'wikipedia.org',
|
|
1342
|
-
source_url: 'https://wikipedia.org/wiki/Ryan_Dahl'
|
|
1343
|
-
}],
|
|
1344
|
-
__typename: 'GenAISearchCitationItem'
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
]
|
|
810
|
+
text: 'Node.js adalah runtime JavaScript',
|
|
811
|
+
title: 'Node.js Official',
|
|
812
|
+
url: 'https://nodejs.org',
|
|
813
|
+
sources: [{ url: 'https://nodejs.org', displayName: 'nodejs.org' }]
|
|
1348
814
|
}
|
|
1349
|
-
]
|
|
1350
|
-
|
|
1351
|
-
```
|
|
1352
|
-
</details>
|
|
1353
|
-
|
|
1354
|
-
<details>
|
|
1355
|
-
<summary><b>Full Response — all types at once</b></summary>
|
|
1356
|
-
|
|
1357
|
-
```js
|
|
1358
|
-
await sock.sendMessage(jid, {
|
|
1359
|
-
richResponse: [
|
|
1360
|
-
{ text: '*Hasil Pencarian:* Node.js {{SS_0}}¹{{/SS_0}}', inlineEntities: [/* ... */] },
|
|
1361
|
-
{ images: ['https://example.com/nodejs.png'] },
|
|
1362
|
-
{ text: 'Cara install:' },
|
|
1363
|
-
{ code: 'npm install node', language: 'bash' },
|
|
1364
|
-
{ table: { headers: ['Version', 'LTS', 'Release'], rows: [['22.x', 'Yes', '2024'], ['21.x', 'No', '2023']] } },
|
|
1365
|
-
{ sources: [['https://nodejs.org/fav.ico', 'https://nodejs.org', 'Node.js']] },
|
|
1366
|
-
{ suggestions: ['Lihat changelog', 'Download', 'Docs'] },
|
|
1367
|
-
{ footer: 'PontaCT · pontalabs' }
|
|
1368
|
-
]
|
|
815
|
+
],
|
|
816
|
+
bottomText: 'Sumber: nodejs.org'
|
|
1369
817
|
}, { quoted: message })
|
|
1370
818
|
```
|
|
1371
|
-
</details>
|
|
1372
819
|
|
|
1373
820
|
---
|
|
1374
821
|
|
|
@@ -1378,11 +825,8 @@ await sock.sendMessage(jid, {
|
|
|
1378
825
|
<summary><b>📋 Get Newsletter Metadata</b></summary>
|
|
1379
826
|
|
|
1380
827
|
```js
|
|
1381
|
-
// By invite code
|
|
1382
828
|
const newsletter = await sock.newsletterMetadata('invite', '0029Vaf0HPMLdQeZsp3XRp2T')
|
|
1383
|
-
|
|
1384
|
-
// By JID
|
|
1385
|
-
const newsletter = await sock.newsletterMetadata('jid', '120363282083849178@newsletter')
|
|
829
|
+
const newsletter2 = await sock.newsletterMetadata('jid', '120363282083849178@newsletter')
|
|
1386
830
|
```
|
|
1387
831
|
</details>
|
|
1388
832
|
|
|
@@ -1415,11 +859,7 @@ const newsletter = await sock.newsletterCreate(
|
|
|
1415
859
|
<summary><b>🌟 React to Newsletter Post</b></summary>
|
|
1416
860
|
|
|
1417
861
|
```js
|
|
1418
|
-
await sock.newsletterReactMessage(
|
|
1419
|
-
'120363282083849178@newsletter',
|
|
1420
|
-
'12', // server message ID
|
|
1421
|
-
'🦖' // emoji
|
|
1422
|
-
)
|
|
862
|
+
await sock.newsletterReactMessage('120363282083849178@newsletter', '12', '🦖')
|
|
1423
863
|
```
|
|
1424
864
|
</details>
|
|
1425
865
|
|
|
@@ -1446,10 +886,10 @@ console.log('Group JID:', group.id)
|
|
|
1446
886
|
```js
|
|
1447
887
|
const jid = '123456789@g.us'
|
|
1448
888
|
|
|
1449
|
-
await sock.groupSettingUpdate(jid, 'announcement')
|
|
1450
|
-
await sock.groupSettingUpdate(jid, 'not_announcement')
|
|
1451
|
-
await sock.groupSettingUpdate(jid, 'locked')
|
|
1452
|
-
await sock.groupSettingUpdate(jid, 'unlocked')
|
|
889
|
+
await sock.groupSettingUpdate(jid, 'announcement')
|
|
890
|
+
await sock.groupSettingUpdate(jid, 'not_announcement')
|
|
891
|
+
await sock.groupSettingUpdate(jid, 'locked')
|
|
892
|
+
await sock.groupSettingUpdate(jid, 'unlocked')
|
|
1453
893
|
```
|
|
1454
894
|
</details>
|
|
1455
895
|
|
|
@@ -1473,54 +913,41 @@ await sock.groupParticipantsUpdate(jid, participants, 'demote')
|
|
|
1473
913
|
const code = await sock.groupInviteCode(jid)
|
|
1474
914
|
console.log('Link: https://chat.whatsapp.com/' + code)
|
|
1475
915
|
|
|
1476
|
-
// Revoke & generate new link
|
|
1477
916
|
const newCode = await sock.groupRevokeInvite(jid)
|
|
1478
917
|
```
|
|
1479
918
|
</details>
|
|
1480
919
|
|
|
1481
|
-
<details>
|
|
1482
|
-
<summary><b>📋 Group Metadata</b></summary>
|
|
1483
|
-
|
|
1484
|
-
```js
|
|
1485
|
-
const metadata = await sock.groupMetadata(jid)
|
|
1486
|
-
console.log('Name:', metadata.subject)
|
|
1487
|
-
console.log('Participants:', metadata.participants.length)
|
|
1488
|
-
```
|
|
1489
|
-
</details>
|
|
1490
|
-
|
|
1491
920
|
<details>
|
|
1492
921
|
<summary><b>📢 Group Status</b></summary>
|
|
1493
922
|
|
|
1494
|
-
>
|
|
923
|
+
> Kirim status grup lewat `groupStatusMessage`. `message` boleh `string` biasa (dianggap `text`) atau object payload `sendMessage` lain (mis. media).
|
|
1495
924
|
|
|
1496
925
|
```js
|
|
1497
926
|
// Text Status
|
|
1498
927
|
await sock.sendMessage(jid, {
|
|
1499
|
-
|
|
1500
|
-
message: 'Selamat datang di grup PontaCT! 🎉',
|
|
1501
|
-
audienceType: 0
|
|
928
|
+
groupStatusMessage: {
|
|
929
|
+
message: { text: 'Selamat datang di grup PontaCT! 🎉' },
|
|
930
|
+
audienceType: 0
|
|
1502
931
|
}
|
|
1503
932
|
})
|
|
1504
933
|
|
|
1505
934
|
// Styled Text Status
|
|
1506
935
|
await sock.sendMessage(jid, {
|
|
1507
|
-
|
|
1508
|
-
message: 'Bot aktif kembali! ✅',
|
|
936
|
+
groupStatusMessage: {
|
|
937
|
+
message: { text: 'Bot aktif kembali! ✅' },
|
|
1509
938
|
audienceType: 0,
|
|
1510
|
-
|
|
1511
|
-
|
|
939
|
+
backgroundColor: '#1A1A2E',
|
|
940
|
+
textColor: '#FFFFFF',
|
|
1512
941
|
font: 4
|
|
1513
942
|
}
|
|
1514
943
|
})
|
|
1515
944
|
|
|
1516
945
|
// Media Status
|
|
1517
|
-
const { imageMessage } = await prepareWAMessageMedia(
|
|
1518
|
-
{ image: { url: 'https://example.com/banner.jpg' } },
|
|
1519
|
-
{ upload: sock.waUploadToServer }
|
|
1520
|
-
)
|
|
1521
|
-
|
|
1522
946
|
await sock.sendMessage(jid, {
|
|
1523
|
-
|
|
947
|
+
groupStatusMessage: {
|
|
948
|
+
message: { image: { url: 'https://example.com/banner.jpg' } },
|
|
949
|
+
audienceType: 0
|
|
950
|
+
}
|
|
1524
951
|
})
|
|
1525
952
|
```
|
|
1526
953
|
|
|
@@ -1529,11 +956,11 @@ await sock.sendMessage(jid, {
|
|
|
1529
956
|
|
|
1530
957
|
| Field | Type | Required | Default | Description |
|
|
1531
958
|
|:---|:---|:---:|:---|:---|
|
|
1532
|
-
| `message` | `
|
|
959
|
+
| `message` | `object` | ✅ | — | Payload pesan (`{ text }`, `{ image }`, dst) |
|
|
1533
960
|
| `audienceType` | `number` | — | `0` | Target audience (0 = all) |
|
|
1534
|
-
| `
|
|
1535
|
-
| `
|
|
1536
|
-
| `font` | `number` | — | — |
|
|
961
|
+
| `backgroundColor` | `string / number` | — | — | Hex (`'#ff6b9d'`) atau integer ARGB — hanya untuk teks |
|
|
962
|
+
| `textColor` | `string / number` | — | — | Hex atau integer ARGB — hanya untuk teks |
|
|
963
|
+
| `font` | `number` | — | — | Gaya font 0–9 — hanya untuk teks |
|
|
1537
964
|
|
|
1538
965
|
</details>
|
|
1539
966
|
|
|
@@ -1565,12 +992,12 @@ await sock.updateBlockStatus(jid, 'unblock')
|
|
|
1565
992
|
<summary><b>👁️ Privacy Settings</b></summary>
|
|
1566
993
|
|
|
1567
994
|
```js
|
|
1568
|
-
await sock.updateLastSeenPrivacy('all')
|
|
1569
|
-
await sock.updateOnlinePrivacy('all')
|
|
1570
|
-
await sock.updateProfilePicturePrivacy('all')
|
|
1571
|
-
await sock.updateReadReceiptsPrivacy('all')
|
|
1572
|
-
await sock.updateGroupsAddPrivacy('all')
|
|
1573
|
-
await sock.updateDefaultDisappearingMode(86400)
|
|
995
|
+
await sock.updateLastSeenPrivacy('all')
|
|
996
|
+
await sock.updateOnlinePrivacy('all')
|
|
997
|
+
await sock.updateProfilePicturePrivacy('all')
|
|
998
|
+
await sock.updateReadReceiptsPrivacy('all')
|
|
999
|
+
await sock.updateGroupsAddPrivacy('all')
|
|
1000
|
+
await sock.updateDefaultDisappearingMode(86400)
|
|
1574
1001
|
```
|
|
1575
1002
|
</details>
|
|
1576
1003
|
|
|
@@ -1583,7 +1010,7 @@ await sock.updateDefaultDisappearingMode(86400) // 0 = disable
|
|
|
1583
1010
|
|
|
1584
1011
|
```js
|
|
1585
1012
|
const sock = makeWASocket({
|
|
1586
|
-
logger: { level: 'debug' },
|
|
1013
|
+
logger: { level: 'debug' },
|
|
1587
1014
|
auth: state
|
|
1588
1015
|
})
|
|
1589
1016
|
```
|
|
@@ -1596,10 +1023,6 @@ const sock = makeWASocket({
|
|
|
1596
1023
|
sock.ws.on('CB:presence', (json) => {
|
|
1597
1024
|
console.log('Presence update:', json)
|
|
1598
1025
|
})
|
|
1599
|
-
|
|
1600
|
-
sock.ws.on('CB:edge_routing', (node) => {
|
|
1601
|
-
console.log('Edge routing:', node)
|
|
1602
|
-
})
|
|
1603
1026
|
```
|
|
1604
1027
|
</details>
|
|
1605
1028
|
|
|
@@ -1607,34 +1030,39 @@ sock.ws.on('CB:edge_routing', (node) => {
|
|
|
1607
1030
|
|
|
1608
1031
|
## 📚 API Reference
|
|
1609
1032
|
|
|
1610
|
-
| Method | Description |
|
|
1033
|
+
| Method / Field | Description |
|
|
1611
1034
|
|:---|:---|
|
|
1612
|
-
| `makeWASocket(options)` |
|
|
1613
|
-
| `useMultiFileAuthState(path)` | Multi-file
|
|
1614
|
-
| `sock.sendMessage(jid, content, opts)` |
|
|
1615
|
-
| `
|
|
1616
|
-
| `
|
|
1617
|
-
| `
|
|
1618
|
-
| `
|
|
1619
|
-
| `
|
|
1620
|
-
| `
|
|
1621
|
-
| `sock.
|
|
1622
|
-
| `sock.
|
|
1623
|
-
| `sock.
|
|
1624
|
-
| `sock.
|
|
1625
|
-
| `sock.
|
|
1626
|
-
| `sock.
|
|
1627
|
-
| `sock.
|
|
1628
|
-
| `sock.
|
|
1629
|
-
| `sock.
|
|
1630
|
-
| `sock.
|
|
1631
|
-
| `sock.
|
|
1632
|
-
| `sock.
|
|
1633
|
-
| `sock.
|
|
1634
|
-
| `sock.
|
|
1635
|
-
| `sock.
|
|
1636
|
-
| `sock.
|
|
1637
|
-
| `sock.
|
|
1035
|
+
| `makeWASocket(options)` | Buat koneksi socket WhatsApp baru |
|
|
1036
|
+
| `useMultiFileAuthState(path)` | Multi-file auth state manager |
|
|
1037
|
+
| `sock.sendMessage(jid, content, opts)` | Kirim pesan tipe apa pun |
|
|
1038
|
+
| `content.album` | Kirim album/carousel media (min. 2 item) |
|
|
1039
|
+
| `content.aiBlocks` | Kirim rich AI message berbagai tipe (lihat [AI Rich Messages](#-ai-rich-messages)) |
|
|
1040
|
+
| `content.topText / bottomText / aiNotice` | Header / footer / disclaimer untuk AI rich message |
|
|
1041
|
+
| `content.buttonLocation` | Pesan lokasi + list menu / extra buttons |
|
|
1042
|
+
| `content.orderStatus` | Kartu order tracking interaktif |
|
|
1043
|
+
| `content.groupStatusMessage` | Kirim status grup dengan styling |
|
|
1044
|
+
| `sock.groupCreate(title, participants)` | Buat grup baru |
|
|
1045
|
+
| `sock.groupMetadata(jid)` | Ambil metadata grup |
|
|
1046
|
+
| `sock.groupSettingUpdate(jid, setting)` | Update pengaturan grup |
|
|
1047
|
+
| `sock.groupParticipantsUpdate(jid, participants, action)` | Ubah anggota grup |
|
|
1048
|
+
| `sock.groupInviteCode(jid)` | Ambil kode undangan grup |
|
|
1049
|
+
| `sock.groupRevokeInvite(jid)` | Cabut & buat ulang undangan |
|
|
1050
|
+
| `sock.newsletterMetadata(type, value)` | Ambil info newsletter |
|
|
1051
|
+
| `sock.newsletterCreate(name, desc, picture)` | Buat newsletter |
|
|
1052
|
+
| `sock.newsletterFollow(jid)` | Follow newsletter |
|
|
1053
|
+
| `sock.newsletterUnfollow(jid)` | Unfollow newsletter |
|
|
1054
|
+
| `sock.newsletterMute(jid)` | Mute newsletter |
|
|
1055
|
+
| `sock.newsletterUnmute(jid)` | Unmute newsletter |
|
|
1056
|
+
| `sock.newsletterReactMessage(jid, id, emoji)` | React ke post newsletter |
|
|
1057
|
+
| `sock.updateProfilePicture(jid, content)` | Update foto profil |
|
|
1058
|
+
| `sock.removeProfilePicture(jid)` | Hapus foto profil |
|
|
1059
|
+
| `sock.updateBlockStatus(jid, status)` | Block / unblock user |
|
|
1060
|
+
| `sock.updateLastSeenPrivacy(value)` | Atur visibilitas last seen |
|
|
1061
|
+
| `sock.updateOnlinePrivacy(value)` | Atur visibilitas status online |
|
|
1062
|
+
| `sock.updateProfilePicturePrivacy(value)` | Atur visibilitas foto profil |
|
|
1063
|
+
| `sock.updateReadReceiptsPrivacy(value)` | Atur read receipts |
|
|
1064
|
+
| `sock.updateGroupsAddPrivacy(value)` | Atur siapa yang bisa menambahkan ke grup |
|
|
1065
|
+
| `sock.updateDefaultDisappearingMode(seconds)` | Atur default disappearing messages |
|
|
1638
1066
|
|
|
1639
1067
|
---
|
|
1640
1068
|
|
|
@@ -1650,31 +1078,31 @@ sock.ws.on('CB:edge_routing', (node) => {
|
|
|
1650
1078
|
|
|
1651
1079
|
## 🤝 Contributing
|
|
1652
1080
|
|
|
1653
|
-
1. **Fork**
|
|
1654
|
-
2.
|
|
1655
|
-
3. Commit
|
|
1656
|
-
4. Push
|
|
1657
|
-
5.
|
|
1081
|
+
1. **Fork** repository ini
|
|
1082
|
+
2. Buat feature branch: `git checkout -b feat/your-feature`
|
|
1083
|
+
3. Commit perubahan: `git commit -m "feat: add something awesome"`
|
|
1084
|
+
4. Push ke branch kamu: `git push origin feat/your-feature`
|
|
1085
|
+
5. Buka **Pull Request**
|
|
1658
1086
|
|
|
1659
1087
|
---
|
|
1660
1088
|
|
|
1661
1089
|
## 📜 License
|
|
1662
1090
|
|
|
1663
|
-
|
|
1091
|
+
Proyek ini dilisensikan untuk **penggunaan personal dan non-komersial saja**.
|
|
1664
1092
|
|
|
1665
1093
|
| | |
|
|
1666
1094
|
|:---:|:---|
|
|
1667
|
-
| ✅ |
|
|
1668
|
-
| ✅ |
|
|
1669
|
-
| ❌ |
|
|
1670
|
-
| ❌ |
|
|
1095
|
+
| ✅ | Penggunaan dan modifikasi personal diperbolehkan |
|
|
1096
|
+
| ✅ | Redistribusi dengan atribusi diperbolehkan |
|
|
1097
|
+
| ❌ | Penggunaan komersial dilarang keras |
|
|
1098
|
+
| ❌ | Dijual ulang atau rebranding dilarang |
|
|
1671
1099
|
|
|
1672
1100
|
---
|
|
1673
1101
|
|
|
1674
1102
|
## ⚠️ Disclaimer
|
|
1675
1103
|
|
|
1676
|
-
>
|
|
1677
|
-
>
|
|
1104
|
+
> Proyek ini **tidak berafiliasi dengan WhatsApp atau Meta** dengan cara apa pun.
|
|
1105
|
+
> Gunakan dengan risiko sendiri dan lihat [Terms of Service](https://www.whatsapp.com/legal/terms-of-service) WhatsApp untuk kepatuhan.
|
|
1678
1106
|
|
|
1679
1107
|
---
|
|
1680
1108
|
|