@queenanya/baileys 8.6.0-beta → 9.0.2
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/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +4633 -0
- package/WAProto/fix-imports.js +29 -0
- package/WAProto/index.d.ts +2165 -45253
- package/WAProto/index.js +45236 -130529
- package/lib/Defaults/index.d.ts +14 -3
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +64 -55
- package/lib/Defaults/index.js.map +1 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +1 -0
- package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
- package/lib/Signal/Group/ciphertext-message.js +2 -5
- package/lib/Signal/Group/ciphertext-message.js.map +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +4 -3
- package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
- package/lib/Signal/Group/group-session-builder.js +7 -41
- package/lib/Signal/Group/group-session-builder.js.map +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +4 -4
- package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
- package/lib/Signal/Group/group_cipher.js +37 -51
- package/lib/Signal/Group/group_cipher.js.map +1 -0
- package/lib/Signal/Group/index.d.ts +12 -11
- package/lib/Signal/Group/index.d.ts.map +1 -0
- package/lib/Signal/Group/index.js +12 -57
- package/lib/Signal/Group/index.js.map +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +2 -1
- package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
- package/lib/Signal/Group/keyhelper.js +7 -44
- package/lib/Signal/Group/keyhelper.js.map +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +3 -2
- package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-chain-key.js +7 -15
- package/lib/Signal/Group/sender-chain-key.js.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +2 -1
- package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +8 -11
- package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +2 -1
- package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-message.js +9 -12
- package/lib/Signal/Group/sender-key-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-name.js +2 -5
- package/lib/Signal/Group/sender-key-name.js.map +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +3 -2
- package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-record.js +9 -21
- package/lib/Signal/Group/sender-key-record.js.map +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +7 -6
- package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-state.js +27 -42
- package/lib/Signal/Group/sender-key-state.js.map +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-message-key.js +4 -7
- package/lib/Signal/Group/sender-message-key.js.map +1 -0
- package/lib/Signal/libsignal.d.ts +5 -3
- package/lib/Signal/libsignal.d.ts.map +1 -0
- package/lib/Signal/libsignal.js +258 -90
- 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 +171 -0
- package/lib/Signal/lid-mapping.js.map +1 -0
- package/lib/Socket/Client/index.d.ts +3 -2
- package/lib/Socket/Client/index.d.ts.map +1 -0
- package/lib/Socket/Client/index.js +3 -18
- package/lib/Socket/Client/index.js.map +1 -0
- package/lib/Socket/Client/types.d.ts +2 -2
- package/lib/Socket/Client/types.d.ts.map +1 -0
- package/lib/Socket/Client/types.js +4 -6
- package/lib/Socket/Client/types.js.map +1 -0
- package/lib/Socket/Client/websocket.d.ts +2 -2
- package/lib/Socket/Client/websocket.d.ts.map +1 -0
- package/lib/Socket/Client/websocket.js +15 -37
- package/lib/Socket/Client/websocket.js.map +1 -0
- package/lib/Socket/business.d.ts +106 -94
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +159 -43
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/chats.d.ts +39 -27
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +271 -261
- package/lib/Socket/chats.js.map +1 -0
- package/lib/Socket/communities.d.ts +111 -86
- package/lib/Socket/communities.d.ts.map +1 -0
- package/lib/Socket/communities.js +138 -70
- package/lib/Socket/communities.js.map +1 -0
- package/lib/Socket/groups.d.ts +53 -43
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +94 -99
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +133 -108
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +17 -9
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +90 -82
- package/lib/Socket/messages-recv.d.ts.map +1 -0
- package/lib/Socket/messages-recv.js +635 -480
- package/lib/Socket/messages-recv.js.map +1 -0
- package/lib/Socket/messages-send.d.ts +90 -76
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +476 -402
- 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 +83 -73
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +181 -202
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/socket.d.ts +24 -16
- package/lib/Socket/socket.d.ts.map +1 -0
- package/lib/Socket/socket.js +402 -196
- package/lib/Socket/socket.js.map +1 -0
- package/lib/Types/Auth.d.ts +13 -5
- package/lib/Types/Auth.d.ts.map +1 -0
- package/lib/Types/Auth.js +2 -2
- 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 +1 -0
- package/lib/Types/Call.d.ts.map +1 -0
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Call.js.map +1 -0
- package/lib/Types/Chat.d.ts +18 -9
- package/lib/Types/Chat.d.ts.map +1 -0
- package/lib/Types/Chat.js +8 -4
- package/lib/Types/Chat.js.map +1 -0
- package/lib/Types/Contact.d.ts +5 -4
- package/lib/Types/Contact.d.ts.map +1 -0
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Contact.js.map +1 -0
- package/lib/Types/Events.d.ts +36 -33
- package/lib/Types/Events.d.ts.map +1 -0
- package/lib/Types/Events.js +2 -2
- package/lib/Types/Events.js.map +1 -0
- package/lib/Types/GroupMetadata.d.ts +12 -11
- package/lib/Types/GroupMetadata.d.ts.map +1 -0
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/GroupMetadata.js.map +1 -0
- package/lib/Types/Label.d.ts +12 -0
- package/lib/Types/Label.d.ts.map +1 -0
- package/lib/Types/Label.js +3 -5
- package/lib/Types/Label.js.map +1 -0
- package/lib/Types/LabelAssociation.d.ts +1 -0
- package/lib/Types/LabelAssociation.d.ts.map +1 -0
- package/lib/Types/LabelAssociation.js +3 -5
- package/lib/Types/LabelAssociation.js.map +1 -0
- package/lib/Types/Message.d.ts +51 -148
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +11 -7
- package/lib/Types/Message.js.map +1 -0
- package/lib/Types/Newsletter.d.ts +173 -71
- package/lib/Types/Newsletter.d.ts.map +1 -0
- package/lib/Types/Newsletter.js +54 -11
- package/lib/Types/Newsletter.js.map +1 -0
- package/lib/Types/Product.d.ts +2 -1
- package/lib/Types/Product.d.ts.map +1 -0
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Product.js.map +1 -0
- package/lib/Types/Signal.d.ts +20 -1
- package/lib/Types/Signal.d.ts.map +1 -0
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Signal.js.map +1 -0
- package/lib/Types/Socket.d.ts +34 -20
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +3 -2
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +14 -2
- package/lib/Types/State.d.ts.map +1 -0
- package/lib/Types/State.js +13 -2
- package/lib/Types/State.js.map +1 -0
- package/lib/Types/USync.d.ts +3 -2
- package/lib/Types/USync.d.ts.map +1 -0
- package/lib/Types/USync.js +2 -2
- package/lib/Types/USync.js.map +1 -0
- package/lib/Types/index.d.ts +15 -14
- package/lib/Types/index.d.ts.map +1 -0
- package/lib/Types/index.js +15 -31
- package/lib/Types/index.js.map +1 -0
- package/lib/Utils/auth-utils.d.ts +5 -4
- package/lib/Utils/auth-utils.d.ts.map +1 -0
- package/lib/Utils/auth-utils.js +199 -141
- package/lib/Utils/auth-utils.js.map +1 -0
- package/lib/Utils/baileys-event-stream.d.ts +2 -1
- package/lib/Utils/baileys-event-stream.d.ts.map +1 -0
- package/lib/Utils/baileys-event-stream.js +15 -22
- package/lib/Utils/baileys-event-stream.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 +3 -2
- package/lib/Utils/business.d.ts.map +1 -0
- package/lib/Utils/business.js +66 -69
- package/lib/Utils/business.js.map +1 -0
- package/lib/Utils/chat-utils.d.ts +11 -11
- package/lib/Utils/chat-utils.d.ts.map +1 -0
- package/lib/Utils/chat-utils.js +203 -194
- package/lib/Utils/chat-utils.js.map +1 -0
- package/lib/Utils/crypto.d.ts +8 -7
- package/lib/Utils/crypto.d.ts.map +1 -0
- package/lib/Utils/crypto.js +50 -101
- package/lib/Utils/crypto.js.map +1 -0
- package/lib/Utils/decode-wa-message.d.ts +18 -5
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +134 -62
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +6 -7
- package/lib/Utils/event-buffer.d.ts.map +1 -0
- package/lib/Utils/event-buffer.js +99 -69
- package/lib/Utils/event-buffer.js.map +1 -0
- package/lib/Utils/generics.d.ts +57 -68
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +179 -356
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/history.d.ts +10 -10
- package/lib/Utils/history.d.ts.map +1 -0
- package/lib/Utils/history.js +37 -50
- package/lib/Utils/history.js.map +1 -0
- package/lib/Utils/index.d.ts +21 -17
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +21 -33
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +4 -4
- package/lib/Utils/link-preview.d.ts.map +1 -0
- package/lib/Utils/link-preview.js +15 -56
- package/lib/Utils/link-preview.js.map +1 -0
- package/lib/Utils/logger.d.ts +8 -6
- package/lib/Utils/logger.d.ts.map +1 -0
- package/lib/Utils/logger.js +3 -7
- package/lib/Utils/logger.js.map +1 -0
- package/lib/Utils/lt-hash.d.ts +9 -8
- package/lib/Utils/lt-hash.d.ts.map +1 -0
- package/lib/Utils/lt-hash.js +23 -26
- package/lib/Utils/lt-hash.js.map +1 -0
- package/lib/Utils/make-mutex.d.ts +1 -0
- package/lib/Utils/make-mutex.d.ts.map +1 -0
- package/lib/Utils/make-mutex.js +7 -10
- package/lib/Utils/make-mutex.js.map +1 -0
- package/lib/Utils/message-retry-manager.d.ts +82 -0
- package/lib/Utils/message-retry-manager.d.ts.map +1 -0
- package/lib/Utils/message-retry-manager.js +149 -0
- package/lib/Utils/message-retry-manager.js.map +1 -0
- package/lib/Utils/messages-media.d.ts +32 -38
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +283 -496
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +11 -10
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +309 -519
- package/lib/Utils/messages.js.map +1 -0
- package/lib/Utils/noise-handler.d.ts +5 -4
- package/lib/Utils/noise-handler.d.ts.map +1 -0
- package/lib/Utils/noise-handler.js +23 -26
- package/lib/Utils/noise-handler.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 +12 -12
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +196 -155
- package/lib/Utils/process-message.js.map +1 -0
- package/lib/Utils/signal.d.ts +7 -6
- package/lib/Utils/signal.d.ts.map +1 -0
- package/lib/Utils/signal.js +70 -64
- package/lib/Utils/signal.js.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +2 -1
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +23 -27
- package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +3 -2
- package/lib/Utils/use-single-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-single-file-auth-state.js +63 -41
- package/lib/Utils/use-single-file-auth-state.js.map +1 -0
- package/lib/Utils/validate-connection.d.ts +4 -3
- package/lib/Utils/validate-connection.d.ts.map +1 -0
- package/lib/Utils/validate-connection.js +99 -77
- package/lib/Utils/validate-connection.js.map +1 -0
- package/lib/WABinary/constants.d.ts +1 -0
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +9 -11
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +2 -1
- package/lib/WABinary/decode.d.ts.map +1 -0
- package/lib/WABinary/decode.js +25 -52
- package/lib/WABinary/decode.js.map +1 -0
- package/lib/WABinary/encode.d.ts +2 -1
- package/lib/WABinary/encode.d.ts.map +1 -0
- package/lib/WABinary/encode.js +14 -48
- package/lib/WABinary/encode.js.map +1 -0
- package/lib/WABinary/generic-utils.d.ts +4 -3
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +31 -39
- package/lib/WABinary/generic-utils.js.map +1 -0
- package/lib/WABinary/index.d.ts +6 -5
- package/lib/WABinary/index.d.ts.map +1 -0
- package/lib/WABinary/index.js +6 -21
- package/lib/WABinary/index.js.map +1 -0
- package/lib/WABinary/jid-utils.d.ts +21 -11
- package/lib/WABinary/jid-utils.d.ts.map +1 -0
- package/lib/WABinary/jid-utils.js +71 -60
- package/lib/WABinary/jid-utils.js.map +1 -0
- package/lib/WABinary/types.d.ts +2 -1
- package/lib/WABinary/types.d.ts.map +1 -0
- package/lib/WABinary/types.js +2 -2
- package/lib/WABinary/types.js.map +1 -0
- package/lib/WAM/BinaryInfo.d.ts +2 -1
- package/lib/WAM/BinaryInfo.d.ts.map +1 -0
- package/lib/WAM/BinaryInfo.js +2 -5
- package/lib/WAM/BinaryInfo.js.map +1 -0
- package/lib/WAM/constants.d.ts +5 -3
- package/lib/WAM/constants.d.ts.map +1 -0
- package/lib/WAM/constants.js +19071 -11568
- package/lib/WAM/constants.js.map +1 -0
- package/lib/WAM/encode.d.ts +2 -1
- package/lib/WAM/encode.d.ts.map +1 -0
- package/lib/WAM/encode.js +17 -22
- package/lib/WAM/encode.js.map +1 -0
- package/lib/WAM/index.d.ts +4 -3
- package/lib/WAM/index.d.ts.map +1 -0
- package/lib/WAM/index.js +4 -19
- package/lib/WAM/index.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +8 -11
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +11 -14
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +8 -11
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +9 -13
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +20 -22
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +5 -3
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +13 -8
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +5 -4
- package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/index.js +5 -20
- package/lib/WAUSync/Protocols/index.js.map +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +5 -4
- package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
- package/lib/WAUSync/USyncQuery.js +40 -35
- package/lib/WAUSync/USyncQuery.js.map +1 -0
- package/lib/WAUSync/USyncUser.d.ts +6 -5
- package/lib/WAUSync/USyncUser.d.ts.map +1 -0
- package/lib/WAUSync/USyncUser.js +2 -5
- package/lib/WAUSync/USyncUser.js.map +1 -0
- package/lib/WAUSync/index.d.ts +4 -3
- package/lib/WAUSync/index.d.ts.map +1 -0
- package/lib/WAUSync/index.js +4 -19
- package/lib/WAUSync/index.js.map +1 -0
- package/lib/index.d.ts +10 -12
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +11 -34
- package/lib/index.js.map +1 -0
- package/package.json +55 -65
- package/CHANGELOG.md +0 -4
- package/README-anya.md +0 -459
- package/README-shizo.md +0 -445
- package/README-whiskey.md +0 -44
- package/lib/Defaults/baileys-version.json +0 -3
- package/lib/Signal/Group/queue-job.d.ts +0 -1
- package/lib/Signal/Group/queue-job.js +0 -57
- package/lib/Socket/usync.d.ts +0 -36
- package/lib/Socket/usync.js +0 -70
- package/lib/Store/index.d.ts +0 -2
- package/lib/Store/index.js +0 -8
- package/lib/Store/make-in-memory-store.d.ts +0 -118
- package/lib/Store/make-in-memory-store.js +0 -429
- package/lib/Store/make-ordered-dictionary.d.ts +0 -13
- package/lib/Store/make-ordered-dictionary.js +0 -81
- package/lib/Store/object-repository.d.ts +0 -10
- package/lib/Store/object-repository.js +0 -27
- package/lib/WAMedia/index.d.ts +0 -2
- package/lib/WAMedia/index.js +0 -18
- package/lib/WAMedia/media-messages.d.ts +0 -18
- package/lib/WAMedia/media-messages.js +0 -102
- package/lib/WAMedia/media-set.d.ts +0 -9
- package/lib/WAMedia/media-set.js +0 -312
package/lib/WAMedia/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./media-messages"), exports);
|
|
18
|
-
__exportStar(require("./media-set"), exports);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { WAMediaUpload } from '../Types';
|
|
2
|
-
export declare const generateProfilePictureFull: (img: any) => Promise<{
|
|
3
|
-
img: Buffer<ArrayBufferLike>;
|
|
4
|
-
}>;
|
|
5
|
-
export declare const generateProfilePictureFP: (buffer: any) => Promise<{
|
|
6
|
-
img: Buffer<ArrayBufferLike>;
|
|
7
|
-
preview: Buffer<ArrayBufferLike>;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const generatePP: (buffer: any) => Promise<{
|
|
10
|
-
img: Buffer<ArrayBufferLike>;
|
|
11
|
-
preview: Buffer<ArrayBufferLike>;
|
|
12
|
-
}>;
|
|
13
|
-
export declare const generateProfilePicturee: (mediaUpload: WAMediaUpload) => Promise<{
|
|
14
|
-
img: Buffer<ArrayBufferLike>;
|
|
15
|
-
}>;
|
|
16
|
-
export declare const changeprofileFull: (img: any) => Promise<{
|
|
17
|
-
img: any;
|
|
18
|
-
}>;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.changeprofileFull = exports.generateProfilePicturee = exports.generatePP = exports.generateProfilePictureFP = exports.generateProfilePictureFull = void 0;
|
|
7
|
-
const jimp_1 = __importDefault(require("jimp"));
|
|
8
|
-
const jimp_2 = require("jimp");
|
|
9
|
-
const toBuffer = async (stream) => {
|
|
10
|
-
const chunks = [];
|
|
11
|
-
for await (const chunk of stream) {
|
|
12
|
-
chunks.push(chunk);
|
|
13
|
-
}
|
|
14
|
-
stream.destroy();
|
|
15
|
-
return Buffer.concat(chunks);
|
|
16
|
-
};
|
|
17
|
-
const generateProfilePictureFull = async (img) => {
|
|
18
|
-
const jimp = await (0, jimp_2.read)(img);
|
|
19
|
-
const min = Math.min(jimp.getWidth(), jimp.getHeight());
|
|
20
|
-
const cropped = jimp.crop(0, 0, jimp.getWidth(), jimp.getHeight());
|
|
21
|
-
let width = jimp.getWidth(), hight = jimp.getHeight(), ratio;
|
|
22
|
-
if (width > hight) {
|
|
23
|
-
ratio = jimp.getWidth() / 720;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
ratio = jimp.getWidth() / 324;
|
|
27
|
-
}
|
|
28
|
-
;
|
|
29
|
-
width = width / ratio;
|
|
30
|
-
hight = hight / ratio;
|
|
31
|
-
img = cropped.quality(100).resize(width, hight).getBufferAsync(jimp_2.MIME_JPEG);
|
|
32
|
-
return {
|
|
33
|
-
img: await cropped.quality(100).resize(width, hight).getBufferAsync(jimp_2.MIME_JPEG),
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
exports.generateProfilePictureFull = generateProfilePictureFull;
|
|
37
|
-
const generateProfilePictureFP = async (buffer) => {
|
|
38
|
-
const jimp = await jimp_1.default.read(buffer);
|
|
39
|
-
const min = jimp.getWidth();
|
|
40
|
-
const max = jimp.getHeight();
|
|
41
|
-
const cropped = jimp.crop(0, 0, min, max);
|
|
42
|
-
return {
|
|
43
|
-
img: await cropped.scaleToFit(720, 720).getBufferAsync(jimp_1.default.MIME_JPEG),
|
|
44
|
-
preview: await cropped.normalize().getBufferAsync(jimp_1.default.MIME_JPEG),
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
exports.generateProfilePictureFP = generateProfilePictureFP;
|
|
48
|
-
const generatePP = async (buffer) => {
|
|
49
|
-
const jimp = await jimp_1.default.read(buffer);
|
|
50
|
-
const min = jimp.getWidth();
|
|
51
|
-
const max = jimp.getHeight();
|
|
52
|
-
const cropped = jimp.crop(0, 0, min, max);
|
|
53
|
-
return {
|
|
54
|
-
img: await cropped.scaleToFit(720, 720).getBufferAsync(jimp_1.default.MIME_JPEG),
|
|
55
|
-
preview: await cropped.normalize().getBufferAsync(jimp_1.default.MIME_JPEG),
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
exports.generatePP = generatePP;
|
|
59
|
-
const generateProfilePicturee = async (mediaUpload) => {
|
|
60
|
-
let bufferOrFilePath;
|
|
61
|
-
let img;
|
|
62
|
-
if (Buffer.isBuffer(mediaUpload)) {
|
|
63
|
-
bufferOrFilePath = mediaUpload;
|
|
64
|
-
}
|
|
65
|
-
else if ('url' in mediaUpload) {
|
|
66
|
-
bufferOrFilePath = mediaUpload.url.toString();
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
bufferOrFilePath = await toBuffer(mediaUpload.stream);
|
|
70
|
-
}
|
|
71
|
-
const jimp = await jimp_1.default.read(bufferOrFilePath);
|
|
72
|
-
const cropped = jimp.getWidth() > jimp.getHeight() ? jimp.resize(720, -1) : jimp.resize(-1, 720);
|
|
73
|
-
img = cropped
|
|
74
|
-
.quality(100)
|
|
75
|
-
.getBufferAsync(jimp_1.default.MIME_JPEG);
|
|
76
|
-
return {
|
|
77
|
-
img: await img,
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
exports.generateProfilePicturee = generateProfilePicturee;
|
|
81
|
-
const changeprofileFull = async (img) => {
|
|
82
|
-
const Jimp = require('jimp');
|
|
83
|
-
const { read, MIME_JPEG, RESIZE_BILINEAR } = require('jimp');
|
|
84
|
-
const jimp = await read(img);
|
|
85
|
-
const min = Math.min(jimp.getWidth(), jimp.getHeight());
|
|
86
|
-
const cropped = jimp.crop(0, 0, jimp.getWidth(), jimp.getHeight());
|
|
87
|
-
let width = jimp.getWidth(), hight = jimp.getHeight(), ratio;
|
|
88
|
-
if (width > hight) {
|
|
89
|
-
ratio = jimp.getWidth() / 720;
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
ratio = jimp.getWidth() / 324;
|
|
93
|
-
}
|
|
94
|
-
;
|
|
95
|
-
width = width / ratio;
|
|
96
|
-
hight = hight / ratio;
|
|
97
|
-
img = cropped.quality(100).resize(width, hight).getBufferAsync(MIME_JPEG);
|
|
98
|
-
return {
|
|
99
|
-
img: await cropped.quality(100).resize(width, hight).getBufferAsync(MIME_JPEG),
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
exports.changeprofileFull = changeprofileFull;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** update the profile picture for yourself or a group as Full */
|
|
2
|
-
export declare const updateProfilePictureFull: (jid: any, content: any, sock: any) => Promise<any>;
|
|
3
|
-
export declare const updateProfilePictureFull2: (jid: any, content: any, sock: any) => Promise<any>;
|
|
4
|
-
export declare const sendStatusMentionsF: (jid: any, content: any, sock: any) => Promise<import("..").proto.WebMessageInfo>;
|
|
5
|
-
export declare const sendStatusMentionsFV2: (jid: any, content: any, sock: any) => Promise<import("..").proto.WebMessageInfo>;
|
|
6
|
-
export declare const sendStatusMentions: (jid: any, content: any, sock: any) => Promise<import("..").proto.WebMessageInfo>;
|
|
7
|
-
export declare const sendStatusMentionsV2: (jid: any, content: any, sock: any) => Promise<import("..").proto.WebMessageInfo>;
|
|
8
|
-
export declare const sendStatusMentionsH: (jid: any, content: any, sock: any) => Promise<import("..").proto.WebMessageInfo>;
|
|
9
|
-
export declare const sendStatusMentionsHV2: (jid: any, content: any, sock: any) => Promise<import("..").proto.WebMessageInfo>;
|
package/lib/WAMedia/media-set.js
DELETED
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendStatusMentionsHV2 = exports.sendStatusMentionsH = exports.sendStatusMentionsV2 = exports.sendStatusMentions = exports.sendStatusMentionsFV2 = exports.sendStatusMentionsF = exports.updateProfilePictureFull2 = exports.updateProfilePictureFull = void 0;
|
|
4
|
-
const crypto_1 = require("crypto");
|
|
5
|
-
const WABinary_1 = require("../WABinary");
|
|
6
|
-
const Utils_1 = require("../Utils");
|
|
7
|
-
const media_messages_1 = require("./media-messages");
|
|
8
|
-
/** update the profile picture for yourself or a group as Full */
|
|
9
|
-
const updateProfilePictureFull = async (jid, content, sock) => {
|
|
10
|
-
let JidTO;
|
|
11
|
-
if (jid.endsWith(WABinary_1.S_WHATSAPP_NET)) {
|
|
12
|
-
JidTO = WABinary_1.S_WHATSAPP_NET;
|
|
13
|
-
}
|
|
14
|
-
else if (jid.endsWith(WABinary_1.C_US)) {
|
|
15
|
-
JidTO = WABinary_1.C_US;
|
|
16
|
-
}
|
|
17
|
-
else if (jid.endsWith(WABinary_1.LID)) {
|
|
18
|
-
JidTO = WABinary_1.LID;
|
|
19
|
-
}
|
|
20
|
-
const { query } = sock;
|
|
21
|
-
const { img } = await (0, media_messages_1.generateProfilePictureFP)(content);
|
|
22
|
-
const media = await query({
|
|
23
|
-
tag: 'iq',
|
|
24
|
-
attrs: {
|
|
25
|
-
target: jid,
|
|
26
|
-
to: JidTO,
|
|
27
|
-
type: 'set',
|
|
28
|
-
xmlns: 'w:profile:picture'
|
|
29
|
-
},
|
|
30
|
-
content: [
|
|
31
|
-
{
|
|
32
|
-
tag: 'picture',
|
|
33
|
-
attrs: { type: 'image' },
|
|
34
|
-
content: img
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
});
|
|
38
|
-
return media;
|
|
39
|
-
};
|
|
40
|
-
exports.updateProfilePictureFull = updateProfilePictureFull;
|
|
41
|
-
const updateProfilePictureFull2 = async (jid, content, sock) => {
|
|
42
|
-
let JidTO;
|
|
43
|
-
if (jid.endsWith(WABinary_1.S_WHATSAPP_NET)) {
|
|
44
|
-
JidTO = WABinary_1.S_WHATSAPP_NET;
|
|
45
|
-
}
|
|
46
|
-
else if (jid.endsWith(WABinary_1.C_US)) {
|
|
47
|
-
JidTO = WABinary_1.C_US;
|
|
48
|
-
}
|
|
49
|
-
else if (jid.endsWith(WABinary_1.LID)) {
|
|
50
|
-
JidTO = WABinary_1.LID;
|
|
51
|
-
}
|
|
52
|
-
const { query } = sock;
|
|
53
|
-
const { preview } = await (0, media_messages_1.generatePP)(content);
|
|
54
|
-
const media = await query({
|
|
55
|
-
tag: 'iq',
|
|
56
|
-
attrs: {
|
|
57
|
-
target: jid,
|
|
58
|
-
to: JidTO,
|
|
59
|
-
type: 'set',
|
|
60
|
-
xmlns: 'w:profile:picture'
|
|
61
|
-
},
|
|
62
|
-
content: [
|
|
63
|
-
{
|
|
64
|
-
tag: 'picture',
|
|
65
|
-
attrs: { type: 'image' },
|
|
66
|
-
content: preview
|
|
67
|
-
}
|
|
68
|
-
]
|
|
69
|
-
});
|
|
70
|
-
return media;
|
|
71
|
-
};
|
|
72
|
-
exports.updateProfilePictureFull2 = updateProfilePictureFull2;
|
|
73
|
-
// send mention msg in group chat or private chat
|
|
74
|
-
const sendStatusMentionsF = async (jid, content, sock) => {
|
|
75
|
-
const { waUploadToServer, relayMessage, groupMetadata } = sock;
|
|
76
|
-
const media = await (0, Utils_1.generateWAMessage)(WABinary_1.STORIES_JID, content, {
|
|
77
|
-
upload: await waUploadToServer,
|
|
78
|
-
backgroundColor: "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"),
|
|
79
|
-
font: content.text ? Math.floor(Math.random() * 9) : undefined,
|
|
80
|
-
userJid: jid
|
|
81
|
-
});
|
|
82
|
-
const additionalNodes = [{
|
|
83
|
-
tag: 'meta',
|
|
84
|
-
attrs: {},
|
|
85
|
-
content: [{
|
|
86
|
-
tag: 'mentioned_users',
|
|
87
|
-
attrs: {},
|
|
88
|
-
content: [{
|
|
89
|
-
tag: 'to',
|
|
90
|
-
attrs: { jid }
|
|
91
|
-
}]
|
|
92
|
-
}]
|
|
93
|
-
}];
|
|
94
|
-
const isPrivate = (0, WABinary_1.isJidUser)(jid);
|
|
95
|
-
const statusJid = isPrivate ? [jid] : (await groupMetadata(jid)).participants.map(p => p.id);
|
|
96
|
-
await relayMessage(WABinary_1.STORIES_JID, media.message, {
|
|
97
|
-
messageId: media.key.id,
|
|
98
|
-
statusJidList: statusJid,
|
|
99
|
-
additionalNodes
|
|
100
|
-
});
|
|
101
|
-
const messageType = isPrivate ? 'statusMentionMessage' : 'groupStatusMentionMessage';
|
|
102
|
-
const msg = await (0, Utils_1.generateWAMessageFromContent)(jid, {
|
|
103
|
-
[messageType]: {
|
|
104
|
-
message: {
|
|
105
|
-
protocolMessage: {
|
|
106
|
-
key: media.key,
|
|
107
|
-
type: 25
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}, { userJid: jid });
|
|
112
|
-
await relayMessage(jid, msg.message, {});
|
|
113
|
-
return media;
|
|
114
|
-
};
|
|
115
|
-
exports.sendStatusMentionsF = sendStatusMentionsF;
|
|
116
|
-
const sendStatusMentionsFV2 = async (jid, content, sock) => {
|
|
117
|
-
const { waUploadToServer, relayMessage, groupMetadata } = sock;
|
|
118
|
-
const media = await (0, Utils_1.generateWAMessage)(WABinary_1.STORIES_JID, content, {
|
|
119
|
-
upload: await waUploadToServer,
|
|
120
|
-
backgroundColor: "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"),
|
|
121
|
-
font: content.text ? Math.floor(Math.random() * 9) : undefined,
|
|
122
|
-
userJid: jid
|
|
123
|
-
});
|
|
124
|
-
const additionalNodes = [{
|
|
125
|
-
tag: 'meta',
|
|
126
|
-
attrs: {},
|
|
127
|
-
content: [{
|
|
128
|
-
tag: 'mentioned_users',
|
|
129
|
-
attrs: {},
|
|
130
|
-
content: [{
|
|
131
|
-
tag: 'to',
|
|
132
|
-
attrs: { jid }
|
|
133
|
-
}]
|
|
134
|
-
}]
|
|
135
|
-
}];
|
|
136
|
-
const isPrivate = (0, WABinary_1.isJidUser)(jid);
|
|
137
|
-
const statusJid = isPrivate ? [jid] : (await groupMetadata(jid)).participants.map(p => p.id);
|
|
138
|
-
await relayMessage(WABinary_1.STORIES_JID, media.message, {
|
|
139
|
-
messageId: media.key.id,
|
|
140
|
-
statusJidList: statusJid,
|
|
141
|
-
additionalNodes
|
|
142
|
-
});
|
|
143
|
-
const messageType = isPrivate ? 'statusMentionMessage' : 'groupStatusMentionMessage';
|
|
144
|
-
const msg = await (0, Utils_1.generateWAMessageFromContent)(jid, {
|
|
145
|
-
[messageType]: {
|
|
146
|
-
message: {
|
|
147
|
-
protocolMessage: {
|
|
148
|
-
key: media.key,
|
|
149
|
-
type: 25
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
messageContextInfo: {
|
|
154
|
-
messageSecret: (0, crypto_1.randomBytes)(32)
|
|
155
|
-
}
|
|
156
|
-
}, { userJid: jid });
|
|
157
|
-
await relayMessage(jid, msg.message, {
|
|
158
|
-
additionalNodes: isPrivate ? [{
|
|
159
|
-
tag: 'meta',
|
|
160
|
-
attrs: { is_status_mention: 'true' }
|
|
161
|
-
}] : undefined
|
|
162
|
-
});
|
|
163
|
-
return media;
|
|
164
|
-
};
|
|
165
|
-
exports.sendStatusMentionsFV2 = sendStatusMentionsFV2;
|
|
166
|
-
// send without mention msg in group chat or private chat
|
|
167
|
-
const sendStatusMentions = async (jid, content, sock) => {
|
|
168
|
-
const { waUploadToServer, relayMessage, groupMetadata } = sock;
|
|
169
|
-
const media = await (0, Utils_1.generateWAMessage)(WABinary_1.STORIES_JID, content, {
|
|
170
|
-
upload: await waUploadToServer,
|
|
171
|
-
backgroundColor: "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"),
|
|
172
|
-
font: content.text ? Math.floor(Math.random() * 9) : undefined,
|
|
173
|
-
userJid: jid
|
|
174
|
-
});
|
|
175
|
-
const additionalNodes = [{
|
|
176
|
-
tag: 'meta',
|
|
177
|
-
attrs: {},
|
|
178
|
-
content: [{
|
|
179
|
-
tag: 'mentioned_users',
|
|
180
|
-
attrs: {},
|
|
181
|
-
content: [{
|
|
182
|
-
tag: 'to',
|
|
183
|
-
attrs: { jid }
|
|
184
|
-
}]
|
|
185
|
-
}]
|
|
186
|
-
}];
|
|
187
|
-
const isPrivate = (0, WABinary_1.isJidUser)(jid);
|
|
188
|
-
const statusJid = isPrivate ? [jid] : (await groupMetadata(jid)).participants.map(p => p.id);
|
|
189
|
-
await relayMessage(WABinary_1.STORIES_JID, media.message, {
|
|
190
|
-
messageId: media.key.id,
|
|
191
|
-
statusJidList: statusJid,
|
|
192
|
-
additionalNodes
|
|
193
|
-
});
|
|
194
|
-
return media;
|
|
195
|
-
};
|
|
196
|
-
exports.sendStatusMentions = sendStatusMentions;
|
|
197
|
-
const sendStatusMentionsV2 = async (jid, content, sock) => {
|
|
198
|
-
const { waUploadToServer, relayMessage, groupMetadata } = sock;
|
|
199
|
-
const media = await (0, Utils_1.generateWAMessage)(WABinary_1.STORIES_JID, content, {
|
|
200
|
-
upload: await waUploadToServer,
|
|
201
|
-
backgroundColor: "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"),
|
|
202
|
-
font: content.text ? Math.floor(Math.random() * 9) : undefined,
|
|
203
|
-
userJid: jid
|
|
204
|
-
});
|
|
205
|
-
const additionalNodes = [{
|
|
206
|
-
tag: 'meta',
|
|
207
|
-
attrs: {},
|
|
208
|
-
content: [{
|
|
209
|
-
tag: 'mentioned_users',
|
|
210
|
-
attrs: {},
|
|
211
|
-
content: [{
|
|
212
|
-
tag: 'to',
|
|
213
|
-
attrs: { jid }
|
|
214
|
-
}]
|
|
215
|
-
}]
|
|
216
|
-
}];
|
|
217
|
-
const isPrivate = (0, WABinary_1.isJidUser)(jid);
|
|
218
|
-
const statusJid = isPrivate ? [jid] : (await groupMetadata(jid)).participants.map(p => p.id);
|
|
219
|
-
await relayMessage(WABinary_1.STORIES_JID, media.message, {
|
|
220
|
-
messageId: media.key.id,
|
|
221
|
-
statusJidList: statusJid,
|
|
222
|
-
additionalNodes
|
|
223
|
-
});
|
|
224
|
-
return media;
|
|
225
|
-
};
|
|
226
|
-
exports.sendStatusMentionsV2 = sendStatusMentionsV2;
|
|
227
|
-
// send without mention msg in group chat or private chat Half
|
|
228
|
-
const sendStatusMentionsH = async (jid, content, sock) => {
|
|
229
|
-
const { waUploadToServer, relayMessage, groupMetadata } = sock;
|
|
230
|
-
const media = await (0, Utils_1.generateWAMessage)(WABinary_1.STORIES_JID, content, {
|
|
231
|
-
upload: await waUploadToServer,
|
|
232
|
-
backgroundColor: "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"),
|
|
233
|
-
font: content.text ? Math.floor(Math.random() * 9) : undefined,
|
|
234
|
-
userJid: jid
|
|
235
|
-
});
|
|
236
|
-
const additionalNodes = [{
|
|
237
|
-
tag: 'meta',
|
|
238
|
-
attrs: {},
|
|
239
|
-
content: [{
|
|
240
|
-
tag: 'mentioned_users',
|
|
241
|
-
attrs: {},
|
|
242
|
-
content: [{
|
|
243
|
-
tag: 'to',
|
|
244
|
-
attrs: { jid }
|
|
245
|
-
}]
|
|
246
|
-
}]
|
|
247
|
-
}];
|
|
248
|
-
const isPrivate = (0, WABinary_1.isJidUser)(jid);
|
|
249
|
-
const statusJid = isPrivate ? [jid] : (await groupMetadata(jid)).participants.map(p => p.id);
|
|
250
|
-
await relayMessage(WABinary_1.STORIES_JID, media.message, {
|
|
251
|
-
messageId: media.key.id,
|
|
252
|
-
statusJidList: statusJid,
|
|
253
|
-
additionalNodes
|
|
254
|
-
});
|
|
255
|
-
const messageType = isPrivate ? 'statusMentionMessage' : 'groupStatusMentionMessage';
|
|
256
|
-
const msg = await (0, Utils_1.generateWAMessageFromContent)(jid, {
|
|
257
|
-
[messageType]: {
|
|
258
|
-
message: {
|
|
259
|
-
protocolMessage: {
|
|
260
|
-
key: media.key,
|
|
261
|
-
type: 25
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}, { userJid: jid });
|
|
266
|
-
return media;
|
|
267
|
-
};
|
|
268
|
-
exports.sendStatusMentionsH = sendStatusMentionsH;
|
|
269
|
-
const sendStatusMentionsHV2 = async (jid, content, sock) => {
|
|
270
|
-
const { waUploadToServer, relayMessage, groupMetadata } = sock;
|
|
271
|
-
const media = await (0, Utils_1.generateWAMessage)(WABinary_1.STORIES_JID, content, {
|
|
272
|
-
upload: await waUploadToServer,
|
|
273
|
-
backgroundColor: "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"),
|
|
274
|
-
font: content.text ? Math.floor(Math.random() * 9) : undefined,
|
|
275
|
-
userJid: jid
|
|
276
|
-
});
|
|
277
|
-
const additionalNodes = [{
|
|
278
|
-
tag: 'meta',
|
|
279
|
-
attrs: {},
|
|
280
|
-
content: [{
|
|
281
|
-
tag: 'mentioned_users',
|
|
282
|
-
attrs: {},
|
|
283
|
-
content: [{
|
|
284
|
-
tag: 'to',
|
|
285
|
-
attrs: { jid }
|
|
286
|
-
}]
|
|
287
|
-
}]
|
|
288
|
-
}];
|
|
289
|
-
const isPrivate = (0, WABinary_1.isJidUser)(jid);
|
|
290
|
-
const statusJid = isPrivate ? [jid] : (await groupMetadata(jid)).participants.map(p => p.id);
|
|
291
|
-
await relayMessage(WABinary_1.STORIES_JID, media.message, {
|
|
292
|
-
messageId: media.key.id,
|
|
293
|
-
statusJidList: statusJid,
|
|
294
|
-
additionalNodes
|
|
295
|
-
});
|
|
296
|
-
const messageType = isPrivate ? 'statusMentionMessage' : 'groupStatusMentionMessage';
|
|
297
|
-
const msg = await (0, Utils_1.generateWAMessageFromContent)(jid, {
|
|
298
|
-
[messageType]: {
|
|
299
|
-
message: {
|
|
300
|
-
protocolMessage: {
|
|
301
|
-
key: media.key,
|
|
302
|
-
type: 25
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
messageContextInfo: {
|
|
307
|
-
messageSecret: (0, crypto_1.randomBytes)(32)
|
|
308
|
-
}
|
|
309
|
-
}, { userJid: jid });
|
|
310
|
-
return media;
|
|
311
|
-
};
|
|
312
|
-
exports.sendStatusMentionsHV2 = sendStatusMentionsHV2;
|