@nozez-lab/baileys 1.1.1 → 1.2.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 +22 -0
- package/README.md +630 -94
- package/WAProto/index.d.ts +15871 -0
- package/WAProto/index.js +115447 -0
- package/engine-requirements.js +13 -0
- package/lib/Defaults/index.d.ts +145 -0
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +152 -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 +8 -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 +11 -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 +7 -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 +12 -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 +13 -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 +17 -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 +55 -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 +21 -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 +6 -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 +395 -0
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +380 -0
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/chats.d.ts +137 -0
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +1214 -0
- package/lib/Socket/chats.js.map +1 -0
- package/lib/Socket/communities.d.ts +562 -0
- package/lib/Socket/communities.d.ts.map +1 -0
- package/lib/Socket/communities.js +432 -0
- package/lib/Socket/communities.js.map +1 -0
- package/lib/Socket/groups.d.ts +286 -0
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +348 -0
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +530 -0
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +12 -0
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +334 -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 +330 -0
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +1368 -0
- package/lib/Socket/messages-send.js.map +1 -0
- package/lib/Socket/mex.d.ts +2 -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 +283 -0
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +226 -0
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/socket.d.ts +61 -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 +421 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +2 -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 +3 -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 +3 -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 +12 -0
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +18 -0
- package/lib/Types/Message.js.map +1 -0
- package/lib/Types/Mex.d.ts +3 -0
- package/lib/Types/Mex.d.ts.map +1 -0
- package/lib/Types/Mex.js +39 -0
- package/lib/Types/Mex.js.map +1 -0
- package/lib/Types/Product.d.ts +2 -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 +2 -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 +2 -0
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +6 -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 +2 -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 +14 -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 +58 -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 +9 -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 +50 -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 +409 -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 +5 -0
- package/lib/Utils/companion-reg-client-utils.d.ts.map +1 -0
- package/lib/Utils/companion-reg-client-utils.js +40 -0
- package/lib/Utils/companion-reg-client-utils.js.map +1 -0
- package/lib/Utils/crypto.d.ts +40 -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 +84 -0
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +317 -0
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +13 -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 +64 -0
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +395 -0
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/history.d.ts +76 -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 +14 -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 +25 -0
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +25 -0
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +13 -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 +3 -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 +7 -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 +7 -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 +80 -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 +137 -0
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +843 -0
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +46 -0
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +1863 -0
- package/lib/Utils/messages.js.map +1 -0
- package/lib/Utils/noise-handler.d.ts +21 -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 +10 -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 +26 -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 +84 -0
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +749 -0
- package/lib/Utils/process-message.js.map +1 -0
- package/lib/Utils/reporting-utils.d.ts +13 -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 +370 -0
- package/lib/Utils/rich-message-utils.js.map +1 -0
- package/lib/Utils/signal.d.ts +83 -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 +17 -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 +3 -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 +30 -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 +11 -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 +109 -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 +44 -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 +62 -0
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +1467 -0
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +10 -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 +77 -0
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +226 -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 +29 -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 +2 -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 +8 -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 +34927 -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 +2 -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 +37 -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 +39 -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 +15 -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 +21 -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 +107 -26
- package/index.d.ts +0 -80
- package/index.js +0 -346
- package/test.js +0 -11
package/README.md
CHANGED
|
@@ -1,125 +1,661 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# ⚡ @nozez-lab/baileys
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<b>A powerful, production-ready WhatsApp library built on top of Baileys v7</b><br>
|
|
5
|
+
Interactive messages · Albums · Buttons · Lists · Pairing Code · and more
|
|
6
|
+
</p>
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://www.npmjs.com/package/@nozez-lab/baileys">
|
|
10
|
+
<img src="https://img.shields.io/npm/v/@nozez-lab/baileys?style=for-the-badge&logo=npm&color=CB3837" />
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@nozez-lab/baileys">
|
|
13
|
+
<img src="https://img.shields.io/npm/dm/@nozez-lab/baileys?style=for-the-badge&logo=npm&color=orange" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://github.com/nozez-lab/baileys">
|
|
16
|
+
<img src="https://img.shields.io/github/stars/nozez-lab/baileys?style=for-the-badge&logo=github&color=yellow" />
|
|
17
|
+
</a>
|
|
18
|
+
<a href="LICENSE">
|
|
19
|
+
<img src="https://img.shields.io/badge/license-MIT-blue?style=for-the-badge" />
|
|
20
|
+
</a>
|
|
21
|
+
<a href="https://nodejs.org">
|
|
22
|
+
<img src="https://img.shields.io/badge/node-%3E%3D20-339933?logo=node.js&labelColor=green&logoColor=white&style=for-the-badge" />
|
|
23
|
+
</a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 📋 Table of Contents
|
|
29
|
+
|
|
30
|
+
- [✨ What's Different](#-whats-different)
|
|
31
|
+
- [🔧 Internal Fixes](#-internal-fixes)
|
|
32
|
+
- [📦 Installation](#-installation)
|
|
33
|
+
- [🔌 Import (ESM & CJS)](#-import-esm--cjs)
|
|
34
|
+
- [🚀 Quick Start](#-quick-start)
|
|
35
|
+
- [🔐 Auth State](#-auth-state)
|
|
36
|
+
- [🗄️ Data Store](#-data-store)
|
|
37
|
+
- [🪪 WhatsApp IDs](#-whatsapp-ids)
|
|
38
|
+
- [✉️ Sending Messages](#-sending-messages)
|
|
39
|
+
- [📝 Text](#-text)
|
|
40
|
+
- [🔔 Mention](#-mention)
|
|
41
|
+
- [😄 Reaction](#-reaction)
|
|
42
|
+
- [📌 Pin Message](#-pin-message)
|
|
43
|
+
- [➡️ Forward Message](#-forward-message)
|
|
44
|
+
- [👤 Contact](#-contact)
|
|
45
|
+
- [📍 Location](#-location)
|
|
46
|
+
- [📅 Event](#-event)
|
|
47
|
+
- [👥 Group Invite](#-group-invite)
|
|
48
|
+
- [🛍️ Product](#-product)
|
|
49
|
+
- [📊 Poll](#-poll)
|
|
50
|
+
- [🖼️ Media Messages](#-media-messages)
|
|
51
|
+
- [🖼️ Image](#-image)
|
|
52
|
+
- [🎥 Video](#-video)
|
|
53
|
+
- [📃 Sticker](#-sticker)
|
|
54
|
+
- [💽 Audio](#-audio)
|
|
55
|
+
- [🗂️ Document](#-document)
|
|
56
|
+
- [🖼️ Album](#-album)
|
|
57
|
+
- [👉 Interactive Messages](#-interactive-messages)
|
|
58
|
+
- [📘 Buttons](#-buttons)
|
|
59
|
+
- [📋 List](#-list)
|
|
60
|
+
- [🗄️ Interactive](#-interactive)
|
|
61
|
+
- [♻️ Modify Messages](#-modify-messages)
|
|
62
|
+
- [🗑️ Delete](#-delete)
|
|
63
|
+
- [✏️ Edit](#-edit)
|
|
64
|
+
- [🧰 Utilities](#-utilities)
|
|
65
|
+
- [🔑 Custom Pairing Code](#-custom-pairing-code)
|
|
66
|
+
- [🖼️ Image Processing](#-image-processing)
|
|
67
|
+
- [📣 Newsletter](#-newsletter)
|
|
68
|
+
- [👥 Group Management](#-group-management)
|
|
69
|
+
- [👤 Profile Management](#-profile-management)
|
|
70
|
+
- [🔏 Privacy](#-privacy)
|
|
71
|
+
- [🔗 Fork Base](#-fork-base)
|
|
72
|
+
- [📣 Credits](#-credits)
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## ✨ What's Different
|
|
77
|
+
|
|
78
|
+
`@nozez-lab/baileys` adalah library WhatsApp yang dikustomisasi untuk kebutuhan bot modern:
|
|
79
|
+
|
|
80
|
+
- ✅ **Native Interactive Messages** — Buttons, Lists, Native Flows, Carousels, Templates
|
|
81
|
+
- ✅ **Album Support** — Kirim gambar/video dalam satu album
|
|
82
|
+
- ✅ **Sticker Pack** — Kirim sticker dalam satu paket
|
|
83
|
+
- ✅ **Pairing Code** — Koneksi mudah tanpa QR Code
|
|
84
|
+
- ✅ **No Obfuscation** — Kode bersih, mudah dibaca dan diaudit
|
|
85
|
+
- ✅ **No Auto-Follow** — Tidak ada behavior channel (newsletter) otomatis
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 🔧 Internal Fixes
|
|
90
|
+
|
|
91
|
+
- 🖼️ Perbaikan upload media ke newsletter (bug upstream)
|
|
92
|
+
- 🔄 Reimplementasi `makeInMemoryStore` dengan adaptasi minimal ESM untuk Baileys v7
|
|
93
|
+
- 📦 FFmpeg dijalankan dengan `spawn` bukan `exec` untuk keamanan proses
|
|
94
|
+
- 🗃️ Penambahan `@napi-rs/image` sebagai backend image processing di `getImageProcessingLibrary()`
|
|
95
|
+
- 💬 Dukungan quote message di dalam channel (newsletter)
|
|
96
|
+
- 🎀 Dukungan custom button icon pada interactive messages
|
|
6
97
|
|
|
7
98
|
---
|
|
8
99
|
|
|
9
100
|
## 📦 Installation
|
|
10
101
|
|
|
11
|
-
|
|
102
|
+
**Via `package.json`:**
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"dependencies": {
|
|
107
|
+
"@nozez-lab/baileys": "latest"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Via terminal:**
|
|
12
113
|
|
|
13
114
|
```bash
|
|
14
|
-
|
|
115
|
+
# Dari NPM
|
|
116
|
+
npm install @nozez-lab/baileys@latest
|
|
117
|
+
|
|
118
|
+
# Dari GitHub
|
|
119
|
+
npm install github:nozez-lab/baileys
|
|
15
120
|
```
|
|
16
121
|
|
|
17
|
-
|
|
122
|
+
### 🔌 Import (ESM & CJS)
|
|
18
123
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* **Built-in Phone Pairing** (`pairWithPhoneNumber`): Connect instantly by displaying the pairing code cleanly in the terminal.
|
|
124
|
+
```javascript
|
|
125
|
+
// ESM
|
|
126
|
+
import { makeWASocket } from '@nozez-lab/baileys'
|
|
23
127
|
|
|
24
|
-
|
|
128
|
+
// CJS (Node.js 24+)
|
|
129
|
+
const { makeWASocket } = require('@nozez-lab/baileys')
|
|
130
|
+
```
|
|
25
131
|
|
|
26
|
-
|
|
132
|
+
---
|
|
27
133
|
|
|
28
|
-
|
|
134
|
+
## 🚀 Quick Start
|
|
29
135
|
|
|
30
136
|
```javascript
|
|
31
|
-
|
|
32
|
-
|
|
137
|
+
import {
|
|
138
|
+
makeWASocket,
|
|
139
|
+
delay,
|
|
140
|
+
DisconnectReason,
|
|
141
|
+
useMultiFileAuthState
|
|
142
|
+
} from '@nozez-lab/baileys'
|
|
143
|
+
import { Boom } from '@hapi/boom'
|
|
144
|
+
import pino from 'pino'
|
|
145
|
+
|
|
146
|
+
const PHONE_NUMBER = '628xxxxxxxxxx'
|
|
147
|
+
const logger = pino({ level: 'silent' })
|
|
33
148
|
|
|
34
149
|
async function startBot() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
150
|
+
const { state, saveCreds } = await useMultiFileAuthState('session')
|
|
151
|
+
|
|
152
|
+
const sock = makeWASocket({ logger, auth: state })
|
|
153
|
+
|
|
154
|
+
sock.ev.on('creds.update', saveCreds)
|
|
155
|
+
|
|
156
|
+
sock.ev.on('connection.update', async (update) => {
|
|
157
|
+
const { connection, lastDisconnect } = update
|
|
158
|
+
|
|
159
|
+
if (connection === 'connecting' && !sock.authState.creds.registered) {
|
|
160
|
+
await delay(1500)
|
|
161
|
+
const code = await sock.requestPairingCode(PHONE_NUMBER)
|
|
162
|
+
console.log('🔗 Pairing Code:', code)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (connection === 'close') {
|
|
166
|
+
const shouldReconnect =
|
|
167
|
+
new Boom(lastDisconnect?.error)?.output?.statusCode !== DisconnectReason.loggedOut
|
|
168
|
+
if (shouldReconnect) startBot()
|
|
48
169
|
}
|
|
49
170
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// Serialize message to get custom helpers & body parser
|
|
62
|
-
const m = sock.serializeMessage(mek);
|
|
63
|
-
|
|
64
|
-
// Command handler example
|
|
65
|
-
if (m.body === '.menu') {
|
|
66
|
-
const buttons = [
|
|
67
|
-
{ type: 'reply', displayText: '📁 Show All Features', id: '.allfeatures' },
|
|
68
|
-
{ type: 'url', displayText: '🌐 Visit Website', url: 'https://nozez.dev' },
|
|
69
|
-
{ type: 'copy', displayText: '🔑 Copy API Key', code: 'API_KEY_12345' }
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
// Send buttons cleanly!
|
|
73
|
-
await m.replyButtons(
|
|
74
|
-
"🤖 NOZEZLAB SYSTEM", // Header (Optional)
|
|
75
|
-
"Welcome to KChartify Bot. Please select one option:", // Body text
|
|
76
|
-
"© NozezLab Ecosystem", // Footer (Optional)
|
|
77
|
-
buttons // Button list
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
171
|
+
if (connection === 'open') {
|
|
172
|
+
console.log('✅ Connected to WhatsApp')
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
sock.ev.on('messages.upsert', async ({ messages }) => {
|
|
177
|
+
for (const msg of messages) {
|
|
178
|
+
if (!msg.message) continue
|
|
179
|
+
console.log('📩 New message:', msg)
|
|
180
|
+
}
|
|
181
|
+
})
|
|
81
182
|
}
|
|
82
183
|
|
|
83
|
-
startBot()
|
|
184
|
+
startBot()
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 🔐 Auth State
|
|
188
|
+
|
|
189
|
+
> [!NOTE]
|
|
190
|
+
> Kamu bisa menggunakan `useSingleFileAuthState` atau `useSqliteAuthState` sebagai alternatif dari `useMultiFileAuthState`. `useSingleFileAuthState` sudah memiliki mekanisme cache internal, sehingga tidak perlu membungkus `state.keys` dengan `makeCacheableSignalKeyStore`.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 🗄️ Data Store
|
|
195
|
+
|
|
196
|
+
> [!CAUTION]
|
|
197
|
+
> Sangat disarankan untuk membuat data store sendiri. Menyimpan seluruh riwayat chat di memori dapat menyebabkan penggunaan RAM yang berlebihan.
|
|
198
|
+
|
|
199
|
+
```javascript
|
|
200
|
+
import {
|
|
201
|
+
makeWASocket,
|
|
202
|
+
makeInMemoryStore,
|
|
203
|
+
delay,
|
|
204
|
+
DisconnectReason,
|
|
205
|
+
useMultiFileAuthState
|
|
206
|
+
} from '@nozez-lab/baileys'
|
|
207
|
+
import pino from 'pino'
|
|
208
|
+
|
|
209
|
+
const logger = pino({ level: 'silent' })
|
|
210
|
+
const STORE_PATH = './store.json'
|
|
211
|
+
|
|
212
|
+
async function startBot() {
|
|
213
|
+
const { state, saveCreds } = await useMultiFileAuthState('session')
|
|
214
|
+
const sock = makeWASocket({ logger, auth: state })
|
|
215
|
+
|
|
216
|
+
const store = makeInMemoryStore({ logger, socket: sock })
|
|
217
|
+
store.bind(sock.ev)
|
|
218
|
+
|
|
219
|
+
sock.ev.on('creds.update', saveCreds)
|
|
220
|
+
sock.ev.on('chats.upsert', () => {
|
|
221
|
+
console.log('✉️ Chats:', store.chats.all())
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
store.readFromFile(STORE_PATH)
|
|
225
|
+
setInterval(() => store.writeToFile(STORE_PATH), 180_000)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
startBot()
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## 🪪 WhatsApp IDs
|
|
234
|
+
|
|
235
|
+
| Tipe | Format |
|
|
236
|
+
|------|--------|
|
|
237
|
+
| Personal | `628xxxxxxxxx@s.whatsapp.net` |
|
|
238
|
+
| LID | `12699999999@lid` |
|
|
239
|
+
| Group | `123456789-123345@g.us` |
|
|
240
|
+
| Meta AI | `11111111111@bot` |
|
|
241
|
+
| Broadcast | `[timestamp]@broadcast` |
|
|
242
|
+
| Status | `status@broadcast` |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## ✉️ Sending Messages
|
|
247
|
+
|
|
248
|
+
> [!NOTE]
|
|
249
|
+
> Dapatkan `jid` dari `message.key.remoteJid`.
|
|
250
|
+
|
|
251
|
+
### 📝 Text
|
|
252
|
+
|
|
253
|
+
```javascript
|
|
254
|
+
// Pesan teks biasa
|
|
255
|
+
sock.sendMessage(jid, { text: 'Halo! 👋' }, { quoted: message })
|
|
256
|
+
|
|
257
|
+
// Dengan link preview
|
|
258
|
+
sock.sendMessage(jid, {
|
|
259
|
+
text: 'Cek ini! https://github.com/nozez-lab/baileys',
|
|
260
|
+
linkPreview: {
|
|
261
|
+
'matched-text': 'https://github.com/nozez-lab/baileys',
|
|
262
|
+
title: '⚡ @nozez-lab/baileys',
|
|
263
|
+
description: 'WhatsApp bot library by Nozez',
|
|
264
|
+
previewType: 0
|
|
265
|
+
}
|
|
266
|
+
})
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### 🔔 Mention
|
|
270
|
+
|
|
271
|
+
```javascript
|
|
272
|
+
// Mention user tertentu
|
|
273
|
+
sock.sendMessage(jid, {
|
|
274
|
+
text: 'Halo @628123456789!',
|
|
275
|
+
mentions: ['628123456789@s.whatsapp.net']
|
|
276
|
+
}, { quoted: message })
|
|
277
|
+
|
|
278
|
+
// Mention semua anggota grup
|
|
279
|
+
sock.sendMessage(jid, {
|
|
280
|
+
text: 'Halo @all!',
|
|
281
|
+
mentionAll: true
|
|
282
|
+
}, { quoted: message })
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### 😄 Reaction
|
|
286
|
+
|
|
287
|
+
```javascript
|
|
288
|
+
sock.sendMessage(jid, {
|
|
289
|
+
react: { key: message.key, text: '⚡' }
|
|
290
|
+
})
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### 📌 Pin Message
|
|
294
|
+
|
|
295
|
+
```javascript
|
|
296
|
+
sock.sendMessage(jid, {
|
|
297
|
+
pin: message.key,
|
|
298
|
+
time: 86400, // 86400 (1h), 604800 (7d), 2592000 (30d)
|
|
299
|
+
type: 1 // 2 untuk unpin
|
|
300
|
+
})
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### ➡️ Forward Message
|
|
304
|
+
|
|
305
|
+
```javascript
|
|
306
|
+
sock.sendMessage(jid, {
|
|
307
|
+
forward: message,
|
|
308
|
+
force: true
|
|
309
|
+
})
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### 👤 Contact
|
|
313
|
+
|
|
314
|
+
```javascript
|
|
315
|
+
const vcard = [
|
|
316
|
+
'BEGIN:VCARD',
|
|
317
|
+
'VERSION:3.0',
|
|
318
|
+
'FN:Nozez',
|
|
319
|
+
'ORG:NozezLab;',
|
|
320
|
+
'TEL;type=CELL;type=VOICE;waid=628123456789:+62 812-3456-789',
|
|
321
|
+
'END:VCARD'
|
|
322
|
+
].join('\n')
|
|
323
|
+
|
|
324
|
+
sock.sendMessage(jid, {
|
|
325
|
+
contacts: {
|
|
326
|
+
displayName: 'Nozez',
|
|
327
|
+
contacts: [{ vcard }]
|
|
328
|
+
}
|
|
329
|
+
}, { quoted: message })
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### 📍 Location
|
|
333
|
+
|
|
334
|
+
```javascript
|
|
335
|
+
sock.sendMessage(jid, {
|
|
336
|
+
location: {
|
|
337
|
+
degreesLatitude: -6.2,
|
|
338
|
+
degreesLongitude: 106.8,
|
|
339
|
+
name: 'Jakarta, Indonesia'
|
|
340
|
+
}
|
|
341
|
+
}, { quoted: message })
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### 📅 Event
|
|
345
|
+
|
|
346
|
+
```javascript
|
|
347
|
+
sock.sendMessage(jid, {
|
|
348
|
+
event: {
|
|
349
|
+
name: '🎉 Community Meetup',
|
|
350
|
+
description: 'Kumpul bareng komunitas Nozez!',
|
|
351
|
+
startDate: new Date(Date.now() + 3600000),
|
|
352
|
+
endDate: new Date(Date.now() + 28800000),
|
|
353
|
+
location: {
|
|
354
|
+
name: 'Jakarta',
|
|
355
|
+
degreesLatitude: -6.2,
|
|
356
|
+
degreesLongitude: 106.8
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}, { quoted: message })
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### 👥 Group Invite
|
|
363
|
+
|
|
364
|
+
```javascript
|
|
365
|
+
const inviteCode = groupUrl.split('chat.whatsapp.com/')[1]?.split('?')[0]
|
|
366
|
+
|
|
367
|
+
sock.sendMessage(jid, {
|
|
368
|
+
groupInvite: {
|
|
369
|
+
inviteCode,
|
|
370
|
+
inviteExpiration: Date.now() + 86400000,
|
|
371
|
+
text: 'Gabung ke grup kita yuk!',
|
|
372
|
+
jid: '1201111111111@g.us',
|
|
373
|
+
subject: 'NozezLab Community'
|
|
374
|
+
}
|
|
375
|
+
}, { quoted: message })
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### 🛍️ Product
|
|
379
|
+
|
|
380
|
+
```javascript
|
|
381
|
+
import { randomUUID } from 'crypto'
|
|
382
|
+
|
|
383
|
+
sock.sendMessage(jid, {
|
|
384
|
+
image: { url: './product.jpg' },
|
|
385
|
+
body: 'Cek produk ini!',
|
|
386
|
+
footer: '@nozez-lab/baileys',
|
|
387
|
+
product: {
|
|
388
|
+
currencyCode: 'IDR',
|
|
389
|
+
description: 'Produk pilihan terbaik',
|
|
390
|
+
priceAmount1000: 50_000_000,
|
|
391
|
+
productId: randomUUID(),
|
|
392
|
+
productImageCount: 1,
|
|
393
|
+
title: 'Premium Package',
|
|
394
|
+
url: 'https://github.com/nozez-lab/baileys'
|
|
395
|
+
},
|
|
396
|
+
businessOwnerJid: '0@s.whatsapp.net'
|
|
397
|
+
})
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### 📊 Poll
|
|
401
|
+
|
|
402
|
+
```javascript
|
|
403
|
+
sock.sendMessage(jid, {
|
|
404
|
+
poll: {
|
|
405
|
+
name: '🔥 Vote sekarang!',
|
|
406
|
+
values: ['Ya', 'Tidak'],
|
|
407
|
+
selectableCount: 1,
|
|
408
|
+
endDate: new Date(Date.now() + 28800000)
|
|
409
|
+
}
|
|
410
|
+
}, { quoted: message })
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## 🖼️ Media Messages
|
|
416
|
+
|
|
417
|
+
### 🖼️ Image
|
|
418
|
+
|
|
419
|
+
```javascript
|
|
420
|
+
sock.sendMessage(jid, {
|
|
421
|
+
image: { url: './gambar.jpg' },
|
|
422
|
+
caption: 'Gambar keren! ✨'
|
|
423
|
+
}, { quoted: message })
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### 🎥 Video
|
|
427
|
+
|
|
428
|
+
```javascript
|
|
429
|
+
sock.sendMessage(jid, {
|
|
430
|
+
video: { url: './video.mp4' },
|
|
431
|
+
caption: 'Video keren!'
|
|
432
|
+
}, { quoted: message })
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### 📃 Sticker
|
|
436
|
+
|
|
437
|
+
```javascript
|
|
438
|
+
sock.sendMessage(jid, {
|
|
439
|
+
sticker: { url: './sticker.webp' }
|
|
440
|
+
}, { quoted: message })
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
### 💽 Audio
|
|
444
|
+
|
|
445
|
+
```javascript
|
|
446
|
+
sock.sendMessage(jid, {
|
|
447
|
+
audio: { url: './audio.mp3' },
|
|
448
|
+
mimetype: 'audio/mp4',
|
|
449
|
+
ptt: true // true = pesan suara, false = file audio
|
|
450
|
+
}, { quoted: message })
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### 🗂️ Document
|
|
454
|
+
|
|
455
|
+
```javascript
|
|
456
|
+
sock.sendMessage(jid, {
|
|
457
|
+
document: { url: './file.pdf' },
|
|
458
|
+
mimetype: 'application/pdf',
|
|
459
|
+
fileName: 'dokumen.pdf',
|
|
460
|
+
caption: 'Ini dokumennya'
|
|
461
|
+
}, { quoted: message })
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
### 🖼️ Album
|
|
465
|
+
|
|
466
|
+
```javascript
|
|
467
|
+
sock.sendMessage(jid, {
|
|
468
|
+
album: [
|
|
469
|
+
{ image: { url: './foto1.jpg' }, caption: 'Foto 1' },
|
|
470
|
+
{ image: { url: './foto2.jpg' }, caption: 'Foto 2' },
|
|
471
|
+
{ video: { url: './video.mp4' }, caption: 'Video' }
|
|
472
|
+
]
|
|
473
|
+
}, { quoted: message })
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
## 👉 Interactive Messages
|
|
479
|
+
|
|
480
|
+
### 📘 Buttons
|
|
481
|
+
|
|
482
|
+
```javascript
|
|
483
|
+
sock.sendMessage(jid, {
|
|
484
|
+
image: { url: './banner.jpg' },
|
|
485
|
+
body: 'Pilih menu di bawah ini:',
|
|
486
|
+
footer: '@nozez-lab/baileys',
|
|
487
|
+
buttons: [
|
|
488
|
+
{ id: '#menu', text: '📋 Menu Utama' },
|
|
489
|
+
{ id: '#info', text: 'ℹ️ Info' },
|
|
490
|
+
{ id: '#help', text: '🆘 Bantuan' }
|
|
491
|
+
]
|
|
492
|
+
}, { quoted: message })
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### 📋 List
|
|
496
|
+
|
|
497
|
+
```javascript
|
|
498
|
+
sock.sendMessage(jid, {
|
|
499
|
+
body: 'Pilih salah satu opsi:',
|
|
500
|
+
footer: '@nozez-lab/baileys',
|
|
501
|
+
button: '📋 Lihat Menu',
|
|
502
|
+
list: [
|
|
503
|
+
{
|
|
504
|
+
title: '🔧 Tools',
|
|
505
|
+
rows: [
|
|
506
|
+
{ id: '#ping', title: 'Ping', description: 'Cek koneksi bot' },
|
|
507
|
+
{ id: '#info', title: 'Info', description: 'Info bot' }
|
|
508
|
+
]
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
title: '🎮 Fun',
|
|
512
|
+
rows: [
|
|
513
|
+
{ id: '#game', title: 'Game', description: 'Main game' }
|
|
514
|
+
]
|
|
515
|
+
}
|
|
516
|
+
]
|
|
517
|
+
}, { quoted: message })
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
### 🗄️ Interactive
|
|
521
|
+
|
|
522
|
+
```javascript
|
|
523
|
+
sock.sendMessage(jid, {
|
|
524
|
+
body: 'Selamat datang!',
|
|
525
|
+
footer: 'Powered by @nozez-lab/baileys',
|
|
526
|
+
nativeFlowButtons: [
|
|
527
|
+
{
|
|
528
|
+
name: 'quick_reply',
|
|
529
|
+
buttonParamsJson: JSON.stringify({ display_text: '⚡ Mulai', id: '#start' })
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
name: 'cta_url',
|
|
533
|
+
buttonParamsJson: JSON.stringify({
|
|
534
|
+
display_text: '🔗 GitHub',
|
|
535
|
+
url: 'https://github.com/nozez-lab/baileys'
|
|
536
|
+
})
|
|
537
|
+
}
|
|
538
|
+
]
|
|
539
|
+
}, { quoted: message })
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
## ♻️ Modify Messages
|
|
545
|
+
|
|
546
|
+
### 🗑️ Delete
|
|
547
|
+
|
|
548
|
+
```javascript
|
|
549
|
+
// Hapus untuk semua
|
|
550
|
+
sock.sendMessage(jid, { delete: message.key })
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
### ✏️ Edit
|
|
554
|
+
|
|
555
|
+
```javascript
|
|
556
|
+
sock.sendMessage(jid, {
|
|
557
|
+
edit: message.key,
|
|
558
|
+
text: 'Pesan yang sudah diedit ✏️'
|
|
559
|
+
})
|
|
84
560
|
```
|
|
85
561
|
|
|
86
562
|
---
|
|
87
563
|
|
|
88
|
-
##
|
|
89
|
-
|
|
90
|
-
###
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
###
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
564
|
+
## 🧰 Utilities
|
|
565
|
+
|
|
566
|
+
### 🔑 Custom Pairing Code
|
|
567
|
+
|
|
568
|
+
```javascript
|
|
569
|
+
const code = await sock.requestPairingCode('628xxxxxxxxxx', 'NOZEZBOT')
|
|
570
|
+
console.log('🔑 Pairing Code:', code)
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
### 🖼️ Image Processing
|
|
574
|
+
|
|
575
|
+
```javascript
|
|
576
|
+
import { getImageProcessingLibrary } from '@nozez-lab/baileys'
|
|
577
|
+
|
|
578
|
+
const lib = await getImageProcessingLibrary()
|
|
579
|
+
console.log('Library yang digunakan:', lib)
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
### 📣 Newsletter (Channel)
|
|
583
|
+
|
|
584
|
+
```javascript
|
|
585
|
+
// Buat newsletter
|
|
586
|
+
const newsletter = await sock.createNewsLetter({
|
|
587
|
+
name: 'Nozez Updates',
|
|
588
|
+
description: 'Update terbaru dari Nozez',
|
|
589
|
+
picture: fs.readFileSync('./logo.jpg')
|
|
590
|
+
})
|
|
591
|
+
|
|
592
|
+
// Kirim pesan ke newsletter
|
|
593
|
+
sock.sendMessage(newsletter.id, { text: '📢 Pengumuman baru!' })
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
### 👥 Group Management
|
|
597
|
+
|
|
598
|
+
```javascript
|
|
599
|
+
// Buat grup
|
|
600
|
+
const group = await sock.groupCreate('Nama Grup', ['628xxx@s.whatsapp.net'])
|
|
601
|
+
|
|
602
|
+
// Tambah anggota
|
|
603
|
+
await sock.groupParticipantsUpdate(group.id, ['628xxx@s.whatsapp.net'], 'add')
|
|
604
|
+
|
|
605
|
+
// Kick anggota
|
|
606
|
+
await sock.groupParticipantsUpdate(group.id, ['628xxx@s.whatsapp.net'], 'remove')
|
|
607
|
+
|
|
608
|
+
// Promosi admin
|
|
609
|
+
await sock.groupParticipantsUpdate(group.id, ['628xxx@s.whatsapp.net'], 'promote')
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
### 👤 Profile Management
|
|
613
|
+
|
|
614
|
+
```javascript
|
|
615
|
+
// Update nama
|
|
616
|
+
await sock.updateProfileName('Nozez Bot')
|
|
617
|
+
|
|
618
|
+
// Update status
|
|
619
|
+
await sock.updateProfileStatus('Ditenagai oleh @nozez-lab/baileys ⚡')
|
|
620
|
+
|
|
621
|
+
// Update foto profil
|
|
622
|
+
await sock.updateProfilePicture(sock.user.id, { url: './foto.jpg' })
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
### 🔏 Privacy
|
|
626
|
+
|
|
627
|
+
```javascript
|
|
628
|
+
// Atur last seen
|
|
629
|
+
await sock.updateLastSeenPrivacy('contacts')
|
|
630
|
+
|
|
631
|
+
// Atur online
|
|
632
|
+
await sock.updateOnlinePrivacy('match_last_seen')
|
|
633
|
+
|
|
634
|
+
// Atur foto profil
|
|
635
|
+
await sock.updateProfilePicturePrivacy('contacts')
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
640
|
+
## 🔗 Fork Base
|
|
641
|
+
|
|
642
|
+
Proyek ini adalah fork dari:
|
|
643
|
+
|
|
644
|
+
> **[WhiskeySockets/Baileys](https://github.com/WhiskeySockets/Baileys)**
|
|
645
|
+
|
|
646
|
+
Semua kredit untuk proyek asli tetap diberikan sepenuhnya. Fork ini menambahkan fitur-fitur tambahan yang dibutuhkan untuk pengembangan bot WhatsApp modern.
|
|
120
647
|
|
|
121
648
|
---
|
|
122
649
|
|
|
123
|
-
##
|
|
650
|
+
## 📣 Credits
|
|
651
|
+
|
|
652
|
+
| Kontribusi | Penulis |
|
|
653
|
+
|-----------|---------|
|
|
654
|
+
| Library Baileys Original | [WhiskeySockets](https://github.com/WhiskeySockets) |
|
|
655
|
+
| Fork & Kustomisasi | [Nozez](https://github.com/nozez-lab) |
|
|
656
|
+
|
|
657
|
+
---
|
|
124
658
|
|
|
125
|
-
|
|
659
|
+
<p align="center">
|
|
660
|
+
Made with ❤️ by <a href="https://github.com/nozez-lab">Nozez</a>
|
|
661
|
+
</p>
|