@nuiisweety/baileys 0.1.0
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 +21 -0
- package/README.md +965 -0
- package/README.md.bak +1376 -0
- package/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +5479 -0
- package/WAProto/fix-imports.js +85 -0
- package/WAProto/index.d.ts +14017 -0
- package/WAProto/index.js +97691 -0
- package/engine-requirements.js +10 -0
- package/lib/Defaults/index.d.ts +75 -0
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +137 -0
- package/lib/Defaults/index.js.map +1 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
- package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/ciphertext-message.js.map +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +15 -0
- package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
- package/lib/Signal/Group/group-session-builder.js +30 -0
- package/lib/Signal/Group/group-session-builder.js.map +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +17 -0
- package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
- package/lib/Signal/Group/group_cipher.js +82 -0
- package/lib/Signal/Group/group_cipher.js.map +1 -0
- package/lib/Signal/Group/index.d.ts +12 -0
- package/lib/Signal/Group/index.d.ts.map +1 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/index.js.map +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +11 -0
- package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
- package/lib/Signal/Group/keyhelper.js +18 -0
- package/lib/Signal/Group/keyhelper.js.map +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
- package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-chain-key.js +26 -0
- package/lib/Signal/Group/sender-chain-key.js.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
- package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +19 -0
- package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +18 -0
- package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-name.js +48 -0
- package/lib/Signal/Group/sender-key-name.js.map +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +31 -0
- package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-record.js +41 -0
- package/lib/Signal/Group/sender-key-record.js.map +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +39 -0
- package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-state.js +84 -0
- package/lib/Signal/Group/sender-key-state.js.map +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +12 -0
- package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-message-key.js +26 -0
- package/lib/Signal/Group/sender-message-key.js.map +1 -0
- package/lib/Signal/libsignal.d.ts +5 -0
- package/lib/Signal/libsignal.d.ts.map +1 -0
- package/lib/Signal/libsignal.js +431 -0
- package/lib/Signal/libsignal.js.map +1 -0
- package/lib/Signal/lid-mapping.d.ts +23 -0
- package/lib/Signal/lid-mapping.d.ts.map +1 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Signal/lid-mapping.js.map +1 -0
- package/lib/Socket/Client/index.d.ts +3 -0
- package/lib/Socket/Client/index.d.ts.map +1 -0
- package/lib/Socket/Client/index.js +3 -0
- package/lib/Socket/Client/index.js.map +1 -0
- package/lib/Socket/Client/types.d.ts +16 -0
- package/lib/Socket/Client/types.d.ts.map +1 -0
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/types.js.map +1 -0
- package/lib/Socket/Client/websocket.d.ts +13 -0
- package/lib/Socket/Client/websocket.d.ts.map +1 -0
- package/lib/Socket/Client/websocket.js +54 -0
- package/lib/Socket/Client/websocket.js.map +1 -0
- package/lib/Socket/business.d.ts +217 -0
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +379 -0
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/chats.d.ts +124 -0
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +1193 -0
- 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 +204 -0
- package/lib/Socket/groups.d.ts +161 -0
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +347 -0
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +260 -0
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +52 -0
- package/lib/Socket/index.js.bak +52 -0
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +203 -0
- package/lib/Socket/messages-recv.d.ts.map +1 -0
- package/lib/Socket/messages-recv.js +1772 -0
- package/lib/Socket/messages-recv.js.map +1 -0
- package/lib/Socket/messages-send.d.ts +199 -0
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +1334 -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 +170 -0
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +181 -0
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/socket.d.ts +59 -0
- package/lib/Socket/socket.d.ts.map +1 -0
- package/lib/Socket/socket.js +967 -0
- package/lib/Socket/socket.js.map +1 -0
- package/lib/Store/index.d.ts +4 -0
- package/lib/Store/index.d.ts.map +1 -0
- package/lib/Store/index.js +4 -0
- package/lib/Store/index.js.map +1 -0
- package/lib/Store/make-in-memory-store.d.ts +63 -0
- package/lib/Store/make-in-memory-store.d.ts.map +1 -0
- package/lib/Store/make-in-memory-store.js +415 -0
- package/lib/Store/make-in-memory-store.js.map +1 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/make-ordered-dictionary.d.ts.map +1 -0
- package/lib/Store/make-ordered-dictionary.js +79 -0
- package/lib/Store/make-ordered-dictionary.js.map +1 -0
- package/lib/Store/object-repository.d.ts +11 -0
- package/lib/Store/object-repository.d.ts.map +1 -0
- package/lib/Store/object-repository.js +24 -0
- package/lib/Store/object-repository.js.map +1 -0
- package/lib/Types/Auth.d.ts +117 -0
- package/lib/Types/Auth.d.ts.map +1 -0
- package/lib/Types/Auth.js +2 -0
- 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 -0
- package/lib/Types/Bussines.js.map +1 -0
- package/lib/Types/Call.d.ts +15 -0
- package/lib/Types/Call.d.ts.map +1 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Call.js.map +1 -0
- package/lib/Types/Chat.d.ts +124 -0
- package/lib/Types/Chat.d.ts.map +1 -0
- package/lib/Types/Chat.js +8 -0
- package/lib/Types/Chat.js.map +1 -0
- package/lib/Types/Contact.d.ts +26 -0
- package/lib/Types/Contact.d.ts.map +1 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Contact.js.map +1 -0
- package/lib/Types/Events.d.ts +256 -0
- package/lib/Types/Events.d.ts.map +1 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/Events.js.map +1 -0
- package/lib/Types/GroupMetadata.d.ts +71 -0
- package/lib/Types/GroupMetadata.d.ts.map +1 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/GroupMetadata.js.map +1 -0
- package/lib/Types/Label.d.ts +47 -0
- package/lib/Types/Label.d.ts.map +1 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/Label.js.map +1 -0
- package/lib/Types/LabelAssociation.d.ts +30 -0
- package/lib/Types/LabelAssociation.d.ts.map +1 -0
- package/lib/Types/LabelAssociation.js +7 -0
- package/lib/Types/LabelAssociation.js.map +1 -0
- package/lib/Types/Message.d.ts +320 -0
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +17 -0
- 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 +79 -0
- package/lib/Types/Product.d.ts.map +1 -0
- package/lib/Types/Product.js +2 -0
- 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.map +1 -0
- package/lib/Types/Signal.d.ts +87 -0
- package/lib/Types/Signal.d.ts.map +1 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Signal.js.map +1 -0
- package/lib/Types/Socket.d.ts +136 -0
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +3 -0
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +97 -0
- package/lib/Types/State.d.ts.map +1 -0
- package/lib/Types/State.js +56 -0
- package/lib/Types/State.js.map +1 -0
- package/lib/Types/USync.d.ts +26 -0
- package/lib/Types/USync.d.ts.map +1 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/USync.js.map +1 -0
- package/lib/Types/index.d.ts +65 -0
- package/lib/Types/index.d.ts.map +1 -0
- package/lib/Types/index.js +26 -0
- package/lib/Types/index.js.map +1 -0
- package/lib/Utils/auth-utils.d.ts +24 -0
- package/lib/Utils/auth-utils.d.ts.map +1 -0
- package/lib/Utils/auth-utils.js +302 -0
- 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 +23 -0
- package/lib/Utils/business.d.ts.map +1 -0
- package/lib/Utils/business.js +231 -0
- package/lib/Utils/business.js.map +1 -0
- package/lib/Utils/chat-utils.d.ts +100 -0
- package/lib/Utils/chat-utils.d.ts.map +1 -0
- package/lib/Utils/chat-utils.js +872 -0
- 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 +37 -0
- package/lib/Utils/crypto.d.ts.map +1 -0
- package/lib/Utils/crypto.js +118 -0
- package/lib/Utils/crypto.js.map +1 -0
- package/lib/Utils/decode-wa-message.d.ts +66 -0
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +311 -0
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +36 -0
- package/lib/Utils/event-buffer.d.ts.map +1 -0
- package/lib/Utils/event-buffer.js +622 -0
- package/lib/Utils/event-buffer.js.map +1 -0
- package/lib/Utils/generics.d.ts +91 -0
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +393 -0
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/history.d.ts +24 -0
- package/lib/Utils/history.d.ts.map +1 -0
- package/lib/Utils/history.js +134 -0
- 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 -0
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +24 -0
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +21 -0
- package/lib/Utils/link-preview.d.ts.map +1 -0
- package/lib/Utils/link-preview.js +85 -0
- package/lib/Utils/link-preview.js.map +1 -0
- package/lib/Utils/logger.d.ts +12 -0
- package/lib/Utils/logger.d.ts.map +1 -0
- package/lib/Utils/logger.js +3 -0
- package/lib/Utils/logger.js.map +1 -0
- package/lib/Utils/lt-hash.d.ts +8 -0
- package/lib/Utils/lt-hash.d.ts.map +1 -0
- package/lib/Utils/lt-hash.js +8 -0
- package/lib/Utils/lt-hash.js.map +1 -0
- package/lib/Utils/make-mutex.d.ts +9 -0
- package/lib/Utils/make-mutex.d.ts.map +1 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/make-mutex.js.map +1 -0
- package/lib/Utils/message-retry-manager.d.ts +115 -0
- package/lib/Utils/message-retry-manager.d.ts.map +1 -0
- package/lib/Utils/message-retry-manager.js +265 -0
- package/lib/Utils/message-retry-manager.js.map +1 -0
- package/lib/Utils/messages-media.d.ts +133 -0
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +786 -0
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +91 -0
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +1762 -0
- package/lib/Utils/messages.js.bak +1183 -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 +20 -0
- package/lib/Utils/noise-handler.d.ts.map +1 -0
- package/lib/Utils/noise-handler.js +201 -0
- 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 +60 -0
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +597 -0
- 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 +246 -0
- package/lib/Utils/rich-message-utils.js.map +1 -0
- package/lib/Utils/signal.d.ts +47 -0
- package/lib/Utils/signal.d.ts.map +1 -0
- package/lib/Utils/signal.js +201 -0
- 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 +13 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +121 -0
- package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +11 -0
- package/lib/Utils/use-single-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-single-file-auth-state.js +106 -0
- 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 -0
- package/lib/Utils/validate-connection.d.ts.map +1 -0
- package/lib/Utils/validate-connection.js +203 -0
- package/lib/Utils/validate-connection.js.map +1 -0
- package/lib/WABinary/constants.d.ts +28 -0
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +1373 -0
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +7 -0
- package/lib/WABinary/decode.d.ts.map +1 -0
- package/lib/WABinary/decode.js +262 -0
- package/lib/WABinary/decode.js.map +1 -0
- package/lib/WABinary/encode.d.ts +3 -0
- package/lib/WABinary/encode.d.ts.map +1 -0
- package/lib/WABinary/encode.js +220 -0
- package/lib/WABinary/encode.js.map +1 -0
- package/lib/WABinary/generic-utils.d.ts +15 -0
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +214 -0
- package/lib/WABinary/generic-utils.js.map +1 -0
- package/lib/WABinary/index.d.ts +6 -0
- package/lib/WABinary/index.d.ts.map +1 -0
- package/lib/WABinary/index.js +6 -0
- package/lib/WABinary/index.js.map +1 -0
- package/lib/WABinary/jid-utils.d.ts +48 -0
- package/lib/WABinary/jid-utils.d.ts.map +1 -0
- package/lib/WABinary/jid-utils.js +96 -0
- package/lib/WABinary/jid-utils.js.map +1 -0
- package/lib/WABinary/types.d.ts +19 -0
- package/lib/WABinary/types.d.ts.map +1 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WABinary/types.js.map +1 -0
- package/lib/WAM/BinaryInfo.d.ts +9 -0
- package/lib/WAM/BinaryInfo.d.ts.map +1 -0
- package/lib/WAM/BinaryInfo.js +10 -0
- package/lib/WAM/BinaryInfo.js.map +1 -0
- package/lib/WAM/constants.d.ts +40 -0
- package/lib/WAM/constants.d.ts.map +1 -0
- package/lib/WAM/constants.js +22853 -0
- package/lib/WAM/constants.js.map +1 -0
- package/lib/WAM/encode.d.ts +3 -0
- package/lib/WAM/encode.d.ts.map +1 -0
- package/lib/WAM/encode.js +150 -0
- package/lib/WAM/encode.js.map +1 -0
- package/lib/WAM/index.d.ts +4 -0
- package/lib/WAM/index.d.ts.map +1 -0
- package/lib/WAM/index.js +4 -0
- package/lib/WAM/index.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- 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 -0
- package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/index.js +6 -0
- package/lib/WAUSync/Protocols/index.js.map +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +30 -0
- package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
- package/lib/WAUSync/USyncQuery.js +98 -0
- package/lib/WAUSync/USyncQuery.js.map +1 -0
- package/lib/WAUSync/USyncUser.d.ts +17 -0
- package/lib/WAUSync/USyncUser.d.ts.map +1 -0
- package/lib/WAUSync/USyncUser.js +31 -0
- package/lib/WAUSync/USyncUser.js.map +1 -0
- package/lib/WAUSync/index.d.ts +4 -0
- package/lib/WAUSync/index.d.ts.map +1 -0
- package/lib/WAUSync/index.js +4 -0
- package/lib/WAUSync/index.js.map +1 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -0
- package/lib/index.js.map +1 -0
- package/package.json +140 -0
package/README.md.bak
ADDED
|
@@ -0,0 +1,1376 @@
|
|
|
1
|
+
<h1 align="center">✨ @nuiisweety/baileys</h1>
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/NuiiS4TORU/-nuisockets/refs/heads/main/file_0000000045bc71fa9e62f6c94e5bb7e0.png" width="100%"/>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div align="center">
|
|
8
|
+
Fork dari <code>@whiskeysockets/baileys</code> v7.0.0-rc11 — dimodifikasi oleh <b>NuiiS4TORU</b>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div align="center">
|
|
12
|
+
<blockquote>
|
|
13
|
+
⚠️ <b>@nuiisweety/baileys tidak pernah melakukan fork dari baileys manapun, terkecuali <a href="https://github.com/WhiskeySockets/Baileys">@whiskeysockets/baileys</a>.</b><br/>
|
|
14
|
+
Semua modifikasi merupakan pengembangan mandiri di atas <code>@whiskeysockets/baileys</code>.
|
|
15
|
+
</blockquote>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 📚 Navigasi
|
|
21
|
+
|
|
22
|
+
<div align="center">
|
|
23
|
+
|
|
24
|
+
**Koneksi**
|
|
25
|
+
[QR Code](#-koneksi-qr-code) · [Pairing Code](#-koneksi-pairing-code) · [Browser Identity](#-browser-identity) · [Opsi Koneksi](#-opsi-koneksi)
|
|
26
|
+
|
|
27
|
+
**Handle Pesan**
|
|
28
|
+
[Terima Pesan](#-terima-pesan) · [Handle Grup](#-handle-grup)
|
|
29
|
+
|
|
30
|
+
**Kirim Pesan**
|
|
31
|
+
[Teks](#-teks) · [Gambar](#-gambar) · [Video](#-video) · [Audio & Voice Note](#-audio--voice-note) · [Dokumen](#-dokumen) · [Sticker](#-sticker) · [Lokasi](#-lokasi) · [Kontak](#-kontak)
|
|
32
|
+
|
|
33
|
+
**Interaksi**
|
|
34
|
+
[Reaksi](#-reaksi) · [Poll](#-poll) · [Poll Result](#-poll-result) · [Poll Update](#-poll-update) · [Forward](#-forward) · [Hapus](#-hapus-pesan) · [Edit](#-edit-pesan) · [Pin](#-pin-pesan)
|
|
35
|
+
|
|
36
|
+
**Tambahan**
|
|
37
|
+
[Album](#-album) · [Event](#-event) · [Group Status](#-group-status--group-story) · [Status Mention](#️-status-mention) · [Flow Reply](#-flow-reply) · [Button Reply](#-button-reply) · [Keep In Chat](#-keep-in-chat) · [Scheduled Call](#-scheduled-call) · [Group Invite](#-group-invite) · [Product](#-product)
|
|
38
|
+
|
|
39
|
+
**Wrapper**
|
|
40
|
+
[View Once](#-view-once) · [View Once V2](#-view-once-v2) · [Ephemeral](#-ephemeral) · [Spoiler](#-spoiler) · [Group Status Wrap](#-group-status-wrap) · [Lottie Sticker](#-lottie-sticker) · [AI Icon](#-ai-icon) · [Secure Meta Label](#️-secure-meta-service-label)
|
|
41
|
+
|
|
42
|
+
**Interactive**
|
|
43
|
+
[Buttons](#-buttons) · [List Message](#-list-message) · [Template Buttons](#-template-buttons) · [Native Flow](#-native-flow) · [Carousel](#-carousel)
|
|
44
|
+
|
|
45
|
+
**Rich Message (AI)**
|
|
46
|
+
[Code Block](#-code-block) · [Links](#-links-rich) · [Table](#-table-rich) · [Rich Response (Gabungan)](#-rich-response-gabungan)
|
|
47
|
+
|
|
48
|
+
**Lainnya**
|
|
49
|
+
[List Reply](#-list-reply) · [Sticker Pack](#-sticker-pack) · [External Ad Reply](#-external-ad-reply) · [Request Payment](#-request-payment) · [Invoice](#-invoice) · [Order](#-order) · [Disappearing Messages](#-disappearing-messages) · [Raw Message](#-raw-message)
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Instalasi
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
const { default: makeWASocket } = require('@nuiisweety/baileys')
|
|
59
|
+
// atau ESM
|
|
60
|
+
import makeWASocket from '@nuiisweety/baileys'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 🔌 Koneksi QR Code
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
const {
|
|
69
|
+
default: makeWASocket,
|
|
70
|
+
useMultiFileAuthState,
|
|
71
|
+
DisconnectReason,
|
|
72
|
+
fetchLatestBaileysVersion
|
|
73
|
+
} = require('@nuiisweety/baileys')
|
|
74
|
+
|
|
75
|
+
async function start() {
|
|
76
|
+
const { state, saveCreds } = await useMultiFileAuthState('auth_info')
|
|
77
|
+
const { version } = await fetchLatestBaileysVersion()
|
|
78
|
+
|
|
79
|
+
const sock = makeWASocket({
|
|
80
|
+
version,
|
|
81
|
+
auth: state,
|
|
82
|
+
printQRInTerminal: true
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
sock.ev.on('creds.update', saveCreds)
|
|
86
|
+
sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
|
|
87
|
+
if (connection === 'close') {
|
|
88
|
+
const code = lastDisconnect?.error?.output?.statusCode
|
|
89
|
+
if (code !== DisconnectReason.loggedOut) start()
|
|
90
|
+
} else if (connection === 'open') {
|
|
91
|
+
console.log('✅ Terhubung!')
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
start()
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 🔑 Koneksi Pairing Code
|
|
101
|
+
|
|
102
|
+
Untuk server/VPS tanpa tampilan terminal.
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
const sock = makeWASocket({
|
|
106
|
+
version,
|
|
107
|
+
auth: state,
|
|
108
|
+
printQRInTerminal: false
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
sock.ev.on('creds.update', saveCreds)
|
|
112
|
+
sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
|
|
113
|
+
if (connection === 'close') {
|
|
114
|
+
if (lastDisconnect?.error?.output?.statusCode !== DisconnectReason.loggedOut) start()
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
// Nomor HP format internasional tanpa +
|
|
119
|
+
if (!sock.authState.creds.registered) {
|
|
120
|
+
const code = await sock.requestPairingCode('628123456789')
|
|
121
|
+
console.log('Pairing code:', code)
|
|
122
|
+
// Masukkan di WA → Perangkat Tertaut → Tautkan Perangkat
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
> Pairing code kadaluarsa dalam beberapa menit. Jalankan ulang jika gagal.
|
|
127
|
+
|
|
128
|
+
**Custom pairing code (8 karakter):**
|
|
129
|
+
```js
|
|
130
|
+
const code = await sock.requestPairingCode('628123456789', 'ABCD1234')
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 🖥️ Browser Identity
|
|
136
|
+
|
|
137
|
+
```js
|
|
138
|
+
const { Browsers } = require('@nuiisweety/baileys')
|
|
139
|
+
|
|
140
|
+
makeWASocket({
|
|
141
|
+
browser: Browsers.macOS('Chrome'), // Mac OS — Chrome
|
|
142
|
+
browser: Browsers.macOS('Firefox'), // Mac OS — Firefox
|
|
143
|
+
browser: Browsers.windows('Chrome'), // Windows — Chrome
|
|
144
|
+
browser: Browsers.ubuntu('Chrome'), // Ubuntu — Chrome
|
|
145
|
+
browser: Browsers.baileys('Chrome'), // Baileys — Chrome
|
|
146
|
+
browser: ['MyBot', 'Chrome', '1.0.0'] // custom
|
|
147
|
+
})
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## ⚙️ Opsi Koneksi
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
makeWASocket({
|
|
156
|
+
version,
|
|
157
|
+
auth: state,
|
|
158
|
+
printQRInTerminal: true,
|
|
159
|
+
browser: Browsers.macOS('Chrome'),
|
|
160
|
+
connectTimeoutMs: 20000,
|
|
161
|
+
keepAliveIntervalMs: 30000,
|
|
162
|
+
markOnlineOnConnect: true,
|
|
163
|
+
syncFullHistory: false,
|
|
164
|
+
generateHighQualityLinkPreview: false,
|
|
165
|
+
emitOwnEvents: true,
|
|
166
|
+
getMessage: async key => store?.messages?.[key.remoteJid]?.get(key.id)?.message
|
|
167
|
+
})
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 📥 Terima Pesan
|
|
173
|
+
|
|
174
|
+
```js
|
|
175
|
+
sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
176
|
+
if (type !== 'notify') return
|
|
177
|
+
|
|
178
|
+
for (const m of messages) {
|
|
179
|
+
if (!m.message) continue
|
|
180
|
+
if (m.key.fromMe) continue
|
|
181
|
+
|
|
182
|
+
const jid = m.key.remoteJid
|
|
183
|
+
const isGroup = jid.endsWith('@g.us')
|
|
184
|
+
const sender = isGroup ? m.key.participant : jid
|
|
185
|
+
|
|
186
|
+
// Ambil teks
|
|
187
|
+
const text =
|
|
188
|
+
m.message.conversation ||
|
|
189
|
+
m.message.extendedTextMessage?.text ||
|
|
190
|
+
m.message.imageMessage?.caption ||
|
|
191
|
+
m.message.videoMessage?.caption || ''
|
|
192
|
+
|
|
193
|
+
// Tandai dibaca
|
|
194
|
+
await sock.readMessages([m.key])
|
|
195
|
+
|
|
196
|
+
// Typing indicator
|
|
197
|
+
await sock.sendPresenceUpdate('composing', jid)
|
|
198
|
+
}
|
|
199
|
+
})
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 👥 Handle Grup
|
|
205
|
+
|
|
206
|
+
```js
|
|
207
|
+
// Anggota masuk/keluar
|
|
208
|
+
sock.ev.on('group-participants.update', ({ id, participants, action }) => {
|
|
209
|
+
// action: 'add' | 'remove' | 'promote' | 'demote'
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
// Info grup diupdate
|
|
213
|
+
sock.ev.on('groups.update', updates => {})
|
|
214
|
+
|
|
215
|
+
// Metadata grup
|
|
216
|
+
const meta = await sock.groupMetadata(groupJid)
|
|
217
|
+
console.log(meta.subject, meta.participants)
|
|
218
|
+
|
|
219
|
+
// Semua grup
|
|
220
|
+
const groups = await sock.groupFetchAllParticipating()
|
|
221
|
+
|
|
222
|
+
// Tambah / keluarkan / promote / demote
|
|
223
|
+
await sock.groupParticipantsUpdate(groupJid, ['628xxx@s.whatsapp.net'], 'add')
|
|
224
|
+
await sock.groupParticipantsUpdate(groupJid, ['628xxx@s.whatsapp.net'], 'remove')
|
|
225
|
+
await sock.groupParticipantsUpdate(groupJid, ['628xxx@s.whatsapp.net'], 'promote')
|
|
226
|
+
await sock.groupParticipantsUpdate(groupJid, ['628xxx@s.whatsapp.net'], 'demote')
|
|
227
|
+
|
|
228
|
+
// Ubah nama / deskripsi
|
|
229
|
+
await sock.groupUpdateSubject(groupJid, 'Nama Baru')
|
|
230
|
+
await sock.groupUpdateDescription(groupJid, 'Deskripsi baru')
|
|
231
|
+
|
|
232
|
+
// Kunci / buka grup
|
|
233
|
+
await sock.groupSettingUpdate(groupJid, 'announcement')
|
|
234
|
+
await sock.groupSettingUpdate(groupJid, 'not_announcement')
|
|
235
|
+
|
|
236
|
+
// Mention semua anggota
|
|
237
|
+
const meta2 = await sock.groupMetadata(groupJid)
|
|
238
|
+
const members = meta2.participants.map(p => p.id)
|
|
239
|
+
await sock.sendMessage(groupJid, {
|
|
240
|
+
text: members.map(m => `@${m.split('@')[0]}`).join(' '),
|
|
241
|
+
mentions: members
|
|
242
|
+
})
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## 💬 Teks
|
|
248
|
+
|
|
249
|
+
```js
|
|
250
|
+
await sock.sendMessage(jid, { text: 'Halo!' })
|
|
251
|
+
|
|
252
|
+
// Dengan mention
|
|
253
|
+
await sock.sendMessage(jid, {
|
|
254
|
+
text: '@628xxx halo!',
|
|
255
|
+
mentions: ['628xxx@s.whatsapp.net']
|
|
256
|
+
}, { quoted: m })
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## 🖼️ Gambar
|
|
262
|
+
|
|
263
|
+
```js
|
|
264
|
+
// URL
|
|
265
|
+
await sock.sendMessage(jid, {
|
|
266
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
267
|
+
caption: 'Keterangan'
|
|
268
|
+
})
|
|
269
|
+
|
|
270
|
+
// Buffer / file
|
|
271
|
+
await sock.sendMessage(jid, {
|
|
272
|
+
image: fs.readFileSync('image.jpg'),
|
|
273
|
+
caption: 'Keterangan'
|
|
274
|
+
})
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 🎥 Video
|
|
280
|
+
|
|
281
|
+
```js
|
|
282
|
+
await sock.sendMessage(jid, {
|
|
283
|
+
video: { url: 'https://example.com/video.mp4' },
|
|
284
|
+
caption: 'Keterangan',
|
|
285
|
+
gifPlayback: false // true = GIF looping
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
// Video note (bubble)
|
|
289
|
+
await sock.sendMessage(jid, {
|
|
290
|
+
video: fs.readFileSync('video.mp4'),
|
|
291
|
+
ptv: true
|
|
292
|
+
})
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## 🎵 Audio & Voice Note
|
|
298
|
+
|
|
299
|
+
```js
|
|
300
|
+
// Audio biasa
|
|
301
|
+
await sock.sendMessage(jid, {
|
|
302
|
+
audio: { url: 'https://example.com/audio.mp3' },
|
|
303
|
+
mimetype: 'audio/mpeg'
|
|
304
|
+
})
|
|
305
|
+
|
|
306
|
+
// Voice note (PTT)
|
|
307
|
+
await sock.sendMessage(jid, {
|
|
308
|
+
audio: fs.readFileSync('voice.ogg'),
|
|
309
|
+
mimetype: 'audio/ogg; codecs=opus',
|
|
310
|
+
ptt: true
|
|
311
|
+
})
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## 📄 Dokumen
|
|
317
|
+
|
|
318
|
+
```js
|
|
319
|
+
await sock.sendMessage(jid, {
|
|
320
|
+
document: fs.readFileSync('file.pdf'),
|
|
321
|
+
mimetype: 'application/pdf',
|
|
322
|
+
fileName: 'dokumen.pdf',
|
|
323
|
+
caption: 'File ini'
|
|
324
|
+
})
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## 🎭 Sticker
|
|
330
|
+
|
|
331
|
+
```js
|
|
332
|
+
await sock.sendMessage(jid, {
|
|
333
|
+
sticker: fs.readFileSync('sticker.webp')
|
|
334
|
+
})
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## 📍 Lokasi
|
|
340
|
+
|
|
341
|
+
```js
|
|
342
|
+
await sock.sendMessage(jid, {
|
|
343
|
+
location: {
|
|
344
|
+
degreesLatitude: -6.2088,
|
|
345
|
+
degreesLongitude: 106.8456,
|
|
346
|
+
name: 'Monas',
|
|
347
|
+
address: 'Jakarta Pusat'
|
|
348
|
+
}
|
|
349
|
+
})
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## 👤 Kontak
|
|
355
|
+
|
|
356
|
+
```js
|
|
357
|
+
await sock.sendMessage(jid, {
|
|
358
|
+
contacts: {
|
|
359
|
+
displayName: 'Nama',
|
|
360
|
+
contacts: [{
|
|
361
|
+
vcard: 'BEGIN:VCARD\nVERSION:3.0\nFN:Nama\nTEL:+62812345678\nEND:VCARD'
|
|
362
|
+
}]
|
|
363
|
+
}
|
|
364
|
+
})
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## 😀 Reaksi
|
|
370
|
+
|
|
371
|
+
```js
|
|
372
|
+
await sock.sendMessage(jid, { react: { text: '👍', key: m.key } })
|
|
373
|
+
// Hapus reaksi
|
|
374
|
+
await sock.sendMessage(jid, { react: { text: '', key: m.key } })
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## 🗳️ Poll
|
|
380
|
+
|
|
381
|
+
```js
|
|
382
|
+
await sock.sendMessage(jid, {
|
|
383
|
+
poll: {
|
|
384
|
+
name: 'Pilih salah satu?',
|
|
385
|
+
values: ['Opsi A', 'Opsi B', 'Opsi C'],
|
|
386
|
+
selectableCount: 1 // 0 = boleh pilih banyak
|
|
387
|
+
}
|
|
388
|
+
})
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**Poll dengan fitur tambahan:**
|
|
392
|
+
```js
|
|
393
|
+
await sock.sendMessage(jid, {
|
|
394
|
+
poll: {
|
|
395
|
+
name: 'Nama Poll',
|
|
396
|
+
values: ['Opsi A', 'Opsi B'],
|
|
397
|
+
selectableCount: 1,
|
|
398
|
+
endDate: new Date('2025-12-31'), // tanggal berakhir
|
|
399
|
+
hideVoter: true, // sembunyikan nama pemilih
|
|
400
|
+
canAddOption: false, // larang tambah opsi
|
|
401
|
+
toAnnouncementGroup: false // true = community announcement group (pollV2)
|
|
402
|
+
}
|
|
403
|
+
})
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
**Quiz (Poll dengan jawaban benar):**
|
|
407
|
+
```js
|
|
408
|
+
await sock.sendMessage(jid, {
|
|
409
|
+
poll: {
|
|
410
|
+
name: 'Ibu kota Indonesia?',
|
|
411
|
+
values: ['Jakarta', 'Surabaya', 'Bandung'],
|
|
412
|
+
selectableCount: 1,
|
|
413
|
+
pollType: 1, // 1 = QUIZ
|
|
414
|
+
correctAnswer: 'Jakarta'
|
|
415
|
+
}
|
|
416
|
+
})
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## 📊 Poll Result
|
|
422
|
+
|
|
423
|
+
```js
|
|
424
|
+
await sock.sendMessage(jid, {
|
|
425
|
+
pollResult: {
|
|
426
|
+
name: 'Nama Poll',
|
|
427
|
+
votes: [
|
|
428
|
+
{ name: 'Opsi A', voteCount: 10 },
|
|
429
|
+
{ name: 'Opsi B', voteCount: 5 }
|
|
430
|
+
],
|
|
431
|
+
pollType: 0 // 0 = POLL, 1 = QUIZ
|
|
432
|
+
}
|
|
433
|
+
})
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## 🗳️ Poll Update
|
|
439
|
+
|
|
440
|
+
```js
|
|
441
|
+
await sock.sendMessage(jid, {
|
|
442
|
+
pollUpdate: {
|
|
443
|
+
key: pollMessage.key, // key dari pesan poll yang mau di-vote
|
|
444
|
+
vote: encryptedVotePayload,
|
|
445
|
+
metadata: optionalMetadata
|
|
446
|
+
}
|
|
447
|
+
})
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## ↩️ Forward
|
|
453
|
+
|
|
454
|
+
```js
|
|
455
|
+
await sock.sendMessage(jid, {
|
|
456
|
+
forward: targetMessage,
|
|
457
|
+
force: true // paksa tampil sebagai forwarded
|
|
458
|
+
})
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## 🗑️ Hapus Pesan
|
|
464
|
+
|
|
465
|
+
```js
|
|
466
|
+
await sock.sendMessage(jid, { delete: m.key })
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
## ✏️ Edit Pesan
|
|
472
|
+
|
|
473
|
+
```js
|
|
474
|
+
await sock.sendMessage(jid, {
|
|
475
|
+
text: 'Teks yang sudah diedit',
|
|
476
|
+
edit: m.key
|
|
477
|
+
})
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## 📌 Pin Pesan
|
|
483
|
+
|
|
484
|
+
```js
|
|
485
|
+
// Pin
|
|
486
|
+
await sock.sendMessage(jid, {
|
|
487
|
+
pin: m.key,
|
|
488
|
+
type: 1,
|
|
489
|
+
time: 86400 // 86400=1hr | 604800=7hr | 2592000=30hr
|
|
490
|
+
})
|
|
491
|
+
// Unpin
|
|
492
|
+
await sock.sendMessage(jid, { pin: m.key, type: 2 })
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
## 🖼️ Album
|
|
498
|
+
|
|
499
|
+
```js
|
|
500
|
+
await sock.sendMessage(jid, {
|
|
501
|
+
album: [
|
|
502
|
+
{ image: { url: 'https://example.com/1.jpg' }, caption: 'Foto 1' },
|
|
503
|
+
{ image: { url: 'https://example.com/2.jpg' }, caption: 'Foto 2' },
|
|
504
|
+
{ video: { url: 'https://example.com/vid.mp4' }, caption: 'Video' }
|
|
505
|
+
]
|
|
506
|
+
})
|
|
507
|
+
// minimal 2 media
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
---
|
|
511
|
+
|
|
512
|
+
## 📅 Event
|
|
513
|
+
|
|
514
|
+
```js
|
|
515
|
+
await sock.sendMessage(jid, {
|
|
516
|
+
event: {
|
|
517
|
+
name: 'Nama Acara',
|
|
518
|
+
description: 'Deskripsi',
|
|
519
|
+
startDate: new Date('2025-12-01T10:00:00'),
|
|
520
|
+
endDate: new Date('2025-12-01T12:00:00'),
|
|
521
|
+
location: {
|
|
522
|
+
degreesLatitude: -6.2088,
|
|
523
|
+
degreesLongitude: 106.8456,
|
|
524
|
+
name: 'Monas, Jakarta'
|
|
525
|
+
},
|
|
526
|
+
extraGuestsAllowed: true
|
|
527
|
+
}
|
|
528
|
+
})
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
**Event dengan scheduled call (audio/video):**
|
|
532
|
+
```js
|
|
533
|
+
await sock.sendMessage(jid, {
|
|
534
|
+
event: {
|
|
535
|
+
name: 'Meeting Online',
|
|
536
|
+
startDate: new Date('2025-12-01T10:00:00'),
|
|
537
|
+
call: 'audio', // 'audio' | 'video'
|
|
538
|
+
isScheduleCall: true
|
|
539
|
+
}
|
|
540
|
+
})
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
---
|
|
544
|
+
|
|
545
|
+
## 📸 Group Status / Group Story
|
|
546
|
+
|
|
547
|
+
```js
|
|
548
|
+
// Teks
|
|
549
|
+
await sock.sendMessage(groupJid, {
|
|
550
|
+
groupStatusMessage: { text: 'Status teks!' }
|
|
551
|
+
})
|
|
552
|
+
|
|
553
|
+
// Gambar
|
|
554
|
+
await sock.sendMessage(groupJid, {
|
|
555
|
+
groupStatusMessage: {
|
|
556
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
557
|
+
caption: 'Keterangan'
|
|
558
|
+
}
|
|
559
|
+
})
|
|
560
|
+
|
|
561
|
+
// Video
|
|
562
|
+
await sock.sendMessage(groupJid, {
|
|
563
|
+
groupStatusMessage: {
|
|
564
|
+
video: { url: 'https://example.com/video.mp4' },
|
|
565
|
+
caption: 'Keterangan'
|
|
566
|
+
}
|
|
567
|
+
})
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
## ⚡ Flow Reply
|
|
573
|
+
|
|
574
|
+
Balas pesan interaktif native flow:
|
|
575
|
+
|
|
576
|
+
```js
|
|
577
|
+
await sock.sendMessage(jid, {
|
|
578
|
+
flowReply: {
|
|
579
|
+
name: 'quick_reply', // nama button yang ditekan
|
|
580
|
+
paramsJson: '{"id":"btn1"}',
|
|
581
|
+
text: 'Teks balasan',
|
|
582
|
+
format: 1,
|
|
583
|
+
version: 1
|
|
584
|
+
}
|
|
585
|
+
})
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
---
|
|
589
|
+
|
|
590
|
+
## 🔘 Button Reply
|
|
591
|
+
|
|
592
|
+
```js
|
|
593
|
+
// Template button
|
|
594
|
+
await sock.sendMessage(jid, {
|
|
595
|
+
buttonReply: {
|
|
596
|
+
displayText: 'Opsi yang dipilih',
|
|
597
|
+
id: 'btn_id',
|
|
598
|
+
index: 0
|
|
599
|
+
},
|
|
600
|
+
type: 'template'
|
|
601
|
+
})
|
|
602
|
+
|
|
603
|
+
// Plain button
|
|
604
|
+
await sock.sendMessage(jid, {
|
|
605
|
+
buttonReply: {
|
|
606
|
+
displayText: 'Opsi yang dipilih',
|
|
607
|
+
id: 'btn_id'
|
|
608
|
+
},
|
|
609
|
+
type: 'plain'
|
|
610
|
+
})
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
---
|
|
614
|
+
|
|
615
|
+
## 📌 Keep In Chat
|
|
616
|
+
|
|
617
|
+
```js
|
|
618
|
+
// Simpan
|
|
619
|
+
await sock.sendMessage(jid, {
|
|
620
|
+
keep: m.key,
|
|
621
|
+
keepType: 1 // 1 = keep, 2 = unkeep
|
|
622
|
+
})
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
---
|
|
626
|
+
|
|
627
|
+
## 📞 Scheduled Call
|
|
628
|
+
|
|
629
|
+
```js
|
|
630
|
+
await sock.sendMessage(jid, {
|
|
631
|
+
call: {
|
|
632
|
+
time: Date.now() + 3600000,
|
|
633
|
+
type: 1, // 1 = voice, 2 = video
|
|
634
|
+
title: 'Meeting'
|
|
635
|
+
}
|
|
636
|
+
})
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
---
|
|
640
|
+
|
|
641
|
+
## 🔗 Group Invite
|
|
642
|
+
|
|
643
|
+
```js
|
|
644
|
+
await sock.sendMessage(jid, {
|
|
645
|
+
groupInvite: {
|
|
646
|
+
jid: 'xxx@g.us',
|
|
647
|
+
inviteCode: 'kode',
|
|
648
|
+
inviteExpiration: Date.now() + 86400000,
|
|
649
|
+
subject: 'Nama Grup',
|
|
650
|
+
text: 'Bergabunglah!'
|
|
651
|
+
}
|
|
652
|
+
})
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
---
|
|
656
|
+
|
|
657
|
+
## 🛍️ Product
|
|
658
|
+
|
|
659
|
+
```js
|
|
660
|
+
await sock.sendMessage(jid, {
|
|
661
|
+
product: {
|
|
662
|
+
productImage: fs.readFileSync('produk.jpg'),
|
|
663
|
+
productId: 'prod_123',
|
|
664
|
+
title: 'Nama Produk',
|
|
665
|
+
description: 'Deskripsi',
|
|
666
|
+
currencyCode: 'IDR',
|
|
667
|
+
priceAmount1000: 50000000,
|
|
668
|
+
retailerId: 'sku_001',
|
|
669
|
+
url: 'https://toko.example.com/produk'
|
|
670
|
+
},
|
|
671
|
+
businessOwnerJid: '628xxx@s.whatsapp.net' // wajib diisi
|
|
672
|
+
})
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
---
|
|
676
|
+
|
|
677
|
+
## 👁️ View Once
|
|
678
|
+
|
|
679
|
+
```js
|
|
680
|
+
await sock.sendMessage(jid, {
|
|
681
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
682
|
+
viewOnce: true
|
|
683
|
+
})
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
---
|
|
687
|
+
|
|
688
|
+
## 👁️ View Once V2
|
|
689
|
+
|
|
690
|
+
```js
|
|
691
|
+
await sock.sendMessage(jid, {
|
|
692
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
693
|
+
viewOnceV2: true // wrap ke viewOnceMessageV2
|
|
694
|
+
})
|
|
695
|
+
|
|
696
|
+
// viewOnceV2Extension
|
|
697
|
+
await sock.sendMessage(jid, {
|
|
698
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
699
|
+
viewOnceV2Extension: true
|
|
700
|
+
})
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
---
|
|
704
|
+
|
|
705
|
+
## ⏱️ Ephemeral
|
|
706
|
+
|
|
707
|
+
Wrap pesan ke dalam `ephemeralMessage`:
|
|
708
|
+
|
|
709
|
+
```js
|
|
710
|
+
await sock.sendMessage(jid, {
|
|
711
|
+
text: 'Pesan ini ephemeral',
|
|
712
|
+
ephemeral: true
|
|
713
|
+
})
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
---
|
|
717
|
+
|
|
718
|
+
## 🫣 Spoiler
|
|
719
|
+
|
|
720
|
+
Wrap pesan ke dalam `spoilerMessage`:
|
|
721
|
+
|
|
722
|
+
```js
|
|
723
|
+
await sock.sendMessage(jid, {
|
|
724
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
725
|
+
caption: 'Spoiler!',
|
|
726
|
+
spoiler: true
|
|
727
|
+
})
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
---
|
|
731
|
+
|
|
732
|
+
## 📢 Group Status Wrap
|
|
733
|
+
|
|
734
|
+
Wrap pesan biasa menjadi `groupStatusMessageV2`:
|
|
735
|
+
|
|
736
|
+
```js
|
|
737
|
+
await sock.sendMessage(jid, {
|
|
738
|
+
text: 'Status di grup ini',
|
|
739
|
+
groupStatus: true
|
|
740
|
+
})
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
---
|
|
744
|
+
|
|
745
|
+
## 🌀 Lottie Sticker
|
|
746
|
+
|
|
747
|
+
Wrap sticker ke dalam `lottieStickerMessage`:
|
|
748
|
+
|
|
749
|
+
```js
|
|
750
|
+
await sock.sendMessage(jid, {
|
|
751
|
+
sticker: fs.readFileSync('sticker.webp'),
|
|
752
|
+
isLottie: true
|
|
753
|
+
})
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
---
|
|
757
|
+
|
|
758
|
+
## 🔲 Buttons
|
|
759
|
+
|
|
760
|
+
Kirim pesan dengan tombol interaktif (plain buttons):
|
|
761
|
+
|
|
762
|
+
```js
|
|
763
|
+
// Dengan teks biasa
|
|
764
|
+
await sock.sendMessage(jid, {
|
|
765
|
+
text: 'Pilih salah satu:',
|
|
766
|
+
footer: 'Footer pesan',
|
|
767
|
+
buttons: [
|
|
768
|
+
{ id: 'btn1', text: 'Tombol 1' },
|
|
769
|
+
{ id: 'btn2', text: 'Tombol 2' },
|
|
770
|
+
{ id: 'btn3', text: 'Tombol 3' }
|
|
771
|
+
]
|
|
772
|
+
})
|
|
773
|
+
|
|
774
|
+
// Dengan gambar sebagai header
|
|
775
|
+
await sock.sendMessage(jid, {
|
|
776
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
777
|
+
caption: 'Isi pesan',
|
|
778
|
+
footer: 'Footer',
|
|
779
|
+
buttons: [
|
|
780
|
+
{ id: 'btn1', text: 'Pilih A' },
|
|
781
|
+
{ id: 'btn2', text: 'Pilih B' }
|
|
782
|
+
]
|
|
783
|
+
})
|
|
784
|
+
|
|
785
|
+
// Native flow button (single select dengan sections)
|
|
786
|
+
await sock.sendMessage(jid, {
|
|
787
|
+
text: 'Pilih menu:',
|
|
788
|
+
buttons: [
|
|
789
|
+
{
|
|
790
|
+
text: 'Buka Menu',
|
|
791
|
+
sections: [
|
|
792
|
+
{
|
|
793
|
+
title: 'Kategori A',
|
|
794
|
+
rows: [
|
|
795
|
+
{ id: 'row1', title: 'Item 1', description: 'Deskripsi' },
|
|
796
|
+
{ id: 'row2', title: 'Item 2' }
|
|
797
|
+
]
|
|
798
|
+
}
|
|
799
|
+
]
|
|
800
|
+
}
|
|
801
|
+
]
|
|
802
|
+
})
|
|
803
|
+
|
|
804
|
+
// Native flow button dengan name kustom
|
|
805
|
+
await sock.sendMessage(jid, {
|
|
806
|
+
text: 'Pilih:',
|
|
807
|
+
buttons: [
|
|
808
|
+
{ name: 'quick_reply', paramsJson: '{"id":"1"}', text: 'Quick Reply' }
|
|
809
|
+
]
|
|
810
|
+
})
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
---
|
|
814
|
+
|
|
815
|
+
## 📋 List Message
|
|
816
|
+
|
|
817
|
+
Kirim pesan daftar pilihan:
|
|
818
|
+
|
|
819
|
+
```js
|
|
820
|
+
await sock.sendMessage(jid, {
|
|
821
|
+
text: 'Silakan pilih:',
|
|
822
|
+
title: 'Judul List',
|
|
823
|
+
buttonText: 'Buka Daftar',
|
|
824
|
+
footer: 'Footer pesan',
|
|
825
|
+
sections: [
|
|
826
|
+
{
|
|
827
|
+
title: 'Bagian 1',
|
|
828
|
+
rows: [
|
|
829
|
+
{ id: 'row1', title: 'Pilihan A', description: 'Deskripsi A' },
|
|
830
|
+
{ id: 'row2', title: 'Pilihan B', description: 'Deskripsi B' }
|
|
831
|
+
]
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
title: 'Bagian 2',
|
|
835
|
+
rows: [
|
|
836
|
+
{ id: 'row3', title: 'Pilihan C' }
|
|
837
|
+
]
|
|
838
|
+
}
|
|
839
|
+
]
|
|
840
|
+
})
|
|
841
|
+
```
|
|
842
|
+
|
|
843
|
+
---
|
|
844
|
+
|
|
845
|
+
## 🗂️ Template Buttons
|
|
846
|
+
|
|
847
|
+
Tombol template (quick reply, URL, call) — tampil di WhatsApp Web/Desktop & iOS:
|
|
848
|
+
|
|
849
|
+
```js
|
|
850
|
+
// Dengan teks
|
|
851
|
+
await sock.sendMessage(jid, {
|
|
852
|
+
text: 'Pesan template',
|
|
853
|
+
footer: 'Footer',
|
|
854
|
+
id: 'template-unik',
|
|
855
|
+
templateButtons: [
|
|
856
|
+
{ id: 'btn1', text: 'Quick Reply' },
|
|
857
|
+
{ url: 'https://example.com', text: 'Kunjungi Website' },
|
|
858
|
+
{ call: '+62812345678', text: 'Hubungi Kami' }
|
|
859
|
+
]
|
|
860
|
+
})
|
|
861
|
+
|
|
862
|
+
// Dengan gambar sebagai header
|
|
863
|
+
await sock.sendMessage(jid, {
|
|
864
|
+
image: { url: 'https://example.com/img.jpg' },
|
|
865
|
+
caption: 'Isi pesan',
|
|
866
|
+
title: 'Judul',
|
|
867
|
+
footer: 'Footer',
|
|
868
|
+
templateButtons: [
|
|
869
|
+
{ id: 'btn1', text: 'Klik Sini' },
|
|
870
|
+
{ url: 'https://example.com', text: 'Buka Link' }
|
|
871
|
+
]
|
|
872
|
+
})
|
|
873
|
+
```
|
|
874
|
+
|
|
875
|
+
---
|
|
876
|
+
|
|
877
|
+
## 🌊 Native Flow
|
|
878
|
+
|
|
879
|
+
Pesan interaktif dengan native flow buttons (mendukung media header, audio footer):
|
|
880
|
+
|
|
881
|
+
```js
|
|
882
|
+
// Teks dengan native flow buttons
|
|
883
|
+
await sock.sendMessage(jid, {
|
|
884
|
+
text: 'Pilih aksi:',
|
|
885
|
+
footer: 'Footer pesan',
|
|
886
|
+
nativeFlow: [
|
|
887
|
+
{ name: 'quick_reply', paramsJson: '{"id":"1"}', text: 'Opsi 1' },
|
|
888
|
+
{ name: 'quick_reply', paramsJson: '{"id":"2"}', text: 'Opsi 2' }
|
|
889
|
+
]
|
|
890
|
+
})
|
|
891
|
+
|
|
892
|
+
// Dengan gambar sebagai header
|
|
893
|
+
await sock.sendMessage(jid, {
|
|
894
|
+
image: { url: 'https://example.com/img.jpg' },
|
|
895
|
+
caption: 'Isi pesan',
|
|
896
|
+
title: 'Judul',
|
|
897
|
+
subtitle: 'Subjudul',
|
|
898
|
+
footer: 'Footer',
|
|
899
|
+
nativeFlow: [
|
|
900
|
+
{ name: 'quick_reply', paramsJson: '{"id":"1"}', text: 'Tombol 1' }
|
|
901
|
+
]
|
|
902
|
+
})
|
|
903
|
+
|
|
904
|
+
// Dengan audio footer
|
|
905
|
+
await sock.sendMessage(jid, {
|
|
906
|
+
text: 'Pesan dengan audio footer',
|
|
907
|
+
audioFooter: fs.readFileSync('audio.ogg'),
|
|
908
|
+
nativeFlow: [
|
|
909
|
+
{ name: 'quick_reply', paramsJson: '{"id":"1"}', text: 'OK' }
|
|
910
|
+
]
|
|
911
|
+
})
|
|
912
|
+
|
|
913
|
+
// Wrap sebagai templateMessage
|
|
914
|
+
await sock.sendMessage(jid, {
|
|
915
|
+
text: 'Template interaktif',
|
|
916
|
+
nativeFlow: [
|
|
917
|
+
{ name: 'quick_reply', paramsJson: '{"id":"1"}', text: 'Tombol' }
|
|
918
|
+
],
|
|
919
|
+
interactiveAsTemplate: true,
|
|
920
|
+
id: 'template-id-unik'
|
|
921
|
+
})
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
---
|
|
925
|
+
|
|
926
|
+
## 🎠 Carousel
|
|
927
|
+
|
|
928
|
+
Pesan carousel dengan kartu-kartu (image/video/product per kartu):
|
|
929
|
+
|
|
930
|
+
```js
|
|
931
|
+
await sock.sendMessage(jid, {
|
|
932
|
+
text: 'Carousel utama',
|
|
933
|
+
footer: 'Footer utama',
|
|
934
|
+
cards: [
|
|
935
|
+
{
|
|
936
|
+
image: { url: 'https://example.com/1.jpg' },
|
|
937
|
+
title: 'Kartu 1',
|
|
938
|
+
caption: 'Deskripsi kartu 1',
|
|
939
|
+
footer: 'Footer kartu 1',
|
|
940
|
+
nativeFlow: [
|
|
941
|
+
{ name: 'quick_reply', paramsJson: '{"id":"c1"}', text: 'Pilih Ini' }
|
|
942
|
+
]
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
image: { url: 'https://example.com/2.jpg' },
|
|
946
|
+
title: 'Kartu 2',
|
|
947
|
+
caption: 'Deskripsi kartu 2',
|
|
948
|
+
nativeFlow: [
|
|
949
|
+
{ name: 'quick_reply', paramsJson: '{"id":"c2"}', text: 'Pilih Itu' },
|
|
950
|
+
{ url: 'https://example.com', text: 'Lihat Detail' }
|
|
951
|
+
]
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
video: { url: 'https://example.com/vid.mp4' },
|
|
955
|
+
caption: 'Video kartu',
|
|
956
|
+
nativeFlow: [
|
|
957
|
+
{ name: 'quick_reply', paramsJson: '{"id":"c3"}', text: 'Tonton' }
|
|
958
|
+
]
|
|
959
|
+
}
|
|
960
|
+
]
|
|
961
|
+
})
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
---
|
|
965
|
+
|
|
966
|
+
## 📝 List Reply
|
|
967
|
+
|
|
968
|
+
Balas pemilihan dari list message:
|
|
969
|
+
|
|
970
|
+
```js
|
|
971
|
+
await sock.sendMessage(jid, {
|
|
972
|
+
listReply: {
|
|
973
|
+
title: 'Pilihan yang dipilih',
|
|
974
|
+
description: 'Deskripsi pilihan',
|
|
975
|
+
id: 'row1'
|
|
976
|
+
}
|
|
977
|
+
})
|
|
978
|
+
```
|
|
979
|
+
|
|
980
|
+
---
|
|
981
|
+
|
|
982
|
+
## 🎴 Sticker Pack
|
|
983
|
+
|
|
984
|
+
Kirim paket sticker:
|
|
985
|
+
|
|
986
|
+
```js
|
|
987
|
+
await sock.sendMessage(jid, {
|
|
988
|
+
stickers: [
|
|
989
|
+
{
|
|
990
|
+
sticker: fs.readFileSync('sticker1.webp'),
|
|
991
|
+
metadata: { stickerPackId: 'pack123', stickerPackName: 'My Pack' }
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
sticker: fs.readFileSync('sticker2.webp')
|
|
995
|
+
}
|
|
996
|
+
]
|
|
997
|
+
})
|
|
998
|
+
```
|
|
999
|
+
|
|
1000
|
+
---
|
|
1001
|
+
|
|
1002
|
+
## 🔗 External Ad Reply
|
|
1003
|
+
|
|
1004
|
+
Tambahkan konteks iklan eksternal pada pesan (tampil sebagai preview besar di atas pesan):
|
|
1005
|
+
|
|
1006
|
+
```js
|
|
1007
|
+
await sock.sendMessage(jid, {
|
|
1008
|
+
text: 'Halo dari iklan!',
|
|
1009
|
+
externalAdReply: {
|
|
1010
|
+
title: 'Judul Iklan',
|
|
1011
|
+
body: 'Deskripsi singkat',
|
|
1012
|
+
url: 'https://example.com',
|
|
1013
|
+
thumbnail: fs.readFileSync('thumbnail.jpg'), // wajib Buffer
|
|
1014
|
+
mediaType: 1,
|
|
1015
|
+
largeThumbnail: true
|
|
1016
|
+
}
|
|
1017
|
+
})
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
---
|
|
1021
|
+
|
|
1022
|
+
## 💸 Request Payment
|
|
1023
|
+
|
|
1024
|
+
Minta pembayaran dari kontak (dibutuhkan teks atau sticker sebagai pesan catatan):
|
|
1025
|
+
|
|
1026
|
+
```js
|
|
1027
|
+
// Dengan teks
|
|
1028
|
+
await sock.sendMessage(jid, {
|
|
1029
|
+
text: 'Tolong bayar untuk pesanan ini',
|
|
1030
|
+
requestPaymentFrom: '628xxx@s.whatsapp.net',
|
|
1031
|
+
amount1000: 50000000, // nominal × 1000 (Rp50.000 → 50000000)
|
|
1032
|
+
currencyCodeIso4217: 'IDR',
|
|
1033
|
+
expiryTimestamp: Date.now() + 86400000
|
|
1034
|
+
})
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1037
|
+
---
|
|
1038
|
+
|
|
1039
|
+
## 🧾 Invoice
|
|
1040
|
+
|
|
1041
|
+
Kirim pesan invoice (butuh gambar atau dokumen sebagai lampiran):
|
|
1042
|
+
|
|
1043
|
+
```js
|
|
1044
|
+
// Invoice dengan gambar
|
|
1045
|
+
await sock.sendMessage(jid, {
|
|
1046
|
+
image: fs.readFileSync('invoice.jpg'),
|
|
1047
|
+
invoiceNote: 'Catatan invoice ini'
|
|
1048
|
+
})
|
|
1049
|
+
|
|
1050
|
+
// Invoice dengan PDF
|
|
1051
|
+
await sock.sendMessage(jid, {
|
|
1052
|
+
document: fs.readFileSync('invoice.pdf'),
|
|
1053
|
+
mimetype: 'application/pdf',
|
|
1054
|
+
fileName: 'invoice.pdf',
|
|
1055
|
+
invoiceNote: 'Invoice bulan ini'
|
|
1056
|
+
})
|
|
1057
|
+
```
|
|
1058
|
+
|
|
1059
|
+
---
|
|
1060
|
+
|
|
1061
|
+
## 🛒 Order
|
|
1062
|
+
|
|
1063
|
+
Kirim pesan pesanan (order):
|
|
1064
|
+
|
|
1065
|
+
```js
|
|
1066
|
+
await sock.sendMessage(jid, {
|
|
1067
|
+
orderText: 'Pesanan dari katalog',
|
|
1068
|
+
thumbnail: fs.readFileSync('thumbnail.jpg'), // wajib Buffer
|
|
1069
|
+
itemCount: 3,
|
|
1070
|
+
totalAmount1000: 150000000, // Rp150.000
|
|
1071
|
+
totalCurrencyCode: 'IDR'
|
|
1072
|
+
})
|
|
1073
|
+
```
|
|
1074
|
+
|
|
1075
|
+
---
|
|
1076
|
+
|
|
1077
|
+
## ⏳ Disappearing Messages
|
|
1078
|
+
|
|
1079
|
+
Aktifkan/nonaktifkan pesan menghilang di sebuah chat:
|
|
1080
|
+
|
|
1081
|
+
```js
|
|
1082
|
+
// Aktifkan (gunakan durasi default 7 hari)
|
|
1083
|
+
await sock.sendMessage(jid, { disappearingMessagesInChat: true })
|
|
1084
|
+
|
|
1085
|
+
// Nonaktifkan
|
|
1086
|
+
await sock.sendMessage(jid, { disappearingMessagesInChat: false })
|
|
1087
|
+
|
|
1088
|
+
// Durasi kustom (dalam detik)
|
|
1089
|
+
await sock.sendMessage(jid, { disappearingMessagesInChat: 86400 }) // 1 hari
|
|
1090
|
+
```
|
|
1091
|
+
|
|
1092
|
+
---
|
|
1093
|
+
|
|
1094
|
+
## 🧩 Raw Message
|
|
1095
|
+
|
|
1096
|
+
Kirim pesan proto langsung tanpa transformasi (untuk kasus advanced):
|
|
1097
|
+
|
|
1098
|
+
```js
|
|
1099
|
+
await sock.sendMessage(jid, {
|
|
1100
|
+
raw: true,
|
|
1101
|
+
extendedTextMessage: {
|
|
1102
|
+
text: 'Pesan raw',
|
|
1103
|
+
contextInfo: { ... }
|
|
1104
|
+
}
|
|
1105
|
+
})
|
|
1106
|
+
```
|
|
1107
|
+
|
|
1108
|
+
> ⚠️ Field `raw` akan di-delete sebelum dikirim. Sisa object digunakan apa adanya sebagai `WAProto.Message`.
|
|
1109
|
+
|
|
1110
|
+
---
|
|
1111
|
+
|
|
1112
|
+
## 🤖 Rich Message (AI)
|
|
1113
|
+
|
|
1114
|
+
Tipe pesan Rich — ditampilkan sebagai `botForwardedMessage` dengan rendering khusus (code highlight, tabel, links dengan citation). Cocok untuk bot AI.
|
|
1115
|
+
|
|
1116
|
+
### 💻 Code Block
|
|
1117
|
+
|
|
1118
|
+
```js
|
|
1119
|
+
await sock.sendMessage(jid, {
|
|
1120
|
+
code: 'console.log("Hello World")',
|
|
1121
|
+
language: 'javascript', // default: 'javascript'
|
|
1122
|
+
headerText: 'Contoh kode:',
|
|
1123
|
+
footerText: 'Semoga membantu!'
|
|
1124
|
+
})
|
|
1125
|
+
```
|
|
1126
|
+
|
|
1127
|
+
Bahasa yang didukung: `javascript`, `python`, `java`, `typescript`, `cpp`, `c`, `go`, `rust`, `php`, `ruby`, `swift`, `kotlin`, dll (sesuai `LANGUAGE_KEYWORDS` di `constants.js`).
|
|
1128
|
+
|
|
1129
|
+
---
|
|
1130
|
+
|
|
1131
|
+
### 🔗 Links (Rich)
|
|
1132
|
+
|
|
1133
|
+
Kirim teks dengan citation/referensi link inline:
|
|
1134
|
+
|
|
1135
|
+
```js
|
|
1136
|
+
await sock.sendMessage(jid, {
|
|
1137
|
+
links: [
|
|
1138
|
+
{
|
|
1139
|
+
text: 'Cek dokumentasi resmi',
|
|
1140
|
+
title: 'Judul Referensi',
|
|
1141
|
+
url: 'https://example.com',
|
|
1142
|
+
displayName: 'Nama Tautan',
|
|
1143
|
+
sources: [
|
|
1144
|
+
{
|
|
1145
|
+
displayName: 'Sumber 1',
|
|
1146
|
+
subtitle: 'Subjudul',
|
|
1147
|
+
url: 'https://source1.com'
|
|
1148
|
+
}
|
|
1149
|
+
]
|
|
1150
|
+
}
|
|
1151
|
+
],
|
|
1152
|
+
headerText: 'Info penting:',
|
|
1153
|
+
footerText: 'Sumber terpercaya'
|
|
1154
|
+
})
|
|
1155
|
+
```
|
|
1156
|
+
|
|
1157
|
+
---
|
|
1158
|
+
|
|
1159
|
+
### 📊 Table (Rich)
|
|
1160
|
+
|
|
1161
|
+
Kirim pesan dalam bentuk tabel:
|
|
1162
|
+
|
|
1163
|
+
```js
|
|
1164
|
+
await sock.sendMessage(jid, {
|
|
1165
|
+
table: [
|
|
1166
|
+
['Nama', 'Usia', 'Kota'], // baris pertama = header
|
|
1167
|
+
['Budi', '25', 'Jakarta'],
|
|
1168
|
+
['Sari', '22', 'Bandung'],
|
|
1169
|
+
['Andi', '30', 'Surabaya']
|
|
1170
|
+
],
|
|
1171
|
+
title: 'Data Pengguna',
|
|
1172
|
+
noHeading: false, // true = baris pertama bukan header
|
|
1173
|
+
headerText: 'Daftar data:',
|
|
1174
|
+
footerText: 'Total: 3 pengguna'
|
|
1175
|
+
})
|
|
1176
|
+
```
|
|
1177
|
+
|
|
1178
|
+
---
|
|
1179
|
+
|
|
1180
|
+
### 🎨 Rich Response (Gabungan)
|
|
1181
|
+
|
|
1182
|
+
Gabungkan teks, code block, dan tabel dalam satu pesan:
|
|
1183
|
+
|
|
1184
|
+
```js
|
|
1185
|
+
await sock.sendMessage(jid, {
|
|
1186
|
+
richResponse: [
|
|
1187
|
+
{
|
|
1188
|
+
text: 'Berikut contoh kode Python:',
|
|
1189
|
+
inlineEntities: [] // opsional
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
code: 'def greet(name):\n print(f"Hello, {name}!")',
|
|
1193
|
+
language: 'python'
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
text: 'Dan berikut tabelnya:'
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
table: [
|
|
1200
|
+
{ isHeading: true, items: ['Kolom A', 'Kolom B'] },
|
|
1201
|
+
{ isHeading: false, items: ['Data 1', 'Data 2'] }
|
|
1202
|
+
],
|
|
1203
|
+
title: 'Tabel Data'
|
|
1204
|
+
}
|
|
1205
|
+
],
|
|
1206
|
+
disclaimerText: 'Disclaimer di bawah pesan' // opsional
|
|
1207
|
+
})
|
|
1208
|
+
```
|
|
1209
|
+
|
|
1210
|
+
---
|
|
1211
|
+
|
|
1212
|
+
## 🎞️ Status Mention
|
|
1213
|
+
|
|
1214
|
+
Kirim pesan status (story) dan mention ke satu atau beberapa user/group sekaligus. `jid` diisi array.
|
|
1215
|
+
|
|
1216
|
+
```js
|
|
1217
|
+
// Mention ke user tertentu
|
|
1218
|
+
await sock.sendMessage(['628xxx@s.whatsapp.net', '628yyy@s.whatsapp.net'], {
|
|
1219
|
+
text: 'Halo! 👋'
|
|
1220
|
+
})
|
|
1221
|
+
|
|
1222
|
+
// Mention ke group (semua member grup otomatis masuk statusJidList)
|
|
1223
|
+
await sock.sendMessage(['xxx@g.us'], {
|
|
1224
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
1225
|
+
caption: 'Story dengan mention grup!'
|
|
1226
|
+
})
|
|
1227
|
+
|
|
1228
|
+
// Gabungan user dan grup
|
|
1229
|
+
await sock.sendMessage(['628xxx@s.whatsapp.net', 'yyy@g.us'], {
|
|
1230
|
+
text: 'Halo semua!'
|
|
1231
|
+
})
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
> Pesan akan dikirim ke `status@broadcast` lalu mention dikirim satu per satu ke masing-masing JID. Untuk grup, semua participant otomatis masuk ke `statusJidList`.
|
|
1235
|
+
|
|
1236
|
+
---
|
|
1237
|
+
|
|
1238
|
+
## 🤖 AI Icon
|
|
1239
|
+
|
|
1240
|
+
Tambahkan AI icon pada pesan. Hanya berfungsi di private chat (`@s.whatsapp.net`).
|
|
1241
|
+
|
|
1242
|
+
```js
|
|
1243
|
+
await sock.sendMessage(jid, {
|
|
1244
|
+
text: 'Pesan dengan AI icon 🤖',
|
|
1245
|
+
ai: true
|
|
1246
|
+
})
|
|
1247
|
+
|
|
1248
|
+
// Dengan media
|
|
1249
|
+
await sock.sendMessage(jid, {
|
|
1250
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
1251
|
+
caption: 'Gambar dari AI',
|
|
1252
|
+
ai: true
|
|
1253
|
+
}, { quoted: m })
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
> ⚠️ `ai: true` hanya bisa dipakai di chat private. Di grup atau newsletter akan throw error.
|
|
1257
|
+
|
|
1258
|
+
---
|
|
1259
|
+
|
|
1260
|
+
## 🏷️ Secure Meta Service Label
|
|
1261
|
+
|
|
1262
|
+
Tambahkan label layanan meta aman pada pesan (biz attributes).
|
|
1263
|
+
|
|
1264
|
+
```js
|
|
1265
|
+
await sock.sendMessage(jid, {
|
|
1266
|
+
text: 'Pesan dengan secure label',
|
|
1267
|
+
secureMetaServiceLabel: true
|
|
1268
|
+
})
|
|
1269
|
+
```
|
|
1270
|
+
|
|
1271
|
+
---
|
|
1272
|
+
|
|
1273
|
+
## Opsi Umum
|
|
1274
|
+
|
|
1275
|
+
Semua `sendMessage` mendukung opsi ke-3:
|
|
1276
|
+
|
|
1277
|
+
```js
|
|
1278
|
+
await sock.sendMessage(jid, content, {
|
|
1279
|
+
quoted: m, // reply/quote pesan
|
|
1280
|
+
ephemeralExpiration: 86400, // pesan hilang (detik)
|
|
1281
|
+
statusJidList: ['628xxx@s.whatsapp.net'], // kirim status ke JID
|
|
1282
|
+
mediaUploadTimeoutMs: 30000,
|
|
1283
|
+
backgroundColor: '#FF0000',
|
|
1284
|
+
font: 1
|
|
1285
|
+
})
|
|
1286
|
+
```
|
|
1287
|
+
|
|
1288
|
+
**Opsi tambahan di dalam content:**
|
|
1289
|
+
```js
|
|
1290
|
+
await sock.sendMessage(jid, {
|
|
1291
|
+
text: 'Pesan dengan opsi ekstra',
|
|
1292
|
+
mentions: ['628xxx@s.whatsapp.net'], // mention spesifik
|
|
1293
|
+
mentionAll: true, // mention semua (nonJidMentions)
|
|
1294
|
+
contextInfo: { ... } // contextInfo manual (di-merge)
|
|
1295
|
+
})
|
|
1296
|
+
```
|
|
1297
|
+
|
|
1298
|
+
---
|
|
1299
|
+
|
|
1300
|
+
## Tabel Semua Tipe Pesan
|
|
1301
|
+
|
|
1302
|
+
| Property | Tipe Proto | Keterangan |
|
|
1303
|
+
|---|---|---|
|
|
1304
|
+
| `text` | `extendedTextMessage` | Teks dengan link preview |
|
|
1305
|
+
| `image` | `imageMessage` | Gambar |
|
|
1306
|
+
| `video` | `videoMessage` | Video |
|
|
1307
|
+
| `audio` | `audioMessage` | Audio / Voice note (`ptt: true`) |
|
|
1308
|
+
| `document` | `documentMessage` | File/dokumen |
|
|
1309
|
+
| `sticker` | `stickerMessage` | Sticker WebP |
|
|
1310
|
+
| `stickers` | `stickerPackMessage` | Paket sticker |
|
|
1311
|
+
| `location` | `locationMessage` | Lokasi GPS |
|
|
1312
|
+
| `contacts` | `contactMessage` / `contactsArrayMessage` | Kontak vCard |
|
|
1313
|
+
| `react` | `reactionMessage` | Reaksi emoji |
|
|
1314
|
+
| `poll` | `pollCreationMessage` / `V2` / `V3` / `V5` | Poll / Quiz |
|
|
1315
|
+
| `pollResult` | `pollResultSnapshotMessage` / `V3` | Hasil poll |
|
|
1316
|
+
| `pollUpdate` | `pollUpdateMessage` | Update vote poll |
|
|
1317
|
+
| `forward` | *(inherit)* | Forward pesan |
|
|
1318
|
+
| `delete` | `protocolMessage (REVOKE)` | Hapus pesan |
|
|
1319
|
+
| `edit` | `protocolMessage (MESSAGE_EDIT)` | Edit pesan |
|
|
1320
|
+
| `pin` | `pinInChatMessage` | Pin/unpin pesan |
|
|
1321
|
+
| `keep` | `keepInChatMessage` | Simpan pesan |
|
|
1322
|
+
| `album` | `albumMessage` | Album foto/video |
|
|
1323
|
+
| `event` | `eventMessage` | Event/acara |
|
|
1324
|
+
| `groupStatusMessage` | *(dugong handler)* | Group Story/Status |
|
|
1325
|
+
| jid as array | `statusMentionMessage` / `groupStatusMentionMessage` | Kirim status + mention ke user/grup |
|
|
1326
|
+
| `groupInvite` | `groupInviteMessage` | Undangan grup |
|
|
1327
|
+
| `product` | `productMessage` | Produk katalog |
|
|
1328
|
+
| `flowReply` | `interactiveResponseMessage` | Balas native flow |
|
|
1329
|
+
| `buttonReply` | `templateButtonReplyMessage` / `buttonsResponseMessage` | Balas tombol |
|
|
1330
|
+
| `listReply` | `listResponseMessage` | Balas list |
|
|
1331
|
+
| `call` | *(scheduled call handler)* | Panggilan terjadwal |
|
|
1332
|
+
| `buttons` | `buttonsMessage` | Tombol interaktif |
|
|
1333
|
+
| `sections` | `listMessage` | Daftar pilihan |
|
|
1334
|
+
| `templateButtons` | `templateMessage` | Template buttons |
|
|
1335
|
+
| `nativeFlow` | `interactiveMessage` | Native flow buttons |
|
|
1336
|
+
| `cards` | `interactiveMessage (carouselMessage)` | Carousel cards |
|
|
1337
|
+
| `externalAdReply` | *(contextInfo inject)* | Preview iklan eksternal |
|
|
1338
|
+
| `requestPaymentFrom` | `requestPaymentMessage` | Minta pembayaran |
|
|
1339
|
+
| `invoiceNote` | `invoiceMessage` | Invoice |
|
|
1340
|
+
| `orderText` | `orderMessage` | Pesanan/order |
|
|
1341
|
+
| `disappearingMessagesInChat` | `protocolMessage (EPHEMERAL_SETTING)` | Pesan menghilang |
|
|
1342
|
+
| `code` | `botForwardedMessage (richResponseMessage)` | Code block (AI) |
|
|
1343
|
+
| `links` | `botForwardedMessage (richResponseMessage)` | Links dengan citation (AI) |
|
|
1344
|
+
| `table` | `botForwardedMessage (richResponseMessage)` | Tabel (AI) |
|
|
1345
|
+
| `richResponse` | `botForwardedMessage (richResponseMessage)` | Gabungan rich message (AI) |
|
|
1346
|
+
| `raw` | *(passthrough)* | Kirim proto langsung |
|
|
1347
|
+
| `ai` | *(bot node inject)* | AI icon pada pesan (private chat only) |
|
|
1348
|
+
| `secureMetaServiceLabel` | *(addBizAttributes)* | Secure meta service label |
|
|
1349
|
+
| `viewOnce` | `viewOnceMessage` | Lihat sekali |
|
|
1350
|
+
| `viewOnceV2` | `viewOnceMessageV2` | Lihat sekali V2 |
|
|
1351
|
+
| `viewOnceV2Extension` | `viewOnceMessageV2Extension` | Lihat sekali V2 extension |
|
|
1352
|
+
| `ephemeral` | `ephemeralMessage` | Wrap ephemeral |
|
|
1353
|
+
| `spoiler` | `spoilerMessage` | Wrap spoiler |
|
|
1354
|
+
| `groupStatus` | `groupStatusMessageV2` | Wrap group status |
|
|
1355
|
+
| `isLottie` | `lottieStickerMessage` | Wrap lottie sticker |
|
|
1356
|
+
|
|
1357
|
+
---
|
|
1358
|
+
|
|
1359
|
+
## File yang Dimodifikasi
|
|
1360
|
+
|
|
1361
|
+
| File | Keterangan |
|
|
1362
|
+
|---|---|
|
|
1363
|
+
| `lib/Socket/dugong.js` | Handler GROUP_STORY, ALBUM, EVENT, POLL_RESULT |
|
|
1364
|
+
| `lib/Socket/messages-send.js` | Route pesan + `getBizBinaryNode` dinamis |
|
|
1365
|
+
| `lib/Utils/messages.js` | Semua handler tipe pesan lengkap |
|
|
1366
|
+
| `lib/Utils/rich-message-utils.js` | Helper Rich Message / AI Response |
|
|
1367
|
+
| `lib/WABinary/generic-utils.js` | `getBizBinaryNode` dengan FLOWS_MAP |
|
|
1368
|
+
| `lib/Types/Message.js` | Export `ButtonType`, `ListType`, dll |
|
|
1369
|
+
| `lib/WABinary/constants.js` | `LANGUAGE_KEYWORDS` untuk syntax highlight |
|
|
1370
|
+
| `lib/Defaults/index.js` | `LEXER_REGEX`, `DONATE_URL`, `LIBRARY_NAME` |
|
|
1371
|
+
|
|
1372
|
+
---
|
|
1373
|
+
|
|
1374
|
+
<div align="center">Made with 💙 by NuiiS4TORU — For the Baileys Community</div>
|
|
1375
|
+
|
|
1376
|
+
> Project ini tidak berafiliasi dengan WhatsApp atau Meta. "WhatsApp" adalah merek dagang terdaftar dari pemiliknya masing-masing.
|