@mtcute/core 0.16.6 → 0.16.9
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/README.md +1 -1
- package/chunks/cjs/BQETTb_8.js +229 -0
- package/chunks/cjs/BijPAnvP.js +181 -0
- package/chunks/cjs/C1cFqHcW.js +989 -0
- package/chunks/cjs/CS5mxbeO.js +6645 -0
- package/chunks/cjs/CZAB54t2.js +81 -0
- package/chunks/cjs/D4qcXFYA.js +139 -0
- package/chunks/cjs/UVFvMVPt.js +10163 -0
- package/chunks/cjs/eX3zeDAz.js +1128 -0
- package/chunks/cjs/ija5tZ1t.js +59 -0
- package/chunks/cjs/j7rWn_1y.js +69 -0
- package/chunks/cjs/jFPoDILV.js +4982 -0
- package/chunks/cjs/package.json +3 -0
- package/chunks/es/BN3qj7tU.js +77 -0
- package/chunks/es/BRgz_-S8.js +135 -0
- package/chunks/es/BbjNWA_t.js +6641 -0
- package/chunks/es/Bi0OVMv8.js +177 -0
- package/chunks/es/CO4G3ySK.js +985 -0
- package/chunks/es/CPnecqvf.js +10159 -0
- package/chunks/es/DBMBgE7t.js +65 -0
- package/chunks/es/DY1E3mHM.js +1124 -0
- package/chunks/es/D_f8sDLe.js +4978 -0
- package/chunks/es/N3PMYmCL.js +55 -0
- package/chunks/es/hecWgeql.js +225 -0
- package/client.cjs +1378 -0
- package/client.d.cts +1 -0
- package/client.d.ts +1 -1
- package/client.js +1373 -1
- package/highlevel/base.d.ts +118 -0
- package/highlevel/client.d.ts +4898 -0
- package/highlevel/client.types.d.ts +58 -0
- package/highlevel/methods/bots/answer-callback-query.d.ts +41 -0
- package/highlevel/methods/bots/answer-pre-checkout-query.d.ts +12 -0
- package/highlevel/methods/bots/get-game-high-scores.d.ts +17 -0
- package/highlevel/methods/chats/ban-chat-member.d.ts +24 -0
- package/highlevel/methods/chats/batched-queries.d.ts +11 -0
- package/highlevel/methods/chats/create-group.d.ts +33 -0
- package/highlevel/methods/chats/get-chat-event-log.d.ts +61 -0
- package/highlevel/methods/chats/get-chat-member.d.ts +15 -0
- package/highlevel/methods/chats/get-chat-members.d.ts +51 -0
- package/highlevel/methods/chats/get-chat.d.ts +11 -0
- package/highlevel/methods/chats/get-full-chat.d.ts +11 -0
- package/highlevel/methods/chats/get-similar-channels.d.ts +12 -0
- package/highlevel/methods/chats/join-chat.d.ts +14 -0
- package/highlevel/methods/chats/set-chat-default-permissions.d.ts +16 -0
- package/highlevel/methods/dialogs/iter-dialogs.d.ts +103 -0
- package/highlevel/methods/files/upload-file.d.ts +64 -0
- package/highlevel/methods/files/upload-media.d.ts +28 -0
- package/highlevel/methods/forums/delete-forum-topic-history.d.ts +15 -0
- package/highlevel/methods/forums/edit-forum-topic.d.ts +34 -0
- package/highlevel/methods/forums/get-forum-topics-by-id.d.ts +9 -0
- package/highlevel/methods/forums/get-forum-topics.d.ts +28 -0
- package/highlevel/methods/forums/reorder-pinned-forum-topics.d.ts +19 -0
- package/highlevel/methods/forums/toggle-forum-topic-closed.d.ts +22 -0
- package/highlevel/methods/invite-links/create-invite-link.d.ts +31 -0
- package/highlevel/methods/invite-links/edit-invite-link.d.ts +36 -0
- package/highlevel/methods/invite-links/export-invite-link.d.ts +12 -0
- package/highlevel/methods/invite-links/get-invite-link-members.d.ts +45 -0
- package/highlevel/methods/invite-links/get-invite-link.d.ts +9 -0
- package/highlevel/methods/invite-links/get-invite-links.d.ts +39 -0
- package/highlevel/methods/invite-links/get-primary-invite-link.d.ts +8 -0
- package/highlevel/methods/invite-links/hide-all-join-requests.d.ts +13 -0
- package/highlevel/methods/invite-links/revoke-invite-link.d.ts +13 -0
- package/highlevel/methods/messages/get-callback-query-message.d.ts +14 -0
- package/highlevel/methods/messages/get-messages-unsafe.d.ts +19 -0
- package/highlevel/methods/messages/get-messages.d.ts +17 -0
- package/highlevel/methods/messages/send-paid-reaction.d.ts +24 -0
- package/highlevel/methods/premium/get-stars-transactions.d.ts +34 -0
- package/highlevel/methods/premium/iter-boosters.d.ts +24 -0
- package/highlevel/methods/premium/iter-stars-transactions.d.ts +29 -0
- package/highlevel/methods/stickers/create-sticker-set.d.ts +72 -0
- package/highlevel/methods/stickers/get-my-sticker-sets.d.ts +13 -0
- package/highlevel/methods/users/get-common-chats.d.ts +9 -0
- package/highlevel/methods.d.ts +277 -0
- package/highlevel/storage/repository/peers.d.ts +32 -0
- package/highlevel/storage/repository/ref-messages.d.ts +20 -0
- package/highlevel/storage/service/current-user.d.ts +23 -0
- package/highlevel/storage/service/peers.d.ts +23 -0
- package/highlevel/storage/service/ref-messages.d.ts +15 -0
- package/highlevel/storage/service/updates.d.ts +16 -0
- package/highlevel/storage/storage.d.ts +27 -0
- package/highlevel/types/bots/inline-message/index.d.ts +3 -0
- package/highlevel/types/bots/keyboards/builder.d.ts +38 -0
- package/highlevel/types/bots/keyboards/builder.test.d.ts +1 -0
- package/highlevel/types/bots/keyboards/index.d.ts +15 -0
- package/highlevel/types/bots/keyboards/keyboards.test.d.ts +1 -0
- package/highlevel/types/conversation.d.ts +210 -0
- package/highlevel/types/media/input-media/types.d.ts +520 -0
- package/highlevel/types/media/invoice.d.ts +89 -0
- package/highlevel/types/media/poll.d.ts +110 -0
- package/highlevel/types/messages/input-message-id.d.ts +20 -0
- package/highlevel/types/messages/message-action.d.ts +392 -0
- package/highlevel/types/messages/message-reactions.d.ts +31 -0
- package/highlevel/types/misc/collectible-info.d.ts +27 -0
- package/highlevel/types/peers/chat-event/actions.d.ts +279 -0
- package/highlevel/types/peers/chat-invite-link.d.ts +72 -0
- package/highlevel/types/peers/chat-member.d.ts +86 -0
- package/highlevel/types/peers/chat.d.ts +255 -0
- package/highlevel/types/peers/full-chat.d.ts +107 -0
- package/highlevel/types/peers/peers-index.test.d.ts +1 -0
- package/highlevel/types/peers/user.d.ts +268 -0
- package/highlevel/types/peers/user.test.d.ts +1 -0
- package/highlevel/types/premium/boost-slot.d.ts +37 -0
- package/highlevel/types/premium/boost.d.ts +57 -0
- package/highlevel/types/premium/business-work-hours.test.d.ts +1 -0
- package/highlevel/types/premium/index.d.ts +10 -0
- package/highlevel/types/premium/stars-status.d.ts +16 -0
- package/highlevel/types/premium/stars-transaction.d.ts +120 -0
- package/highlevel/types/reactions/peer-reaction.d.ts +53 -0
- package/highlevel/types/reactions/reaction-count.d.ts +25 -0
- package/highlevel/types/reactions/types.d.ts +16 -0
- package/highlevel/types/updates/bot-chat-join-request.d.ts +42 -0
- package/highlevel/types/updates/index.d.ts +107 -0
- package/highlevel/types/updates/inline-query.d.ts +42 -0
- package/highlevel/updates/manager.d.ts +124 -0
- package/highlevel/updates/types.d.ts +142 -0
- package/highlevel/updates/utils.d.ts +21 -0
- package/highlevel/utils/entities.test.d.ts +1 -0
- package/highlevel/utils/file-type.test.d.ts +1 -0
- package/highlevel/utils/file-utils.test.d.ts +1 -0
- package/highlevel/utils/inline-utils.test.d.ts +1 -0
- package/highlevel/utils/inspectable.test.d.ts +1 -0
- package/highlevel/utils/memoize.test.d.ts +1 -0
- package/highlevel/utils/peer-utils.test.d.ts +1 -0
- package/highlevel/utils/query-batcher.d.ts +49 -0
- package/highlevel/utils/query-batcher.test.d.ts +1 -0
- package/highlevel/utils/stream-utils.test.d.ts +1 -0
- package/highlevel/utils/string-session.test.d.ts +1 -0
- package/highlevel/utils/voice-utils.test.d.ts +1 -0
- package/highlevel/worker/app-config.d.ts +9 -0
- package/highlevel/worker/port.d.ts +59 -0
- package/highlevel/worker/protocol.d.ts +57 -0
- package/highlevel/worker/storage.d.ts +39 -0
- package/index.cjs +1284 -0
- package/index.d.cts +10 -0
- package/index.d.ts +10 -1
- package/index.js +1279 -1
- package/methods.cjs +270 -0
- package/methods.d.cts +1 -0
- package/methods.d.ts +1 -1
- package/methods.js +265 -1
- package/network/auth-key.d.ts +21 -0
- package/network/auth-key.test.d.ts +1 -0
- package/network/authorization.d.ts +9 -0
- package/network/client.d.ts +213 -0
- package/network/config-manager.test.d.ts +1 -0
- package/network/middlewares/default.d.ts +8 -0
- package/network/mtproto-session.d.ts +125 -0
- package/network/multi-session-connection.d.ts +33 -0
- package/network/network-manager.d.ts +248 -0
- package/network/persistent-connection.d.ts +52 -0
- package/network/persistent-connection.test.d.ts +1 -0
- package/network/server-salt.d.ts +12 -0
- package/network/session-connection.d.ts +79 -0
- package/network/transports/abstract.d.ts +97 -0
- package/network/transports/intermediate.test.d.ts +1 -0
- package/network/transports/obfuscated.test.d.ts +1 -0
- package/network/transports/streamed.d.ts +23 -0
- package/network/transports/wrapped.d.ts +10 -0
- package/package.json +80 -46
- package/platform.cjs +11 -0
- package/platform.d.cts +18 -0
- package/platform.d.ts +18 -1
- package/platform.js +6 -1
- package/storage/driver.d.ts +56 -0
- package/storage/memory/memory.test.d.ts +1 -0
- package/storage/repository/auth-keys.d.ts +41 -0
- package/storage/repository/key-value.d.ts +10 -0
- package/storage/service/auth-keys.d.ts +9 -0
- package/storage/service/auth-keys.test.d.ts +1 -0
- package/storage/service/default-dcs.d.ts +10 -0
- package/storage/service/future-salts.d.ts +11 -0
- package/storage/service/updates.test.d.ts +1 -0
- package/storage/service/utils.test-utils.d.ts +2 -0
- package/storage/sqlite/driver.d.ts +24 -0
- package/storage/sqlite/types.d.ts +18 -0
- package/storage/storage.d.ts +52 -0
- package/types/utils.d.ts +10 -0
- package/utils/async-lock.test.d.ts +1 -0
- package/utils/bigint-utils.test.d.ts +1 -0
- package/utils/buffer-utils.test.d.ts +1 -0
- package/utils/composer.test.d.ts +1 -0
- package/utils/condition-variable.test.d.ts +1 -0
- package/utils/controllable-promise.d.ts +11 -0
- package/utils/controllable-promise.test.d.ts +1 -0
- package/utils/crypto/abstract.d.ts +29 -0
- package/utils/crypto/factorization.test.d.ts +1 -0
- package/utils/crypto/keys.d.ts +27 -0
- package/utils/crypto/keys.test.d.ts +1 -0
- package/utils/crypto/miller-rabin.test.d.ts +1 -0
- package/utils/crypto/mtproto.test.d.ts +1 -0
- package/utils/crypto/password.test.d.ts +1 -0
- package/utils/crypto/utils.test.d.ts +1 -0
- package/utils/deque.test.d.ts +1 -0
- package/utils/function-utils.test.d.ts +1 -0
- package/utils/index.d.ts +30 -0
- package/utils/linked-list.test.d.ts +1 -0
- package/utils/links/bots.d.ts +72 -0
- package/utils/links/bots.test.d.ts +1 -0
- package/utils/links/calls.d.ts +17 -0
- package/utils/links/chat.d.ts +47 -0
- package/utils/links/chat.test.d.ts +1 -0
- package/utils/links/common.d.ts +31 -0
- package/utils/links/misc.d.ts +26 -0
- package/utils/links/misc.test.d.ts +1 -0
- package/utils/links/proxy.d.ts +18 -0
- package/utils/links/proxy.test.d.ts +1 -0
- package/utils/links/stickers.d.ts +10 -0
- package/utils/links/user.d.ts +28 -0
- package/utils/links/user.test.d.ts +1 -0
- package/utils/logger.d.ts +55 -0
- package/utils/logger.test.d.ts +1 -0
- package/utils/long-utils.d.ts +80 -0
- package/utils/long-utils.test.d.ts +1 -0
- package/utils/lru-map.test.d.ts +1 -0
- package/utils/lru-set.d.ts +22 -0
- package/utils/lru-set.test.d.ts +1 -0
- package/utils/peer-utils.d.ts +29 -0
- package/utils/peer-utils.test.d.ts +1 -0
- package/utils/reloadable.d.ts +24 -0
- package/utils/sorted-array.test.d.ts +1 -0
- package/utils/timers.d.ts +16 -0
- package/utils/tl-json.test.d.ts +1 -0
- package/utils/type-assertions.d.ts +29 -0
- package/utils/type-assertions.test.d.ts +1 -0
- package/utils.cjs +689 -0
- package/utils.d.cts +1 -0
- package/utils.d.ts +1 -1
- package/utils.js +681 -1
- package/worker.cjs +589 -0
- package/worker.d.cts +1 -0
- package/worker.d.ts +1 -1
- package/worker.js +584 -1
- package/cjs/highlevel/base.d.ts +0 -116
- package/cjs/highlevel/base.js +0 -279
- package/cjs/highlevel/base.js.map +0 -1
- package/cjs/highlevel/client.d.ts +0 -4813
- package/cjs/highlevel/client.js +0 -1175
- package/cjs/highlevel/client.js.map +0 -1
- package/cjs/highlevel/client.types.d.ts +0 -56
- package/cjs/highlevel/client.types.js +0 -3
- package/cjs/highlevel/client.types.js.map +0 -1
- package/cjs/highlevel/index.js +0 -21
- package/cjs/highlevel/index.js.map +0 -1
- package/cjs/highlevel/managers/app-config-manager.js +0 -43
- package/cjs/highlevel/managers/app-config-manager.js.map +0 -1
- package/cjs/highlevel/methods/_imports.js +0 -4
- package/cjs/highlevel/methods/_imports.js.map +0 -1
- package/cjs/highlevel/methods/_init.js +0 -50
- package/cjs/highlevel/methods/_init.js.map +0 -1
- package/cjs/highlevel/methods/auth/check-password.js +0 -22
- package/cjs/highlevel/methods/auth/check-password.js.map +0 -1
- package/cjs/highlevel/methods/auth/get-password-hint.js +0 -17
- package/cjs/highlevel/methods/auth/get-password-hint.js.map +0 -1
- package/cjs/highlevel/methods/auth/log-out.js +0 -20
- package/cjs/highlevel/methods/auth/log-out.js.map +0 -1
- package/cjs/highlevel/methods/auth/recover-password.js +0 -20
- package/cjs/highlevel/methods/auth/recover-password.js.map +0 -1
- package/cjs/highlevel/methods/auth/resend-code.js +0 -24
- package/cjs/highlevel/methods/auth/resend-code.js.map +0 -1
- package/cjs/highlevel/methods/auth/run.js +0 -23
- package/cjs/highlevel/methods/auth/run.js.map +0 -1
- package/cjs/highlevel/methods/auth/send-code.js +0 -30
- package/cjs/highlevel/methods/auth/send-code.js.map +0 -1
- package/cjs/highlevel/methods/auth/send-recovery-code.js +0 -17
- package/cjs/highlevel/methods/auth/send-recovery-code.js.map +0 -1
- package/cjs/highlevel/methods/auth/sign-in-bot.js +0 -24
- package/cjs/highlevel/methods/auth/sign-in-bot.js.map +0 -1
- package/cjs/highlevel/methods/auth/sign-in-qr.js +0 -126
- package/cjs/highlevel/methods/auth/sign-in-qr.js.map +0 -1
- package/cjs/highlevel/methods/auth/sign-in.js +0 -24
- package/cjs/highlevel/methods/auth/sign-in.js.map +0 -1
- package/cjs/highlevel/methods/auth/start-test.js +0 -66
- package/cjs/highlevel/methods/auth/start-test.js.map +0 -1
- package/cjs/highlevel/methods/auth/start.js +0 -186
- package/cjs/highlevel/methods/auth/start.js.map +0 -1
- package/cjs/highlevel/methods/auth/utils.js +0 -33
- package/cjs/highlevel/methods/auth/utils.js.map +0 -1
- package/cjs/highlevel/methods/bots/answer-callback-query.d.ts +0 -41
- package/cjs/highlevel/methods/bots/answer-callback-query.js +0 -28
- package/cjs/highlevel/methods/bots/answer-callback-query.js.map +0 -1
- package/cjs/highlevel/methods/bots/answer-inline-query.js +0 -44
- package/cjs/highlevel/methods/bots/answer-inline-query.js.map +0 -1
- package/cjs/highlevel/methods/bots/answer-pre-checkout-query.d.ts +0 -12
- package/cjs/highlevel/methods/bots/answer-pre-checkout-query.js +0 -25
- package/cjs/highlevel/methods/bots/answer-pre-checkout-query.js.map +0 -1
- package/cjs/highlevel/methods/bots/delete-my-commands.js +0 -25
- package/cjs/highlevel/methods/bots/delete-my-commands.js.map +0 -1
- package/cjs/highlevel/methods/bots/get-bot-info.js +0 -17
- package/cjs/highlevel/methods/bots/get-bot-info.js.map +0 -1
- package/cjs/highlevel/methods/bots/get-bot-menu-button.js +0 -15
- package/cjs/highlevel/methods/bots/get-bot-menu-button.js.map +0 -1
- package/cjs/highlevel/methods/bots/get-callback-answer.js +0 -39
- package/cjs/highlevel/methods/bots/get-callback-answer.js.map +0 -1
- package/cjs/highlevel/methods/bots/get-game-high-scores.d.ts +0 -17
- package/cjs/highlevel/methods/bots/get-game-high-scores.js +0 -55
- package/cjs/highlevel/methods/bots/get-game-high-scores.js.map +0 -1
- package/cjs/highlevel/methods/bots/get-my-commands.js +0 -23
- package/cjs/highlevel/methods/bots/get-my-commands.js.map +0 -1
- package/cjs/highlevel/methods/bots/normalize-command-scope.js +0 -34
- package/cjs/highlevel/methods/bots/normalize-command-scope.js.map +0 -1
- package/cjs/highlevel/methods/bots/set-bot-info.js +0 -22
- package/cjs/highlevel/methods/bots/set-bot-info.js.map +0 -1
- package/cjs/highlevel/methods/bots/set-bot-menu-button.js +0 -18
- package/cjs/highlevel/methods/bots/set-bot-menu-button.js.map +0 -1
- package/cjs/highlevel/methods/bots/set-game-score.js +0 -53
- package/cjs/highlevel/methods/bots/set-game-score.js.map +0 -1
- package/cjs/highlevel/methods/bots/set-my-commands.js +0 -36
- package/cjs/highlevel/methods/bots/set-my-commands.js.map +0 -1
- package/cjs/highlevel/methods/bots/set-my-default-rights.js +0 -20
- package/cjs/highlevel/methods/bots/set-my-default-rights.js.map +0 -1
- package/cjs/highlevel/methods/chats/add-chat-members.js +0 -47
- package/cjs/highlevel/methods/chats/add-chat-members.js.map +0 -1
- package/cjs/highlevel/methods/chats/archive-chats.js +0 -26
- package/cjs/highlevel/methods/chats/archive-chats.js.map +0 -1
- package/cjs/highlevel/methods/chats/ban-chat-member.d.ts +0 -23
- package/cjs/highlevel/methods/chats/ban-chat-member.js +0 -48
- package/cjs/highlevel/methods/chats/ban-chat-member.js.map +0 -1
- package/cjs/highlevel/methods/chats/batched-queries.d.ts +0 -10
- package/cjs/highlevel/methods/chats/batched-queries.js +0 -125
- package/cjs/highlevel/methods/chats/batched-queries.js.map +0 -1
- package/cjs/highlevel/methods/chats/create-channel.js +0 -24
- package/cjs/highlevel/methods/chats/create-channel.js.map +0 -1
- package/cjs/highlevel/methods/chats/create-group.d.ts +0 -33
- package/cjs/highlevel/methods/chats/create-group.js +0 -33
- package/cjs/highlevel/methods/chats/create-group.js.map +0 -1
- package/cjs/highlevel/methods/chats/create-supergroup.js +0 -26
- package/cjs/highlevel/methods/chats/create-supergroup.js.map +0 -1
- package/cjs/highlevel/methods/chats/delete-channel.js +0 -19
- package/cjs/highlevel/methods/chats/delete-channel.js.map +0 -1
- package/cjs/highlevel/methods/chats/delete-chat-photo.js +0 -36
- package/cjs/highlevel/methods/chats/delete-chat-photo.js.map +0 -1
- package/cjs/highlevel/methods/chats/delete-group.js +0 -31
- package/cjs/highlevel/methods/chats/delete-group.js.map +0 -1
- package/cjs/highlevel/methods/chats/delete-history.js +0 -28
- package/cjs/highlevel/methods/chats/delete-history.js.map +0 -1
- package/cjs/highlevel/methods/chats/delete-user-history.js +0 -23
- package/cjs/highlevel/methods/chats/delete-user-history.js.map +0 -1
- package/cjs/highlevel/methods/chats/edit-admin-rights.js +0 -25
- package/cjs/highlevel/methods/chats/edit-admin-rights.js.map +0 -1
- package/cjs/highlevel/methods/chats/get-chat-event-log.d.ts +0 -61
- package/cjs/highlevel/methods/chats/get-chat-event-log.js +0 -55
- package/cjs/highlevel/methods/chats/get-chat-event-log.js.map +0 -1
- package/cjs/highlevel/methods/chats/get-chat-member.d.ts +0 -15
- package/cjs/highlevel/methods/chats/get-chat-member.js +0 -60
- package/cjs/highlevel/methods/chats/get-chat-member.js.map +0 -1
- package/cjs/highlevel/methods/chats/get-chat-members.d.ts +0 -51
- package/cjs/highlevel/methods/chats/get-chat-members.js +0 -87
- package/cjs/highlevel/methods/chats/get-chat-members.js.map +0 -1
- package/cjs/highlevel/methods/chats/get-chat-preview.js +0 -30
- package/cjs/highlevel/methods/chats/get-chat-preview.js.map +0 -1
- package/cjs/highlevel/methods/chats/get-chat.d.ts +0 -11
- package/cjs/highlevel/methods/chats/get-chat.js +0 -39
- package/cjs/highlevel/methods/chats/get-chat.js.map +0 -1
- package/cjs/highlevel/methods/chats/get-full-chat.d.ts +0 -11
- package/cjs/highlevel/methods/chats/get-full-chat.js +0 -57
- package/cjs/highlevel/methods/chats/get-full-chat.js.map +0 -1
- package/cjs/highlevel/methods/chats/get-nearby-chats.js +0 -42
- package/cjs/highlevel/methods/chats/get-nearby-chats.js.map +0 -1
- package/cjs/highlevel/methods/chats/get-similar-channels.d.ts +0 -12
- package/cjs/highlevel/methods/chats/get-similar-channels.js +0 -31
- package/cjs/highlevel/methods/chats/get-similar-channels.js.map +0 -1
- package/cjs/highlevel/methods/chats/iter-chat-event-log.js +0 -57
- package/cjs/highlevel/methods/chats/iter-chat-event-log.js.map +0 -1
- package/cjs/highlevel/methods/chats/iter-chat-members.js +0 -53
- package/cjs/highlevel/methods/chats/iter-chat-members.js.map +0 -1
- package/cjs/highlevel/methods/chats/join-chat.d.ts +0 -14
- package/cjs/highlevel/methods/chats/join-chat.js +0 -41
- package/cjs/highlevel/methods/chats/join-chat.js.map +0 -1
- package/cjs/highlevel/methods/chats/kick-chat-member.js +0 -30
- package/cjs/highlevel/methods/chats/kick-chat-member.js.map +0 -1
- package/cjs/highlevel/methods/chats/leave-chat.js +0 -37
- package/cjs/highlevel/methods/chats/leave-chat.js.map +0 -1
- package/cjs/highlevel/methods/chats/mark-chat-unread.js +0 -23
- package/cjs/highlevel/methods/chats/mark-chat-unread.js.map +0 -1
- package/cjs/highlevel/methods/chats/open-chat.js +0 -48
- package/cjs/highlevel/methods/chats/open-chat.js.map +0 -1
- package/cjs/highlevel/methods/chats/reorder-usernames.js +0 -44
- package/cjs/highlevel/methods/chats/reorder-usernames.js.map +0 -1
- package/cjs/highlevel/methods/chats/restrict-chat-member.js +0 -31
- package/cjs/highlevel/methods/chats/restrict-chat-member.js.map +0 -1
- package/cjs/highlevel/methods/chats/save-draft.js +0 -29
- package/cjs/highlevel/methods/chats/save-draft.js.map +0 -1
- package/cjs/highlevel/methods/chats/set-chat-color.js +0 -42
- package/cjs/highlevel/methods/chats/set-chat-color.js.map +0 -1
- package/cjs/highlevel/methods/chats/set-chat-default-permissions.d.ts +0 -16
- package/cjs/highlevel/methods/chats/set-chat-default-permissions.js +0 -35
- package/cjs/highlevel/methods/chats/set-chat-default-permissions.js.map +0 -1
- package/cjs/highlevel/methods/chats/set-chat-description.js +0 -24
- package/cjs/highlevel/methods/chats/set-chat-description.js.map +0 -1
- package/cjs/highlevel/methods/chats/set-chat-photo.js +0 -90
- package/cjs/highlevel/methods/chats/set-chat-photo.js.map +0 -1
- package/cjs/highlevel/methods/chats/set-chat-title.js +0 -37
- package/cjs/highlevel/methods/chats/set-chat-title.js.map +0 -1
- package/cjs/highlevel/methods/chats/set-chat-ttl.js +0 -19
- package/cjs/highlevel/methods/chats/set-chat-ttl.js.map +0 -1
- package/cjs/highlevel/methods/chats/set-chat-username.js +0 -23
- package/cjs/highlevel/methods/chats/set-chat-username.js.map +0 -1
- package/cjs/highlevel/methods/chats/set-slow-mode.js +0 -23
- package/cjs/highlevel/methods/chats/set-slow-mode.js.map +0 -1
- package/cjs/highlevel/methods/chats/toggle-content-protection.js +0 -20
- package/cjs/highlevel/methods/chats/toggle-content-protection.js.map +0 -1
- package/cjs/highlevel/methods/chats/toggle-fragment-username.js +0 -49
- package/cjs/highlevel/methods/chats/toggle-fragment-username.js.map +0 -1
- package/cjs/highlevel/methods/chats/toggle-join-requests.js +0 -23
- package/cjs/highlevel/methods/chats/toggle-join-requests.js.map +0 -1
- package/cjs/highlevel/methods/chats/toggle-join-to-send.js +0 -23
- package/cjs/highlevel/methods/chats/toggle-join-to-send.js.map +0 -1
- package/cjs/highlevel/methods/chats/unarchive-chats.js +0 -28
- package/cjs/highlevel/methods/chats/unarchive-chats.js.map +0 -1
- package/cjs/highlevel/methods/chats/unban-chat-member.js +0 -39
- package/cjs/highlevel/methods/chats/unban-chat-member.js.map +0 -1
- package/cjs/highlevel/methods/contacts/add-contact.js +0 -26
- package/cjs/highlevel/methods/contacts/add-contact.js.map +0 -1
- package/cjs/highlevel/methods/contacts/delete-contacts.js +0 -32
- package/cjs/highlevel/methods/contacts/delete-contacts.js.map +0 -1
- package/cjs/highlevel/methods/contacts/get-contacts.js +0 -22
- package/cjs/highlevel/methods/contacts/get-contacts.js.map +0 -1
- package/cjs/highlevel/methods/contacts/import-contacts.js +0 -26
- package/cjs/highlevel/methods/contacts/import-contacts.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/create-folder.js +0 -45
- package/cjs/highlevel/methods/dialogs/create-folder.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/delete-folder.js +0 -18
- package/cjs/highlevel/methods/dialogs/delete-folder.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/edit-folder.js +0 -39
- package/cjs/highlevel/methods/dialogs/edit-folder.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/find-dialogs.js +0 -92
- package/cjs/highlevel/methods/dialogs/find-dialogs.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/find-folder.js +0 -33
- package/cjs/highlevel/methods/dialogs/find-folder.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/get-chatlist-preview.js +0 -18
- package/cjs/highlevel/methods/dialogs/get-chatlist-preview.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/get-folders.js +0 -32
- package/cjs/highlevel/methods/dialogs/get-folders.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/get-peer-dialogs.js +0 -25
- package/cjs/highlevel/methods/dialogs/get-peer-dialogs.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/iter-dialogs.d.ts +0 -103
- package/cjs/highlevel/methods/dialogs/iter-dialogs.js +0 -199
- package/cjs/highlevel/methods/dialogs/iter-dialogs.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/join-chatlist.js +0 -42
- package/cjs/highlevel/methods/dialogs/join-chatlist.js.map +0 -1
- package/cjs/highlevel/methods/dialogs/set-folders-order.js +0 -18
- package/cjs/highlevel/methods/dialogs/set-folders-order.js.map +0 -1
- package/cjs/highlevel/methods/files/download-buffer.js +0 -26
- package/cjs/highlevel/methods/files/download-buffer.js.map +0 -1
- package/cjs/highlevel/methods/files/download-file.js +0 -4
- package/cjs/highlevel/methods/files/download-file.js.map +0 -1
- package/cjs/highlevel/methods/files/download-iterable.js +0 -185
- package/cjs/highlevel/methods/files/download-iterable.js.map +0 -1
- package/cjs/highlevel/methods/files/download-node-stream.js +0 -4
- package/cjs/highlevel/methods/files/download-node-stream.js.map +0 -1
- package/cjs/highlevel/methods/files/download-stream.js +0 -38
- package/cjs/highlevel/methods/files/download-stream.js.map +0 -1
- package/cjs/highlevel/methods/files/normalize-file-to-document.js +0 -23
- package/cjs/highlevel/methods/files/normalize-file-to-document.js.map +0 -1
- package/cjs/highlevel/methods/files/normalize-input-file.js +0 -42
- package/cjs/highlevel/methods/files/normalize-input-file.js.map +0 -1
- package/cjs/highlevel/methods/files/normalize-input-media.js +0 -381
- package/cjs/highlevel/methods/files/normalize-input-media.js.map +0 -1
- package/cjs/highlevel/methods/files/upload-file.d.ts +0 -64
- package/cjs/highlevel/methods/files/upload-file.js +0 -231
- package/cjs/highlevel/methods/files/upload-file.js.map +0 -1
- package/cjs/highlevel/methods/files/upload-media.d.ts +0 -28
- package/cjs/highlevel/methods/files/upload-media.js +0 -69
- package/cjs/highlevel/methods/files/upload-media.js.map +0 -1
- package/cjs/highlevel/methods/forums/create-forum-topic.js +0 -28
- package/cjs/highlevel/methods/forums/create-forum-topic.js.map +0 -1
- package/cjs/highlevel/methods/forums/delete-forum-topic-history.d.ts +0 -15
- package/cjs/highlevel/methods/forums/delete-forum-topic-history.js +0 -27
- package/cjs/highlevel/methods/forums/delete-forum-topic-history.js.map +0 -1
- package/cjs/highlevel/methods/forums/edit-forum-topic.d.ts +0 -34
- package/cjs/highlevel/methods/forums/edit-forum-topic.js +0 -31
- package/cjs/highlevel/methods/forums/edit-forum-topic.js.map +0 -1
- package/cjs/highlevel/methods/forums/get-forum-topics-by-id.d.ts +0 -9
- package/cjs/highlevel/methods/forums/get-forum-topics-by-id.js +0 -22
- package/cjs/highlevel/methods/forums/get-forum-topics-by-id.js.map +0 -1
- package/cjs/highlevel/methods/forums/get-forum-topics.d.ts +0 -28
- package/cjs/highlevel/methods/forums/get-forum-topics.js +0 -42
- package/cjs/highlevel/methods/forums/get-forum-topics.js.map +0 -1
- package/cjs/highlevel/methods/forums/iter-forum-topics.js +0 -35
- package/cjs/highlevel/methods/forums/iter-forum-topics.js.map +0 -1
- package/cjs/highlevel/methods/forums/reorder-pinned-forum-topics.d.ts +0 -19
- package/cjs/highlevel/methods/forums/reorder-pinned-forum-topics.js +0 -20
- package/cjs/highlevel/methods/forums/reorder-pinned-forum-topics.js.map +0 -1
- package/cjs/highlevel/methods/forums/toggle-forum-topic-closed.d.ts +0 -22
- package/cjs/highlevel/methods/forums/toggle-forum-topic-closed.js +0 -24
- package/cjs/highlevel/methods/forums/toggle-forum-topic-closed.js.map +0 -1
- package/cjs/highlevel/methods/forums/toggle-forum-topic-pinned.js +0 -20
- package/cjs/highlevel/methods/forums/toggle-forum-topic-pinned.js.map +0 -1
- package/cjs/highlevel/methods/forums/toggle-forum.js +0 -22
- package/cjs/highlevel/methods/forums/toggle-forum.js.map +0 -1
- package/cjs/highlevel/methods/forums/toggle-general-topic-hidden.js +0 -24
- package/cjs/highlevel/methods/forums/toggle-general-topic-hidden.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/create-invite-link.d.ts +0 -31
- package/cjs/highlevel/methods/invite-links/create-invite-link.js +0 -28
- package/cjs/highlevel/methods/invite-links/create-invite-link.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/edit-invite-link.d.ts +0 -36
- package/cjs/highlevel/methods/invite-links/edit-invite-link.js +0 -32
- package/cjs/highlevel/methods/invite-links/edit-invite-link.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/export-invite-link.d.ts +0 -12
- package/cjs/highlevel/methods/invite-links/export-invite-link.js +0 -24
- package/cjs/highlevel/methods/invite-links/export-invite-link.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/get-invite-link-members.d.ts +0 -45
- package/cjs/highlevel/methods/invite-links/get-invite-link-members.js +0 -43
- package/cjs/highlevel/methods/invite-links/get-invite-link-members.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/get-invite-link.d.ts +0 -9
- package/cjs/highlevel/methods/invite-links/get-invite-link.js +0 -22
- package/cjs/highlevel/methods/invite-links/get-invite-link.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/get-invite-links.d.ts +0 -39
- package/cjs/highlevel/methods/invite-links/get-invite-links.js +0 -43
- package/cjs/highlevel/methods/invite-links/get-invite-links.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/get-primary-invite-link.d.ts +0 -8
- package/cjs/highlevel/methods/invite-links/get-primary-invite-link.js +0 -30
- package/cjs/highlevel/methods/invite-links/get-primary-invite-link.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/hide-all-join-requests.d.ts +0 -13
- package/cjs/highlevel/methods/invite-links/hide-all-join-requests.js +0 -18
- package/cjs/highlevel/methods/invite-links/hide-all-join-requests.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/hide-join-request.js +0 -19
- package/cjs/highlevel/methods/invite-links/hide-join-request.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/iter-invite-link-members.js +0 -43
- package/cjs/highlevel/methods/invite-links/iter-invite-link-members.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/iter-invite-links.js +0 -45
- package/cjs/highlevel/methods/invite-links/iter-invite-links.js.map +0 -1
- package/cjs/highlevel/methods/invite-links/revoke-invite-link.d.ts +0 -13
- package/cjs/highlevel/methods/invite-links/revoke-invite-link.js +0 -28
- package/cjs/highlevel/methods/invite-links/revoke-invite-link.js.map +0 -1
- package/cjs/highlevel/methods/messages/_business-connection.js +0 -42
- package/cjs/highlevel/methods/messages/_business-connection.js.map +0 -1
- package/cjs/highlevel/methods/messages/close-poll.js +0 -47
- package/cjs/highlevel/methods/messages/close-poll.js.map +0 -1
- package/cjs/highlevel/methods/messages/delete-messages.js +0 -66
- package/cjs/highlevel/methods/messages/delete-messages.js.map +0 -1
- package/cjs/highlevel/methods/messages/delete-scheduled-messages.js +0 -21
- package/cjs/highlevel/methods/messages/delete-scheduled-messages.js.map +0 -1
- package/cjs/highlevel/methods/messages/edit-inline-message.js +0 -57
- package/cjs/highlevel/methods/messages/edit-inline-message.js.map +0 -1
- package/cjs/highlevel/methods/messages/edit-message.js +0 -47
- package/cjs/highlevel/methods/messages/edit-message.js.map +0 -1
- package/cjs/highlevel/methods/messages/find-in-update.js +0 -52
- package/cjs/highlevel/methods/messages/find-in-update.js.map +0 -1
- package/cjs/highlevel/methods/messages/forward-messages.js +0 -74
- package/cjs/highlevel/methods/messages/forward-messages.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-all-scheduled-messages.js +0 -32
- package/cjs/highlevel/methods/messages/get-all-scheduled-messages.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-available-effects.js +0 -26
- package/cjs/highlevel/methods/messages/get-available-effects.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-callback-query-message.d.ts +0 -14
- package/cjs/highlevel/methods/messages/get-callback-query-message.js +0 -56
- package/cjs/highlevel/methods/messages/get-callback-query-message.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-discussion-message.js +0 -63
- package/cjs/highlevel/methods/messages/get-discussion-message.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-fact-check.js +0 -27
- package/cjs/highlevel/methods/messages/get-fact-check.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-history.js +0 -58
- package/cjs/highlevel/methods/messages/get-history.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-message-by-link.js +0 -34
- package/cjs/highlevel/methods/messages/get-message-by-link.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-message-group.js +0 -36
- package/cjs/highlevel/methods/messages/get-message-group.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-message-reactions.js +0 -59
- package/cjs/highlevel/methods/messages/get-message-reactions.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-messages-unsafe.d.ts +0 -19
- package/cjs/highlevel/methods/messages/get-messages-unsafe.js +0 -42
- package/cjs/highlevel/methods/messages/get-messages-unsafe.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-messages.d.ts +0 -17
- package/cjs/highlevel/methods/messages/get-messages.js +0 -76
- package/cjs/highlevel/methods/messages/get-messages.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-reaction-users.js +0 -29
- package/cjs/highlevel/methods/messages/get-reaction-users.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-reply-to.js +0 -25
- package/cjs/highlevel/methods/messages/get-reply-to.js.map +0 -1
- package/cjs/highlevel/methods/messages/get-scheduled-messages.js +0 -35
- package/cjs/highlevel/methods/messages/get-scheduled-messages.js.map +0 -1
- package/cjs/highlevel/methods/messages/iter-history.js +0 -41
- package/cjs/highlevel/methods/messages/iter-history.js.map +0 -1
- package/cjs/highlevel/methods/messages/iter-reaction-users.js +0 -40
- package/cjs/highlevel/methods/messages/iter-reaction-users.js.map +0 -1
- package/cjs/highlevel/methods/messages/iter-search-global.js +0 -47
- package/cjs/highlevel/methods/messages/iter-search-global.js.map +0 -1
- package/cjs/highlevel/methods/messages/iter-search-messages.js +0 -55
- package/cjs/highlevel/methods/messages/iter-search-messages.js.map +0 -1
- package/cjs/highlevel/methods/messages/pin-message.js +0 -28
- package/cjs/highlevel/methods/messages/pin-message.js.map +0 -1
- package/cjs/highlevel/methods/messages/read-history.js +0 -50
- package/cjs/highlevel/methods/messages/read-history.js.map +0 -1
- package/cjs/highlevel/methods/messages/read-reactions.js +0 -22
- package/cjs/highlevel/methods/messages/read-reactions.js.map +0 -1
- package/cjs/highlevel/methods/messages/search-global.js +0 -51
- package/cjs/highlevel/methods/messages/search-global.js.map +0 -1
- package/cjs/highlevel/methods/messages/search-hashtag.js +0 -75
- package/cjs/highlevel/methods/messages/search-hashtag.js.map +0 -1
- package/cjs/highlevel/methods/messages/search-messages.js +0 -50
- package/cjs/highlevel/methods/messages/search-messages.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-answer.js +0 -37
- package/cjs/highlevel/methods/messages/send-answer.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-comment.js +0 -75
- package/cjs/highlevel/methods/messages/send-comment.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-common.js +0 -88
- package/cjs/highlevel/methods/messages/send-common.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-copy-group.js +0 -41
- package/cjs/highlevel/methods/messages/send-copy-group.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-copy.js +0 -57
- package/cjs/highlevel/methods/messages/send-copy.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-media-group.js +0 -80
- package/cjs/highlevel/methods/messages/send-media-group.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-media.js +0 -65
- package/cjs/highlevel/methods/messages/send-media.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-quote.js +0 -66
- package/cjs/highlevel/methods/messages/send-quote.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-reaction.js +0 -39
- package/cjs/highlevel/methods/messages/send-reaction.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-reply.js +0 -28
- package/cjs/highlevel/methods/messages/send-reply.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-scheduled.js +0 -34
- package/cjs/highlevel/methods/messages/send-scheduled.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-text.js +0 -99
- package/cjs/highlevel/methods/messages/send-text.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-typing.js +0 -85
- package/cjs/highlevel/methods/messages/send-typing.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-vote.js +0 -56
- package/cjs/highlevel/methods/messages/send-vote.js.map +0 -1
- package/cjs/highlevel/methods/messages/translate-message.js +0 -26
- package/cjs/highlevel/methods/messages/translate-message.js.map +0 -1
- package/cjs/highlevel/methods/messages/translate-text.js +0 -34
- package/cjs/highlevel/methods/messages/translate-text.js.map +0 -1
- package/cjs/highlevel/methods/messages/unpin-all-messages.js +0 -30
- package/cjs/highlevel/methods/messages/unpin-all-messages.js.map +0 -1
- package/cjs/highlevel/methods/messages/unpin-message.js +0 -26
- package/cjs/highlevel/methods/messages/unpin-message.js.map +0 -1
- package/cjs/highlevel/methods/misc/chain-id.js +0 -11
- package/cjs/highlevel/methods/misc/chain-id.js.map +0 -1
- package/cjs/highlevel/methods/misc/get-collectible-info.js +0 -26
- package/cjs/highlevel/methods/misc/get-collectible-info.js.map +0 -1
- package/cjs/highlevel/methods/misc/init-takeout-session.js +0 -17
- package/cjs/highlevel/methods/misc/init-takeout-session.js.map +0 -1
- package/cjs/highlevel/methods/misc/normalize-privacy-rules.js +0 -44
- package/cjs/highlevel/methods/misc/normalize-privacy-rules.js.map +0 -1
- package/cjs/highlevel/methods/misc/normalize-text.js +0 -34
- package/cjs/highlevel/methods/misc/normalize-text.js.map +0 -1
- package/cjs/highlevel/methods/misc/with-params.js +0 -32
- package/cjs/highlevel/methods/misc/with-params.js.map +0 -1
- package/cjs/highlevel/methods/password/change-cloud-password.js +0 -29
- package/cjs/highlevel/methods/password/change-cloud-password.js.map +0 -1
- package/cjs/highlevel/methods/password/enable-cloud-password.js +0 -36
- package/cjs/highlevel/methods/password/enable-cloud-password.js.map +0 -1
- package/cjs/highlevel/methods/password/password-email.js +0 -38
- package/cjs/highlevel/methods/password/password-email.js.map +0 -1
- package/cjs/highlevel/methods/password/remove-cloud-password.js +0 -28
- package/cjs/highlevel/methods/password/remove-cloud-password.js.map +0 -1
- package/cjs/highlevel/methods/premium/apply-boost.js +0 -17
- package/cjs/highlevel/methods/premium/apply-boost.js.map +0 -1
- package/cjs/highlevel/methods/premium/can-apply-boost.js +0 -33
- package/cjs/highlevel/methods/premium/can-apply-boost.js.map +0 -1
- package/cjs/highlevel/methods/premium/create-business-chat-link.js +0 -26
- package/cjs/highlevel/methods/premium/create-business-chat-link.js.map +0 -1
- package/cjs/highlevel/methods/premium/edit-business-chat-link.js +0 -42
- package/cjs/highlevel/methods/premium/edit-business-chat-link.js.map +0 -1
- package/cjs/highlevel/methods/premium/get-boost-stats.js +0 -20
- package/cjs/highlevel/methods/premium/get-boost-stats.js.map +0 -1
- package/cjs/highlevel/methods/premium/get-boosts.js +0 -23
- package/cjs/highlevel/methods/premium/get-boosts.js.map +0 -1
- package/cjs/highlevel/methods/premium/get-business-chat-links.js +0 -14
- package/cjs/highlevel/methods/premium/get-business-chat-links.js.map +0 -1
- package/cjs/highlevel/methods/premium/get-business-connection.js +0 -26
- package/cjs/highlevel/methods/premium/get-business-connection.js.map +0 -1
- package/cjs/highlevel/methods/premium/get-my-boost-slots.js +0 -20
- package/cjs/highlevel/methods/premium/get-my-boost-slots.js.map +0 -1
- package/cjs/highlevel/methods/premium/iter-boosters.d.ts +0 -26
- package/cjs/highlevel/methods/premium/iter-boosters.js +0 -36
- package/cjs/highlevel/methods/premium/iter-boosters.js.map +0 -1
- package/cjs/highlevel/methods/premium/set-business-intro.js +0 -42
- package/cjs/highlevel/methods/premium/set-business-intro.js.map +0 -1
- package/cjs/highlevel/methods/premium/set-business-work-hours.js +0 -33
- package/cjs/highlevel/methods/premium/set-business-work-hours.js.map +0 -1
- package/cjs/highlevel/methods/stickers/_utils.js +0 -27
- package/cjs/highlevel/methods/stickers/_utils.js.map +0 -1
- package/cjs/highlevel/methods/stickers/add-sticker-to-set.js +0 -25
- package/cjs/highlevel/methods/stickers/add-sticker-to-set.js.map +0 -1
- package/cjs/highlevel/methods/stickers/create-sticker-set.d.ts +0 -72
- package/cjs/highlevel/methods/stickers/create-sticker-set.js +0 -39
- package/cjs/highlevel/methods/stickers/create-sticker-set.js.map +0 -1
- package/cjs/highlevel/methods/stickers/delete-sticker-from-set.js +0 -28
- package/cjs/highlevel/methods/stickers/delete-sticker-from-set.js.map +0 -1
- package/cjs/highlevel/methods/stickers/get-custom-emojis.js +0 -50
- package/cjs/highlevel/methods/stickers/get-custom-emojis.js.map +0 -1
- package/cjs/highlevel/methods/stickers/get-installed-stickers.js +0 -26
- package/cjs/highlevel/methods/stickers/get-installed-stickers.js.map +0 -1
- package/cjs/highlevel/methods/stickers/get-my-sticker-sets.d.ts +0 -13
- package/cjs/highlevel/methods/stickers/get-my-sticker-sets.js +0 -24
- package/cjs/highlevel/methods/stickers/get-my-sticker-sets.js.map +0 -1
- package/cjs/highlevel/methods/stickers/get-sticker-set.js +0 -19
- package/cjs/highlevel/methods/stickers/get-sticker-set.js.map +0 -1
- package/cjs/highlevel/methods/stickers/move-sticker-in-set.js +0 -31
- package/cjs/highlevel/methods/stickers/move-sticker-in-set.js.map +0 -1
- package/cjs/highlevel/methods/stickers/replace-sticker-in-set.js +0 -32
- package/cjs/highlevel/methods/stickers/replace-sticker-in-set.js.map +0 -1
- package/cjs/highlevel/methods/stickers/set-chat-sticker-set.js +0 -24
- package/cjs/highlevel/methods/stickers/set-chat-sticker-set.js.map +0 -1
- package/cjs/highlevel/methods/stickers/set-sticker-set-thumb.js +0 -23
- package/cjs/highlevel/methods/stickers/set-sticker-set-thumb.js.map +0 -1
- package/cjs/highlevel/methods/stories/can-send-story.js +0 -36
- package/cjs/highlevel/methods/stories/can-send-story.js.map +0 -1
- package/cjs/highlevel/methods/stories/delete-stories.js +0 -19
- package/cjs/highlevel/methods/stories/delete-stories.js.map +0 -1
- package/cjs/highlevel/methods/stories/edit-story.js +0 -44
- package/cjs/highlevel/methods/stories/edit-story.js.map +0 -1
- package/cjs/highlevel/methods/stories/find-in-update.js +0 -21
- package/cjs/highlevel/methods/stories/find-in-update.js.map +0 -1
- package/cjs/highlevel/methods/stories/get-all-stories.js +0 -23
- package/cjs/highlevel/methods/stories/get-all-stories.js.map +0 -1
- package/cjs/highlevel/methods/stories/get-peer-stories.js +0 -20
- package/cjs/highlevel/methods/stories/get-peer-stories.js.map +0 -1
- package/cjs/highlevel/methods/stories/get-profile-stories.js +0 -31
- package/cjs/highlevel/methods/stories/get-profile-stories.js.map +0 -1
- package/cjs/highlevel/methods/stories/get-stories-by-id.js +0 -29
- package/cjs/highlevel/methods/stories/get-stories-by-id.js.map +0 -1
- package/cjs/highlevel/methods/stories/get-stories-interactions.js +0 -24
- package/cjs/highlevel/methods/stories/get-stories-interactions.js.map +0 -1
- package/cjs/highlevel/methods/stories/get-story-link.js +0 -23
- package/cjs/highlevel/methods/stories/get-story-link.js.map +0 -1
- package/cjs/highlevel/methods/stories/get-story-viewers.js +0 -26
- package/cjs/highlevel/methods/stories/get-story-viewers.js.map +0 -1
- package/cjs/highlevel/methods/stories/hide-my-stories-views.js +0 -29
- package/cjs/highlevel/methods/stories/hide-my-stories-views.js.map +0 -1
- package/cjs/highlevel/methods/stories/increment-stories-views.js +0 -24
- package/cjs/highlevel/methods/stories/increment-stories-views.js.map +0 -1
- package/cjs/highlevel/methods/stories/iter-all-stories.js +0 -32
- package/cjs/highlevel/methods/stories/iter-all-stories.js.map +0 -1
- package/cjs/highlevel/methods/stories/iter-profile-stories.js +0 -33
- package/cjs/highlevel/methods/stories/iter-profile-stories.js.map +0 -1
- package/cjs/highlevel/methods/stories/iter-story-viewers.js +0 -36
- package/cjs/highlevel/methods/stories/iter-story-viewers.js.map +0 -1
- package/cjs/highlevel/methods/stories/read-stories.js +0 -21
- package/cjs/highlevel/methods/stories/read-stories.js.map +0 -1
- package/cjs/highlevel/methods/stories/report-story.js +0 -21
- package/cjs/highlevel/methods/stories/report-story.js.map +0 -1
- package/cjs/highlevel/methods/stories/send-story-reaction.js +0 -21
- package/cjs/highlevel/methods/stories/send-story-reaction.js.map +0 -1
- package/cjs/highlevel/methods/stories/send-story.js +0 -48
- package/cjs/highlevel/methods/stories/send-story.js.map +0 -1
- package/cjs/highlevel/methods/stories/toggle-peer-stories-archived.js +0 -20
- package/cjs/highlevel/methods/stories/toggle-peer-stories-archived.js.map +0 -1
- package/cjs/highlevel/methods/stories/toggle-stories-pinned.js +0 -20
- package/cjs/highlevel/methods/stories/toggle-stories-pinned.js.map +0 -1
- package/cjs/highlevel/methods/users/block-user.js +0 -19
- package/cjs/highlevel/methods/users/block-user.js.map +0 -1
- package/cjs/highlevel/methods/users/delete-profile-photos.js +0 -25
- package/cjs/highlevel/methods/users/delete-profile-photos.js.map +0 -1
- package/cjs/highlevel/methods/users/edit-close-friends.js +0 -37
- package/cjs/highlevel/methods/users/edit-close-friends.js.map +0 -1
- package/cjs/highlevel/methods/users/get-common-chats.d.ts +0 -9
- package/cjs/highlevel/methods/users/get-common-chats.js +0 -23
- package/cjs/highlevel/methods/users/get-common-chats.js.map +0 -1
- package/cjs/highlevel/methods/users/get-global-ttl.js +0 -15
- package/cjs/highlevel/methods/users/get-global-ttl.js.map +0 -1
- package/cjs/highlevel/methods/users/get-me.js +0 -26
- package/cjs/highlevel/methods/users/get-me.js.map +0 -1
- package/cjs/highlevel/methods/users/get-my-username.js +0 -14
- package/cjs/highlevel/methods/users/get-my-username.js.map +0 -1
- package/cjs/highlevel/methods/users/get-profile-photo.js +0 -27
- package/cjs/highlevel/methods/users/get-profile-photo.js.map +0 -1
- package/cjs/highlevel/methods/users/get-profile-photos.js +0 -35
- package/cjs/highlevel/methods/users/get-profile-photos.js.map +0 -1
- package/cjs/highlevel/methods/users/get-users.js +0 -29
- package/cjs/highlevel/methods/users/get-users.js.map +0 -1
- package/cjs/highlevel/methods/users/iter-profile-photos.js +0 -35
- package/cjs/highlevel/methods/users/iter-profile-photos.js.map +0 -1
- package/cjs/highlevel/methods/users/resolve-peer-many.js +0 -86
- package/cjs/highlevel/methods/users/resolve-peer-many.js.map +0 -1
- package/cjs/highlevel/methods/users/resolve-peer.js +0 -182
- package/cjs/highlevel/methods/users/resolve-peer.js.map +0 -1
- package/cjs/highlevel/methods/users/set-global-ttl.js +0 -19
- package/cjs/highlevel/methods/users/set-global-ttl.js.map +0 -1
- package/cjs/highlevel/methods/users/set-my-birthday.js +0 -22
- package/cjs/highlevel/methods/users/set-my-birthday.js.map +0 -1
- package/cjs/highlevel/methods/users/set-my-emoji-status.js +0 -37
- package/cjs/highlevel/methods/users/set-my-emoji-status.js.map +0 -1
- package/cjs/highlevel/methods/users/set-my-profile-photo.js +0 -42
- package/cjs/highlevel/methods/users/set-my-profile-photo.js.map +0 -1
- package/cjs/highlevel/methods/users/set-my-username.js +0 -24
- package/cjs/highlevel/methods/users/set-my-username.js.map +0 -1
- package/cjs/highlevel/methods/users/set-offline.js +0 -16
- package/cjs/highlevel/methods/users/set-offline.js.map +0 -1
- package/cjs/highlevel/methods/users/unblock-user.js +0 -19
- package/cjs/highlevel/methods/users/unblock-user.js.map +0 -1
- package/cjs/highlevel/methods/users/update-profile.js +0 -22
- package/cjs/highlevel/methods/users/update-profile.js.map +0 -1
- package/cjs/highlevel/methods.d.ts +0 -274
- package/cjs/highlevel/methods.js +0 -532
- package/cjs/highlevel/methods.js.map +0 -1
- package/cjs/highlevel/storage/index.js +0 -21
- package/cjs/highlevel/storage/index.js.map +0 -1
- package/cjs/highlevel/storage/provider.js +0 -3
- package/cjs/highlevel/storage/provider.js.map +0 -1
- package/cjs/highlevel/storage/repository/peers.d.ts +0 -32
- package/cjs/highlevel/storage/repository/peers.js +0 -3
- package/cjs/highlevel/storage/repository/peers.js.map +0 -1
- package/cjs/highlevel/storage/repository/ref-messages.d.ts +0 -20
- package/cjs/highlevel/storage/repository/ref-messages.js +0 -3
- package/cjs/highlevel/storage/repository/ref-messages.js.map +0 -1
- package/cjs/highlevel/storage/service/current-user.d.ts +0 -23
- package/cjs/highlevel/storage/service/current-user.js +0 -131
- package/cjs/highlevel/storage/service/current-user.js.map +0 -1
- package/cjs/highlevel/storage/service/peers.d.ts +0 -23
- package/cjs/highlevel/storage/service/peers.js +0 -221
- package/cjs/highlevel/storage/service/peers.js.map +0 -1
- package/cjs/highlevel/storage/service/ref-messages.d.ts +0 -15
- package/cjs/highlevel/storage/service/ref-messages.js +0 -43
- package/cjs/highlevel/storage/service/ref-messages.js.map +0 -1
- package/cjs/highlevel/storage/service/updates.d.ts +0 -16
- package/cjs/highlevel/storage/service/updates.js +0 -73
- package/cjs/highlevel/storage/service/updates.js.map +0 -1
- package/cjs/highlevel/storage/storage.d.ts +0 -27
- package/cjs/highlevel/storage/storage.js +0 -38
- package/cjs/highlevel/storage/storage.js.map +0 -1
- package/cjs/highlevel/types/auth/index.js +0 -18
- package/cjs/highlevel/types/auth/index.js.map +0 -1
- package/cjs/highlevel/types/auth/sent-code.js +0 -80
- package/cjs/highlevel/types/auth/sent-code.js.map +0 -1
- package/cjs/highlevel/types/bots/command-scope/index.js +0 -29
- package/cjs/highlevel/types/bots/command-scope/index.js.map +0 -1
- package/cjs/highlevel/types/bots/command-scope/inner.js +0 -76
- package/cjs/highlevel/types/bots/command-scope/inner.js.map +0 -1
- package/cjs/highlevel/types/bots/game-high-score.js +0 -39
- package/cjs/highlevel/types/bots/game-high-score.js.map +0 -1
- package/cjs/highlevel/types/bots/index.js +0 -22
- package/cjs/highlevel/types/bots/index.js.map +0 -1
- package/cjs/highlevel/types/bots/inline-message/factories.js +0 -175
- package/cjs/highlevel/types/bots/inline-message/factories.js.map +0 -1
- package/cjs/highlevel/types/bots/inline-message/index.d.ts +0 -3
- package/cjs/highlevel/types/bots/inline-message/index.js +0 -33
- package/cjs/highlevel/types/bots/inline-message/index.js.map +0 -1
- package/cjs/highlevel/types/bots/inline-message/types.js +0 -3
- package/cjs/highlevel/types/bots/inline-message/types.js.map +0 -1
- package/cjs/highlevel/types/bots/inline-result/factories.js +0 -486
- package/cjs/highlevel/types/bots/inline-result/factories.js.map +0 -1
- package/cjs/highlevel/types/bots/inline-result/index.js +0 -33
- package/cjs/highlevel/types/bots/inline-result/index.js.map +0 -1
- package/cjs/highlevel/types/bots/inline-result/types.js +0 -3
- package/cjs/highlevel/types/bots/inline-result/types.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboards/builder.d.ts +0 -38
- package/cjs/highlevel/types/bots/keyboards/builder.js +0 -94
- package/cjs/highlevel/types/bots/keyboards/builder.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboards/factories.js +0 -366
- package/cjs/highlevel/types/bots/keyboards/factories.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboards/index.d.ts +0 -15
- package/cjs/highlevel/types/bots/keyboards/index.js +0 -34
- package/cjs/highlevel/types/bots/keyboards/index.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboards/types.js +0 -3
- package/cjs/highlevel/types/bots/keyboards/types.js.map +0 -1
- package/cjs/highlevel/types/calls/discard-reason.js +0 -37
- package/cjs/highlevel/types/calls/discard-reason.js.map +0 -1
- package/cjs/highlevel/types/calls/index.js +0 -18
- package/cjs/highlevel/types/calls/index.js.map +0 -1
- package/cjs/highlevel/types/conversation.d.ts +0 -210
- package/cjs/highlevel/types/conversation.js +0 -475
- package/cjs/highlevel/types/conversation.js.map +0 -1
- package/cjs/highlevel/types/errors.js +0 -49
- package/cjs/highlevel/types/errors.js.map +0 -1
- package/cjs/highlevel/types/files/file-location.js +0 -42
- package/cjs/highlevel/types/files/file-location.js.map +0 -1
- package/cjs/highlevel/types/files/index.js +0 -21
- package/cjs/highlevel/types/files/index.js.map +0 -1
- package/cjs/highlevel/types/files/uploaded-file.js +0 -9
- package/cjs/highlevel/types/files/uploaded-file.js.map +0 -1
- package/cjs/highlevel/types/files/utils.js +0 -3
- package/cjs/highlevel/types/files/utils.js.map +0 -1
- package/cjs/highlevel/types/files/web-document.js +0 -58
- package/cjs/highlevel/types/files/web-document.js.map +0 -1
- package/cjs/highlevel/types/index.js +0 -32
- package/cjs/highlevel/types/index.js.map +0 -1
- package/cjs/highlevel/types/media/audio.js +0 -49
- package/cjs/highlevel/types/media/audio.js.map +0 -1
- package/cjs/highlevel/types/media/contact.js +0 -52
- package/cjs/highlevel/types/media/contact.js.map +0 -1
- package/cjs/highlevel/types/media/dice.js +0 -172
- package/cjs/highlevel/types/media/dice.js.map +0 -1
- package/cjs/highlevel/types/media/document-utils.js +0 -42
- package/cjs/highlevel/types/media/document-utils.js.map +0 -1
- package/cjs/highlevel/types/media/document.js +0 -142
- package/cjs/highlevel/types/media/document.js.map +0 -1
- package/cjs/highlevel/types/media/extended-media.js +0 -41
- package/cjs/highlevel/types/media/extended-media.js.map +0 -1
- package/cjs/highlevel/types/media/game.js +0 -77
- package/cjs/highlevel/types/media/game.js.map +0 -1
- package/cjs/highlevel/types/media/index.js +0 -36
- package/cjs/highlevel/types/media/index.js.map +0 -1
- package/cjs/highlevel/types/media/input-media/factories.js +0 -256
- package/cjs/highlevel/types/media/input-media/factories.js.map +0 -1
- package/cjs/highlevel/types/media/input-media/index.js +0 -33
- package/cjs/highlevel/types/media/input-media/index.js.map +0 -1
- package/cjs/highlevel/types/media/input-media/types.d.ts +0 -516
- package/cjs/highlevel/types/media/input-media/types.js +0 -3
- package/cjs/highlevel/types/media/input-media/types.js.map +0 -1
- package/cjs/highlevel/types/media/invoice.d.ts +0 -89
- package/cjs/highlevel/types/media/invoice.js +0 -132
- package/cjs/highlevel/types/media/invoice.js.map +0 -1
- package/cjs/highlevel/types/media/location.js +0 -120
- package/cjs/highlevel/types/media/location.js.map +0 -1
- package/cjs/highlevel/types/media/paid-media.js +0 -66
- package/cjs/highlevel/types/media/paid-media.js.map +0 -1
- package/cjs/highlevel/types/media/photo.js +0 -167
- package/cjs/highlevel/types/media/photo.js.map +0 -1
- package/cjs/highlevel/types/media/poll.d.ts +0 -110
- package/cjs/highlevel/types/media/poll.js +0 -194
- package/cjs/highlevel/types/media/poll.js.map +0 -1
- package/cjs/highlevel/types/media/sticker.js +0 -147
- package/cjs/highlevel/types/media/sticker.js.map +0 -1
- package/cjs/highlevel/types/media/story.js +0 -57
- package/cjs/highlevel/types/media/story.js.map +0 -1
- package/cjs/highlevel/types/media/thumbnail.js +0 -256
- package/cjs/highlevel/types/media/thumbnail.js.map +0 -1
- package/cjs/highlevel/types/media/venue.js +0 -80
- package/cjs/highlevel/types/media/venue.js.map +0 -1
- package/cjs/highlevel/types/media/video.js +0 -84
- package/cjs/highlevel/types/media/video.js.map +0 -1
- package/cjs/highlevel/types/media/voice.js +0 -41
- package/cjs/highlevel/types/media/voice.js.map +0 -1
- package/cjs/highlevel/types/media/web-page.js +0 -198
- package/cjs/highlevel/types/media/web-page.js.map +0 -1
- package/cjs/highlevel/types/messages/dialog.js +0 -240
- package/cjs/highlevel/types/messages/dialog.js.map +0 -1
- package/cjs/highlevel/types/messages/draft-message.js +0 -57
- package/cjs/highlevel/types/messages/draft-message.js.map +0 -1
- package/cjs/highlevel/types/messages/fact-check.js +0 -56
- package/cjs/highlevel/types/messages/fact-check.js.map +0 -1
- package/cjs/highlevel/types/messages/index.js +0 -31
- package/cjs/highlevel/types/messages/index.js.map +0 -1
- package/cjs/highlevel/types/messages/input-message-id.d.ts +0 -20
- package/cjs/highlevel/types/messages/input-message-id.js +0 -11
- package/cjs/highlevel/types/messages/input-message-id.js.map +0 -1
- package/cjs/highlevel/types/messages/message-action.d.ts +0 -377
- package/cjs/highlevel/types/messages/message-action.js +0 -280
- package/cjs/highlevel/types/messages/message-action.js.map +0 -1
- package/cjs/highlevel/types/messages/message-effect.js +0 -69
- package/cjs/highlevel/types/messages/message-effect.js.map +0 -1
- package/cjs/highlevel/types/messages/message-entity.js +0 -107
- package/cjs/highlevel/types/messages/message-entity.js.map +0 -1
- package/cjs/highlevel/types/messages/message-forward.js +0 -68
- package/cjs/highlevel/types/messages/message-forward.js.map +0 -1
- package/cjs/highlevel/types/messages/message-media.js +0 -82
- package/cjs/highlevel/types/messages/message-media.js.map +0 -1
- package/cjs/highlevel/types/messages/message-reactions.d.ts +0 -29
- package/cjs/highlevel/types/messages/message-reactions.js +0 -47
- package/cjs/highlevel/types/messages/message-reactions.js.map +0 -1
- package/cjs/highlevel/types/messages/message-replies.js +0 -69
- package/cjs/highlevel/types/messages/message-replies.js.map +0 -1
- package/cjs/highlevel/types/messages/message.js +0 -463
- package/cjs/highlevel/types/messages/message.js.map +0 -1
- package/cjs/highlevel/types/messages/replied-message.js +0 -165
- package/cjs/highlevel/types/messages/replied-message.js.map +0 -1
- package/cjs/highlevel/types/messages/search-filters.js +0 -58
- package/cjs/highlevel/types/messages/search-filters.js.map +0 -1
- package/cjs/highlevel/types/misc/app-config.js +0 -5
- package/cjs/highlevel/types/misc/app-config.js.map +0 -1
- package/cjs/highlevel/types/misc/collectible-info.d.ts +0 -27
- package/cjs/highlevel/types/misc/collectible-info.js +0 -46
- package/cjs/highlevel/types/misc/collectible-info.js.map +0 -1
- package/cjs/highlevel/types/misc/entities.js +0 -18
- package/cjs/highlevel/types/misc/entities.js.map +0 -1
- package/cjs/highlevel/types/misc/index.js +0 -23
- package/cjs/highlevel/types/misc/index.js.map +0 -1
- package/cjs/highlevel/types/misc/input-privacy-rule/allow.js +0 -36
- package/cjs/highlevel/types/misc/input-privacy-rule/allow.js.map +0 -1
- package/cjs/highlevel/types/misc/input-privacy-rule/bundle.js +0 -31
- package/cjs/highlevel/types/misc/input-privacy-rule/bundle.js.map +0 -1
- package/cjs/highlevel/types/misc/input-privacy-rule/disallow.js +0 -32
- package/cjs/highlevel/types/misc/input-privacy-rule/disallow.js.map +0 -1
- package/cjs/highlevel/types/misc/input-privacy-rule/index.js +0 -33
- package/cjs/highlevel/types/misc/input-privacy-rule/index.js.map +0 -1
- package/cjs/highlevel/types/misc/input-privacy-rule/types.js +0 -3
- package/cjs/highlevel/types/misc/input-privacy-rule/types.js.map +0 -1
- package/cjs/highlevel/types/misc/sticker-set.js +0 -257
- package/cjs/highlevel/types/misc/sticker-set.js.map +0 -1
- package/cjs/highlevel/types/misc/takeout-session.js +0 -87
- package/cjs/highlevel/types/misc/takeout-session.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-colors.js +0 -38
- package/cjs/highlevel/types/peers/chat-colors.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-event/actions.d.ts +0 -266
- package/cjs/highlevel/types/peers/chat-event/actions.js +0 -234
- package/cjs/highlevel/types/peers/chat-event/actions.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-event/filters.js +0 -108
- package/cjs/highlevel/types/peers/chat-event/filters.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-event/index.js +0 -58
- package/cjs/highlevel/types/peers/chat-event/index.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-invite-link-member.js +0 -57
- package/cjs/highlevel/types/peers/chat-invite-link-member.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-invite-link.d.ts +0 -72
- package/cjs/highlevel/types/peers/chat-invite-link.js +0 -110
- package/cjs/highlevel/types/peers/chat-invite-link.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-location.js +0 -31
- package/cjs/highlevel/types/peers/chat-location.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-member.d.ts +0 -81
- package/cjs/highlevel/types/peers/chat-member.js +0 -156
- package/cjs/highlevel/types/peers/chat-member.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-permissions.js +0 -177
- package/cjs/highlevel/types/peers/chat-permissions.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-photo.js +0 -134
- package/cjs/highlevel/types/peers/chat-photo.js.map +0 -1
- package/cjs/highlevel/types/peers/chat-preview.js +0 -76
- package/cjs/highlevel/types/peers/chat-preview.js.map +0 -1
- package/cjs/highlevel/types/peers/chat.d.ts +0 -248
- package/cjs/highlevel/types/peers/chat.js +0 -482
- package/cjs/highlevel/types/peers/chat.js.map +0 -1
- package/cjs/highlevel/types/peers/chatlist-preview.js +0 -49
- package/cjs/highlevel/types/peers/chatlist-preview.js.map +0 -1
- package/cjs/highlevel/types/peers/forum-topic.js +0 -161
- package/cjs/highlevel/types/peers/forum-topic.js.map +0 -1
- package/cjs/highlevel/types/peers/full-chat.d.ts +0 -105
- package/cjs/highlevel/types/peers/full-chat.js +0 -241
- package/cjs/highlevel/types/peers/full-chat.js.map +0 -1
- package/cjs/highlevel/types/peers/index.js +0 -33
- package/cjs/highlevel/types/peers/index.js.map +0 -1
- package/cjs/highlevel/types/peers/peer.js +0 -20
- package/cjs/highlevel/types/peers/peer.js.map +0 -1
- package/cjs/highlevel/types/peers/peers-index.js +0 -59
- package/cjs/highlevel/types/peers/peers-index.js.map +0 -1
- package/cjs/highlevel/types/peers/typing-status.js +0 -3
- package/cjs/highlevel/types/peers/typing-status.js.map +0 -1
- package/cjs/highlevel/types/peers/user.d.ts +0 -268
- package/cjs/highlevel/types/peers/user.js +0 -456
- package/cjs/highlevel/types/peers/user.js.map +0 -1
- package/cjs/highlevel/types/premium/boost-slot.d.ts +0 -37
- package/cjs/highlevel/types/premium/boost-slot.js +0 -66
- package/cjs/highlevel/types/premium/boost-slot.js.map +0 -1
- package/cjs/highlevel/types/premium/boost-stats.js +0 -92
- package/cjs/highlevel/types/premium/boost-stats.js.map +0 -1
- package/cjs/highlevel/types/premium/boost.d.ts +0 -55
- package/cjs/highlevel/types/premium/boost.js +0 -82
- package/cjs/highlevel/types/premium/boost.js.map +0 -1
- package/cjs/highlevel/types/premium/business-account.js +0 -45
- package/cjs/highlevel/types/premium/business-account.js.map +0 -1
- package/cjs/highlevel/types/premium/business-chat-link.js +0 -39
- package/cjs/highlevel/types/premium/business-chat-link.js.map +0 -1
- package/cjs/highlevel/types/premium/business-connection.js +0 -45
- package/cjs/highlevel/types/premium/business-connection.js.map +0 -1
- package/cjs/highlevel/types/premium/business-intro.js +0 -43
- package/cjs/highlevel/types/premium/business-intro.js.map +0 -1
- package/cjs/highlevel/types/premium/business-location.js +0 -26
- package/cjs/highlevel/types/premium/business-location.js.map +0 -1
- package/cjs/highlevel/types/premium/business-work-hours.js +0 -141
- package/cjs/highlevel/types/premium/business-work-hours.js.map +0 -1
- package/cjs/highlevel/types/premium/index.d.ts +0 -8
- package/cjs/highlevel/types/premium/index.js +0 -25
- package/cjs/highlevel/types/premium/index.js.map +0 -1
- package/cjs/highlevel/types/reactions/emoji-status.js +0 -26
- package/cjs/highlevel/types/reactions/emoji-status.js.map +0 -1
- package/cjs/highlevel/types/reactions/index.js +0 -19
- package/cjs/highlevel/types/reactions/index.js.map +0 -1
- package/cjs/highlevel/types/reactions/peer-reaction.d.ts +0 -32
- package/cjs/highlevel/types/reactions/peer-reaction.js +0 -55
- package/cjs/highlevel/types/reactions/peer-reaction.js.map +0 -1
- package/cjs/highlevel/types/reactions/reaction-count.d.ts +0 -23
- package/cjs/highlevel/types/reactions/reaction-count.js +0 -37
- package/cjs/highlevel/types/reactions/reaction-count.js.map +0 -1
- package/cjs/highlevel/types/reactions/types.d.ts +0 -14
- package/cjs/highlevel/types/reactions/types.js +0 -44
- package/cjs/highlevel/types/reactions/types.js.map +0 -1
- package/cjs/highlevel/types/stories/all-stories.js +0 -48
- package/cjs/highlevel/types/stories/all-stories.js.map +0 -1
- package/cjs/highlevel/types/stories/index.js +0 -24
- package/cjs/highlevel/types/stories/index.js.map +0 -1
- package/cjs/highlevel/types/stories/interactive/base.js +0 -32
- package/cjs/highlevel/types/stories/interactive/base.js.map +0 -1
- package/cjs/highlevel/types/stories/interactive/channel-post.js +0 -32
- package/cjs/highlevel/types/stories/interactive/channel-post.js.map +0 -1
- package/cjs/highlevel/types/stories/interactive/index.js +0 -52
- package/cjs/highlevel/types/stories/interactive/index.js.map +0 -1
- package/cjs/highlevel/types/stories/interactive/input.js +0 -92
- package/cjs/highlevel/types/stories/interactive/input.js.map +0 -1
- package/cjs/highlevel/types/stories/interactive/location.js +0 -30
- package/cjs/highlevel/types/stories/interactive/location.js.map +0 -1
- package/cjs/highlevel/types/stories/interactive/reaction.js +0 -36
- package/cjs/highlevel/types/stories/interactive/reaction.js.map +0 -1
- package/cjs/highlevel/types/stories/interactive/url.js +0 -20
- package/cjs/highlevel/types/stories/interactive/url.js.map +0 -1
- package/cjs/highlevel/types/stories/interactive/venue.js +0 -54
- package/cjs/highlevel/types/stories/interactive/venue.js.map +0 -1
- package/cjs/highlevel/types/stories/interactive/weather.js +0 -30
- package/cjs/highlevel/types/stories/interactive/weather.js.map +0 -1
- package/cjs/highlevel/types/stories/peer-stories.js +0 -41
- package/cjs/highlevel/types/stories/peer-stories.js.map +0 -1
- package/cjs/highlevel/types/stories/stealth-mode.js +0 -25
- package/cjs/highlevel/types/stories/stealth-mode.js.map +0 -1
- package/cjs/highlevel/types/stories/story-interactions.js +0 -58
- package/cjs/highlevel/types/stories/story-interactions.js.map +0 -1
- package/cjs/highlevel/types/stories/story-viewer.js +0 -146
- package/cjs/highlevel/types/stories/story-viewer.js.map +0 -1
- package/cjs/highlevel/types/stories/story.js +0 -150
- package/cjs/highlevel/types/stories/story.js.map +0 -1
- package/cjs/highlevel/types/updates/bot-chat-join-request.d.ts +0 -42
- package/cjs/highlevel/types/updates/bot-chat-join-request.js +0 -68
- package/cjs/highlevel/types/updates/bot-chat-join-request.js.map +0 -1
- package/cjs/highlevel/types/updates/bot-reaction.js +0 -108
- package/cjs/highlevel/types/updates/bot-reaction.js.map +0 -1
- package/cjs/highlevel/types/updates/bot-stopped.js +0 -45
- package/cjs/highlevel/types/updates/bot-stopped.js.map +0 -1
- package/cjs/highlevel/types/updates/business-message.js +0 -35
- package/cjs/highlevel/types/updates/business-message.js.map +0 -1
- package/cjs/highlevel/types/updates/callback-query.js +0 -157
- package/cjs/highlevel/types/updates/callback-query.js.map +0 -1
- package/cjs/highlevel/types/updates/chat-join-request.js +0 -52
- package/cjs/highlevel/types/updates/chat-join-request.js.map +0 -1
- package/cjs/highlevel/types/updates/chat-member-update.js +0 -180
- package/cjs/highlevel/types/updates/chat-member-update.js.map +0 -1
- package/cjs/highlevel/types/updates/chosen-inline-result.js +0 -78
- package/cjs/highlevel/types/updates/chosen-inline-result.js.map +0 -1
- package/cjs/highlevel/types/updates/delete-business-message-update.js +0 -37
- package/cjs/highlevel/types/updates/delete-business-message-update.js.map +0 -1
- package/cjs/highlevel/types/updates/delete-message-update.js +0 -29
- package/cjs/highlevel/types/updates/delete-message-update.js.map +0 -1
- package/cjs/highlevel/types/updates/delete-story-update.js +0 -33
- package/cjs/highlevel/types/updates/delete-story-update.js.map +0 -1
- package/cjs/highlevel/types/updates/history-read-update.js +0 -110
- package/cjs/highlevel/types/updates/history-read-update.js.map +0 -1
- package/cjs/highlevel/types/updates/index.d.ts +0 -107
- package/cjs/highlevel/types/updates/index.js +0 -46
- package/cjs/highlevel/types/updates/index.js.map +0 -1
- package/cjs/highlevel/types/updates/inline-query.d.ts +0 -42
- package/cjs/highlevel/types/updates/inline-query.js +0 -75
- package/cjs/highlevel/types/updates/inline-query.js.map +0 -1
- package/cjs/highlevel/types/updates/parse-update.js +0 -86
- package/cjs/highlevel/types/updates/parse-update.js.map +0 -1
- package/cjs/highlevel/types/updates/poll-update.js +0 -69
- package/cjs/highlevel/types/updates/poll-update.js.map +0 -1
- package/cjs/highlevel/types/updates/poll-vote.js +0 -80
- package/cjs/highlevel/types/updates/poll-vote.js.map +0 -1
- package/cjs/highlevel/types/updates/pre-checkout-query.js +0 -63
- package/cjs/highlevel/types/updates/pre-checkout-query.js.map +0 -1
- package/cjs/highlevel/types/updates/story-update.js +0 -39
- package/cjs/highlevel/types/updates/story-update.js.map +0 -1
- package/cjs/highlevel/types/updates/user-status-update.js +0 -48
- package/cjs/highlevel/types/updates/user-status-update.js.map +0 -1
- package/cjs/highlevel/types/updates/user-typing-update.js +0 -100
- package/cjs/highlevel/types/updates/user-typing-update.js.map +0 -1
- package/cjs/highlevel/types/utils.js +0 -3
- package/cjs/highlevel/types/utils.js.map +0 -1
- package/cjs/highlevel/updates/index.js +0 -20
- package/cjs/highlevel/updates/index.js.map +0 -1
- package/cjs/highlevel/updates/manager.d.ts +0 -123
- package/cjs/highlevel/updates/manager.js +0 -1414
- package/cjs/highlevel/updates/manager.js.map +0 -1
- package/cjs/highlevel/updates/parsed.js +0 -49
- package/cjs/highlevel/updates/parsed.js.map +0 -1
- package/cjs/highlevel/updates/types.d.ts +0 -142
- package/cjs/highlevel/updates/types.js +0 -3
- package/cjs/highlevel/updates/types.js.map +0 -1
- package/cjs/highlevel/updates/utils.d.ts +0 -21
- package/cjs/highlevel/updates/utils.js +0 -109
- package/cjs/highlevel/updates/utils.js.map +0 -1
- package/cjs/highlevel/utils/convert-file-id.js +0 -294
- package/cjs/highlevel/utils/convert-file-id.js.map +0 -1
- package/cjs/highlevel/utils/entities.js +0 -53
- package/cjs/highlevel/utils/entities.js.map +0 -1
- package/cjs/highlevel/utils/file-type.js +0 -173
- package/cjs/highlevel/utils/file-type.js.map +0 -1
- package/cjs/highlevel/utils/file-utils.js +0 -124
- package/cjs/highlevel/utils/file-utils.js.map +0 -1
- package/cjs/highlevel/utils/index.js +0 -28
- package/cjs/highlevel/utils/index.js.map +0 -1
- package/cjs/highlevel/utils/inline-utils.js +0 -66
- package/cjs/highlevel/utils/inline-utils.js.map +0 -1
- package/cjs/highlevel/utils/inspectable.js +0 -73
- package/cjs/highlevel/utils/inspectable.js.map +0 -1
- package/cjs/highlevel/utils/memoize.js +0 -31
- package/cjs/highlevel/utils/memoize.js.map +0 -1
- package/cjs/highlevel/utils/misc-utils.js +0 -43
- package/cjs/highlevel/utils/misc-utils.js.map +0 -1
- package/cjs/highlevel/utils/peer-utils.js +0 -139
- package/cjs/highlevel/utils/peer-utils.js.map +0 -1
- package/cjs/highlevel/utils/query-batcher.d.ts +0 -48
- package/cjs/highlevel/utils/query-batcher.js +0 -146
- package/cjs/highlevel/utils/query-batcher.js.map +0 -1
- package/cjs/highlevel/utils/rps-meter.js +0 -43
- package/cjs/highlevel/utils/rps-meter.js.map +0 -1
- package/cjs/highlevel/utils/stream-utils.js +0 -114
- package/cjs/highlevel/utils/stream-utils.js.map +0 -1
- package/cjs/highlevel/utils/string-session.js +0 -121
- package/cjs/highlevel/utils/string-session.js.map +0 -1
- package/cjs/highlevel/utils/voice-utils.js +0 -64
- package/cjs/highlevel/utils/voice-utils.js.map +0 -1
- package/cjs/highlevel/worker/app-config.d.ts +0 -12
- package/cjs/highlevel/worker/app-config.js +0 -16
- package/cjs/highlevel/worker/app-config.js.map +0 -1
- package/cjs/highlevel/worker/errors.js +0 -121
- package/cjs/highlevel/worker/errors.js.map +0 -1
- package/cjs/highlevel/worker/index.js +0 -26
- package/cjs/highlevel/worker/index.js.map +0 -1
- package/cjs/highlevel/worker/invoker.js +0 -74
- package/cjs/highlevel/worker/invoker.js.map +0 -1
- package/cjs/highlevel/worker/port.d.ts +0 -61
- package/cjs/highlevel/worker/port.js +0 -141
- package/cjs/highlevel/worker/port.js.map +0 -1
- package/cjs/highlevel/worker/protocol.d.ts +0 -57
- package/cjs/highlevel/worker/protocol.js +0 -76
- package/cjs/highlevel/worker/protocol.js.map +0 -1
- package/cjs/highlevel/worker/storage.d.ts +0 -39
- package/cjs/highlevel/worker/storage.js +0 -81
- package/cjs/highlevel/worker/storage.js.map +0 -1
- package/cjs/highlevel/worker/worker.js +0 -145
- package/cjs/highlevel/worker/worker.js.map +0 -1
- package/cjs/index.d.ts +0 -10
- package/cjs/index.js +0 -38
- package/cjs/index.js.map +0 -1
- package/cjs/network/auth-key.d.ts +0 -21
- package/cjs/network/auth-key.js +0 -108
- package/cjs/network/auth-key.js.map +0 -1
- package/cjs/network/authorization.d.ts +0 -9
- package/cjs/network/authorization.js +0 -341
- package/cjs/network/authorization.js.map +0 -1
- package/cjs/network/client.d.ts +0 -213
- package/cjs/network/client.js +0 -191
- package/cjs/network/client.js.map +0 -1
- package/cjs/network/config-manager.js +0 -51
- package/cjs/network/config-manager.js.map +0 -1
- package/cjs/network/index.js +0 -22
- package/cjs/network/index.js.map +0 -1
- package/cjs/network/middlewares/bundle.js +0 -20
- package/cjs/network/middlewares/bundle.js.map +0 -1
- package/cjs/network/middlewares/default.d.ts +0 -8
- package/cjs/network/middlewares/default.js +0 -10
- package/cjs/network/middlewares/default.js.map +0 -1
- package/cjs/network/middlewares/flood-waiter.js +0 -70
- package/cjs/network/middlewares/flood-waiter.js.map +0 -1
- package/cjs/network/middlewares/index.js +0 -29
- package/cjs/network/middlewares/index.js.map +0 -1
- package/cjs/network/middlewares/internal-errors.js +0 -41
- package/cjs/network/middlewares/internal-errors.js.map +0 -1
- package/cjs/network/middlewares/on-error.js +0 -44
- package/cjs/network/middlewares/on-error.js.map +0 -1
- package/cjs/network/middlewares/on-method.js +0 -45
- package/cjs/network/middlewares/on-method.js.map +0 -1
- package/cjs/network/mtproto-session.d.ts +0 -125
- package/cjs/network/mtproto-session.js +0 -263
- package/cjs/network/mtproto-session.js.map +0 -1
- package/cjs/network/multi-session-connection.d.ts +0 -33
- package/cjs/network/multi-session-connection.js +0 -269
- package/cjs/network/multi-session-connection.js.map +0 -1
- package/cjs/network/network-manager.d.ts +0 -246
- package/cjs/network/network-manager.js +0 -579
- package/cjs/network/network-manager.js.map +0 -1
- package/cjs/network/persistent-connection.d.ts +0 -52
- package/cjs/network/persistent-connection.js +0 -206
- package/cjs/network/persistent-connection.js.map +0 -1
- package/cjs/network/reconnection.js +0 -18
- package/cjs/network/reconnection.js.map +0 -1
- package/cjs/network/server-salt.d.ts +0 -12
- package/cjs/network/server-salt.js +0 -44
- package/cjs/network/server-salt.js.map +0 -1
- package/cjs/network/session-connection.d.ts +0 -79
- package/cjs/network/session-connection.js +0 -1557
- package/cjs/network/session-connection.js.map +0 -1
- package/cjs/network/transports/abstract.d.ts +0 -98
- package/cjs/network/transports/abstract.js +0 -39
- package/cjs/network/transports/abstract.js.map +0 -1
- package/cjs/network/transports/index.js +0 -22
- package/cjs/network/transports/index.js.map +0 -1
- package/cjs/network/transports/intermediate.js +0 -70
- package/cjs/network/transports/intermediate.js.map +0 -1
- package/cjs/network/transports/obfuscated.js +0 -82
- package/cjs/network/transports/obfuscated.js.map +0 -1
- package/cjs/network/transports/streamed.d.ts +0 -23
- package/cjs/network/transports/streamed.js +0 -29
- package/cjs/network/transports/streamed.js.map +0 -1
- package/cjs/network/transports/wrapped.d.ts +0 -10
- package/cjs/network/transports/wrapped.js +0 -28
- package/cjs/network/transports/wrapped.js.map +0 -1
- package/cjs/package.json +0 -3
- package/cjs/platform.d.ts +0 -18
- package/cjs/platform.js +0 -38
- package/cjs/platform.js.map +0 -1
- package/cjs/storage/driver.d.ts +0 -56
- package/cjs/storage/driver.js +0 -40
- package/cjs/storage/driver.js.map +0 -1
- package/cjs/storage/index.js +0 -23
- package/cjs/storage/index.js.map +0 -1
- package/cjs/storage/memory/driver.js +0 -15
- package/cjs/storage/memory/driver.js.map +0 -1
- package/cjs/storage/memory/index.js +0 -26
- package/cjs/storage/memory/index.js.map +0 -1
- package/cjs/storage/memory/repository/auth-keys.js +0 -60
- package/cjs/storage/memory/repository/auth-keys.js.map +0 -1
- package/cjs/storage/memory/repository/kv.js +0 -25
- package/cjs/storage/memory/repository/kv.js.map +0 -1
- package/cjs/storage/memory/repository/peers.js +0 -57
- package/cjs/storage/memory/repository/peers.js.map +0 -1
- package/cjs/storage/memory/repository/ref-messages.js +0 -43
- package/cjs/storage/memory/repository/ref-messages.js.map +0 -1
- package/cjs/storage/provider.js +0 -3
- package/cjs/storage/provider.js.map +0 -1
- package/cjs/storage/repository/auth-keys.d.ts +0 -41
- package/cjs/storage/repository/auth-keys.js +0 -3
- package/cjs/storage/repository/auth-keys.js.map +0 -1
- package/cjs/storage/repository/index.js +0 -19
- package/cjs/storage/repository/index.js.map +0 -1
- package/cjs/storage/repository/key-value.d.ts +0 -10
- package/cjs/storage/repository/key-value.js +0 -3
- package/cjs/storage/repository/key-value.js.map +0 -1
- package/cjs/storage/service/auth-keys.d.ts +0 -9
- package/cjs/storage/service/auth-keys.js +0 -19
- package/cjs/storage/service/auth-keys.js.map +0 -1
- package/cjs/storage/service/base.js +0 -29
- package/cjs/storage/service/base.js.map +0 -1
- package/cjs/storage/service/default-dcs.d.ts +0 -10
- package/cjs/storage/service/default-dcs.js +0 -57
- package/cjs/storage/service/default-dcs.js.map +0 -1
- package/cjs/storage/service/future-salts.d.ts +0 -11
- package/cjs/storage/service/future-salts.js +0 -44
- package/cjs/storage/service/future-salts.js.map +0 -1
- package/cjs/storage/sqlite/driver.d.ts +0 -24
- package/cjs/storage/sqlite/driver.js +0 -129
- package/cjs/storage/sqlite/driver.js.map +0 -1
- package/cjs/storage/sqlite/index.js +0 -40
- package/cjs/storage/sqlite/index.js.map +0 -1
- package/cjs/storage/sqlite/repository/auth-keys.js +0 -77
- package/cjs/storage/sqlite/repository/auth-keys.js.map +0 -1
- package/cjs/storage/sqlite/repository/kv.js +0 -101
- package/cjs/storage/sqlite/repository/kv.js.map +0 -1
- package/cjs/storage/sqlite/repository/peers.js +0 -96
- package/cjs/storage/sqlite/repository/peers.js.map +0 -1
- package/cjs/storage/sqlite/repository/ref-messages.js +0 -55
- package/cjs/storage/sqlite/repository/ref-messages.js.map +0 -1
- package/cjs/storage/sqlite/types.d.ts +0 -18
- package/cjs/storage/sqlite/types.js +0 -3
- package/cjs/storage/sqlite/types.js.map +0 -1
- package/cjs/storage/storage.d.ts +0 -51
- package/cjs/storage/storage.js +0 -71
- package/cjs/storage/storage.js.map +0 -1
- package/cjs/types/errors.js +0 -71
- package/cjs/types/errors.js.map +0 -1
- package/cjs/types/index.js +0 -20
- package/cjs/types/index.js.map +0 -1
- package/cjs/types/peers.js +0 -3
- package/cjs/types/peers.js.map +0 -1
- package/cjs/types/utils.d.ts +0 -10
- package/cjs/types/utils.js +0 -9
- package/cjs/types/utils.js.map +0 -1
- package/cjs/utils/abort-signal.js +0 -13
- package/cjs/utils/abort-signal.js.map +0 -1
- package/cjs/utils/async-lock.js +0 -41
- package/cjs/utils/async-lock.js.map +0 -1
- package/cjs/utils/bigint-utils.js +0 -205
- package/cjs/utils/bigint-utils.js.map +0 -1
- package/cjs/utils/binary/asn1-parser.js +0 -121
- package/cjs/utils/binary/asn1-parser.js.map +0 -1
- package/cjs/utils/buffer-utils.js +0 -76
- package/cjs/utils/buffer-utils.js.map +0 -1
- package/cjs/utils/composer.js +0 -22
- package/cjs/utils/composer.js.map +0 -1
- package/cjs/utils/condition-variable.js +0 -30
- package/cjs/utils/condition-variable.js.map +0 -1
- package/cjs/utils/controllable-promise.d.ts +0 -11
- package/cjs/utils/controllable-promise.js +0 -19
- package/cjs/utils/controllable-promise.js.map +0 -1
- package/cjs/utils/crypto/abstract.d.ts +0 -29
- package/cjs/utils/crypto/abstract.js +0 -16
- package/cjs/utils/crypto/abstract.js.map +0 -1
- package/cjs/utils/crypto/factorization.js +0 -61
- package/cjs/utils/crypto/factorization.js.map +0 -1
- package/cjs/utils/crypto/index.js +0 -24
- package/cjs/utils/crypto/index.js.map +0 -1
- package/cjs/utils/crypto/keys.d.ts +0 -27
- package/cjs/utils/crypto/keys.js +0 -72
- package/cjs/utils/crypto/keys.js.map +0 -1
- package/cjs/utils/crypto/miller-rabin.js +0 -42
- package/cjs/utils/crypto/miller-rabin.js.map +0 -1
- package/cjs/utils/crypto/mtproto.js +0 -66
- package/cjs/utils/crypto/mtproto.js.map +0 -1
- package/cjs/utils/crypto/password.js +0 -97
- package/cjs/utils/crypto/password.js.map +0 -1
- package/cjs/utils/crypto/utils.js +0 -30
- package/cjs/utils/crypto/utils.js.map +0 -1
- package/cjs/utils/dcs.js +0 -90
- package/cjs/utils/dcs.js.map +0 -1
- package/cjs/utils/deque.js +0 -222
- package/cjs/utils/deque.js.map +0 -1
- package/cjs/utils/early-timer.js +0 -82
- package/cjs/utils/early-timer.js.map +0 -1
- package/cjs/utils/error-reporting.js +0 -22
- package/cjs/utils/error-reporting.js.map +0 -1
- package/cjs/utils/function-utils.js +0 -64
- package/cjs/utils/function-utils.js.map +0 -1
- package/cjs/utils/index.d.ts +0 -28
- package/cjs/utils/index.js +0 -53
- package/cjs/utils/index.js.map +0 -1
- package/cjs/utils/linked-list.js +0 -76
- package/cjs/utils/linked-list.js.map +0 -1
- package/cjs/utils/links/bots.d.ts +0 -71
- package/cjs/utils/links/bots.js +0 -259
- package/cjs/utils/links/bots.js.map +0 -1
- package/cjs/utils/links/bundle.js +0 -24
- package/cjs/utils/links/bundle.js.map +0 -1
- package/cjs/utils/links/calls.d.ts +0 -16
- package/cjs/utils/links/calls.js +0 -59
- package/cjs/utils/links/calls.js.map +0 -1
- package/cjs/utils/links/chat.d.ts +0 -46
- package/cjs/utils/links/chat.js +0 -160
- package/cjs/utils/links/chat.js.map +0 -1
- package/cjs/utils/links/common.d.ts +0 -31
- package/cjs/utils/links/common.js +0 -60
- package/cjs/utils/links/common.js.map +0 -1
- package/cjs/utils/links/index.js +0 -29
- package/cjs/utils/links/index.js.map +0 -1
- package/cjs/utils/links/misc.d.ts +0 -25
- package/cjs/utils/links/misc.js +0 -100
- package/cjs/utils/links/misc.js.map +0 -1
- package/cjs/utils/links/proxy.d.ts +0 -17
- package/cjs/utils/links/proxy.js +0 -61
- package/cjs/utils/links/proxy.js.map +0 -1
- package/cjs/utils/links/stickers.d.ts +0 -9
- package/cjs/utils/links/stickers.js +0 -28
- package/cjs/utils/links/stickers.js.map +0 -1
- package/cjs/utils/links/user.d.ts +0 -27
- package/cjs/utils/links/user.js +0 -81
- package/cjs/utils/links/user.js.map +0 -1
- package/cjs/utils/logger.d.ts +0 -54
- package/cjs/utils/logger.js +0 -169
- package/cjs/utils/logger.js.map +0 -1
- package/cjs/utils/long-utils.d.ts +0 -80
- package/cjs/utils/long-utils.js +0 -169
- package/cjs/utils/long-utils.js.map +0 -1
- package/cjs/utils/lru-map.js +0 -117
- package/cjs/utils/lru-map.js.map +0 -1
- package/cjs/utils/lru-set.d.ts +0 -22
- package/cjs/utils/lru-set.js +0 -52
- package/cjs/utils/lru-set.js.map +0 -1
- package/cjs/utils/misc-utils.js +0 -31
- package/cjs/utils/misc-utils.js.map +0 -1
- package/cjs/utils/peer-utils.d.ts +0 -29
- package/cjs/utils/peer-utils.js +0 -167
- package/cjs/utils/peer-utils.js.map +0 -1
- package/cjs/utils/reloadable.d.ts +0 -23
- package/cjs/utils/reloadable.js +0 -65
- package/cjs/utils/reloadable.js.map +0 -1
- package/cjs/utils/sorted-array.js +0 -86
- package/cjs/utils/sorted-array.js.map +0 -1
- package/cjs/utils/tl-json.js +0 -62
- package/cjs/utils/tl-json.js.map +0 -1
- package/cjs/utils/type-assertions.d.ts +0 -39
- package/cjs/utils/type-assertions.js +0 -80
- package/cjs/utils/type-assertions.js.map +0 -1
- package/esm/highlevel/base.d.ts +0 -116
- package/esm/highlevel/base.js +0 -275
- package/esm/highlevel/base.js.map +0 -1
- package/esm/highlevel/client.d.ts +0 -4813
- package/esm/highlevel/client.js +0 -1148
- package/esm/highlevel/client.js.map +0 -1
- package/esm/highlevel/client.types.d.ts +0 -56
- package/esm/highlevel/client.types.js +0 -2
- package/esm/highlevel/client.types.js.map +0 -1
- package/esm/highlevel/index.d.ts +0 -4
- package/esm/highlevel/index.js +0 -5
- package/esm/highlevel/index.js.map +0 -1
- package/esm/highlevel/managers/app-config-manager.d.ts +0 -12
- package/esm/highlevel/managers/app-config-manager.js +0 -39
- package/esm/highlevel/managers/app-config-manager.js.map +0 -1
- package/esm/highlevel/methods/_imports.js +0 -3
- package/esm/highlevel/methods/_imports.js.map +0 -1
- package/esm/highlevel/methods/_init.js +0 -48
- package/esm/highlevel/methods/_init.js.map +0 -1
- package/esm/highlevel/methods/auth/check-password.d.ts +0 -10
- package/esm/highlevel/methods/auth/check-password.js +0 -18
- package/esm/highlevel/methods/auth/check-password.js.map +0 -1
- package/esm/highlevel/methods/auth/get-password-hint.d.ts +0 -7
- package/esm/highlevel/methods/auth/get-password-hint.js +0 -13
- package/esm/highlevel/methods/auth/get-password-hint.js.map +0 -1
- package/esm/highlevel/methods/auth/log-out.d.ts +0 -17
- package/esm/highlevel/methods/auth/log-out.js +0 -16
- package/esm/highlevel/methods/auth/log-out.js.map +0 -1
- package/esm/highlevel/methods/auth/recover-password.d.ts +0 -12
- package/esm/highlevel/methods/auth/recover-password.js +0 -16
- package/esm/highlevel/methods/auth/recover-password.js.map +0 -1
- package/esm/highlevel/methods/auth/resend-code.d.ts +0 -16
- package/esm/highlevel/methods/auth/resend-code.js +0 -20
- package/esm/highlevel/methods/auth/resend-code.js.map +0 -1
- package/esm/highlevel/methods/auth/run.d.ts +0 -16
- package/esm/highlevel/methods/auth/run.js +0 -19
- package/esm/highlevel/methods/auth/run.js.map +0 -1
- package/esm/highlevel/methods/auth/send-code.d.ts +0 -18
- package/esm/highlevel/methods/auth/send-code.js +0 -26
- package/esm/highlevel/methods/auth/send-code.js.map +0 -1
- package/esm/highlevel/methods/auth/send-recovery-code.d.ts +0 -7
- package/esm/highlevel/methods/auth/send-recovery-code.js +0 -13
- package/esm/highlevel/methods/auth/send-recovery-code.js.map +0 -1
- package/esm/highlevel/methods/auth/sign-in-bot.d.ts +0 -10
- package/esm/highlevel/methods/auth/sign-in-bot.js +0 -20
- package/esm/highlevel/methods/auth/sign-in-bot.js.map +0 -1
- package/esm/highlevel/methods/auth/sign-in-qr.d.ts +0 -33
- package/esm/highlevel/methods/auth/sign-in-qr.js +0 -122
- package/esm/highlevel/methods/auth/sign-in-qr.js.map +0 -1
- package/esm/highlevel/methods/auth/sign-in.d.ts +0 -19
- package/esm/highlevel/methods/auth/sign-in.js +0 -20
- package/esm/highlevel/methods/auth/sign-in.js.map +0 -1
- package/esm/highlevel/methods/auth/start-test.d.ts +0 -30
- package/esm/highlevel/methods/auth/start-test.js +0 -62
- package/esm/highlevel/methods/auth/start-test.js.map +0 -1
- package/esm/highlevel/methods/auth/start.d.ts +0 -89
- package/esm/highlevel/methods/auth/start.js +0 -182
- package/esm/highlevel/methods/auth/start.js.map +0 -1
- package/esm/highlevel/methods/auth/utils.d.ts +0 -9
- package/esm/highlevel/methods/auth/utils.js +0 -28
- package/esm/highlevel/methods/auth/utils.js.map +0 -1
- package/esm/highlevel/methods/bots/answer-callback-query.d.ts +0 -41
- package/esm/highlevel/methods/bots/answer-callback-query.js +0 -21
- package/esm/highlevel/methods/bots/answer-callback-query.js.map +0 -1
- package/esm/highlevel/methods/bots/answer-inline-query.d.ts +0 -88
- package/esm/highlevel/methods/bots/answer-inline-query.js +0 -37
- package/esm/highlevel/methods/bots/answer-inline-query.js.map +0 -1
- package/esm/highlevel/methods/bots/answer-pre-checkout-query.d.ts +0 -12
- package/esm/highlevel/methods/bots/answer-pre-checkout-query.js +0 -18
- package/esm/highlevel/methods/bots/answer-pre-checkout-query.js.map +0 -1
- package/esm/highlevel/methods/bots/delete-my-commands.d.ts +0 -22
- package/esm/highlevel/methods/bots/delete-my-commands.js +0 -21
- package/esm/highlevel/methods/bots/delete-my-commands.js.map +0 -1
- package/esm/highlevel/methods/bots/get-bot-info.d.ts +0 -18
- package/esm/highlevel/methods/bots/get-bot-info.js +0 -13
- package/esm/highlevel/methods/bots/get-bot-info.js.map +0 -1
- package/esm/highlevel/methods/bots/get-bot-menu-button.d.ts +0 -7
- package/esm/highlevel/methods/bots/get-bot-menu-button.js +0 -11
- package/esm/highlevel/methods/bots/get-bot-menu-button.js.map +0 -1
- package/esm/highlevel/methods/bots/get-callback-answer.d.ts +0 -41
- package/esm/highlevel/methods/bots/get-callback-answer.js +0 -35
- package/esm/highlevel/methods/bots/get-callback-answer.js.map +0 -1
- package/esm/highlevel/methods/bots/get-game-high-scores.d.ts +0 -17
- package/esm/highlevel/methods/bots/get-game-high-scores.js +0 -50
- package/esm/highlevel/methods/bots/get-game-high-scores.js.map +0 -1
- package/esm/highlevel/methods/bots/get-my-commands.d.ts +0 -21
- package/esm/highlevel/methods/bots/get-my-commands.js +0 -19
- package/esm/highlevel/methods/bots/get-my-commands.js.map +0 -1
- package/esm/highlevel/methods/bots/normalize-command-scope.d.ts +0 -5
- package/esm/highlevel/methods/bots/normalize-command-scope.js +0 -30
- package/esm/highlevel/methods/bots/normalize-command-scope.js.map +0 -1
- package/esm/highlevel/methods/bots/set-bot-info.d.ts +0 -23
- package/esm/highlevel/methods/bots/set-bot-info.js +0 -18
- package/esm/highlevel/methods/bots/set-bot-info.js.map +0 -1
- package/esm/highlevel/methods/bots/set-bot-menu-button.d.ts +0 -7
- package/esm/highlevel/methods/bots/set-bot-menu-button.js +0 -14
- package/esm/highlevel/methods/bots/set-bot-menu-button.js.map +0 -1
- package/esm/highlevel/methods/bots/set-game-score.d.ts +0 -54
- package/esm/highlevel/methods/bots/set-game-score.js +0 -48
- package/esm/highlevel/methods/bots/set-game-score.js.map +0 -1
- package/esm/highlevel/methods/bots/set-my-commands.d.ts +0 -26
- package/esm/highlevel/methods/bots/set-my-commands.js +0 -32
- package/esm/highlevel/methods/bots/set-my-commands.js.map +0 -1
- package/esm/highlevel/methods/bots/set-my-default-rights.d.ts +0 -11
- package/esm/highlevel/methods/bots/set-my-default-rights.js +0 -16
- package/esm/highlevel/methods/bots/set-my-default-rights.js.map +0 -1
- package/esm/highlevel/methods/chats/add-chat-members.d.ts +0 -20
- package/esm/highlevel/methods/chats/add-chat-members.js +0 -43
- package/esm/highlevel/methods/chats/add-chat-members.js.map +0 -1
- package/esm/highlevel/methods/chats/archive-chats.d.ts +0 -9
- package/esm/highlevel/methods/chats/archive-chats.js +0 -22
- package/esm/highlevel/methods/chats/archive-chats.js.map +0 -1
- package/esm/highlevel/methods/chats/ban-chat-member.d.ts +0 -23
- package/esm/highlevel/methods/chats/ban-chat-member.js +0 -44
- package/esm/highlevel/methods/chats/ban-chat-member.js.map +0 -1
- package/esm/highlevel/methods/chats/batched-queries.d.ts +0 -10
- package/esm/highlevel/methods/chats/batched-queries.js +0 -121
- package/esm/highlevel/methods/chats/batched-queries.js.map +0 -1
- package/esm/highlevel/methods/chats/create-channel.d.ts +0 -17
- package/esm/highlevel/methods/chats/create-channel.js +0 -20
- package/esm/highlevel/methods/chats/create-channel.js.map +0 -1
- package/esm/highlevel/methods/chats/create-group.d.ts +0 -33
- package/esm/highlevel/methods/chats/create-group.js +0 -29
- package/esm/highlevel/methods/chats/create-group.js.map +0 -1
- package/esm/highlevel/methods/chats/create-supergroup.d.ts +0 -27
- package/esm/highlevel/methods/chats/create-supergroup.js +0 -22
- package/esm/highlevel/methods/chats/create-supergroup.js.map +0 -1
- package/esm/highlevel/methods/chats/delete-channel.d.ts +0 -8
- package/esm/highlevel/methods/chats/delete-channel.js +0 -15
- package/esm/highlevel/methods/chats/delete-channel.js.map +0 -1
- package/esm/highlevel/methods/chats/delete-chat-photo.d.ts +0 -10
- package/esm/highlevel/methods/chats/delete-chat-photo.js +0 -32
- package/esm/highlevel/methods/chats/delete-chat-photo.js.map +0 -1
- package/esm/highlevel/methods/chats/delete-group.d.ts +0 -8
- package/esm/highlevel/methods/chats/delete-group.js +0 -27
- package/esm/highlevel/methods/chats/delete-group.js.map +0 -1
- package/esm/highlevel/methods/chats/delete-history.d.ts +0 -22
- package/esm/highlevel/methods/chats/delete-history.js +0 -24
- package/esm/highlevel/methods/chats/delete-history.js.map +0 -1
- package/esm/highlevel/methods/chats/delete-user-history.d.ts +0 -16
- package/esm/highlevel/methods/chats/delete-user-history.js +0 -19
- package/esm/highlevel/methods/chats/delete-user-history.js.map +0 -1
- package/esm/highlevel/methods/chats/edit-admin-rights.d.ts +0 -16
- package/esm/highlevel/methods/chats/edit-admin-rights.js +0 -21
- package/esm/highlevel/methods/chats/edit-admin-rights.js.map +0 -1
- package/esm/highlevel/methods/chats/get-chat-event-log.d.ts +0 -61
- package/esm/highlevel/methods/chats/get-chat-event-log.js +0 -48
- package/esm/highlevel/methods/chats/get-chat-event-log.js.map +0 -1
- package/esm/highlevel/methods/chats/get-chat-member.d.ts +0 -15
- package/esm/highlevel/methods/chats/get-chat-member.js +0 -56
- package/esm/highlevel/methods/chats/get-chat-member.js.map +0 -1
- package/esm/highlevel/methods/chats/get-chat-members.d.ts +0 -51
- package/esm/highlevel/methods/chats/get-chat-members.js +0 -80
- package/esm/highlevel/methods/chats/get-chat-members.js.map +0 -1
- package/esm/highlevel/methods/chats/get-chat-preview.d.ts +0 -12
- package/esm/highlevel/methods/chats/get-chat-preview.js +0 -26
- package/esm/highlevel/methods/chats/get-chat-preview.js.map +0 -1
- package/esm/highlevel/methods/chats/get-chat.d.ts +0 -11
- package/esm/highlevel/methods/chats/get-chat.js +0 -35
- package/esm/highlevel/methods/chats/get-chat.js.map +0 -1
- package/esm/highlevel/methods/chats/get-full-chat.d.ts +0 -11
- package/esm/highlevel/methods/chats/get-full-chat.js +0 -53
- package/esm/highlevel/methods/chats/get-full-chat.js.map +0 -1
- package/esm/highlevel/methods/chats/get-nearby-chats.d.ts +0 -9
- package/esm/highlevel/methods/chats/get-nearby-chats.js +0 -38
- package/esm/highlevel/methods/chats/get-nearby-chats.js.map +0 -1
- package/esm/highlevel/methods/chats/get-similar-channels.d.ts +0 -12
- package/esm/highlevel/methods/chats/get-similar-channels.js +0 -27
- package/esm/highlevel/methods/chats/get-similar-channels.js.map +0 -1
- package/esm/highlevel/methods/chats/iter-chat-event-log.d.ts +0 -26
- package/esm/highlevel/methods/chats/iter-chat-event-log.js +0 -50
- package/esm/highlevel/methods/chats/iter-chat-event-log.js.map +0 -1
- package/esm/highlevel/methods/chats/iter-chat-members.d.ts +0 -22
- package/esm/highlevel/methods/chats/iter-chat-members.js +0 -49
- package/esm/highlevel/methods/chats/iter-chat-members.js.map +0 -1
- package/esm/highlevel/methods/chats/join-chat.d.ts +0 -14
- package/esm/highlevel/methods/chats/join-chat.js +0 -37
- package/esm/highlevel/methods/chats/join-chat.js.map +0 -1
- package/esm/highlevel/methods/chats/kick-chat-member.d.ts +0 -15
- package/esm/highlevel/methods/chats/kick-chat-member.js +0 -26
- package/esm/highlevel/methods/chats/kick-chat-member.js.map +0 -1
- package/esm/highlevel/methods/chats/leave-chat.d.ts +0 -13
- package/esm/highlevel/methods/chats/leave-chat.js +0 -33
- package/esm/highlevel/methods/chats/leave-chat.js.map +0 -1
- package/esm/highlevel/methods/chats/mark-chat-unread.d.ts +0 -8
- package/esm/highlevel/methods/chats/mark-chat-unread.js +0 -19
- package/esm/highlevel/methods/chats/mark-chat-unread.js.map +0 -1
- package/esm/highlevel/methods/chats/open-chat.d.ts +0 -26
- package/esm/highlevel/methods/chats/open-chat.js +0 -43
- package/esm/highlevel/methods/chats/open-chat.js.map +0 -1
- package/esm/highlevel/methods/chats/reorder-usernames.d.ts +0 -8
- package/esm/highlevel/methods/chats/reorder-usernames.js +0 -40
- package/esm/highlevel/methods/chats/reorder-usernames.js.map +0 -1
- package/esm/highlevel/methods/chats/restrict-chat-member.d.ts +0 -28
- package/esm/highlevel/methods/chats/restrict-chat-member.js +0 -27
- package/esm/highlevel/methods/chats/restrict-chat-member.js.map +0 -1
- package/esm/highlevel/methods/chats/save-draft.d.ts +0 -10
- package/esm/highlevel/methods/chats/save-draft.js +0 -25
- package/esm/highlevel/methods/chats/save-draft.js.map +0 -1
- package/esm/highlevel/methods/chats/set-chat-color.d.ts +0 -38
- package/esm/highlevel/methods/chats/set-chat-color.js +0 -38
- package/esm/highlevel/methods/chats/set-chat-color.js.map +0 -1
- package/esm/highlevel/methods/chats/set-chat-default-permissions.d.ts +0 -16
- package/esm/highlevel/methods/chats/set-chat-default-permissions.js +0 -31
- package/esm/highlevel/methods/chats/set-chat-default-permissions.js.map +0 -1
- package/esm/highlevel/methods/chats/set-chat-description.d.ts +0 -11
- package/esm/highlevel/methods/chats/set-chat-description.js +0 -20
- package/esm/highlevel/methods/chats/set-chat-description.js.map +0 -1
- package/esm/highlevel/methods/chats/set-chat-photo.d.ts +0 -20
- package/esm/highlevel/methods/chats/set-chat-photo.js +0 -86
- package/esm/highlevel/methods/chats/set-chat-photo.js.map +0 -1
- package/esm/highlevel/methods/chats/set-chat-title.d.ts +0 -11
- package/esm/highlevel/methods/chats/set-chat-title.js +0 -33
- package/esm/highlevel/methods/chats/set-chat-title.js.map +0 -1
- package/esm/highlevel/methods/chats/set-chat-ttl.d.ts +0 -9
- package/esm/highlevel/methods/chats/set-chat-ttl.js +0 -15
- package/esm/highlevel/methods/chats/set-chat-ttl.js.map +0 -1
- package/esm/highlevel/methods/chats/set-chat-username.d.ts +0 -11
- package/esm/highlevel/methods/chats/set-chat-username.js +0 -19
- package/esm/highlevel/methods/chats/set-chat-username.js.map +0 -1
- package/esm/highlevel/methods/chats/set-slow-mode.d.ts +0 -12
- package/esm/highlevel/methods/chats/set-slow-mode.js +0 -19
- package/esm/highlevel/methods/chats/set-slow-mode.js.map +0 -1
- package/esm/highlevel/methods/chats/toggle-content-protection.d.ts +0 -9
- package/esm/highlevel/methods/chats/toggle-content-protection.js +0 -16
- package/esm/highlevel/methods/chats/toggle-content-protection.js.map +0 -1
- package/esm/highlevel/methods/chats/toggle-fragment-username.d.ts +0 -20
- package/esm/highlevel/methods/chats/toggle-fragment-username.js +0 -45
- package/esm/highlevel/methods/chats/toggle-fragment-username.js.map +0 -1
- package/esm/highlevel/methods/chats/toggle-join-requests.d.ts +0 -12
- package/esm/highlevel/methods/chats/toggle-join-requests.js +0 -19
- package/esm/highlevel/methods/chats/toggle-join-requests.js.map +0 -1
- package/esm/highlevel/methods/chats/toggle-join-to-send.d.ts +0 -12
- package/esm/highlevel/methods/chats/toggle-join-to-send.js +0 -19
- package/esm/highlevel/methods/chats/toggle-join-to-send.js.map +0 -1
- package/esm/highlevel/methods/chats/unarchive-chats.d.ts +0 -9
- package/esm/highlevel/methods/chats/unarchive-chats.js +0 -24
- package/esm/highlevel/methods/chats/unarchive-chats.js.map +0 -1
- package/esm/highlevel/methods/chats/unban-chat-member.d.ts +0 -16
- package/esm/highlevel/methods/chats/unban-chat-member.js +0 -35
- package/esm/highlevel/methods/chats/unban-chat-member.js.map +0 -1
- package/esm/highlevel/methods/contacts/add-contact.d.ts +0 -28
- package/esm/highlevel/methods/contacts/add-contact.js +0 -22
- package/esm/highlevel/methods/contacts/add-contact.js.map +0 -1
- package/esm/highlevel/methods/contacts/delete-contacts.d.ts +0 -12
- package/esm/highlevel/methods/contacts/delete-contacts.js +0 -28
- package/esm/highlevel/methods/contacts/delete-contacts.js.map +0 -1
- package/esm/highlevel/methods/contacts/get-contacts.d.ts +0 -6
- package/esm/highlevel/methods/contacts/get-contacts.js +0 -15
- package/esm/highlevel/methods/contacts/get-contacts.js.map +0 -1
- package/esm/highlevel/methods/contacts/import-contacts.d.ts +0 -9
- package/esm/highlevel/methods/contacts/import-contacts.js +0 -19
- package/esm/highlevel/methods/contacts/import-contacts.js.map +0 -1
- package/esm/highlevel/methods/dialogs/create-folder.d.ts +0 -13
- package/esm/highlevel/methods/dialogs/create-folder.js +0 -41
- package/esm/highlevel/methods/dialogs/create-folder.js.map +0 -1
- package/esm/highlevel/methods/dialogs/delete-folder.d.ts +0 -8
- package/esm/highlevel/methods/dialogs/delete-folder.js +0 -14
- package/esm/highlevel/methods/dialogs/delete-folder.js.map +0 -1
- package/esm/highlevel/methods/dialogs/edit-folder.d.ts +0 -18
- package/esm/highlevel/methods/dialogs/edit-folder.js +0 -35
- package/esm/highlevel/methods/dialogs/edit-folder.js.map +0 -1
- package/esm/highlevel/methods/dialogs/find-dialogs.d.ts +0 -12
- package/esm/highlevel/methods/dialogs/find-dialogs.js +0 -88
- package/esm/highlevel/methods/dialogs/find-dialogs.js.map +0 -1
- package/esm/highlevel/methods/dialogs/find-folder.d.ts +0 -19
- package/esm/highlevel/methods/dialogs/find-folder.js +0 -29
- package/esm/highlevel/methods/dialogs/find-folder.js.map +0 -1
- package/esm/highlevel/methods/dialogs/get-chatlist-preview.d.ts +0 -8
- package/esm/highlevel/methods/dialogs/get-chatlist-preview.js +0 -14
- package/esm/highlevel/methods/dialogs/get-chatlist-preview.js.map +0 -1
- package/esm/highlevel/methods/dialogs/get-folders.d.ts +0 -9
- package/esm/highlevel/methods/dialogs/get-folders.js +0 -27
- package/esm/highlevel/methods/dialogs/get-folders.js.map +0 -1
- package/esm/highlevel/methods/dialogs/get-peer-dialogs.d.ts +0 -10
- package/esm/highlevel/methods/dialogs/get-peer-dialogs.js +0 -21
- package/esm/highlevel/methods/dialogs/get-peer-dialogs.js.map +0 -1
- package/esm/highlevel/methods/dialogs/iter-dialogs.d.ts +0 -103
- package/esm/highlevel/methods/dialogs/iter-dialogs.js +0 -192
- package/esm/highlevel/methods/dialogs/iter-dialogs.js.map +0 -1
- package/esm/highlevel/methods/dialogs/join-chatlist.d.ts +0 -15
- package/esm/highlevel/methods/dialogs/join-chatlist.js +0 -38
- package/esm/highlevel/methods/dialogs/join-chatlist.js.map +0 -1
- package/esm/highlevel/methods/dialogs/set-folders-order.d.ts +0 -7
- package/esm/highlevel/methods/dialogs/set-folders-order.js +0 -14
- package/esm/highlevel/methods/dialogs/set-folders-order.js.map +0 -1
- package/esm/highlevel/methods/files/download-buffer.d.ts +0 -11
- package/esm/highlevel/methods/files/download-buffer.js +0 -22
- package/esm/highlevel/methods/files/download-buffer.js.map +0 -1
- package/esm/highlevel/methods/files/download-file.js +0 -3
- package/esm/highlevel/methods/files/download-file.js.map +0 -1
- package/esm/highlevel/methods/files/download-iterable.d.ts +0 -10
- package/esm/highlevel/methods/files/download-iterable.js +0 -181
- package/esm/highlevel/methods/files/download-iterable.js.map +0 -1
- package/esm/highlevel/methods/files/download-node-stream.js +0 -3
- package/esm/highlevel/methods/files/download-node-stream.js.map +0 -1
- package/esm/highlevel/methods/files/download-stream.d.ts +0 -9
- package/esm/highlevel/methods/files/download-stream.js +0 -34
- package/esm/highlevel/methods/files/download-stream.js.map +0 -1
- package/esm/highlevel/methods/files/normalize-file-to-document.d.ts +0 -9
- package/esm/highlevel/methods/files/normalize-file-to-document.js +0 -19
- package/esm/highlevel/methods/files/normalize-file-to-document.js.map +0 -1
- package/esm/highlevel/methods/files/normalize-input-file.d.ts +0 -13
- package/esm/highlevel/methods/files/normalize-input-file.js +0 -38
- package/esm/highlevel/methods/files/normalize-input-file.js.map +0 -1
- package/esm/highlevel/methods/files/normalize-input-media.d.ts +0 -12
- package/esm/highlevel/methods/files/normalize-input-media.js +0 -374
- package/esm/highlevel/methods/files/normalize-input-media.js.map +0 -1
- package/esm/highlevel/methods/files/upload-file.d.ts +0 -64
- package/esm/highlevel/methods/files/upload-file.js +0 -227
- package/esm/highlevel/methods/files/upload-file.js.map +0 -1
- package/esm/highlevel/methods/files/upload-media.d.ts +0 -28
- package/esm/highlevel/methods/files/upload-media.js +0 -65
- package/esm/highlevel/methods/files/upload-media.js.map +0 -1
- package/esm/highlevel/methods/forums/create-forum-topic.d.ts +0 -36
- package/esm/highlevel/methods/forums/create-forum-topic.js +0 -24
- package/esm/highlevel/methods/forums/create-forum-topic.js.map +0 -1
- package/esm/highlevel/methods/forums/delete-forum-topic-history.d.ts +0 -15
- package/esm/highlevel/methods/forums/delete-forum-topic-history.js +0 -23
- package/esm/highlevel/methods/forums/delete-forum-topic-history.js.map +0 -1
- package/esm/highlevel/methods/forums/edit-forum-topic.d.ts +0 -34
- package/esm/highlevel/methods/forums/edit-forum-topic.js +0 -24
- package/esm/highlevel/methods/forums/edit-forum-topic.js.map +0 -1
- package/esm/highlevel/methods/forums/get-forum-topics-by-id.d.ts +0 -9
- package/esm/highlevel/methods/forums/get-forum-topics-by-id.js +0 -18
- package/esm/highlevel/methods/forums/get-forum-topics-by-id.js.map +0 -1
- package/esm/highlevel/methods/forums/get-forum-topics.d.ts +0 -28
- package/esm/highlevel/methods/forums/get-forum-topics.js +0 -38
- package/esm/highlevel/methods/forums/get-forum-topics.js.map +0 -1
- package/esm/highlevel/methods/forums/iter-forum-topics.d.ts +0 -20
- package/esm/highlevel/methods/forums/iter-forum-topics.js +0 -31
- package/esm/highlevel/methods/forums/iter-forum-topics.js.map +0 -1
- package/esm/highlevel/methods/forums/reorder-pinned-forum-topics.d.ts +0 -19
- package/esm/highlevel/methods/forums/reorder-pinned-forum-topics.js +0 -16
- package/esm/highlevel/methods/forums/reorder-pinned-forum-topics.js.map +0 -1
- package/esm/highlevel/methods/forums/toggle-forum-topic-closed.d.ts +0 -22
- package/esm/highlevel/methods/forums/toggle-forum-topic-closed.js +0 -20
- package/esm/highlevel/methods/forums/toggle-forum-topic-closed.js.map +0 -1
- package/esm/highlevel/methods/forums/toggle-forum-topic-pinned.d.ts +0 -15
- package/esm/highlevel/methods/forums/toggle-forum-topic-pinned.js +0 -16
- package/esm/highlevel/methods/forums/toggle-forum-topic-pinned.js.map +0 -1
- package/esm/highlevel/methods/forums/toggle-forum.d.ts +0 -11
- package/esm/highlevel/methods/forums/toggle-forum.js +0 -18
- package/esm/highlevel/methods/forums/toggle-forum.js.map +0 -1
- package/esm/highlevel/methods/forums/toggle-general-topic-hidden.d.ts +0 -20
- package/esm/highlevel/methods/forums/toggle-general-topic-hidden.js +0 -20
- package/esm/highlevel/methods/forums/toggle-general-topic-hidden.js.map +0 -1
- package/esm/highlevel/methods/invite-links/create-invite-link.d.ts +0 -31
- package/esm/highlevel/methods/invite-links/create-invite-link.js +0 -24
- package/esm/highlevel/methods/invite-links/create-invite-link.js.map +0 -1
- package/esm/highlevel/methods/invite-links/edit-invite-link.d.ts +0 -36
- package/esm/highlevel/methods/invite-links/edit-invite-link.js +0 -28
- package/esm/highlevel/methods/invite-links/edit-invite-link.js.map +0 -1
- package/esm/highlevel/methods/invite-links/export-invite-link.d.ts +0 -12
- package/esm/highlevel/methods/invite-links/export-invite-link.js +0 -20
- package/esm/highlevel/methods/invite-links/export-invite-link.js.map +0 -1
- package/esm/highlevel/methods/invite-links/get-invite-link-members.d.ts +0 -45
- package/esm/highlevel/methods/invite-links/get-invite-link-members.js +0 -39
- package/esm/highlevel/methods/invite-links/get-invite-link-members.js.map +0 -1
- package/esm/highlevel/methods/invite-links/get-invite-link.d.ts +0 -9
- package/esm/highlevel/methods/invite-links/get-invite-link.js +0 -18
- package/esm/highlevel/methods/invite-links/get-invite-link.js.map +0 -1
- package/esm/highlevel/methods/invite-links/get-invite-links.d.ts +0 -39
- package/esm/highlevel/methods/invite-links/get-invite-links.js +0 -39
- package/esm/highlevel/methods/invite-links/get-invite-links.js.map +0 -1
- package/esm/highlevel/methods/invite-links/get-primary-invite-link.d.ts +0 -8
- package/esm/highlevel/methods/invite-links/get-primary-invite-link.js +0 -26
- package/esm/highlevel/methods/invite-links/get-primary-invite-link.js.map +0 -1
- package/esm/highlevel/methods/invite-links/hide-all-join-requests.d.ts +0 -13
- package/esm/highlevel/methods/invite-links/hide-all-join-requests.js +0 -14
- package/esm/highlevel/methods/invite-links/hide-all-join-requests.js.map +0 -1
- package/esm/highlevel/methods/invite-links/hide-join-request.d.ts +0 -13
- package/esm/highlevel/methods/invite-links/hide-join-request.js +0 -15
- package/esm/highlevel/methods/invite-links/hide-join-request.js.map +0 -1
- package/esm/highlevel/methods/invite-links/iter-invite-link-members.d.ts +0 -25
- package/esm/highlevel/methods/invite-links/iter-invite-link-members.js +0 -39
- package/esm/highlevel/methods/invite-links/iter-invite-link-members.js.map +0 -1
- package/esm/highlevel/methods/invite-links/iter-invite-links.d.ts +0 -27
- package/esm/highlevel/methods/invite-links/iter-invite-links.js +0 -41
- package/esm/highlevel/methods/invite-links/iter-invite-links.js.map +0 -1
- package/esm/highlevel/methods/invite-links/revoke-invite-link.d.ts +0 -13
- package/esm/highlevel/methods/invite-links/revoke-invite-link.js +0 -24
- package/esm/highlevel/methods/invite-links/revoke-invite-link.js.map +0 -1
- package/esm/highlevel/methods/messages/_business-connection.d.ts +0 -8
- package/esm/highlevel/methods/messages/_business-connection.js +0 -38
- package/esm/highlevel/methods/messages/_business-connection.js.map +0 -1
- package/esm/highlevel/methods/messages/close-poll.d.ts +0 -15
- package/esm/highlevel/methods/messages/close-poll.js +0 -40
- package/esm/highlevel/methods/messages/close-poll.js.map +0 -1
- package/esm/highlevel/methods/messages/delete-messages.d.ts +0 -29
- package/esm/highlevel/methods/messages/delete-messages.js +0 -61
- package/esm/highlevel/methods/messages/delete-messages.js.map +0 -1
- package/esm/highlevel/methods/messages/delete-scheduled-messages.d.ts +0 -9
- package/esm/highlevel/methods/messages/delete-scheduled-messages.js +0 -17
- package/esm/highlevel/methods/messages/delete-scheduled-messages.js.map +0 -1
- package/esm/highlevel/methods/messages/edit-inline-message.d.ts +0 -51
- package/esm/highlevel/methods/messages/edit-inline-message.js +0 -53
- package/esm/highlevel/methods/messages/edit-inline-message.js.map +0 -1
- package/esm/highlevel/methods/messages/edit-message.d.ts +0 -55
- package/esm/highlevel/methods/messages/edit-message.js +0 -43
- package/esm/highlevel/methods/messages/edit-message.js.map +0 -1
- package/esm/highlevel/methods/messages/find-in-update.d.ts +0 -13
- package/esm/highlevel/methods/messages/find-in-update.js +0 -48
- package/esm/highlevel/methods/messages/find-in-update.js.map +0 -1
- package/esm/highlevel/methods/messages/forward-messages.d.ts +0 -78
- package/esm/highlevel/methods/messages/forward-messages.js +0 -69
- package/esm/highlevel/methods/messages/forward-messages.js.map +0 -1
- package/esm/highlevel/methods/messages/get-all-scheduled-messages.d.ts +0 -8
- package/esm/highlevel/methods/messages/get-all-scheduled-messages.js +0 -25
- package/esm/highlevel/methods/messages/get-all-scheduled-messages.js.map +0 -1
- package/esm/highlevel/methods/messages/get-available-effects.d.ts +0 -6
- package/esm/highlevel/methods/messages/get-available-effects.js +0 -22
- package/esm/highlevel/methods/messages/get-available-effects.js.map +0 -1
- package/esm/highlevel/methods/messages/get-callback-query-message.d.ts +0 -14
- package/esm/highlevel/methods/messages/get-callback-query-message.js +0 -52
- package/esm/highlevel/methods/messages/get-callback-query-message.js.map +0 -1
- package/esm/highlevel/methods/messages/get-discussion-message.d.ts +0 -21
- package/esm/highlevel/methods/messages/get-discussion-message.js +0 -58
- package/esm/highlevel/methods/messages/get-discussion-message.js.map +0 -1
- package/esm/highlevel/methods/messages/get-fact-check.d.ts +0 -11
- package/esm/highlevel/methods/messages/get-fact-check.js +0 -23
- package/esm/highlevel/methods/messages/get-fact-check.js.map +0 -1
- package/esm/highlevel/methods/messages/get-history.d.ts +0 -61
- package/esm/highlevel/methods/messages/get-history.js +0 -51
- package/esm/highlevel/methods/messages/get-history.js.map +0 -1
- package/esm/highlevel/methods/messages/get-message-by-link.d.ts +0 -6
- package/esm/highlevel/methods/messages/get-message-by-link.js +0 -30
- package/esm/highlevel/methods/messages/get-message-by-link.js.map +0 -1
- package/esm/highlevel/methods/messages/get-message-group.d.ts +0 -9
- package/esm/highlevel/methods/messages/get-message-group.js +0 -32
- package/esm/highlevel/methods/messages/get-message-group.js.map +0 -1
- package/esm/highlevel/methods/messages/get-message-reactions.d.ts +0 -28
- package/esm/highlevel/methods/messages/get-message-reactions.js +0 -54
- package/esm/highlevel/methods/messages/get-message-reactions.js.map +0 -1
- package/esm/highlevel/methods/messages/get-messages-unsafe.d.ts +0 -19
- package/esm/highlevel/methods/messages/get-messages-unsafe.js +0 -38
- package/esm/highlevel/methods/messages/get-messages-unsafe.js.map +0 -1
- package/esm/highlevel/methods/messages/get-messages.d.ts +0 -17
- package/esm/highlevel/methods/messages/get-messages.js +0 -72
- package/esm/highlevel/methods/messages/get-messages.js.map +0 -1
- package/esm/highlevel/methods/messages/get-reaction-users.d.ts +0 -24
- package/esm/highlevel/methods/messages/get-reaction-users.js +0 -25
- package/esm/highlevel/methods/messages/get-reaction-users.js.map +0 -1
- package/esm/highlevel/methods/messages/get-reply-to.d.ts +0 -10
- package/esm/highlevel/methods/messages/get-reply-to.js +0 -21
- package/esm/highlevel/methods/messages/get-reply-to.js.map +0 -1
- package/esm/highlevel/methods/messages/get-scheduled-messages.d.ts +0 -13
- package/esm/highlevel/methods/messages/get-scheduled-messages.js +0 -31
- package/esm/highlevel/methods/messages/get-scheduled-messages.js.map +0 -1
- package/esm/highlevel/methods/messages/iter-history.d.ts +0 -23
- package/esm/highlevel/methods/messages/iter-history.js +0 -37
- package/esm/highlevel/methods/messages/iter-history.js.map +0 -1
- package/esm/highlevel/methods/messages/iter-reaction-users.d.ts +0 -26
- package/esm/highlevel/methods/messages/iter-reaction-users.js +0 -36
- package/esm/highlevel/methods/messages/iter-reaction-users.js.map +0 -1
- package/esm/highlevel/methods/messages/iter-search-global.d.ts +0 -27
- package/esm/highlevel/methods/messages/iter-search-global.js +0 -43
- package/esm/highlevel/methods/messages/iter-search-global.js.map +0 -1
- package/esm/highlevel/methods/messages/iter-search-messages.d.ts +0 -26
- package/esm/highlevel/methods/messages/iter-search-messages.js +0 -51
- package/esm/highlevel/methods/messages/iter-search-messages.js.map +0 -1
- package/esm/highlevel/methods/messages/pin-message.d.ts +0 -21
- package/esm/highlevel/methods/messages/pin-message.js +0 -24
- package/esm/highlevel/methods/messages/pin-message.js.map +0 -1
- package/esm/highlevel/methods/messages/read-history.d.ts +0 -24
- package/esm/highlevel/methods/messages/read-history.js +0 -46
- package/esm/highlevel/methods/messages/read-history.js.map +0 -1
- package/esm/highlevel/methods/messages/read-reactions.d.ts +0 -14
- package/esm/highlevel/methods/messages/read-reactions.js +0 -18
- package/esm/highlevel/methods/messages/read-reactions.js.map +0 -1
- package/esm/highlevel/methods/messages/search-global.d.ts +0 -51
- package/esm/highlevel/methods/messages/search-global.js +0 -47
- package/esm/highlevel/methods/messages/search-global.js.map +0 -1
- package/esm/highlevel/methods/messages/search-hashtag.d.ts +0 -44
- package/esm/highlevel/methods/messages/search-hashtag.js +0 -70
- package/esm/highlevel/methods/messages/search-hashtag.js.map +0 -1
- package/esm/highlevel/methods/messages/search-messages.d.ts +0 -93
- package/esm/highlevel/methods/messages/search-messages.js +0 -43
- package/esm/highlevel/methods/messages/search-messages.js.map +0 -1
- package/esm/highlevel/methods/messages/send-answer.d.ts +0 -12
- package/esm/highlevel/methods/messages/send-answer.js +0 -31
- package/esm/highlevel/methods/messages/send-answer.js.map +0 -1
- package/esm/highlevel/methods/messages/send-comment.d.ts +0 -39
- package/esm/highlevel/methods/messages/send-comment.js +0 -69
- package/esm/highlevel/methods/messages/send-comment.js.map +0 -1
- package/esm/highlevel/methods/messages/send-common.d.ts +0 -116
- package/esm/highlevel/methods/messages/send-common.js +0 -83
- package/esm/highlevel/methods/messages/send-common.js.map +0 -1
- package/esm/highlevel/methods/messages/send-copy-group.d.ts +0 -21
- package/esm/highlevel/methods/messages/send-copy-group.js +0 -37
- package/esm/highlevel/methods/messages/send-copy-group.js.map +0 -1
- package/esm/highlevel/methods/messages/send-copy.d.ts +0 -32
- package/esm/highlevel/methods/messages/send-copy.js +0 -53
- package/esm/highlevel/methods/messages/send-copy.js.map +0 -1
- package/esm/highlevel/methods/messages/send-media-group.d.ts +0 -35
- package/esm/highlevel/methods/messages/send-media-group.js +0 -76
- package/esm/highlevel/methods/messages/send-media-group.js.map +0 -1
- package/esm/highlevel/methods/messages/send-media.d.ts +0 -48
- package/esm/highlevel/methods/messages/send-media.js +0 -61
- package/esm/highlevel/methods/messages/send-media.js.map +0 -1
- package/esm/highlevel/methods/messages/send-quote.d.ts +0 -33
- package/esm/highlevel/methods/messages/send-quote.js +0 -60
- package/esm/highlevel/methods/messages/send-quote.js.map +0 -1
- package/esm/highlevel/methods/messages/send-reaction.d.ts +0 -21
- package/esm/highlevel/methods/messages/send-reaction.js +0 -35
- package/esm/highlevel/methods/messages/send-reaction.js.map +0 -1
- package/esm/highlevel/methods/messages/send-reply.d.ts +0 -12
- package/esm/highlevel/methods/messages/send-reply.js +0 -22
- package/esm/highlevel/methods/messages/send-reply.js.map +0 -1
- package/esm/highlevel/methods/messages/send-scheduled.d.ts +0 -14
- package/esm/highlevel/methods/messages/send-scheduled.js +0 -30
- package/esm/highlevel/methods/messages/send-scheduled.js.map +0 -1
- package/esm/highlevel/methods/messages/send-text.d.ts +0 -31
- package/esm/highlevel/methods/messages/send-text.js +0 -95
- package/esm/highlevel/methods/messages/send-text.js.map +0 -1
- package/esm/highlevel/methods/messages/send-typing.d.ts +0 -29
- package/esm/highlevel/methods/messages/send-typing.js +0 -81
- package/esm/highlevel/methods/messages/send-typing.js.map +0 -1
- package/esm/highlevel/methods/messages/send-vote.d.ts +0 -15
- package/esm/highlevel/methods/messages/send-vote.js +0 -52
- package/esm/highlevel/methods/messages/send-vote.js.map +0 -1
- package/esm/highlevel/methods/messages/translate-message.d.ts +0 -11
- package/esm/highlevel/methods/messages/translate-message.js +0 -22
- package/esm/highlevel/methods/messages/translate-message.js.map +0 -1
- package/esm/highlevel/methods/messages/translate-text.d.ts +0 -9
- package/esm/highlevel/methods/messages/translate-text.js +0 -30
- package/esm/highlevel/methods/messages/translate-text.js.map +0 -1
- package/esm/highlevel/methods/messages/unpin-all-messages.d.ts +0 -18
- package/esm/highlevel/methods/messages/unpin-all-messages.js +0 -26
- package/esm/highlevel/methods/messages/unpin-all-messages.js.map +0 -1
- package/esm/highlevel/methods/messages/unpin-message.d.ts +0 -12
- package/esm/highlevel/methods/messages/unpin-message.js +0 -22
- package/esm/highlevel/methods/messages/unpin-message.js.map +0 -1
- package/esm/highlevel/methods/misc/chain-id.d.ts +0 -4
- package/esm/highlevel/methods/misc/chain-id.js +0 -7
- package/esm/highlevel/methods/misc/chain-id.js.map +0 -1
- package/esm/highlevel/methods/misc/get-collectible-info.d.ts +0 -6
- package/esm/highlevel/methods/misc/get-collectible-info.js +0 -22
- package/esm/highlevel/methods/misc/get-collectible-info.js.map +0 -1
- package/esm/highlevel/methods/misc/init-takeout-session.d.ts +0 -9
- package/esm/highlevel/methods/misc/init-takeout-session.js +0 -13
- package/esm/highlevel/methods/misc/init-takeout-session.js.map +0 -1
- package/esm/highlevel/methods/misc/normalize-privacy-rules.d.ts +0 -8
- package/esm/highlevel/methods/misc/normalize-privacy-rules.js +0 -40
- package/esm/highlevel/methods/misc/normalize-privacy-rules.js.map +0 -1
- package/esm/highlevel/methods/misc/normalize-text.d.ts +0 -5
- package/esm/highlevel/methods/misc/normalize-text.js +0 -30
- package/esm/highlevel/methods/misc/normalize-text.js.map +0 -1
- package/esm/highlevel/methods/misc/with-params.d.ts +0 -10
- package/esm/highlevel/methods/misc/with-params.js +0 -28
- package/esm/highlevel/methods/misc/with-params.js.map +0 -1
- package/esm/highlevel/methods/password/change-cloud-password.d.ts +0 -12
- package/esm/highlevel/methods/password/change-cloud-password.js +0 -25
- package/esm/highlevel/methods/password/change-cloud-password.js.map +0 -1
- package/esm/highlevel/methods/password/enable-cloud-password.d.ts +0 -17
- package/esm/highlevel/methods/password/enable-cloud-password.js +0 -32
- package/esm/highlevel/methods/password/enable-cloud-password.js.map +0 -1
- package/esm/highlevel/methods/password/password-email.d.ts +0 -15
- package/esm/highlevel/methods/password/password-email.js +0 -32
- package/esm/highlevel/methods/password/password-email.js.map +0 -1
- package/esm/highlevel/methods/password/remove-cloud-password.d.ts +0 -7
- package/esm/highlevel/methods/password/remove-cloud-password.js +0 -24
- package/esm/highlevel/methods/password/remove-cloud-password.js.map +0 -1
- package/esm/highlevel/methods/premium/apply-boost.d.ts +0 -8
- package/esm/highlevel/methods/premium/apply-boost.js +0 -13
- package/esm/highlevel/methods/premium/apply-boost.js.map +0 -1
- package/esm/highlevel/methods/premium/can-apply-boost.d.ts +0 -29
- package/esm/highlevel/methods/premium/can-apply-boost.js +0 -29
- package/esm/highlevel/methods/premium/can-apply-boost.js.map +0 -1
- package/esm/highlevel/methods/premium/create-business-chat-link.d.ts +0 -12
- package/esm/highlevel/methods/premium/create-business-chat-link.js +0 -22
- package/esm/highlevel/methods/premium/create-business-chat-link.js.map +0 -1
- package/esm/highlevel/methods/premium/edit-business-chat-link.d.ts +0 -20
- package/esm/highlevel/methods/premium/edit-business-chat-link.js +0 -37
- package/esm/highlevel/methods/premium/edit-business-chat-link.js.map +0 -1
- package/esm/highlevel/methods/premium/get-boost-stats.d.ts +0 -9
- package/esm/highlevel/methods/premium/get-boost-stats.js +0 -16
- package/esm/highlevel/methods/premium/get-boost-stats.js.map +0 -1
- package/esm/highlevel/methods/premium/get-boosts.d.ts +0 -18
- package/esm/highlevel/methods/premium/get-boosts.js +0 -19
- package/esm/highlevel/methods/premium/get-boosts.js.map +0 -1
- package/esm/highlevel/methods/premium/get-business-chat-links.d.ts +0 -6
- package/esm/highlevel/methods/premium/get-business-chat-links.js +0 -10
- package/esm/highlevel/methods/premium/get-business-chat-links.js.map +0 -1
- package/esm/highlevel/methods/premium/get-business-connection.d.ts +0 -8
- package/esm/highlevel/methods/premium/get-business-connection.js +0 -22
- package/esm/highlevel/methods/premium/get-business-connection.js.map +0 -1
- package/esm/highlevel/methods/premium/get-my-boost-slots.d.ts +0 -9
- package/esm/highlevel/methods/premium/get-my-boost-slots.js +0 -16
- package/esm/highlevel/methods/premium/get-my-boost-slots.js.map +0 -1
- package/esm/highlevel/methods/premium/iter-boosters.d.ts +0 -26
- package/esm/highlevel/methods/premium/iter-boosters.js +0 -32
- package/esm/highlevel/methods/premium/iter-boosters.js.map +0 -1
- package/esm/highlevel/methods/premium/set-business-intro.d.ts +0 -22
- package/esm/highlevel/methods/premium/set-business-intro.js +0 -38
- package/esm/highlevel/methods/premium/set-business-intro.js.map +0 -1
- package/esm/highlevel/methods/premium/set-business-work-hours.d.ts +0 -18
- package/esm/highlevel/methods/premium/set-business-work-hours.js +0 -29
- package/esm/highlevel/methods/premium/set-business-work-hours.js.map +0 -1
- package/esm/highlevel/methods/stickers/_utils.d.ts +0 -10
- package/esm/highlevel/methods/stickers/_utils.js +0 -23
- package/esm/highlevel/methods/stickers/_utils.js.map +0 -1
- package/esm/highlevel/methods/stickers/add-sticker-to-set.d.ts +0 -21
- package/esm/highlevel/methods/stickers/add-sticker-to-set.js +0 -21
- package/esm/highlevel/methods/stickers/add-sticker-to-set.js.map +0 -1
- package/esm/highlevel/methods/stickers/create-sticker-set.d.ts +0 -72
- package/esm/highlevel/methods/stickers/create-sticker-set.js +0 -35
- package/esm/highlevel/methods/stickers/create-sticker-set.js.map +0 -1
- package/esm/highlevel/methods/stickers/delete-sticker-from-set.d.ts +0 -15
- package/esm/highlevel/methods/stickers/delete-sticker-from-set.js +0 -24
- package/esm/highlevel/methods/stickers/delete-sticker-from-set.js.map +0 -1
- package/esm/highlevel/methods/stickers/get-custom-emojis.d.ts +0 -14
- package/esm/highlevel/methods/stickers/get-custom-emojis.js +0 -45
- package/esm/highlevel/methods/stickers/get-custom-emojis.js.map +0 -1
- package/esm/highlevel/methods/stickers/get-installed-stickers.d.ts +0 -10
- package/esm/highlevel/methods/stickers/get-installed-stickers.js +0 -19
- package/esm/highlevel/methods/stickers/get-installed-stickers.js.map +0 -1
- package/esm/highlevel/methods/stickers/get-my-sticker-sets.d.ts +0 -13
- package/esm/highlevel/methods/stickers/get-my-sticker-sets.js +0 -17
- package/esm/highlevel/methods/stickers/get-my-sticker-sets.js.map +0 -1
- package/esm/highlevel/methods/stickers/get-sticker-set.d.ts +0 -8
- package/esm/highlevel/methods/stickers/get-sticker-set.js +0 -15
- package/esm/highlevel/methods/stickers/get-sticker-set.js.map +0 -1
- package/esm/highlevel/methods/stickers/move-sticker-in-set.d.ts +0 -17
- package/esm/highlevel/methods/stickers/move-sticker-in-set.js +0 -27
- package/esm/highlevel/methods/stickers/move-sticker-in-set.js.map +0 -1
- package/esm/highlevel/methods/stickers/replace-sticker-in-set.d.ts +0 -24
- package/esm/highlevel/methods/stickers/replace-sticker-in-set.js +0 -28
- package/esm/highlevel/methods/stickers/replace-sticker-in-set.js.map +0 -1
- package/esm/highlevel/methods/stickers/set-chat-sticker-set.d.ts +0 -11
- package/esm/highlevel/methods/stickers/set-chat-sticker-set.js +0 -20
- package/esm/highlevel/methods/stickers/set-chat-sticker-set.js.map +0 -1
- package/esm/highlevel/methods/stickers/set-sticker-set-thumb.d.ts +0 -20
- package/esm/highlevel/methods/stickers/set-sticker-set-thumb.js +0 -19
- package/esm/highlevel/methods/stickers/set-sticker-set-thumb.js.map +0 -1
- package/esm/highlevel/methods/stories/can-send-story.d.ts +0 -13
- package/esm/highlevel/methods/stories/can-send-story.js +0 -32
- package/esm/highlevel/methods/stories/can-send-story.js.map +0 -1
- package/esm/highlevel/methods/stories/delete-stories.d.ts +0 -20
- package/esm/highlevel/methods/stories/delete-stories.js +0 -15
- package/esm/highlevel/methods/stories/delete-stories.js.map +0 -1
- package/esm/highlevel/methods/stories/edit-story.d.ts +0 -38
- package/esm/highlevel/methods/stories/edit-story.js +0 -40
- package/esm/highlevel/methods/stories/edit-story.js.map +0 -1
- package/esm/highlevel/methods/stories/find-in-update.d.ts +0 -5
- package/esm/highlevel/methods/stories/find-in-update.js +0 -17
- package/esm/highlevel/methods/stories/find-in-update.js.map +0 -1
- package/esm/highlevel/methods/stories/get-all-stories.d.ts +0 -15
- package/esm/highlevel/methods/stories/get-all-stories.js +0 -19
- package/esm/highlevel/methods/stories/get-all-stories.js.map +0 -1
- package/esm/highlevel/methods/stories/get-peer-stories.d.ts +0 -8
- package/esm/highlevel/methods/stories/get-peer-stories.js +0 -16
- package/esm/highlevel/methods/stories/get-peer-stories.js.map +0 -1
- package/esm/highlevel/methods/stories/get-profile-stories.d.ts +0 -25
- package/esm/highlevel/methods/stories/get-profile-stories.js +0 -27
- package/esm/highlevel/methods/stories/get-profile-stories.js.map +0 -1
- package/esm/highlevel/methods/stories/get-stories-by-id.d.ts +0 -10
- package/esm/highlevel/methods/stories/get-stories-by-id.js +0 -25
- package/esm/highlevel/methods/stories/get-stories-by-id.js.map +0 -1
- package/esm/highlevel/methods/stories/get-stories-interactions.d.ts +0 -9
- package/esm/highlevel/methods/stories/get-stories-interactions.js +0 -20
- package/esm/highlevel/methods/stories/get-stories-interactions.js.map +0 -1
- package/esm/highlevel/methods/stories/get-story-link.d.ts +0 -11
- package/esm/highlevel/methods/stories/get-story-link.js +0 -19
- package/esm/highlevel/methods/stories/get-story-link.js.map +0 -1
- package/esm/highlevel/methods/stories/get-story-viewers.d.ts +0 -33
- package/esm/highlevel/methods/stories/get-story-viewers.js +0 -22
- package/esm/highlevel/methods/stories/get-story-viewers.js.map +0 -1
- package/esm/highlevel/methods/stories/hide-my-stories-views.d.ts +0 -21
- package/esm/highlevel/methods/stories/hide-my-stories-views.js +0 -25
- package/esm/highlevel/methods/stories/hide-my-stories-views.js.map +0 -1
- package/esm/highlevel/methods/stories/increment-stories-views.d.ts +0 -13
- package/esm/highlevel/methods/stories/increment-stories-views.js +0 -20
- package/esm/highlevel/methods/stories/increment-stories-views.js.map +0 -1
- package/esm/highlevel/methods/stories/iter-all-stories.d.ts +0 -16
- package/esm/highlevel/methods/stories/iter-all-stories.js +0 -28
- package/esm/highlevel/methods/stories/iter-all-stories.js.map +0 -1
- package/esm/highlevel/methods/stories/iter-profile-stories.d.ts +0 -21
- package/esm/highlevel/methods/stories/iter-profile-stories.js +0 -29
- package/esm/highlevel/methods/stories/iter-profile-stories.js.map +0 -1
- package/esm/highlevel/methods/stories/iter-story-viewers.d.ts +0 -22
- package/esm/highlevel/methods/stories/iter-story-viewers.js +0 -32
- package/esm/highlevel/methods/stories/iter-story-viewers.js.map +0 -1
- package/esm/highlevel/methods/stories/read-stories.d.ts +0 -11
- package/esm/highlevel/methods/stories/read-stories.js +0 -17
- package/esm/highlevel/methods/stories/read-stories.js.map +0 -1
- package/esm/highlevel/methods/stories/report-story.d.ts +0 -19
- package/esm/highlevel/methods/stories/report-story.js +0 -17
- package/esm/highlevel/methods/stories/report-story.js.map +0 -1
- package/esm/highlevel/methods/stories/send-story-reaction.d.ts +0 -14
- package/esm/highlevel/methods/stories/send-story-reaction.js +0 -17
- package/esm/highlevel/methods/stories/send-story-reaction.js.map +0 -1
- package/esm/highlevel/methods/stories/send-story.d.ts +0 -51
- package/esm/highlevel/methods/stories/send-story.js +0 -44
- package/esm/highlevel/methods/stories/send-story.js.map +0 -1
- package/esm/highlevel/methods/stories/toggle-peer-stories-archived.d.ts +0 -8
- package/esm/highlevel/methods/stories/toggle-peer-stories-archived.js +0 -16
- package/esm/highlevel/methods/stories/toggle-peer-stories-archived.js.map +0 -1
- package/esm/highlevel/methods/stories/toggle-stories-pinned.d.ts +0 -24
- package/esm/highlevel/methods/stories/toggle-stories-pinned.js +0 -16
- package/esm/highlevel/methods/stories/toggle-stories-pinned.js.map +0 -1
- package/esm/highlevel/methods/users/block-user.d.ts +0 -8
- package/esm/highlevel/methods/users/block-user.js +0 -15
- package/esm/highlevel/methods/users/block-user.js.map +0 -1
- package/esm/highlevel/methods/users/delete-profile-photos.d.ts +0 -9
- package/esm/highlevel/methods/users/delete-profile-photos.js +0 -21
- package/esm/highlevel/methods/users/delete-profile-photos.js.map +0 -1
- package/esm/highlevel/methods/users/edit-close-friends.d.ts +0 -14
- package/esm/highlevel/methods/users/edit-close-friends.js +0 -32
- package/esm/highlevel/methods/users/edit-close-friends.js.map +0 -1
- package/esm/highlevel/methods/users/get-common-chats.d.ts +0 -9
- package/esm/highlevel/methods/users/get-common-chats.js +0 -19
- package/esm/highlevel/methods/users/get-common-chats.js.map +0 -1
- package/esm/highlevel/methods/users/get-global-ttl.d.ts +0 -5
- package/esm/highlevel/methods/users/get-global-ttl.js +0 -11
- package/esm/highlevel/methods/users/get-global-ttl.js.map +0 -1
- package/esm/highlevel/methods/users/get-me.d.ts +0 -6
- package/esm/highlevel/methods/users/get-me.js +0 -22
- package/esm/highlevel/methods/users/get-me.js.map +0 -1
- package/esm/highlevel/methods/users/get-my-username.d.ts +0 -8
- package/esm/highlevel/methods/users/get-my-username.js +0 -10
- package/esm/highlevel/methods/users/get-my-username.js.map +0 -1
- package/esm/highlevel/methods/users/get-profile-photo.d.ts +0 -11
- package/esm/highlevel/methods/users/get-profile-photo.js +0 -23
- package/esm/highlevel/methods/users/get-profile-photo.js.map +0 -1
- package/esm/highlevel/methods/users/get-profile-photos.d.ts +0 -22
- package/esm/highlevel/methods/users/get-profile-photos.js +0 -28
- package/esm/highlevel/methods/users/get-profile-photos.js.map +0 -1
- package/esm/highlevel/methods/users/get-users.d.ts +0 -12
- package/esm/highlevel/methods/users/get-users.js +0 -25
- package/esm/highlevel/methods/users/get-users.js.map +0 -1
- package/esm/highlevel/methods/users/iter-profile-photos.d.ts +0 -23
- package/esm/highlevel/methods/users/iter-profile-photos.js +0 -31
- package/esm/highlevel/methods/users/iter-profile-photos.js.map +0 -1
- package/esm/highlevel/methods/users/resolve-peer-many.d.ts +0 -26
- package/esm/highlevel/methods/users/resolve-peer-many.js +0 -82
- package/esm/highlevel/methods/users/resolve-peer-many.js.map +0 -1
- package/esm/highlevel/methods/users/resolve-peer.d.ts +0 -19
- package/esm/highlevel/methods/users/resolve-peer.js +0 -173
- package/esm/highlevel/methods/users/resolve-peer.js.map +0 -1
- package/esm/highlevel/methods/users/set-global-ttl.d.ts +0 -8
- package/esm/highlevel/methods/users/set-global-ttl.js +0 -15
- package/esm/highlevel/methods/users/set-global-ttl.js.map +0 -1
- package/esm/highlevel/methods/users/set-my-birthday.d.ts +0 -12
- package/esm/highlevel/methods/users/set-my-birthday.js +0 -18
- package/esm/highlevel/methods/users/set-my-birthday.js.map +0 -1
- package/esm/highlevel/methods/users/set-my-emoji-status.d.ts +0 -13
- package/esm/highlevel/methods/users/set-my-emoji-status.js +0 -33
- package/esm/highlevel/methods/users/set-my-emoji-status.js.map +0 -1
- package/esm/highlevel/methods/users/set-my-profile-photo.d.ts +0 -16
- package/esm/highlevel/methods/users/set-my-profile-photo.js +0 -38
- package/esm/highlevel/methods/users/set-my-profile-photo.js.map +0 -1
- package/esm/highlevel/methods/users/set-my-username.d.ts +0 -11
- package/esm/highlevel/methods/users/set-my-username.js +0 -20
- package/esm/highlevel/methods/users/set-my-username.js.map +0 -1
- package/esm/highlevel/methods/users/set-offline.d.ts +0 -7
- package/esm/highlevel/methods/users/set-offline.js +0 -12
- package/esm/highlevel/methods/users/set-offline.js.map +0 -1
- package/esm/highlevel/methods/users/unblock-user.d.ts +0 -8
- package/esm/highlevel/methods/users/unblock-user.js +0 -15
- package/esm/highlevel/methods/users/unblock-user.js.map +0 -1
- package/esm/highlevel/methods/users/update-profile.d.ts +0 -23
- package/esm/highlevel/methods/users/update-profile.js +0 -18
- package/esm/highlevel/methods/users/update-profile.js.map +0 -1
- package/esm/highlevel/methods.d.ts +0 -274
- package/esm/highlevel/methods.js +0 -260
- package/esm/highlevel/methods.js.map +0 -1
- package/esm/highlevel/storage/index.d.ts +0 -4
- package/esm/highlevel/storage/index.js +0 -5
- package/esm/highlevel/storage/index.js.map +0 -1
- package/esm/highlevel/storage/provider.d.ts +0 -7
- package/esm/highlevel/storage/provider.js +0 -2
- package/esm/highlevel/storage/provider.js.map +0 -1
- package/esm/highlevel/storage/repository/peers.d.ts +0 -32
- package/esm/highlevel/storage/repository/peers.js +0 -2
- package/esm/highlevel/storage/repository/peers.js.map +0 -1
- package/esm/highlevel/storage/repository/ref-messages.d.ts +0 -20
- package/esm/highlevel/storage/repository/ref-messages.js +0 -2
- package/esm/highlevel/storage/repository/ref-messages.js.map +0 -1
- package/esm/highlevel/storage/service/current-user.d.ts +0 -23
- package/esm/highlevel/storage/service/current-user.js +0 -127
- package/esm/highlevel/storage/service/current-user.js.map +0 -1
- package/esm/highlevel/storage/service/peers.d.ts +0 -23
- package/esm/highlevel/storage/service/peers.js +0 -214
- package/esm/highlevel/storage/service/peers.js.map +0 -1
- package/esm/highlevel/storage/service/ref-messages.d.ts +0 -15
- package/esm/highlevel/storage/service/ref-messages.js +0 -39
- package/esm/highlevel/storage/service/ref-messages.js.map +0 -1
- package/esm/highlevel/storage/service/updates.d.ts +0 -16
- package/esm/highlevel/storage/service/updates.js +0 -69
- package/esm/highlevel/storage/service/updates.js.map +0 -1
- package/esm/highlevel/storage/storage.d.ts +0 -27
- package/esm/highlevel/storage/storage.js +0 -34
- package/esm/highlevel/storage/storage.js.map +0 -1
- package/esm/highlevel/types/auth/index.d.ts +0 -1
- package/esm/highlevel/types/auth/index.js +0 -2
- package/esm/highlevel/types/auth/index.js.map +0 -1
- package/esm/highlevel/types/auth/sent-code.d.ts +0 -56
- package/esm/highlevel/types/auth/sent-code.js +0 -77
- package/esm/highlevel/types/auth/sent-code.js.map +0 -1
- package/esm/highlevel/types/bots/command-scope/index.d.ts +0 -10
- package/esm/highlevel/types/bots/command-scope/index.js +0 -11
- package/esm/highlevel/types/bots/command-scope/index.js.map +0 -1
- package/esm/highlevel/types/bots/command-scope/inner.d.ts +0 -54
- package/esm/highlevel/types/bots/command-scope/inner.js +0 -69
- package/esm/highlevel/types/bots/command-scope/inner.js.map +0 -1
- package/esm/highlevel/types/bots/game-high-score.d.ts +0 -23
- package/esm/highlevel/types/bots/game-high-score.js +0 -36
- package/esm/highlevel/types/bots/game-high-score.js.map +0 -1
- package/esm/highlevel/types/bots/index.d.ts +0 -5
- package/esm/highlevel/types/bots/index.js +0 -6
- package/esm/highlevel/types/bots/index.js.map +0 -1
- package/esm/highlevel/types/bots/inline-message/factories.d.ts +0 -47
- package/esm/highlevel/types/bots/inline-message/factories.js +0 -163
- package/esm/highlevel/types/bots/inline-message/factories.js.map +0 -1
- package/esm/highlevel/types/bots/inline-message/index.d.ts +0 -3
- package/esm/highlevel/types/bots/inline-message/index.js +0 -4
- package/esm/highlevel/types/bots/inline-message/index.js.map +0 -1
- package/esm/highlevel/types/bots/inline-message/types.d.ts +0 -114
- package/esm/highlevel/types/bots/inline-message/types.js +0 -2
- package/esm/highlevel/types/bots/inline-message/types.js.map +0 -1
- package/esm/highlevel/types/bots/inline-result/factories.d.ts +0 -97
- package/esm/highlevel/types/bots/inline-result/factories.js +0 -470
- package/esm/highlevel/types/bots/inline-result/factories.js.map +0 -1
- package/esm/highlevel/types/bots/inline-result/index.d.ts +0 -3
- package/esm/highlevel/types/bots/inline-result/index.js +0 -4
- package/esm/highlevel/types/bots/inline-result/index.js.map +0 -1
- package/esm/highlevel/types/bots/inline-result/types.d.ts +0 -417
- package/esm/highlevel/types/bots/inline-result/types.js +0 -2
- package/esm/highlevel/types/bots/inline-result/types.js.map +0 -1
- package/esm/highlevel/types/bots/keyboards/builder.d.ts +0 -38
- package/esm/highlevel/types/bots/keyboards/builder.js +0 -90
- package/esm/highlevel/types/bots/keyboards/builder.js.map +0 -1
- package/esm/highlevel/types/bots/keyboards/factories.d.ts +0 -201
- package/esm/highlevel/types/bots/keyboards/factories.js +0 -341
- package/esm/highlevel/types/bots/keyboards/factories.js.map +0 -1
- package/esm/highlevel/types/bots/keyboards/index.d.ts +0 -15
- package/esm/highlevel/types/bots/keyboards/index.js +0 -16
- package/esm/highlevel/types/bots/keyboards/index.js.map +0 -1
- package/esm/highlevel/types/bots/keyboards/types.d.ts +0 -34
- package/esm/highlevel/types/bots/keyboards/types.js +0 -2
- package/esm/highlevel/types/bots/keyboards/types.js.map +0 -1
- package/esm/highlevel/types/calls/discard-reason.d.ts +0 -13
- package/esm/highlevel/types/calls/discard-reason.js +0 -32
- package/esm/highlevel/types/calls/discard-reason.js.map +0 -1
- package/esm/highlevel/types/calls/index.d.ts +0 -1
- package/esm/highlevel/types/calls/index.js +0 -2
- package/esm/highlevel/types/calls/index.js.map +0 -1
- package/esm/highlevel/types/conversation.d.ts +0 -210
- package/esm/highlevel/types/conversation.js +0 -471
- package/esm/highlevel/types/conversation.js.map +0 -1
- package/esm/highlevel/types/errors.d.ts +0 -33
- package/esm/highlevel/types/errors.js +0 -42
- package/esm/highlevel/types/errors.js.map +0 -1
- package/esm/highlevel/types/files/file-location.d.ts +0 -48
- package/esm/highlevel/types/files/file-location.js +0 -39
- package/esm/highlevel/types/files/file-location.js.map +0 -1
- package/esm/highlevel/types/files/index.d.ts +0 -4
- package/esm/highlevel/types/files/index.js +0 -5
- package/esm/highlevel/types/files/index.js.map +0 -1
- package/esm/highlevel/types/files/uploaded-file.d.ts +0 -24
- package/esm/highlevel/types/files/uploaded-file.js +0 -5
- package/esm/highlevel/types/files/uploaded-file.js.map +0 -1
- package/esm/highlevel/types/files/utils.d.ts +0 -88
- package/esm/highlevel/types/files/utils.js +0 -2
- package/esm/highlevel/types/files/utils.js.map +0 -1
- package/esm/highlevel/types/files/web-document.d.ts +0 -32
- package/esm/highlevel/types/files/web-document.js +0 -55
- package/esm/highlevel/types/files/web-document.js.map +0 -1
- package/esm/highlevel/types/index.d.ts +0 -15
- package/esm/highlevel/types/index.js +0 -16
- package/esm/highlevel/types/index.js.map +0 -1
- package/esm/highlevel/types/media/audio.d.ts +0 -31
- package/esm/highlevel/types/media/audio.js +0 -46
- package/esm/highlevel/types/media/audio.js.map +0 -1
- package/esm/highlevel/types/media/contact.d.ts +0 -31
- package/esm/highlevel/types/media/contact.js +0 -49
- package/esm/highlevel/types/media/contact.js.map +0 -1
- package/esm/highlevel/types/media/dice.d.ts +0 -155
- package/esm/highlevel/types/media/dice.js +0 -169
- package/esm/highlevel/types/media/dice.js.map +0 -1
- package/esm/highlevel/types/media/document-utils.d.ts +0 -11
- package/esm/highlevel/types/media/document-utils.js +0 -37
- package/esm/highlevel/types/media/document-utils.js.map +0 -1
- package/esm/highlevel/types/media/document.d.ts +0 -75
- package/esm/highlevel/types/media/document.js +0 -138
- package/esm/highlevel/types/media/document.js.map +0 -1
- package/esm/highlevel/types/media/extended-media.d.ts +0 -20
- package/esm/highlevel/types/media/extended-media.js +0 -38
- package/esm/highlevel/types/media/extended-media.js.map +0 -1
- package/esm/highlevel/types/media/game.d.ts +0 -38
- package/esm/highlevel/types/media/game.js +0 -74
- package/esm/highlevel/types/media/game.js.map +0 -1
- package/esm/highlevel/types/media/index.d.ts +0 -19
- package/esm/highlevel/types/media/index.js +0 -20
- package/esm/highlevel/types/media/index.js.map +0 -1
- package/esm/highlevel/types/media/input-media/factories.d.ts +0 -142
- package/esm/highlevel/types/media/input-media/factories.js +0 -233
- package/esm/highlevel/types/media/input-media/factories.js.map +0 -1
- package/esm/highlevel/types/media/input-media/index.d.ts +0 -3
- package/esm/highlevel/types/media/input-media/index.js +0 -4
- package/esm/highlevel/types/media/input-media/index.js.map +0 -1
- package/esm/highlevel/types/media/input-media/types.d.ts +0 -516
- package/esm/highlevel/types/media/input-media/types.js +0 -2
- package/esm/highlevel/types/media/input-media/types.js.map +0 -1
- package/esm/highlevel/types/media/invoice.d.ts +0 -89
- package/esm/highlevel/types/media/invoice.js +0 -129
- package/esm/highlevel/types/media/invoice.js.map +0 -1
- package/esm/highlevel/types/media/location.d.ts +0 -83
- package/esm/highlevel/types/media/location.js +0 -116
- package/esm/highlevel/types/media/location.js.map +0 -1
- package/esm/highlevel/types/media/paid-media.d.ts +0 -33
- package/esm/highlevel/types/media/paid-media.js +0 -63
- package/esm/highlevel/types/media/paid-media.js.map +0 -1
- package/esm/highlevel/types/media/photo.d.ts +0 -72
- package/esm/highlevel/types/media/photo.js +0 -164
- package/esm/highlevel/types/media/photo.js.map +0 -1
- package/esm/highlevel/types/media/poll.d.ts +0 -110
- package/esm/highlevel/types/media/poll.js +0 -188
- package/esm/highlevel/types/media/poll.js.map +0 -1
- package/esm/highlevel/types/media/sticker.d.ts +0 -123
- package/esm/highlevel/types/media/sticker.js +0 -144
- package/esm/highlevel/types/media/sticker.js.map +0 -1
- package/esm/highlevel/types/media/story.d.ts +0 -33
- package/esm/highlevel/types/media/story.js +0 -54
- package/esm/highlevel/types/media/story.js.map +0 -1
- package/esm/highlevel/types/media/thumbnail.d.ts +0 -70
- package/esm/highlevel/types/media/thumbnail.js +0 -250
- package/esm/highlevel/types/media/thumbnail.js.map +0 -1
- package/esm/highlevel/types/media/venue.d.ts +0 -58
- package/esm/highlevel/types/media/venue.js +0 -77
- package/esm/highlevel/types/media/venue.js.map +0 -1
- package/esm/highlevel/types/media/video.d.ts +0 -47
- package/esm/highlevel/types/media/video.js +0 -81
- package/esm/highlevel/types/media/video.js.map +0 -1
- package/esm/highlevel/types/media/voice.d.ts +0 -23
- package/esm/highlevel/types/media/voice.js +0 -38
- package/esm/highlevel/types/media/voice.js.map +0 -1
- package/esm/highlevel/types/media/web-page.d.ts +0 -151
- package/esm/highlevel/types/media/web-page.js +0 -195
- package/esm/highlevel/types/media/web-page.js.map +0 -1
- package/esm/highlevel/types/messages/dialog.d.ts +0 -110
- package/esm/highlevel/types/messages/dialog.js +0 -237
- package/esm/highlevel/types/messages/dialog.js.map +0 -1
- package/esm/highlevel/types/messages/draft-message.d.ts +0 -29
- package/esm/highlevel/types/messages/draft-message.js +0 -54
- package/esm/highlevel/types/messages/draft-message.js.map +0 -1
- package/esm/highlevel/types/messages/fact-check.d.ts +0 -30
- package/esm/highlevel/types/messages/fact-check.js +0 -53
- package/esm/highlevel/types/messages/fact-check.js.map +0 -1
- package/esm/highlevel/types/messages/index.d.ts +0 -14
- package/esm/highlevel/types/messages/index.js +0 -15
- package/esm/highlevel/types/messages/index.js.map +0 -1
- package/esm/highlevel/types/messages/input-message-id.d.ts +0 -20
- package/esm/highlevel/types/messages/input-message-id.js +0 -7
- package/esm/highlevel/types/messages/input-message-id.js.map +0 -1
- package/esm/highlevel/types/messages/message-action.d.ts +0 -377
- package/esm/highlevel/types/messages/message-action.js +0 -276
- package/esm/highlevel/types/messages/message-action.js.map +0 -1
- package/esm/highlevel/types/messages/message-effect.d.ts +0 -20
- package/esm/highlevel/types/messages/message-effect.js +0 -66
- package/esm/highlevel/types/messages/message-effect.js.map +0 -1
- package/esm/highlevel/types/messages/message-entity.d.ts +0 -89
- package/esm/highlevel/types/messages/message-entity.js +0 -104
- package/esm/highlevel/types/messages/message-entity.js.map +0 -1
- package/esm/highlevel/types/messages/message-forward.d.ts +0 -36
- package/esm/highlevel/types/messages/message-forward.js +0 -65
- package/esm/highlevel/types/messages/message-forward.js.map +0 -1
- package/esm/highlevel/types/messages/message-media.d.ts +0 -23
- package/esm/highlevel/types/messages/message-media.js +0 -78
- package/esm/highlevel/types/messages/message-media.js.map +0 -1
- package/esm/highlevel/types/messages/message-reactions.d.ts +0 -29
- package/esm/highlevel/types/messages/message-reactions.js +0 -44
- package/esm/highlevel/types/messages/message-reactions.js.map +0 -1
- package/esm/highlevel/types/messages/message-replies.d.ts +0 -42
- package/esm/highlevel/types/messages/message-replies.js +0 -66
- package/esm/highlevel/types/messages/message-replies.js.map +0 -1
- package/esm/highlevel/types/messages/message.d.ts +0 -248
- package/esm/highlevel/types/messages/message.js +0 -460
- package/esm/highlevel/types/messages/message.js.map +0 -1
- package/esm/highlevel/types/messages/replied-message.d.ts +0 -103
- package/esm/highlevel/types/messages/replied-message.js +0 -162
- package/esm/highlevel/types/messages/replied-message.js.map +0 -1
- package/esm/highlevel/types/messages/search-filters.d.ts +0 -82
- package/esm/highlevel/types/messages/search-filters.js +0 -55
- package/esm/highlevel/types/messages/search-filters.js.map +0 -1
- package/esm/highlevel/types/misc/app-config.d.ts +0 -887
- package/esm/highlevel/types/misc/app-config.js +0 -4
- package/esm/highlevel/types/misc/app-config.js.map +0 -1
- package/esm/highlevel/types/misc/collectible-info.d.ts +0 -27
- package/esm/highlevel/types/misc/collectible-info.js +0 -43
- package/esm/highlevel/types/misc/collectible-info.js.map +0 -1
- package/esm/highlevel/types/misc/entities.d.ts +0 -22
- package/esm/highlevel/types/misc/entities.js +0 -14
- package/esm/highlevel/types/misc/entities.js.map +0 -1
- package/esm/highlevel/types/misc/index.d.ts +0 -6
- package/esm/highlevel/types/misc/index.js +0 -7
- package/esm/highlevel/types/misc/index.js.map +0 -1
- package/esm/highlevel/types/misc/input-privacy-rule/allow.d.ts +0 -22
- package/esm/highlevel/types/misc/input-privacy-rule/allow.js +0 -31
- package/esm/highlevel/types/misc/input-privacy-rule/allow.js.map +0 -1
- package/esm/highlevel/types/misc/input-privacy-rule/bundle.d.ts +0 -3
- package/esm/highlevel/types/misc/input-privacy-rule/bundle.js +0 -4
- package/esm/highlevel/types/misc/input-privacy-rule/bundle.js.map +0 -1
- package/esm/highlevel/types/misc/input-privacy-rule/disallow.d.ts +0 -20
- package/esm/highlevel/types/misc/input-privacy-rule/disallow.js +0 -27
- package/esm/highlevel/types/misc/input-privacy-rule/disallow.js.map +0 -1
- package/esm/highlevel/types/misc/input-privacy-rule/index.d.ts +0 -3
- package/esm/highlevel/types/misc/input-privacy-rule/index.js +0 -4
- package/esm/highlevel/types/misc/input-privacy-rule/index.js.map +0 -1
- package/esm/highlevel/types/misc/input-privacy-rule/types.d.ts +0 -11
- package/esm/highlevel/types/misc/input-privacy-rule/types.js +0 -2
- package/esm/highlevel/types/misc/input-privacy-rule/types.js.map +0 -1
- package/esm/highlevel/types/misc/sticker-set.d.ts +0 -158
- package/esm/highlevel/types/misc/sticker-set.js +0 -253
- package/esm/highlevel/types/misc/sticker-set.js.map +0 -1
- package/esm/highlevel/types/misc/takeout-session.d.ts +0 -49
- package/esm/highlevel/types/misc/takeout-session.js +0 -84
- package/esm/highlevel/types/misc/takeout-session.js.map +0 -1
- package/esm/highlevel/types/peers/chat-colors.d.ts +0 -25
- package/esm/highlevel/types/peers/chat-colors.js +0 -35
- package/esm/highlevel/types/peers/chat-colors.js.map +0 -1
- package/esm/highlevel/types/peers/chat-event/actions.d.ts +0 -266
- package/esm/highlevel/types/peers/chat-event/actions.js +0 -230
- package/esm/highlevel/types/peers/chat-event/actions.js.map +0 -1
- package/esm/highlevel/types/peers/chat-event/filters.d.ts +0 -10
- package/esm/highlevel/types/peers/chat-event/filters.js +0 -104
- package/esm/highlevel/types/peers/chat-event/filters.js.map +0 -1
- package/esm/highlevel/types/peers/chat-event/index.d.ts +0 -27
- package/esm/highlevel/types/peers/chat-event/index.js +0 -41
- package/esm/highlevel/types/peers/chat-event/index.js.map +0 -1
- package/esm/highlevel/types/peers/chat-invite-link-member.d.ts +0 -33
- package/esm/highlevel/types/peers/chat-invite-link-member.js +0 -54
- package/esm/highlevel/types/peers/chat-invite-link-member.js.map +0 -1
- package/esm/highlevel/types/peers/chat-invite-link.d.ts +0 -72
- package/esm/highlevel/types/peers/chat-invite-link.js +0 -107
- package/esm/highlevel/types/peers/chat-invite-link.js.map +0 -1
- package/esm/highlevel/types/peers/chat-location.d.ts +0 -17
- package/esm/highlevel/types/peers/chat-location.js +0 -28
- package/esm/highlevel/types/peers/chat-location.js.map +0 -1
- package/esm/highlevel/types/peers/chat-member.d.ts +0 -81
- package/esm/highlevel/types/peers/chat-member.js +0 -153
- package/esm/highlevel/types/peers/chat-member.js.map +0 -1
- package/esm/highlevel/types/peers/chat-permissions.d.ts +0 -127
- package/esm/highlevel/types/peers/chat-permissions.js +0 -174
- package/esm/highlevel/types/peers/chat-permissions.js.map +0 -1
- package/esm/highlevel/types/peers/chat-photo.d.ts +0 -39
- package/esm/highlevel/types/peers/chat-photo.js +0 -128
- package/esm/highlevel/types/peers/chat-photo.js.map +0 -1
- package/esm/highlevel/types/peers/chat-preview.d.ts +0 -55
- package/esm/highlevel/types/peers/chat-preview.js +0 -73
- package/esm/highlevel/types/peers/chat-preview.js.map +0 -1
- package/esm/highlevel/types/peers/chat.d.ts +0 -248
- package/esm/highlevel/types/peers/chat.js +0 -479
- package/esm/highlevel/types/peers/chat.js.map +0 -1
- package/esm/highlevel/types/peers/chatlist-preview.d.ts +0 -21
- package/esm/highlevel/types/peers/chatlist-preview.js +0 -46
- package/esm/highlevel/types/peers/chatlist-preview.js.map +0 -1
- package/esm/highlevel/types/peers/forum-topic.d.ts +0 -96
- package/esm/highlevel/types/peers/forum-topic.js +0 -158
- package/esm/highlevel/types/peers/forum-topic.js.map +0 -1
- package/esm/highlevel/types/peers/full-chat.d.ts +0 -105
- package/esm/highlevel/types/peers/full-chat.js +0 -238
- package/esm/highlevel/types/peers/full-chat.js.map +0 -1
- package/esm/highlevel/types/peers/index.d.ts +0 -16
- package/esm/highlevel/types/peers/index.js +0 -17
- package/esm/highlevel/types/peers/index.js.map +0 -1
- package/esm/highlevel/types/peers/peer.d.ts +0 -49
- package/esm/highlevel/types/peers/peer.js +0 -16
- package/esm/highlevel/types/peers/peer.js.map +0 -1
- package/esm/highlevel/types/peers/peers-index.d.ts +0 -15
- package/esm/highlevel/types/peers/peers-index.js +0 -55
- package/esm/highlevel/types/peers/peers-index.js.map +0 -1
- package/esm/highlevel/types/peers/typing-status.d.ts +0 -26
- package/esm/highlevel/types/peers/typing-status.js +0 -2
- package/esm/highlevel/types/peers/typing-status.js.map +0 -1
- package/esm/highlevel/types/peers/user.d.ts +0 -268
- package/esm/highlevel/types/peers/user.js +0 -453
- package/esm/highlevel/types/peers/user.js.map +0 -1
- package/esm/highlevel/types/premium/boost-slot.d.ts +0 -37
- package/esm/highlevel/types/premium/boost-slot.js +0 -63
- package/esm/highlevel/types/premium/boost-slot.js.map +0 -1
- package/esm/highlevel/types/premium/boost-stats.d.ts +0 -54
- package/esm/highlevel/types/premium/boost-stats.js +0 -89
- package/esm/highlevel/types/premium/boost-stats.js.map +0 -1
- package/esm/highlevel/types/premium/boost.d.ts +0 -55
- package/esm/highlevel/types/premium/boost.js +0 -79
- package/esm/highlevel/types/premium/boost.js.map +0 -1
- package/esm/highlevel/types/premium/business-account.d.ts +0 -19
- package/esm/highlevel/types/premium/business-account.js +0 -42
- package/esm/highlevel/types/premium/business-account.js.map +0 -1
- package/esm/highlevel/types/premium/business-chat-link.d.ts +0 -19
- package/esm/highlevel/types/premium/business-chat-link.js +0 -36
- package/esm/highlevel/types/premium/business-chat-link.js.map +0 -1
- package/esm/highlevel/types/premium/business-connection.d.ts +0 -23
- package/esm/highlevel/types/premium/business-connection.js +0 -42
- package/esm/highlevel/types/premium/business-connection.js.map +0 -1
- package/esm/highlevel/types/premium/business-intro.d.ts +0 -22
- package/esm/highlevel/types/premium/business-intro.js +0 -40
- package/esm/highlevel/types/premium/business-intro.js.map +0 -1
- package/esm/highlevel/types/premium/business-location.d.ts +0 -10
- package/esm/highlevel/types/premium/business-location.js +0 -23
- package/esm/highlevel/types/premium/business-location.js.map +0 -1
- package/esm/highlevel/types/premium/business-work-hours.d.ts +0 -42
- package/esm/highlevel/types/premium/business-work-hours.js +0 -137
- package/esm/highlevel/types/premium/business-work-hours.js.map +0 -1
- package/esm/highlevel/types/premium/index.d.ts +0 -8
- package/esm/highlevel/types/premium/index.js +0 -9
- package/esm/highlevel/types/premium/index.js.map +0 -1
- package/esm/highlevel/types/reactions/emoji-status.d.ts +0 -12
- package/esm/highlevel/types/reactions/emoji-status.js +0 -23
- package/esm/highlevel/types/reactions/emoji-status.js.map +0 -1
- package/esm/highlevel/types/reactions/index.d.ts +0 -2
- package/esm/highlevel/types/reactions/index.js +0 -3
- package/esm/highlevel/types/reactions/index.js.map +0 -1
- package/esm/highlevel/types/reactions/peer-reaction.d.ts +0 -32
- package/esm/highlevel/types/reactions/peer-reaction.js +0 -52
- package/esm/highlevel/types/reactions/peer-reaction.js.map +0 -1
- package/esm/highlevel/types/reactions/reaction-count.d.ts +0 -23
- package/esm/highlevel/types/reactions/reaction-count.js +0 -34
- package/esm/highlevel/types/reactions/reaction-count.js.map +0 -1
- package/esm/highlevel/types/reactions/types.d.ts +0 -14
- package/esm/highlevel/types/reactions/types.js +0 -36
- package/esm/highlevel/types/reactions/types.js.map +0 -1
- package/esm/highlevel/types/stories/all-stories.d.ts +0 -28
- package/esm/highlevel/types/stories/all-stories.js +0 -45
- package/esm/highlevel/types/stories/all-stories.js.map +0 -1
- package/esm/highlevel/types/stories/index.d.ts +0 -7
- package/esm/highlevel/types/stories/index.js +0 -8
- package/esm/highlevel/types/stories/index.js.map +0 -1
- package/esm/highlevel/types/stories/interactive/base.d.ts +0 -16
- package/esm/highlevel/types/stories/interactive/base.js +0 -28
- package/esm/highlevel/types/stories/interactive/base.js.map +0 -1
- package/esm/highlevel/types/stories/interactive/channel-post.d.ts +0 -17
- package/esm/highlevel/types/stories/interactive/channel-post.js +0 -29
- package/esm/highlevel/types/stories/interactive/channel-post.js.map +0 -1
- package/esm/highlevel/types/stories/interactive/index.d.ts +0 -12
- package/esm/highlevel/types/stories/interactive/index.js +0 -29
- package/esm/highlevel/types/stories/interactive/index.js.map +0 -1
- package/esm/highlevel/types/stories/interactive/input.d.ts +0 -68
- package/esm/highlevel/types/stories/interactive/input.js +0 -85
- package/esm/highlevel/types/stories/interactive/input.js.map +0 -1
- package/esm/highlevel/types/stories/interactive/location.d.ts +0 -15
- package/esm/highlevel/types/stories/interactive/location.js +0 -27
- package/esm/highlevel/types/stories/interactive/location.js.map +0 -1
- package/esm/highlevel/types/stories/interactive/reaction.d.ts +0 -21
- package/esm/highlevel/types/stories/interactive/reaction.js +0 -33
- package/esm/highlevel/types/stories/interactive/reaction.js.map +0 -1
- package/esm/highlevel/types/stories/interactive/url.d.ts +0 -11
- package/esm/highlevel/types/stories/interactive/url.js +0 -16
- package/esm/highlevel/types/stories/interactive/url.js.map +0 -1
- package/esm/highlevel/types/stories/interactive/venue.d.ts +0 -28
- package/esm/highlevel/types/stories/interactive/venue.js +0 -51
- package/esm/highlevel/types/stories/interactive/venue.js.map +0 -1
- package/esm/highlevel/types/stories/interactive/weather.d.ts +0 -15
- package/esm/highlevel/types/stories/interactive/weather.js +0 -27
- package/esm/highlevel/types/stories/interactive/weather.js.map +0 -1
- package/esm/highlevel/types/stories/peer-stories.d.ts +0 -20
- package/esm/highlevel/types/stories/peer-stories.js +0 -38
- package/esm/highlevel/types/stories/peer-stories.js.map +0 -1
- package/esm/highlevel/types/stories/stealth-mode.d.ts +0 -9
- package/esm/highlevel/types/stories/stealth-mode.js +0 -22
- package/esm/highlevel/types/stories/stealth-mode.js.map +0 -1
- package/esm/highlevel/types/stories/story-interactions.d.ts +0 -34
- package/esm/highlevel/types/stories/story-interactions.js +0 -55
- package/esm/highlevel/types/stories/story-interactions.js.map +0 -1
- package/esm/highlevel/types/stories/story-viewer.d.ts +0 -75
- package/esm/highlevel/types/stories/story-viewer.js +0 -142
- package/esm/highlevel/types/stories/story-viewer.js.map +0 -1
- package/esm/highlevel/types/stories/story.d.ts +0 -79
- package/esm/highlevel/types/stories/story.js +0 -147
- package/esm/highlevel/types/stories/story.js.map +0 -1
- package/esm/highlevel/types/updates/bot-chat-join-request.d.ts +0 -42
- package/esm/highlevel/types/updates/bot-chat-join-request.js +0 -65
- package/esm/highlevel/types/updates/bot-chat-join-request.js.map +0 -1
- package/esm/highlevel/types/updates/bot-reaction.d.ts +0 -72
- package/esm/highlevel/types/updates/bot-reaction.js +0 -105
- package/esm/highlevel/types/updates/bot-reaction.js.map +0 -1
- package/esm/highlevel/types/updates/bot-stopped.d.ts +0 -28
- package/esm/highlevel/types/updates/bot-stopped.js +0 -42
- package/esm/highlevel/types/updates/bot-stopped.js.map +0 -1
- package/esm/highlevel/types/updates/business-message.d.ts +0 -18
- package/esm/highlevel/types/updates/business-message.js +0 -31
- package/esm/highlevel/types/updates/business-message.js.map +0 -1
- package/esm/highlevel/types/updates/callback-query.d.ts +0 -95
- package/esm/highlevel/types/updates/callback-query.js +0 -154
- package/esm/highlevel/types/updates/callback-query.js.map +0 -1
- package/esm/highlevel/types/updates/chat-join-request.d.ts +0 -30
- package/esm/highlevel/types/updates/chat-join-request.js +0 -49
- package/esm/highlevel/types/updates/chat-join-request.js.map +0 -1
- package/esm/highlevel/types/updates/chat-member-update.d.ts +0 -76
- package/esm/highlevel/types/updates/chat-member-update.js +0 -177
- package/esm/highlevel/types/updates/chat-member-update.js.map +0 -1
- package/esm/highlevel/types/updates/chosen-inline-result.d.ts +0 -50
- package/esm/highlevel/types/updates/chosen-inline-result.js +0 -75
- package/esm/highlevel/types/updates/chosen-inline-result.js.map +0 -1
- package/esm/highlevel/types/updates/delete-business-message-update.d.ts +0 -21
- package/esm/highlevel/types/updates/delete-business-message-update.js +0 -34
- package/esm/highlevel/types/updates/delete-business-message-update.js.map +0 -1
- package/esm/highlevel/types/updates/delete-message-update.d.ts +0 -16
- package/esm/highlevel/types/updates/delete-message-update.js +0 -26
- package/esm/highlevel/types/updates/delete-message-update.js.map +0 -1
- package/esm/highlevel/types/updates/delete-story-update.d.ts +0 -18
- package/esm/highlevel/types/updates/delete-story-update.js +0 -30
- package/esm/highlevel/types/updates/delete-story-update.js.map +0 -1
- package/esm/highlevel/types/updates/history-read-update.d.ts +0 -39
- package/esm/highlevel/types/updates/history-read-update.js +0 -107
- package/esm/highlevel/types/updates/history-read-update.js.map +0 -1
- package/esm/highlevel/types/updates/index.d.ts +0 -107
- package/esm/highlevel/types/updates/index.js +0 -22
- package/esm/highlevel/types/updates/index.js.map +0 -1
- package/esm/highlevel/types/updates/inline-query.d.ts +0 -42
- package/esm/highlevel/types/updates/inline-query.js +0 -72
- package/esm/highlevel/types/updates/inline-query.js.map +0 -1
- package/esm/highlevel/types/updates/parse-update.d.ts +0 -4
- package/esm/highlevel/types/updates/parse-update.js +0 -82
- package/esm/highlevel/types/updates/parse-update.js.map +0 -1
- package/esm/highlevel/types/updates/poll-update.d.ts +0 -39
- package/esm/highlevel/types/updates/poll-update.js +0 -66
- package/esm/highlevel/types/updates/poll-update.js.map +0 -1
- package/esm/highlevel/types/updates/poll-vote.d.ts +0 -52
- package/esm/highlevel/types/updates/poll-vote.js +0 -77
- package/esm/highlevel/types/updates/poll-vote.js.map +0 -1
- package/esm/highlevel/types/updates/pre-checkout-query.d.ts +0 -36
- package/esm/highlevel/types/updates/pre-checkout-query.js +0 -60
- package/esm/highlevel/types/updates/pre-checkout-query.js.map +0 -1
- package/esm/highlevel/types/updates/story-update.d.ts +0 -22
- package/esm/highlevel/types/updates/story-update.js +0 -36
- package/esm/highlevel/types/updates/story-update.js.map +0 -1
- package/esm/highlevel/types/updates/user-status-update.d.ts +0 -28
- package/esm/highlevel/types/updates/user-status-update.js +0 -45
- package/esm/highlevel/types/updates/user-status-update.js.map +0 -1
- package/esm/highlevel/types/updates/user-typing-update.d.ts +0 -31
- package/esm/highlevel/types/updates/user-typing-update.js +0 -97
- package/esm/highlevel/types/updates/user-typing-update.js.map +0 -1
- package/esm/highlevel/types/utils.d.ts +0 -12
- package/esm/highlevel/types/utils.js +0 -2
- package/esm/highlevel/types/utils.js.map +0 -1
- package/esm/highlevel/updates/index.d.ts +0 -2
- package/esm/highlevel/updates/index.js +0 -4
- package/esm/highlevel/updates/index.js.map +0 -1
- package/esm/highlevel/updates/manager.d.ts +0 -123
- package/esm/highlevel/updates/manager.js +0 -1410
- package/esm/highlevel/updates/manager.js.map +0 -1
- package/esm/highlevel/updates/parsed.d.ts +0 -32
- package/esm/highlevel/updates/parsed.js +0 -45
- package/esm/highlevel/updates/parsed.js.map +0 -1
- package/esm/highlevel/updates/types.d.ts +0 -142
- package/esm/highlevel/updates/types.js +0 -2
- package/esm/highlevel/updates/types.js.map +0 -1
- package/esm/highlevel/updates/utils.d.ts +0 -21
- package/esm/highlevel/updates/utils.js +0 -99
- package/esm/highlevel/updates/utils.js.map +0 -1
- package/esm/highlevel/utils/convert-file-id.d.ts +0 -46
- package/esm/highlevel/utils/convert-file-id.js +0 -282
- package/esm/highlevel/utils/convert-file-id.js.map +0 -1
- package/esm/highlevel/utils/entities.d.ts +0 -19
- package/esm/highlevel/utils/entities.js +0 -49
- package/esm/highlevel/utils/entities.js.map +0 -1
- package/esm/highlevel/utils/file-type.d.ts +0 -2
- package/esm/highlevel/utils/file-type.js +0 -169
- package/esm/highlevel/utils/file-type.js.map +0 -1
- package/esm/highlevel/utils/file-utils.d.ts +0 -31
- package/esm/highlevel/utils/file-utils.js +0 -115
- package/esm/highlevel/utils/file-utils.js.map +0 -1
- package/esm/highlevel/utils/index.d.ts +0 -10
- package/esm/highlevel/utils/index.js +0 -12
- package/esm/highlevel/utils/index.js.map +0 -1
- package/esm/highlevel/utils/inline-utils.d.ts +0 -14
- package/esm/highlevel/utils/inline-utils.js +0 -60
- package/esm/highlevel/utils/inline-utils.js.map +0 -1
- package/esm/highlevel/utils/inspectable.d.ts +0 -9
- package/esm/highlevel/utils/inspectable.js +0 -66
- package/esm/highlevel/utils/inspectable.js.map +0 -1
- package/esm/highlevel/utils/memoize.d.ts +0 -1
- package/esm/highlevel/utils/memoize.js +0 -27
- package/esm/highlevel/utils/memoize.js.map +0 -1
- package/esm/highlevel/utils/misc-utils.d.ts +0 -12
- package/esm/highlevel/utils/misc-utils.js +0 -34
- package/esm/highlevel/utils/misc-utils.js.map +0 -1
- package/esm/highlevel/utils/peer-utils.d.ts +0 -11
- package/esm/highlevel/utils/peer-utils.js +0 -128
- package/esm/highlevel/utils/peer-utils.js.map +0 -1
- package/esm/highlevel/utils/query-batcher.d.ts +0 -48
- package/esm/highlevel/utils/query-batcher.js +0 -142
- package/esm/highlevel/utils/query-batcher.js.map +0 -1
- package/esm/highlevel/utils/rps-meter.d.ts +0 -9
- package/esm/highlevel/utils/rps-meter.js +0 -39
- package/esm/highlevel/utils/rps-meter.js.map +0 -1
- package/esm/highlevel/utils/stream-utils.d.ts +0 -6
- package/esm/highlevel/utils/stream-utils.js +0 -108
- package/esm/highlevel/utils/stream-utils.js.map +0 -1
- package/esm/highlevel/utils/string-session.d.ts +0 -11
- package/esm/highlevel/utils/string-session.js +0 -116
- package/esm/highlevel/utils/string-session.js.map +0 -1
- package/esm/highlevel/utils/voice-utils.d.ts +0 -14
- package/esm/highlevel/utils/voice-utils.js +0 -59
- package/esm/highlevel/utils/voice-utils.js.map +0 -1
- package/esm/highlevel/worker/app-config.d.ts +0 -12
- package/esm/highlevel/worker/app-config.js +0 -12
- package/esm/highlevel/worker/app-config.js.map +0 -1
- package/esm/highlevel/worker/errors.d.ts +0 -8
- package/esm/highlevel/worker/errors.js +0 -116
- package/esm/highlevel/worker/errors.js.map +0 -1
- package/esm/highlevel/worker/index.d.ts +0 -3
- package/esm/highlevel/worker/index.js +0 -4
- package/esm/highlevel/worker/index.js.map +0 -1
- package/esm/highlevel/worker/invoker.d.ts +0 -18
- package/esm/highlevel/worker/invoker.js +0 -70
- package/esm/highlevel/worker/invoker.js.map +0 -1
- package/esm/highlevel/worker/port.d.ts +0 -61
- package/esm/highlevel/worker/port.js +0 -137
- package/esm/highlevel/worker/port.js.map +0 -1
- package/esm/highlevel/worker/protocol.d.ts +0 -57
- package/esm/highlevel/worker/protocol.js +0 -68
- package/esm/highlevel/worker/protocol.js.map +0 -1
- package/esm/highlevel/worker/storage.d.ts +0 -39
- package/esm/highlevel/worker/storage.js +0 -77
- package/esm/highlevel/worker/storage.js.map +0 -1
- package/esm/highlevel/worker/worker.d.ts +0 -15
- package/esm/highlevel/worker/worker.js +0 -141
- package/esm/highlevel/worker/worker.js.map +0 -1
- package/esm/index.d.ts +0 -10
- package/esm/index.js +0 -11
- package/esm/index.js.map +0 -1
- package/esm/network/auth-key.d.ts +0 -21
- package/esm/network/auth-key.js +0 -104
- package/esm/network/auth-key.js.map +0 -1
- package/esm/network/authorization.d.ts +0 -9
- package/esm/network/authorization.js +0 -334
- package/esm/network/authorization.js.map +0 -1
- package/esm/network/client.d.ts +0 -213
- package/esm/network/client.js +0 -184
- package/esm/network/client.js.map +0 -1
- package/esm/network/config-manager.d.ts +0 -19
- package/esm/network/config-manager.js +0 -47
- package/esm/network/config-manager.js.map +0 -1
- package/esm/network/index.d.ts +0 -6
- package/esm/network/index.js +0 -6
- package/esm/network/index.js.map +0 -1
- package/esm/network/middlewares/bundle.d.ts +0 -3
- package/esm/network/middlewares/bundle.js +0 -4
- package/esm/network/middlewares/bundle.js.map +0 -1
- package/esm/network/middlewares/default.d.ts +0 -8
- package/esm/network/middlewares/default.js +0 -6
- package/esm/network/middlewares/default.js.map +0 -1
- package/esm/network/middlewares/flood-waiter.d.ts +0 -37
- package/esm/network/middlewares/flood-waiter.js +0 -66
- package/esm/network/middlewares/flood-waiter.js.map +0 -1
- package/esm/network/middlewares/index.d.ts +0 -2
- package/esm/network/middlewares/index.js +0 -3
- package/esm/network/middlewares/index.js.map +0 -1
- package/esm/network/middlewares/internal-errors.d.ts +0 -17
- package/esm/network/middlewares/internal-errors.js +0 -37
- package/esm/network/middlewares/internal-errors.js.map +0 -1
- package/esm/network/middlewares/on-error.d.ts +0 -30
- package/esm/network/middlewares/on-error.js +0 -40
- package/esm/network/middlewares/on-error.js.map +0 -1
- package/esm/network/middlewares/on-method.d.ts +0 -39
- package/esm/network/middlewares/on-method.js +0 -41
- package/esm/network/middlewares/on-method.js.map +0 -1
- package/esm/network/mtproto-session.d.ts +0 -125
- package/esm/network/mtproto-session.js +0 -256
- package/esm/network/mtproto-session.js.map +0 -1
- package/esm/network/multi-session-connection.d.ts +0 -33
- package/esm/network/multi-session-connection.js +0 -262
- package/esm/network/multi-session-connection.js.map +0 -1
- package/esm/network/network-manager.d.ts +0 -246
- package/esm/network/network-manager.js +0 -574
- package/esm/network/network-manager.js.map +0 -1
- package/esm/network/persistent-connection.d.ts +0 -52
- package/esm/network/persistent-connection.js +0 -199
- package/esm/network/persistent-connection.js.map +0 -1
- package/esm/network/reconnection.d.ts +0 -11
- package/esm/network/reconnection.js +0 -14
- package/esm/network/reconnection.js.map +0 -1
- package/esm/network/server-salt.d.ts +0 -12
- package/esm/network/server-salt.js +0 -37
- package/esm/network/server-salt.js.map +0 -1
- package/esm/network/session-connection.d.ts +0 -79
- package/esm/network/session-connection.js +0 -1550
- package/esm/network/session-connection.js.map +0 -1
- package/esm/network/transports/abstract.d.ts +0 -98
- package/esm/network/transports/abstract.js +0 -35
- package/esm/network/transports/abstract.js.map +0 -1
- package/esm/network/transports/index.d.ts +0 -5
- package/esm/network/transports/index.js +0 -6
- package/esm/network/transports/index.js.map +0 -1
- package/esm/network/transports/intermediate.d.ts +0 -23
- package/esm/network/transports/intermediate.js +0 -65
- package/esm/network/transports/intermediate.js.map +0 -1
- package/esm/network/transports/obfuscated.d.ts +0 -18
- package/esm/network/transports/obfuscated.js +0 -78
- package/esm/network/transports/obfuscated.js.map +0 -1
- package/esm/network/transports/streamed.d.ts +0 -23
- package/esm/network/transports/streamed.js +0 -22
- package/esm/network/transports/streamed.js.map +0 -1
- package/esm/network/transports/wrapped.d.ts +0 -10
- package/esm/network/transports/wrapped.js +0 -21
- package/esm/network/transports/wrapped.js.map +0 -1
- package/esm/platform.d.ts +0 -18
- package/esm/platform.js +0 -27
- package/esm/platform.js.map +0 -1
- package/esm/storage/driver.d.ts +0 -56
- package/esm/storage/driver.js +0 -36
- package/esm/storage/driver.js.map +0 -1
- package/esm/storage/index.d.ts +0 -6
- package/esm/storage/index.js +0 -7
- package/esm/storage/index.js.map +0 -1
- package/esm/storage/memory/driver.d.ts +0 -6
- package/esm/storage/memory/driver.js +0 -11
- package/esm/storage/memory/driver.js.map +0 -1
- package/esm/storage/memory/index.d.ts +0 -22
- package/esm/storage/memory/index.js +0 -21
- package/esm/storage/memory/index.js.map +0 -1
- package/esm/storage/memory/repository/auth-keys.d.ts +0 -19
- package/esm/storage/memory/repository/auth-keys.js +0 -56
- package/esm/storage/memory/repository/auth-keys.js.map +0 -1
- package/esm/storage/memory/repository/kv.d.ts +0 -11
- package/esm/storage/memory/repository/kv.js +0 -21
- package/esm/storage/memory/repository/kv.js.map +0 -1
- package/esm/storage/memory/repository/peers.d.ts +0 -18
- package/esm/storage/memory/repository/peers.js +0 -53
- package/esm/storage/memory/repository/peers.js.map +0 -1
- package/esm/storage/memory/repository/ref-messages.d.ts +0 -16
- package/esm/storage/memory/repository/ref-messages.js +0 -39
- package/esm/storage/memory/repository/ref-messages.js.map +0 -1
- package/esm/storage/provider.d.ts +0 -10
- package/esm/storage/provider.js +0 -2
- package/esm/storage/provider.js.map +0 -1
- package/esm/storage/repository/auth-keys.d.ts +0 -41
- package/esm/storage/repository/auth-keys.js +0 -2
- package/esm/storage/repository/auth-keys.js.map +0 -1
- package/esm/storage/repository/index.d.ts +0 -2
- package/esm/storage/repository/index.js +0 -3
- package/esm/storage/repository/index.js.map +0 -1
- package/esm/storage/repository/key-value.d.ts +0 -10
- package/esm/storage/repository/key-value.js +0 -2
- package/esm/storage/repository/key-value.js.map +0 -1
- package/esm/storage/service/auth-keys.d.ts +0 -9
- package/esm/storage/service/auth-keys.js +0 -15
- package/esm/storage/service/auth-keys.js.map +0 -1
- package/esm/storage/service/base.d.ts +0 -19
- package/esm/storage/service/base.js +0 -25
- package/esm/storage/service/base.js.map +0 -1
- package/esm/storage/service/default-dcs.d.ts +0 -10
- package/esm/storage/service/default-dcs.js +0 -53
- package/esm/storage/service/default-dcs.js.map +0 -1
- package/esm/storage/service/future-salts.d.ts +0 -11
- package/esm/storage/service/future-salts.js +0 -40
- package/esm/storage/service/future-salts.js.map +0 -1
- package/esm/storage/sqlite/driver.d.ts +0 -24
- package/esm/storage/sqlite/driver.js +0 -125
- package/esm/storage/sqlite/driver.js.map +0 -1
- package/esm/storage/sqlite/index.d.ts +0 -17
- package/esm/storage/sqlite/index.js +0 -22
- package/esm/storage/sqlite/index.js.map +0 -1
- package/esm/storage/sqlite/repository/auth-keys.d.ts +0 -20
- package/esm/storage/sqlite/repository/auth-keys.js +0 -73
- package/esm/storage/sqlite/repository/auth-keys.js.map +0 -1
- package/esm/storage/sqlite/repository/kv.d.ts +0 -14
- package/esm/storage/sqlite/repository/kv.js +0 -97
- package/esm/storage/sqlite/repository/kv.js.map +0 -1
- package/esm/storage/sqlite/repository/peers.d.ts +0 -18
- package/esm/storage/sqlite/repository/peers.js +0 -92
- package/esm/storage/sqlite/repository/peers.js.map +0 -1
- package/esm/storage/sqlite/repository/ref-messages.d.ts +0 -16
- package/esm/storage/sqlite/repository/ref-messages.js +0 -51
- package/esm/storage/sqlite/repository/ref-messages.js.map +0 -1
- package/esm/storage/sqlite/types.d.ts +0 -18
- package/esm/storage/sqlite/types.js +0 -2
- package/esm/storage/sqlite/types.js.map +0 -1
- package/esm/storage/storage.d.ts +0 -51
- package/esm/storage/storage.js +0 -67
- package/esm/storage/storage.js.map +0 -1
- package/esm/types/errors.d.ts +0 -53
- package/esm/types/errors.js +0 -62
- package/esm/types/errors.js.map +0 -1
- package/esm/types/index.d.ts +0 -3
- package/esm/types/index.js +0 -4
- package/esm/types/index.js.map +0 -1
- package/esm/types/peers.d.ts +0 -4
- package/esm/types/peers.js +0 -2
- package/esm/types/peers.js.map +0 -1
- package/esm/types/utils.d.ts +0 -10
- package/esm/types/utils.js +0 -5
- package/esm/types/utils.js.map +0 -1
- package/esm/utils/abort-signal.d.ts +0 -1
- package/esm/utils/abort-signal.js +0 -9
- package/esm/utils/abort-signal.js.map +0 -1
- package/esm/utils/async-lock.d.ts +0 -10
- package/esm/utils/async-lock.js +0 -37
- package/esm/utils/async-lock.js.map +0 -1
- package/esm/utils/bigint-utils.d.ts +0 -47
- package/esm/utils/bigint-utils.js +0 -190
- package/esm/utils/bigint-utils.js.map +0 -1
- package/esm/utils/binary/asn1-parser.d.ts +0 -17
- package/esm/utils/binary/asn1-parser.js +0 -116
- package/esm/utils/binary/asn1-parser.js.map +0 -1
- package/esm/utils/buffer-utils.d.ts +0 -27
- package/esm/utils/buffer-utils.js +0 -68
- package/esm/utils/buffer-utils.js.map +0 -1
- package/esm/utils/composer.d.ts +0 -3
- package/esm/utils/composer.js +0 -18
- package/esm/utils/composer.js.map +0 -1
- package/esm/utils/condition-variable.d.ts +0 -9
- package/esm/utils/condition-variable.js +0 -26
- package/esm/utils/condition-variable.js.map +0 -1
- package/esm/utils/controllable-promise.d.ts +0 -11
- package/esm/utils/controllable-promise.js +0 -15
- package/esm/utils/controllable-promise.js.map +0 -1
- package/esm/utils/crypto/abstract.d.ts +0 -29
- package/esm/utils/crypto/abstract.js +0 -12
- package/esm/utils/crypto/abstract.js.map +0 -1
- package/esm/utils/crypto/factorization.d.ts +0 -6
- package/esm/utils/crypto/factorization.js +0 -57
- package/esm/utils/crypto/factorization.js.map +0 -1
- package/esm/utils/crypto/index.d.ts +0 -7
- package/esm/utils/crypto/index.js +0 -8
- package/esm/utils/crypto/index.js.map +0 -1
- package/esm/utils/crypto/keys.d.ts +0 -27
- package/esm/utils/crypto/keys.js +0 -66
- package/esm/utils/crypto/keys.js.map +0 -1
- package/esm/utils/crypto/miller-rabin.d.ts +0 -2
- package/esm/utils/crypto/miller-rabin.js +0 -38
- package/esm/utils/crypto/miller-rabin.js.map +0 -1
- package/esm/utils/crypto/mtproto.d.ts +0 -31
- package/esm/utils/crypto/mtproto.js +0 -60
- package/esm/utils/crypto/mtproto.js.map +0 -1
- package/esm/utils/crypto/password.d.ts +0 -29
- package/esm/utils/crypto/password.js +0 -91
- package/esm/utils/crypto/password.js.map +0 -1
- package/esm/utils/crypto/utils.d.ts +0 -14
- package/esm/utils/crypto/utils.js +0 -25
- package/esm/utils/crypto/utils.js.map +0 -1
- package/esm/utils/dcs.d.ts +0 -17
- package/esm/utils/dcs.js +0 -85
- package/esm/utils/dcs.js.map +0 -1
- package/esm/utils/deque.d.ts +0 -29
- package/esm/utils/deque.js +0 -218
- package/esm/utils/deque.js.map +0 -1
- package/esm/utils/early-timer.d.ts +0 -42
- package/esm/utils/early-timer.js +0 -78
- package/esm/utils/early-timer.js.map +0 -1
- package/esm/utils/error-reporting.d.ts +0 -3
- package/esm/utils/error-reporting.js +0 -18
- package/esm/utils/error-reporting.js.map +0 -1
- package/esm/utils/function-utils.d.ts +0 -22
- package/esm/utils/function-utils.js +0 -59
- package/esm/utils/function-utils.js.map +0 -1
- package/esm/utils/index.d.ts +0 -28
- package/esm/utils/index.js +0 -31
- package/esm/utils/index.js.map +0 -1
- package/esm/utils/linked-list.d.ts +0 -21
- package/esm/utils/linked-list.js +0 -72
- package/esm/utils/linked-list.js.map +0 -1
- package/esm/utils/links/bots.d.ts +0 -71
- package/esm/utils/links/bots.js +0 -256
- package/esm/utils/links/bots.js.map +0 -1
- package/esm/utils/links/bundle.d.ts +0 -7
- package/esm/utils/links/bundle.js +0 -8
- package/esm/utils/links/bundle.js.map +0 -1
- package/esm/utils/links/calls.d.ts +0 -16
- package/esm/utils/links/calls.js +0 -56
- package/esm/utils/links/calls.js.map +0 -1
- package/esm/utils/links/chat.d.ts +0 -46
- package/esm/utils/links/chat.js +0 -157
- package/esm/utils/links/chat.js.map +0 -1
- package/esm/utils/links/common.d.ts +0 -31
- package/esm/utils/links/common.js +0 -56
- package/esm/utils/links/common.js.map +0 -1
- package/esm/utils/links/index.d.ts +0 -2
- package/esm/utils/links/index.js +0 -3
- package/esm/utils/links/index.js.map +0 -1
- package/esm/utils/links/misc.d.ts +0 -25
- package/esm/utils/links/misc.js +0 -97
- package/esm/utils/links/misc.js.map +0 -1
- package/esm/utils/links/proxy.d.ts +0 -17
- package/esm/utils/links/proxy.js +0 -58
- package/esm/utils/links/proxy.js.map +0 -1
- package/esm/utils/links/stickers.d.ts +0 -9
- package/esm/utils/links/stickers.js +0 -25
- package/esm/utils/links/stickers.js.map +0 -1
- package/esm/utils/links/user.d.ts +0 -27
- package/esm/utils/links/user.js +0 -78
- package/esm/utils/links/user.js.map +0 -1
- package/esm/utils/logger.d.ts +0 -54
- package/esm/utils/logger.js +0 -164
- package/esm/utils/logger.js.map +0 -1
- package/esm/utils/long-utils.d.ts +0 -80
- package/esm/utils/long-utils.js +0 -155
- package/esm/utils/long-utils.js.map +0 -1
- package/esm/utils/lru-map.d.ts +0 -22
- package/esm/utils/lru-map.js +0 -113
- package/esm/utils/lru-map.js.map +0 -1
- package/esm/utils/lru-set.d.ts +0 -22
- package/esm/utils/lru-set.js +0 -48
- package/esm/utils/lru-set.js.map +0 -1
- package/esm/utils/misc-utils.d.ts +0 -8
- package/esm/utils/misc-utils.js +0 -25
- package/esm/utils/misc-utils.js.map +0 -1
- package/esm/utils/peer-utils.d.ts +0 -29
- package/esm/utils/peer-utils.js +0 -159
- package/esm/utils/peer-utils.js.map +0 -1
- package/esm/utils/reloadable.d.ts +0 -23
- package/esm/utils/reloadable.js +0 -61
- package/esm/utils/reloadable.js.map +0 -1
- package/esm/utils/sorted-array.d.ts +0 -17
- package/esm/utils/sorted-array.js +0 -82
- package/esm/utils/sorted-array.js.map +0 -1
- package/esm/utils/tl-json.d.ts +0 -13
- package/esm/utils/tl-json.js +0 -57
- package/esm/utils/tl-json.js.map +0 -1
- package/esm/utils/type-assertions.d.ts +0 -39
- package/esm/utils/type-assertions.js +0 -69
- package/esm/utils/type-assertions.js.map +0 -1
- /package/{cjs/highlevel/methods/_imports.d.ts → highlevel/base.test.d.ts} +0 -0
- /package/{cjs/highlevel → highlevel}/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/managers/app-config-manager.d.ts +0 -0
- /package/{esm/highlevel → highlevel}/methods/_imports.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/_init.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/check-password.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/get-password-hint.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/log-out.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/recover-password.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/resend-code.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/run.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/send-code.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/send-recovery-code.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/sign-in-bot.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/sign-in-qr.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/sign-in.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/start-test.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/start.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/auth/utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/answer-inline-query.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/delete-my-commands.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/get-bot-info.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/get-bot-menu-button.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/get-callback-answer.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/get-my-commands.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/normalize-command-scope.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/set-bot-info.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/set-bot-menu-button.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/set-game-score.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/set-my-commands.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/bots/set-my-default-rights.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/add-chat-members.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/archive-chats.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/create-channel.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/create-supergroup.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/delete-channel.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/delete-chat-photo.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/delete-group.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/delete-history.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/delete-user-history.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/edit-admin-rights.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/get-chat-preview.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/get-nearby-chats.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/iter-chat-event-log.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/iter-chat-members.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/kick-chat-member.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/leave-chat.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/mark-chat-unread.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/open-chat.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/reorder-usernames.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/restrict-chat-member.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/save-draft.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/set-chat-color.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/set-chat-description.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/set-chat-photo.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/set-chat-title.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/set-chat-ttl.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/set-chat-username.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/set-slow-mode.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/toggle-content-protection.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/toggle-fragment-username.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/toggle-join-requests.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/toggle-join-to-send.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/unarchive-chats.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/chats/unban-chat-member.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/contacts/add-contact.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/contacts/delete-contacts.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/contacts/get-contacts.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/contacts/import-contacts.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/dialogs/create-folder.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/dialogs/delete-folder.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/dialogs/edit-folder.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/dialogs/find-dialogs.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/dialogs/find-folder.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/dialogs/get-chatlist-preview.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/dialogs/get-folders.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/dialogs/get-peer-dialogs.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/dialogs/join-chatlist.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/dialogs/set-folders-order.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/files/download-buffer.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/files/download-file.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/files/download-iterable.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/files/download-node-stream.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/files/download-stream.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/files/normalize-file-to-document.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/files/normalize-input-file.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/files/normalize-input-media.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/forums/create-forum-topic.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/forums/iter-forum-topics.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/forums/toggle-forum-topic-pinned.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/forums/toggle-forum.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/forums/toggle-general-topic-hidden.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/invite-links/hide-join-request.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/invite-links/iter-invite-link-members.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/invite-links/iter-invite-links.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/_business-connection.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/close-poll.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/delete-messages.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/delete-scheduled-messages.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/edit-inline-message.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/edit-message.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/find-in-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/forward-messages.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-all-scheduled-messages.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-available-effects.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-discussion-message.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-fact-check.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-history.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-message-by-link.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-message-group.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-message-reactions.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-reaction-users.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-reply-to.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/get-scheduled-messages.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/iter-history.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/iter-reaction-users.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/iter-search-global.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/iter-search-messages.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/pin-message.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/read-history.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/read-reactions.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/search-global.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/search-hashtag.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/search-messages.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-answer.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-comment.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-common.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-copy-group.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-copy.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-media-group.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-media.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-quote.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-reaction.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-reply.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-scheduled.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-text.d.ts +0 -0
- /package/{esm/highlevel/methods/_init.d.ts → highlevel/methods/messages/send-text.test.d.ts} +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-typing.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/send-vote.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/translate-message.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/translate-text.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/unpin-all-messages.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/messages/unpin-message.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/misc/chain-id.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/misc/get-collectible-info.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/misc/init-takeout-session.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/misc/normalize-privacy-rules.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/misc/normalize-text.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/misc/with-params.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/password/change-cloud-password.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/password/enable-cloud-password.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/password/password-email.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/password/remove-cloud-password.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/apply-boost.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/can-apply-boost.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/create-business-chat-link.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/edit-business-chat-link.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/get-boost-stats.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/get-boosts.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/get-business-chat-links.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/get-business-connection.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/get-my-boost-slots.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/set-business-intro.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/premium/set-business-work-hours.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stickers/_utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stickers/add-sticker-to-set.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stickers/delete-sticker-from-set.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stickers/get-custom-emojis.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stickers/get-installed-stickers.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stickers/get-sticker-set.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stickers/move-sticker-in-set.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stickers/replace-sticker-in-set.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stickers/set-chat-sticker-set.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stickers/set-sticker-set-thumb.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/can-send-story.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/delete-stories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/edit-story.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/find-in-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/get-all-stories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/get-peer-stories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/get-profile-stories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/get-stories-by-id.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/get-stories-interactions.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/get-story-link.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/get-story-viewers.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/hide-my-stories-views.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/increment-stories-views.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/iter-all-stories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/iter-profile-stories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/iter-story-viewers.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/read-stories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/report-story.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/send-story-reaction.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/send-story.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/toggle-peer-stories-archived.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/stories/toggle-stories-pinned.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/block-user.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/delete-profile-photos.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/edit-close-friends.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/get-global-ttl.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/get-me.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/get-my-username.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/get-profile-photo.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/get-profile-photos.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/get-users.d.ts +0 -0
- /package/{esm/highlevel/methods/files/download-file.d.ts → highlevel/methods/users/get-users.test.d.ts} +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/iter-profile-photos.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/resolve-peer-many.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/resolve-peer.d.ts +0 -0
- /package/{esm/highlevel/methods/files/download-node-stream.d.ts → highlevel/methods/users/resolve-peer.test.d.ts} +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/set-global-ttl.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/set-my-birthday.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/set-my-emoji-status.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/set-my-profile-photo.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/set-my-username.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/set-offline.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/unblock-user.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/methods/users/update-profile.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/storage/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/storage/provider.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/auth/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/auth/sent-code.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/command-scope/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/command-scope/inner.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/game-high-score.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/inline-message/factories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/inline-message/types.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/inline-result/factories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/inline-result/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/inline-result/types.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/keyboards/factories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/bots/keyboards/types.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/calls/discard-reason.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/calls/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/errors.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/files/file-location.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/files/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/files/uploaded-file.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/files/utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/files/web-document.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/audio.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/contact.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/dice.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/document-utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/document.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/extended-media.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/game.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/input-media/factories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/input-media/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/location.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/paid-media.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/photo.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/sticker.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/story.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/thumbnail.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/venue.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/video.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/voice.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/media/web-page.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/dialog.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/draft-message.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/fact-check.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/message-effect.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/message-entity.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/message-forward.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/message-media.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/message-replies.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/message.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/replied-message.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/messages/search-filters.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/misc/app-config.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/misc/entities.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/misc/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/misc/input-privacy-rule/allow.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/misc/input-privacy-rule/bundle.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/misc/input-privacy-rule/disallow.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/misc/input-privacy-rule/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/misc/input-privacy-rule/types.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/misc/sticker-set.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/misc/takeout-session.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/chat-colors.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/chat-event/filters.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/chat-event/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/chat-invite-link-member.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/chat-location.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/chat-permissions.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/chat-photo.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/chat-preview.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/chatlist-preview.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/forum-topic.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/peer.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/peers-index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/peers/typing-status.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/premium/boost-stats.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/premium/business-account.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/premium/business-chat-link.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/premium/business-connection.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/premium/business-intro.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/premium/business-location.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/premium/business-work-hours.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/reactions/emoji-status.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/reactions/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/all-stories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/interactive/base.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/interactive/channel-post.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/interactive/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/interactive/input.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/interactive/location.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/interactive/reaction.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/interactive/url.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/interactive/venue.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/interactive/weather.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/peer-stories.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/stealth-mode.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/story-interactions.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/story-viewer.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/stories/story.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/bot-reaction.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/bot-stopped.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/business-message.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/callback-query.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/chat-join-request.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/chat-member-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/chosen-inline-result.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/delete-business-message-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/delete-message-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/delete-story-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/history-read-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/parse-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/poll-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/poll-vote.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/pre-checkout-query.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/story-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/user-status-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/updates/user-typing-update.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/types/utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/updates/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/updates/parsed.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/convert-file-id.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/entities.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/file-type.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/file-utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/inline-utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/inspectable.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/memoize.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/misc-utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/peer-utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/rps-meter.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/stream-utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/string-session.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/utils/voice-utils.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/worker/errors.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/worker/index.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/worker/invoker.d.ts +0 -0
- /package/{cjs/highlevel → highlevel}/worker/worker.d.ts +0 -0
- /package/{cjs/network → network}/config-manager.d.ts +0 -0
- /package/{cjs/network → network}/index.d.ts +0 -0
- /package/{cjs/network → network}/middlewares/bundle.d.ts +0 -0
- /package/{cjs/network → network}/middlewares/flood-waiter.d.ts +0 -0
- /package/{cjs/network → network}/middlewares/index.d.ts +0 -0
- /package/{cjs/network → network}/middlewares/internal-errors.d.ts +0 -0
- /package/{cjs/network → network}/middlewares/on-error.d.ts +0 -0
- /package/{cjs/network → network}/middlewares/on-method.d.ts +0 -0
- /package/{cjs/network → network}/reconnection.d.ts +0 -0
- /package/{cjs/network → network}/transports/index.d.ts +0 -0
- /package/{cjs/network → network}/transports/intermediate.d.ts +0 -0
- /package/{cjs/network → network}/transports/obfuscated.d.ts +0 -0
- /package/{cjs/storage → storage}/index.d.ts +0 -0
- /package/{cjs/storage → storage}/memory/driver.d.ts +0 -0
- /package/{cjs/storage → storage}/memory/index.d.ts +0 -0
- /package/{cjs/storage → storage}/memory/repository/auth-keys.d.ts +0 -0
- /package/{cjs/storage → storage}/memory/repository/kv.d.ts +0 -0
- /package/{cjs/storage → storage}/memory/repository/peers.d.ts +0 -0
- /package/{cjs/storage → storage}/memory/repository/ref-messages.d.ts +0 -0
- /package/{cjs/storage → storage}/provider.d.ts +0 -0
- /package/{cjs/storage → storage}/repository/index.d.ts +0 -0
- /package/{cjs/storage → storage}/service/base.d.ts +0 -0
- /package/{cjs/storage → storage}/sqlite/index.d.ts +0 -0
- /package/{cjs/storage → storage}/sqlite/repository/auth-keys.d.ts +0 -0
- /package/{cjs/storage → storage}/sqlite/repository/kv.d.ts +0 -0
- /package/{cjs/storage → storage}/sqlite/repository/peers.d.ts +0 -0
- /package/{cjs/storage → storage}/sqlite/repository/ref-messages.d.ts +0 -0
- /package/{cjs/types → types}/errors.d.ts +0 -0
- /package/{cjs/types → types}/index.d.ts +0 -0
- /package/{cjs/types → types}/peers.d.ts +0 -0
- /package/{cjs/utils → utils}/abort-signal.d.ts +0 -0
- /package/{cjs/utils → utils}/async-lock.d.ts +0 -0
- /package/{cjs/utils → utils}/bigint-utils.d.ts +0 -0
- /package/{cjs/utils → utils}/binary/asn1-parser.d.ts +0 -0
- /package/{cjs/utils → utils}/buffer-utils.d.ts +0 -0
- /package/{cjs/utils → utils}/composer.d.ts +0 -0
- /package/{cjs/utils → utils}/condition-variable.d.ts +0 -0
- /package/{cjs/utils → utils}/crypto/factorization.d.ts +0 -0
- /package/{cjs/utils → utils}/crypto/index.d.ts +0 -0
- /package/{cjs/utils → utils}/crypto/miller-rabin.d.ts +0 -0
- /package/{cjs/utils → utils}/crypto/mtproto.d.ts +0 -0
- /package/{cjs/utils → utils}/crypto/password.d.ts +0 -0
- /package/{cjs/utils → utils}/crypto/utils.d.ts +0 -0
- /package/{cjs/utils → utils}/dcs.d.ts +0 -0
- /package/{cjs/utils → utils}/deque.d.ts +0 -0
- /package/{cjs/utils → utils}/early-timer.d.ts +0 -0
- /package/{cjs/utils → utils}/error-reporting.d.ts +0 -0
- /package/{cjs/utils → utils}/function-utils.d.ts +0 -0
- /package/{cjs/utils → utils}/linked-list.d.ts +0 -0
- /package/{cjs/utils → utils}/links/bundle.d.ts +0 -0
- /package/{cjs/utils → utils}/links/index.d.ts +0 -0
- /package/{cjs/utils → utils}/lru-map.d.ts +0 -0
- /package/{cjs/utils → utils}/misc-utils.d.ts +0 -0
- /package/{cjs/utils → utils}/sorted-array.d.ts +0 -0
- /package/{cjs/utils → utils}/tl-json.d.ts +0 -0
|
@@ -0,0 +1,4982 @@
|
|
|
1
|
+
if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WARNED) {
|
|
2
|
+
globalThis._MTCUTE_CJS_DEPRECATION_WARNED = true;
|
|
3
|
+
console.warn("[@mtcute/core] CommonJS support is deprecated and will be removed soon. Please consider switching to ESM, it's " + (/* @__PURE__ */ new Date()).getFullYear() + " already.");
|
|
4
|
+
console.warn("[@mtcute/core] Learn more about switching to ESM: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c");
|
|
5
|
+
}
|
|
6
|
+
"use strict";
|
|
7
|
+
const platform = require("./j7rWn_1y.js");
|
|
8
|
+
const tl = require("@mtcute/tl");
|
|
9
|
+
const conditionVariable = require("./eX3zeDAz.js");
|
|
10
|
+
const controllablePromise = require("./CZAB54t2.js");
|
|
11
|
+
const storyViewer = require("./UVFvMVPt.js");
|
|
12
|
+
const Long = require("long");
|
|
13
|
+
const peersIndex = require("./ija5tZ1t.js");
|
|
14
|
+
const fileId = require("@mtcute/file-id");
|
|
15
|
+
const chat = require("./BijPAnvP.js");
|
|
16
|
+
async function _onAuthorization(client, auth) {
|
|
17
|
+
const user = await client.notifyLoggedIn(auth);
|
|
18
|
+
return new storyViewer.User$2(user);
|
|
19
|
+
}
|
|
20
|
+
function isSelfPeer(client, peer) {
|
|
21
|
+
const state = client.storage.self.getCached();
|
|
22
|
+
if (!state) return false;
|
|
23
|
+
switch (peer._) {
|
|
24
|
+
case "inputPeerSelf":
|
|
25
|
+
case "inputUserSelf":
|
|
26
|
+
return true;
|
|
27
|
+
case "inputPeerUser":
|
|
28
|
+
case "inputPeerUserFromMessage":
|
|
29
|
+
case "inputUser":
|
|
30
|
+
case "inputUserFromMessage":
|
|
31
|
+
case "peerUser":
|
|
32
|
+
return peer.userId === state.userId;
|
|
33
|
+
default:
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function checkPassword(client, password) {
|
|
38
|
+
const res = await client.call({
|
|
39
|
+
_: "auth.checkPassword",
|
|
40
|
+
password: await client.computeSrpParams(
|
|
41
|
+
await client.call({
|
|
42
|
+
_: "account.getPassword"
|
|
43
|
+
}),
|
|
44
|
+
password
|
|
45
|
+
)
|
|
46
|
+
});
|
|
47
|
+
return _onAuthorization(client, res);
|
|
48
|
+
}
|
|
49
|
+
function getPasswordHint(client) {
|
|
50
|
+
return client.call({
|
|
51
|
+
_: "account.getPassword"
|
|
52
|
+
}).then((res) => res.hint ?? null);
|
|
53
|
+
}
|
|
54
|
+
async function logOut(client) {
|
|
55
|
+
const res = await client.call({ _: "auth.logOut" });
|
|
56
|
+
await client.notifyLoggedOut();
|
|
57
|
+
return {
|
|
58
|
+
futureAuthToken: res.futureAuthToken
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async function recoverPassword(client, params) {
|
|
62
|
+
const { recoveryCode } = params;
|
|
63
|
+
const res = await client.call({
|
|
64
|
+
_: "auth.recoverPassword",
|
|
65
|
+
code: recoveryCode
|
|
66
|
+
});
|
|
67
|
+
return _onAuthorization(client, res);
|
|
68
|
+
}
|
|
69
|
+
async function resendCode(client, params) {
|
|
70
|
+
const { phone, phoneCodeHash, abortSignal } = params;
|
|
71
|
+
const res = await client.call(
|
|
72
|
+
{
|
|
73
|
+
_: "auth.resendCode",
|
|
74
|
+
phoneNumber: conditionVariable.normalizePhoneNumber(phone),
|
|
75
|
+
phoneCodeHash
|
|
76
|
+
},
|
|
77
|
+
{ abortSignal }
|
|
78
|
+
);
|
|
79
|
+
controllablePromise.assertTypeIs("sendCode", res, "auth.sentCode");
|
|
80
|
+
return new storyViewer.SentCode$1(res);
|
|
81
|
+
}
|
|
82
|
+
function getMe(client) {
|
|
83
|
+
return client.call({
|
|
84
|
+
_: "users.getUsers",
|
|
85
|
+
id: [
|
|
86
|
+
{
|
|
87
|
+
_: "inputUserSelf"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}).then(async ([user]) => {
|
|
91
|
+
controllablePromise.assertTypeIs("getMe (@ users.getUsers)", user, "user");
|
|
92
|
+
await client.storage.self.storeFrom(user);
|
|
93
|
+
return new storyViewer.User$2(user);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
async function sendCode(client, params) {
|
|
97
|
+
const phone = conditionVariable.normalizePhoneNumber(params.phone);
|
|
98
|
+
const { id, hash } = await client.getApiCrenetials();
|
|
99
|
+
const res = await client.call(
|
|
100
|
+
{
|
|
101
|
+
_: "auth.sendCode",
|
|
102
|
+
phoneNumber: phone,
|
|
103
|
+
apiId: id,
|
|
104
|
+
apiHash: hash,
|
|
105
|
+
settings: {
|
|
106
|
+
_: "codeSettings",
|
|
107
|
+
logoutTokens: params.futureAuthTokens,
|
|
108
|
+
...params.codeSettings
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{ abortSignal: params.abortSignal }
|
|
112
|
+
);
|
|
113
|
+
controllablePromise.assertTypeIs("sendCode", res, "auth.sentCode");
|
|
114
|
+
return new storyViewer.SentCode$1(res);
|
|
115
|
+
}
|
|
116
|
+
async function signIn(client, params) {
|
|
117
|
+
const { phone, phoneCodeHash, phoneCode, abortSignal } = params;
|
|
118
|
+
const res = await client.call(
|
|
119
|
+
{
|
|
120
|
+
_: "auth.signIn",
|
|
121
|
+
phoneNumber: conditionVariable.normalizePhoneNumber(phone),
|
|
122
|
+
phoneCodeHash,
|
|
123
|
+
phoneCode
|
|
124
|
+
},
|
|
125
|
+
{ abortSignal }
|
|
126
|
+
);
|
|
127
|
+
return _onAuthorization(client, res);
|
|
128
|
+
}
|
|
129
|
+
async function signInBot(client, token) {
|
|
130
|
+
const { id, hash } = await client.getApiCrenetials();
|
|
131
|
+
const res = await client.call({
|
|
132
|
+
_: "auth.importBotAuthorization",
|
|
133
|
+
flags: 0,
|
|
134
|
+
apiId: id,
|
|
135
|
+
apiHash: hash,
|
|
136
|
+
botAuthToken: token
|
|
137
|
+
});
|
|
138
|
+
return _onAuthorization(client, res);
|
|
139
|
+
}
|
|
140
|
+
async function signInQr(client, params) {
|
|
141
|
+
const { onUrlUpdated, abortSignal, onQrScanned } = params;
|
|
142
|
+
let waiter;
|
|
143
|
+
const originalHandler = client.getServerUpdateHandler();
|
|
144
|
+
const onUpdate = (upd) => {
|
|
145
|
+
if (upd._ === "updateShort" && upd.update._ === "updateLoginToken") {
|
|
146
|
+
onQrScanned?.();
|
|
147
|
+
waiter?.resolve();
|
|
148
|
+
client.onServerUpdate(originalHandler);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
client.onServerUpdate(onUpdate);
|
|
152
|
+
abortSignal?.addEventListener("abort", () => {
|
|
153
|
+
client.onServerUpdate(originalHandler);
|
|
154
|
+
waiter?.reject(abortSignal.reason);
|
|
155
|
+
});
|
|
156
|
+
async function handle2fa(input) {
|
|
157
|
+
const isDynamic = typeof input === "function";
|
|
158
|
+
while (true) {
|
|
159
|
+
const password = await conditionVariable.resolveMaybeDynamic(input);
|
|
160
|
+
try {
|
|
161
|
+
return await checkPassword(client, password);
|
|
162
|
+
} catch (e) {
|
|
163
|
+
if (tl.tl.RpcError.is(e, "PASSWORD_HASH_INVALID")) {
|
|
164
|
+
if (!isDynamic) {
|
|
165
|
+
throw e;
|
|
166
|
+
}
|
|
167
|
+
if (params.invalidPasswordCallback) {
|
|
168
|
+
await params.invalidPasswordCallback?.();
|
|
169
|
+
} else {
|
|
170
|
+
console.log("Invalid password. Please try again");
|
|
171
|
+
}
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
throw e;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
const { id, hash } = await client.getApiCrenetials();
|
|
180
|
+
const platform$1 = platform.getPlatform();
|
|
181
|
+
loop: while (true) {
|
|
182
|
+
let res;
|
|
183
|
+
try {
|
|
184
|
+
res = await client.call(
|
|
185
|
+
{
|
|
186
|
+
_: "auth.exportLoginToken",
|
|
187
|
+
apiId: id,
|
|
188
|
+
apiHash: hash,
|
|
189
|
+
exceptIds: []
|
|
190
|
+
},
|
|
191
|
+
{ abortSignal }
|
|
192
|
+
);
|
|
193
|
+
} catch (e) {
|
|
194
|
+
if (tl.tl.RpcError.is(e, "SESSION_PASSWORD_NEEDED") && params.password) {
|
|
195
|
+
return await handle2fa(params.password);
|
|
196
|
+
}
|
|
197
|
+
throw e;
|
|
198
|
+
}
|
|
199
|
+
switch (res._) {
|
|
200
|
+
case "auth.loginToken":
|
|
201
|
+
onUrlUpdated(
|
|
202
|
+
`tg://login?token=${platform$1.base64Encode(res.token, true)}`,
|
|
203
|
+
new Date(res.expires * 1e3)
|
|
204
|
+
);
|
|
205
|
+
waiter = controllablePromise.createControllablePromise();
|
|
206
|
+
await Promise.race([waiter, conditionVariable.sleepWithAbort(res.expires * 1e3 - Date.now(), client.stopSignal)]);
|
|
207
|
+
break;
|
|
208
|
+
case "auth.loginTokenMigrateTo": {
|
|
209
|
+
await client.changePrimaryDc(res.dcId);
|
|
210
|
+
let res2;
|
|
211
|
+
try {
|
|
212
|
+
res2 = await client.call(
|
|
213
|
+
{
|
|
214
|
+
_: "auth.importLoginToken",
|
|
215
|
+
token: res.token
|
|
216
|
+
},
|
|
217
|
+
{ abortSignal }
|
|
218
|
+
);
|
|
219
|
+
} catch (e) {
|
|
220
|
+
if (tl.tl.RpcError.is(e, "SESSION_PASSWORD_NEEDED") && params.password) {
|
|
221
|
+
return await handle2fa(params.password);
|
|
222
|
+
}
|
|
223
|
+
throw e;
|
|
224
|
+
}
|
|
225
|
+
controllablePromise.assertTypeIs("auth.importLoginToken", res2, "auth.loginTokenSuccess");
|
|
226
|
+
break loop;
|
|
227
|
+
}
|
|
228
|
+
case "auth.loginTokenSuccess":
|
|
229
|
+
break loop;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const [self] = await client.call(
|
|
233
|
+
{
|
|
234
|
+
_: "users.getUsers",
|
|
235
|
+
id: [{ _: "inputUserSelf" }]
|
|
236
|
+
},
|
|
237
|
+
{ abortSignal }
|
|
238
|
+
);
|
|
239
|
+
controllablePromise.assertTypeIs("users.getUsers", self, "user");
|
|
240
|
+
await client.notifyLoggedIn(self);
|
|
241
|
+
return new storyViewer.User$2(self);
|
|
242
|
+
} finally {
|
|
243
|
+
client.onServerUpdate(originalHandler);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
async function start(client, params) {
|
|
247
|
+
if (params.session) {
|
|
248
|
+
await client.importSession(params.session, params.sessionForce);
|
|
249
|
+
}
|
|
250
|
+
const { abortSignal } = params;
|
|
251
|
+
let has2fa = false;
|
|
252
|
+
let sentCode;
|
|
253
|
+
let phone = null;
|
|
254
|
+
try {
|
|
255
|
+
const me = await getMe(client);
|
|
256
|
+
client.log.info("Logged in as %s (ID: %s, username: %s, bot: %s)", me.displayName, me.id, me.username, me.isBot);
|
|
257
|
+
await client.notifyLoggedIn(me.raw);
|
|
258
|
+
return me;
|
|
259
|
+
} catch (e) {
|
|
260
|
+
if (tl.tl.RpcError.is(e)) {
|
|
261
|
+
if (e.text === "SESSION_PASSWORD_NEEDED") has2fa = true;
|
|
262
|
+
else if (e.text !== "AUTH_KEY_UNREGISTERED") throw e;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (!has2fa && !params.qrCodeHandler) {
|
|
266
|
+
if (!params.phone && !params.botToken) {
|
|
267
|
+
throw new platform.MtArgumentError("Neither phone nor bot token were provided");
|
|
268
|
+
}
|
|
269
|
+
phone = params.phone ? await conditionVariable.resolveMaybeDynamic(params.phone) : null;
|
|
270
|
+
if (phone) {
|
|
271
|
+
phone = conditionVariable.normalizePhoneNumber(phone);
|
|
272
|
+
if (!params.code) {
|
|
273
|
+
throw new platform.MtArgumentError("You must pass `code` to use `phone`");
|
|
274
|
+
}
|
|
275
|
+
} else {
|
|
276
|
+
const botToken = params.botToken ? await conditionVariable.resolveMaybeDynamic(params.botToken) : null;
|
|
277
|
+
if (!botToken) {
|
|
278
|
+
throw new platform.MtArgumentError("Either bot token or phone number must be provided");
|
|
279
|
+
}
|
|
280
|
+
return signInBot(client, botToken);
|
|
281
|
+
}
|
|
282
|
+
try {
|
|
283
|
+
sentCode = await sendCode(client, {
|
|
284
|
+
phone,
|
|
285
|
+
futureAuthTokens: params.futureAuthTokens,
|
|
286
|
+
codeSettings: params.codeSettings,
|
|
287
|
+
abortSignal
|
|
288
|
+
});
|
|
289
|
+
} catch (e) {
|
|
290
|
+
if (tl.tl.RpcError.is(e, "SESSION_PASSWORD_NEEDED")) {
|
|
291
|
+
has2fa = true;
|
|
292
|
+
} else {
|
|
293
|
+
throw e;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (sentCode) {
|
|
298
|
+
if (params.forceSms && (sentCode.type === "app" || sentCode.type === "email")) {
|
|
299
|
+
sentCode = await resendCode(client, {
|
|
300
|
+
phone,
|
|
301
|
+
phoneCodeHash: sentCode.phoneCodeHash,
|
|
302
|
+
abortSignal
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
if (params.codeSentCallback) {
|
|
306
|
+
await params.codeSentCallback(sentCode);
|
|
307
|
+
} else {
|
|
308
|
+
if (sentCode.type === "email_required") {
|
|
309
|
+
throw new platform.MtcuteError("Email login setup is required to sign in");
|
|
310
|
+
}
|
|
311
|
+
console.log(`The confirmation code has been sent via ${sentCode.type}.`);
|
|
312
|
+
}
|
|
313
|
+
for (; ; ) {
|
|
314
|
+
const code = await conditionVariable.resolveMaybeDynamic(params.code);
|
|
315
|
+
if (!code) throw new tl.tl.RpcError(400, "PHONE_CODE_EMPTY");
|
|
316
|
+
try {
|
|
317
|
+
return await signIn(client, {
|
|
318
|
+
phone,
|
|
319
|
+
phoneCodeHash: sentCode.phoneCodeHash,
|
|
320
|
+
phoneCode: code,
|
|
321
|
+
abortSignal
|
|
322
|
+
});
|
|
323
|
+
} catch (e) {
|
|
324
|
+
if (!tl.tl.RpcError.is(e)) throw e;
|
|
325
|
+
if (e.is("SESSION_PASSWORD_NEEDED")) {
|
|
326
|
+
has2fa = true;
|
|
327
|
+
break;
|
|
328
|
+
} else if (e.is("PHONE_CODE_EMPTY") || e.is("PHONE_CODE_EXPIRED") || e.is("PHONE_CODE_INVALID") || e.is("PHONE_CODE_HASH_EMPTY")) {
|
|
329
|
+
if (typeof params.code !== "function") {
|
|
330
|
+
throw new platform.MtArgumentError("Provided code was invalid");
|
|
331
|
+
}
|
|
332
|
+
if (params.invalidCodeCallback) {
|
|
333
|
+
await params.invalidCodeCallback("code");
|
|
334
|
+
} else {
|
|
335
|
+
console.log("Invalid code. Please try again");
|
|
336
|
+
}
|
|
337
|
+
continue;
|
|
338
|
+
} else {
|
|
339
|
+
throw e;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (has2fa) {
|
|
346
|
+
if (!params.password) {
|
|
347
|
+
throw new platform.MtArgumentError("2FA is enabled, but `password` was not provided.");
|
|
348
|
+
}
|
|
349
|
+
for (; ; ) {
|
|
350
|
+
const password = await conditionVariable.resolveMaybeDynamic(params.password);
|
|
351
|
+
try {
|
|
352
|
+
return await checkPassword(client, password);
|
|
353
|
+
} catch (e) {
|
|
354
|
+
if (typeof params.password !== "function") {
|
|
355
|
+
throw new platform.MtArgumentError("Provided password was invalid");
|
|
356
|
+
}
|
|
357
|
+
if (tl.tl.RpcError.is(e, "PASSWORD_HASH_INVALID")) {
|
|
358
|
+
if (params.invalidCodeCallback) {
|
|
359
|
+
await params.invalidCodeCallback("password");
|
|
360
|
+
} else {
|
|
361
|
+
console.log("Invalid password. Please try again");
|
|
362
|
+
}
|
|
363
|
+
continue;
|
|
364
|
+
} else {
|
|
365
|
+
throw e;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (params.qrCodeHandler) {
|
|
371
|
+
return signInQr(client, {
|
|
372
|
+
onUrlUpdated: params.qrCodeHandler,
|
|
373
|
+
password: params.password,
|
|
374
|
+
invalidPasswordCallback: params.invalidCodeCallback ? () => params.invalidCodeCallback("password") : void 0,
|
|
375
|
+
abortSignal
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
throw new platform.MtArgumentError("Failed to log in with provided credentials");
|
|
379
|
+
}
|
|
380
|
+
function run(client, params, then) {
|
|
381
|
+
start(client, params).then(then).catch((err) => client.emitError(err));
|
|
382
|
+
}
|
|
383
|
+
function sendRecoveryCode(client) {
|
|
384
|
+
return client.call({
|
|
385
|
+
_: "auth.requestPasswordRecovery"
|
|
386
|
+
}).then((res) => res.emailPattern);
|
|
387
|
+
}
|
|
388
|
+
async function startTest(client, params) {
|
|
389
|
+
if (!params) params = {};
|
|
390
|
+
if (params.logout) {
|
|
391
|
+
try {
|
|
392
|
+
await logOut(client);
|
|
393
|
+
} catch {
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
const availableDcs = await client.call({
|
|
397
|
+
_: "help.getConfig"
|
|
398
|
+
}).then((res) => res.dcOptions);
|
|
399
|
+
let phone = params.phone;
|
|
400
|
+
if (phone) {
|
|
401
|
+
if (!phone.match(/^99966\d{5}/)) {
|
|
402
|
+
throw new platform.MtArgumentError(`${phone} is an invalid test phone number`);
|
|
403
|
+
}
|
|
404
|
+
const id = Number.parseInt(phone[5]);
|
|
405
|
+
if (!availableDcs.find((dc) => dc.id === id)) {
|
|
406
|
+
throw new platform.MtArgumentError(`${phone} has invalid DC ID (${id})`);
|
|
407
|
+
}
|
|
408
|
+
} else {
|
|
409
|
+
let dcId = await client.getPrimaryDcId();
|
|
410
|
+
if (params.dcId) {
|
|
411
|
+
if (!availableDcs.find((dc) => dc.id === params.dcId)) {
|
|
412
|
+
throw new platform.MtArgumentError(`DC ID is invalid (${dcId})`);
|
|
413
|
+
}
|
|
414
|
+
dcId = params.dcId;
|
|
415
|
+
}
|
|
416
|
+
let numbers = Math.floor(Math.random() * 9999).toString();
|
|
417
|
+
while (numbers.length !== 4) numbers += "0";
|
|
418
|
+
phone = `99966${dcId}${numbers}`;
|
|
419
|
+
}
|
|
420
|
+
let code = "";
|
|
421
|
+
return start(client, {
|
|
422
|
+
phone,
|
|
423
|
+
code: () => code,
|
|
424
|
+
codeSentCallback: (sent) => {
|
|
425
|
+
for (let i = 0; i < sent.length; i++) {
|
|
426
|
+
code += phone[5];
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
async function answerCallbackQuery(client, queryId, params) {
|
|
432
|
+
const { cacheTime = 0, text, alert, url } = params ?? {};
|
|
433
|
+
const r = await client.call({
|
|
434
|
+
_: "messages.setBotCallbackAnswer",
|
|
435
|
+
queryId: Long.isLong(queryId) ? queryId : queryId.id,
|
|
436
|
+
cacheTime,
|
|
437
|
+
alert,
|
|
438
|
+
message: text,
|
|
439
|
+
url
|
|
440
|
+
});
|
|
441
|
+
controllablePromise.assertTrue("messages.setBotCallbackAnswer", r);
|
|
442
|
+
}
|
|
443
|
+
async function answerInlineQuery(client, queryId, results, params) {
|
|
444
|
+
const { cacheTime = 300, gallery, private: priv, nextOffset, switchPm, switchWebview } = params ?? {};
|
|
445
|
+
const [defaultGallery, tlResults] = await storyViewer._convertToTl(client, results);
|
|
446
|
+
await client.call({
|
|
447
|
+
_: "messages.setInlineBotResults",
|
|
448
|
+
queryId: Long.isLong(queryId) ? queryId : queryId.id,
|
|
449
|
+
results: tlResults,
|
|
450
|
+
cacheTime,
|
|
451
|
+
gallery: gallery ?? defaultGallery,
|
|
452
|
+
private: priv,
|
|
453
|
+
nextOffset,
|
|
454
|
+
switchPm: switchPm ? {
|
|
455
|
+
_: "inlineBotSwitchPM",
|
|
456
|
+
text: switchPm.text,
|
|
457
|
+
startParam: switchPm.parameter
|
|
458
|
+
} : void 0,
|
|
459
|
+
switchWebview: switchWebview ? {
|
|
460
|
+
_: "inlineBotWebView",
|
|
461
|
+
text: switchWebview.text,
|
|
462
|
+
url: switchWebview.url
|
|
463
|
+
} : void 0
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
async function answerPreCheckoutQuery(client, queryId, params) {
|
|
467
|
+
const { error } = params ?? {};
|
|
468
|
+
const r = await client.call({
|
|
469
|
+
_: "messages.setBotPrecheckoutResults",
|
|
470
|
+
queryId: Long.isLong(queryId) ? queryId : queryId.queryId,
|
|
471
|
+
success: !error,
|
|
472
|
+
error
|
|
473
|
+
});
|
|
474
|
+
controllablePromise.assertTrue("messages.setBotPrecheckoutResults", r);
|
|
475
|
+
}
|
|
476
|
+
async function _normalizeCommandScope(client, scope) {
|
|
477
|
+
if (tl.tl.isAnyBotCommandScope(scope)) return scope;
|
|
478
|
+
switch (scope.type) {
|
|
479
|
+
case "peer":
|
|
480
|
+
case "peer_admins": {
|
|
481
|
+
const peer = await storyViewer.resolvePeer(client, scope.peer);
|
|
482
|
+
return {
|
|
483
|
+
_: scope.type === "peer" ? "botCommandScopePeer" : "botCommandScopePeerAdmins",
|
|
484
|
+
peer
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
case "member": {
|
|
488
|
+
const user = await storyViewer.resolveUser(client, scope.user);
|
|
489
|
+
const chat2 = await storyViewer.resolvePeer(client, scope.chat);
|
|
490
|
+
return {
|
|
491
|
+
_: "botCommandScopePeerUser",
|
|
492
|
+
peer: chat2,
|
|
493
|
+
userId: user
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
default:
|
|
497
|
+
conditionVariable.assertNever();
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
async function deleteMyCommands(client, params) {
|
|
501
|
+
const scope = params?.scope ? await _normalizeCommandScope(client, params.scope) : {
|
|
502
|
+
_: "botCommandScopeDefault"
|
|
503
|
+
};
|
|
504
|
+
await client.call({
|
|
505
|
+
_: "bots.resetBotCommands",
|
|
506
|
+
scope,
|
|
507
|
+
langCode: params?.langCode ?? ""
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
async function getBotInfo(client, params) {
|
|
511
|
+
const { bot, langCode = "" } = params;
|
|
512
|
+
return client.call({
|
|
513
|
+
_: "bots.getBotInfo",
|
|
514
|
+
bot: bot ? await storyViewer.resolveUser(client, bot) : void 0,
|
|
515
|
+
langCode
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
async function getBotMenuButton(client, user) {
|
|
519
|
+
return client.call({
|
|
520
|
+
_: "bots.getBotMenuButton",
|
|
521
|
+
userId: await storyViewer.resolveUser(client, user)
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
async function getCallbackAnswer(client, params) {
|
|
525
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
526
|
+
const { data, game, timeout = 1e4, fireAndForget } = params;
|
|
527
|
+
let password;
|
|
528
|
+
if (params?.password) {
|
|
529
|
+
const pwd = await client.call({ _: "account.getPassword" });
|
|
530
|
+
password = await client.computeSrpParams(pwd, params.password);
|
|
531
|
+
}
|
|
532
|
+
const promise = client.call(
|
|
533
|
+
{
|
|
534
|
+
_: "messages.getBotCallbackAnswer",
|
|
535
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
536
|
+
msgId: message,
|
|
537
|
+
data: typeof data === "string" ? platform.getPlatform().utf8Encode(data) : data,
|
|
538
|
+
password,
|
|
539
|
+
game
|
|
540
|
+
},
|
|
541
|
+
{ timeout, throw503: true }
|
|
542
|
+
);
|
|
543
|
+
if (fireAndForget) {
|
|
544
|
+
promise.catch(() => {
|
|
545
|
+
});
|
|
546
|
+
return {
|
|
547
|
+
_: "messages.botCallbackAnswer",
|
|
548
|
+
cacheTime: 0
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
return promise;
|
|
552
|
+
}
|
|
553
|
+
async function getGameHighScores(client, params) {
|
|
554
|
+
const { userId } = params;
|
|
555
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
556
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
557
|
+
let user;
|
|
558
|
+
if (userId) {
|
|
559
|
+
user = await storyViewer.resolveUser(client, userId);
|
|
560
|
+
} else {
|
|
561
|
+
user = { _: "inputUserEmpty" };
|
|
562
|
+
}
|
|
563
|
+
const res = await client.call({
|
|
564
|
+
_: "messages.getGameHighScores",
|
|
565
|
+
peer: chat2,
|
|
566
|
+
id: message,
|
|
567
|
+
userId: user
|
|
568
|
+
});
|
|
569
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
570
|
+
return res.scores.map((score) => new storyViewer.GameHighScore$2(score, peers));
|
|
571
|
+
}
|
|
572
|
+
async function getInlineGameHighScores(client, messageId, userId) {
|
|
573
|
+
const id = conditionVariable.normalizeInlineId(messageId);
|
|
574
|
+
let user;
|
|
575
|
+
if (userId) {
|
|
576
|
+
user = await storyViewer.resolveUser(client, userId);
|
|
577
|
+
} else {
|
|
578
|
+
user = { _: "inputUserEmpty" };
|
|
579
|
+
}
|
|
580
|
+
const res = await client.call(
|
|
581
|
+
{
|
|
582
|
+
_: "messages.getInlineGameHighScores",
|
|
583
|
+
id,
|
|
584
|
+
userId: user
|
|
585
|
+
},
|
|
586
|
+
{ dcId: id.dcId }
|
|
587
|
+
);
|
|
588
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
589
|
+
return res.scores.map((score) => new storyViewer.GameHighScore$2(score, peers));
|
|
590
|
+
}
|
|
591
|
+
async function getMyCommands(client, params) {
|
|
592
|
+
return client.call({
|
|
593
|
+
_: "bots.getBotCommands",
|
|
594
|
+
scope: params?.scope ? await _normalizeCommandScope(client, params.scope) : {
|
|
595
|
+
_: "botCommandScopeDefault"
|
|
596
|
+
},
|
|
597
|
+
langCode: params?.langCode ?? ""
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
async function setBotInfo(client, params) {
|
|
601
|
+
const { bot, langCode = "", name, bio, description } = params;
|
|
602
|
+
const r = await client.call({
|
|
603
|
+
_: "bots.setBotInfo",
|
|
604
|
+
bot: bot ? await storyViewer.resolveUser(client, bot) : void 0,
|
|
605
|
+
langCode,
|
|
606
|
+
name,
|
|
607
|
+
about: bio,
|
|
608
|
+
description
|
|
609
|
+
});
|
|
610
|
+
controllablePromise.assertTrue("bots.setBotInfo", r);
|
|
611
|
+
}
|
|
612
|
+
async function setBotMenuButton(client, user, button) {
|
|
613
|
+
const r = await client.call({
|
|
614
|
+
_: "bots.setBotMenuButton",
|
|
615
|
+
userId: await storyViewer.resolveUser(client, user),
|
|
616
|
+
button
|
|
617
|
+
});
|
|
618
|
+
controllablePromise.assertTrue("bots.setBotMenuButton", r);
|
|
619
|
+
}
|
|
620
|
+
async function setGameScore(client, params) {
|
|
621
|
+
const { userId, score, noEdit, force, shouldDispatch } = params;
|
|
622
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
623
|
+
const user = await storyViewer.resolveUser(client, userId);
|
|
624
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
625
|
+
const res = await client.call({
|
|
626
|
+
_: "messages.setGameScore",
|
|
627
|
+
peer: chat2,
|
|
628
|
+
id: message,
|
|
629
|
+
userId: user,
|
|
630
|
+
score,
|
|
631
|
+
editMessage: !noEdit,
|
|
632
|
+
force
|
|
633
|
+
});
|
|
634
|
+
return storyViewer._findMessageInUpdate(client, res, true, !shouldDispatch);
|
|
635
|
+
}
|
|
636
|
+
async function setInlineGameScore(client, params) {
|
|
637
|
+
const { messageId, userId, score, noEdit, force } = params;
|
|
638
|
+
const user = await storyViewer.resolveUser(client, userId);
|
|
639
|
+
const id = conditionVariable.normalizeInlineId(messageId);
|
|
640
|
+
const r = await client.call(
|
|
641
|
+
{
|
|
642
|
+
_: "messages.setInlineGameScore",
|
|
643
|
+
id,
|
|
644
|
+
userId: user,
|
|
645
|
+
score,
|
|
646
|
+
editMessage: !noEdit,
|
|
647
|
+
force
|
|
648
|
+
},
|
|
649
|
+
{ dcId: id.dcId }
|
|
650
|
+
);
|
|
651
|
+
controllablePromise.assertTrue("messages.setInlineGameScore", r);
|
|
652
|
+
}
|
|
653
|
+
async function setMyCommands(client, params) {
|
|
654
|
+
const scope = params.scope ? await _normalizeCommandScope(client, params.scope) : {
|
|
655
|
+
_: "botCommandScopeDefault"
|
|
656
|
+
};
|
|
657
|
+
if (params.commands?.length) {
|
|
658
|
+
const r = await client.call({
|
|
659
|
+
_: "bots.setBotCommands",
|
|
660
|
+
commands: params.commands,
|
|
661
|
+
scope,
|
|
662
|
+
langCode: params.langCode ?? ""
|
|
663
|
+
});
|
|
664
|
+
controllablePromise.assertTrue("bots.setBotCommands", r);
|
|
665
|
+
} else {
|
|
666
|
+
const r = await client.call({
|
|
667
|
+
_: "bots.resetBotCommands",
|
|
668
|
+
scope,
|
|
669
|
+
langCode: params.langCode ?? ""
|
|
670
|
+
});
|
|
671
|
+
controllablePromise.assertTrue("bots.resetBotCommands", r);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
async function setMyDefaultRights(client, params) {
|
|
675
|
+
const { target, rights } = params;
|
|
676
|
+
const r = await client.call({
|
|
677
|
+
_: target === "group" ? "bots.setBotGroupDefaultAdminRights" : "bots.setBotBroadcastDefaultAdminRights",
|
|
678
|
+
adminRights: {
|
|
679
|
+
_: "chatAdminRights",
|
|
680
|
+
...rights
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
controllablePromise.assertTrue("bots.setBotGroupDefaultAdminRights", r);
|
|
684
|
+
}
|
|
685
|
+
async function addChatMembers(client, chatId, users, params) {
|
|
686
|
+
const { forwardCount = 100 } = params;
|
|
687
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
688
|
+
if (!Array.isArray(users)) users = [users];
|
|
689
|
+
if (conditionVariable.isInputPeerChat(chat2)) {
|
|
690
|
+
const missing = [];
|
|
691
|
+
for (const user of users) {
|
|
692
|
+
const p = await storyViewer.resolveUser(client, user);
|
|
693
|
+
const { updates, missingInvitees } = await client.call({
|
|
694
|
+
_: "messages.addChatUser",
|
|
695
|
+
chatId: chat2.chatId,
|
|
696
|
+
userId: p,
|
|
697
|
+
fwdLimit: forwardCount
|
|
698
|
+
});
|
|
699
|
+
client.handleClientUpdate(updates);
|
|
700
|
+
missing.push(...missingInvitees);
|
|
701
|
+
}
|
|
702
|
+
return missing;
|
|
703
|
+
} else if (conditionVariable.isInputPeerChannel(chat2)) {
|
|
704
|
+
const { updates, missingInvitees } = await client.call({
|
|
705
|
+
_: "channels.inviteToChannel",
|
|
706
|
+
channel: conditionVariable.toInputChannel(chat2),
|
|
707
|
+
users: await storyViewer.resolvePeerMany(client, users, conditionVariable.toInputUser)
|
|
708
|
+
});
|
|
709
|
+
client.handleClientUpdate(updates);
|
|
710
|
+
return missingInvitees;
|
|
711
|
+
}
|
|
712
|
+
throw new controllablePromise.MtInvalidPeerTypeError(chatId, "chat or channel");
|
|
713
|
+
}
|
|
714
|
+
async function archiveChats(client, chats) {
|
|
715
|
+
if (!Array.isArray(chats)) chats = [chats];
|
|
716
|
+
const resolvedPeers = await storyViewer.resolvePeerMany(client, chats);
|
|
717
|
+
const updates = await client.call({
|
|
718
|
+
_: "folders.editPeerFolders",
|
|
719
|
+
folderPeers: resolvedPeers.filter(controllablePromise.isPresent).map((peer) => ({
|
|
720
|
+
_: "inputFolderPeer",
|
|
721
|
+
peer,
|
|
722
|
+
folderId: 1
|
|
723
|
+
}))
|
|
724
|
+
});
|
|
725
|
+
client.handleClientUpdate(updates);
|
|
726
|
+
}
|
|
727
|
+
async function banChatMember(client, params) {
|
|
728
|
+
const { chatId, participantId, shouldDispatch } = params;
|
|
729
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
730
|
+
const peer = await storyViewer.resolvePeer(client, participantId);
|
|
731
|
+
let res;
|
|
732
|
+
if (conditionVariable.isInputPeerChannel(chat2)) {
|
|
733
|
+
res = await client.call({
|
|
734
|
+
_: "channels.editBanned",
|
|
735
|
+
channel: conditionVariable.toInputChannel(chat2),
|
|
736
|
+
participant: peer,
|
|
737
|
+
bannedRights: {
|
|
738
|
+
_: "chatBannedRights",
|
|
739
|
+
untilDate: conditionVariable.normalizeDate(params?.untilDate) ?? 0,
|
|
740
|
+
viewMessages: true
|
|
741
|
+
}
|
|
742
|
+
});
|
|
743
|
+
} else if (conditionVariable.isInputPeerChat(chat2)) {
|
|
744
|
+
res = await client.call({
|
|
745
|
+
_: "messages.deleteChatUser",
|
|
746
|
+
chatId: chat2.chatId,
|
|
747
|
+
userId: conditionVariable.toInputUser(peer)
|
|
748
|
+
});
|
|
749
|
+
} else {
|
|
750
|
+
throw new controllablePromise.MtInvalidPeerTypeError(chatId, "chat or channel");
|
|
751
|
+
}
|
|
752
|
+
return storyViewer._findMessageInUpdate(client, res, false, !shouldDispatch, true);
|
|
753
|
+
}
|
|
754
|
+
async function createChannel(client, params) {
|
|
755
|
+
const { title, description = "" } = params;
|
|
756
|
+
const res = await client.call({
|
|
757
|
+
_: "channels.createChannel",
|
|
758
|
+
title,
|
|
759
|
+
about: description,
|
|
760
|
+
broadcast: true
|
|
761
|
+
});
|
|
762
|
+
storyViewer.assertIsUpdatesGroup("channels.createChannel", res);
|
|
763
|
+
client.handleClientUpdate(res);
|
|
764
|
+
return new storyViewer.Chat$2(res.chats[0]);
|
|
765
|
+
}
|
|
766
|
+
async function createGroup(client, params) {
|
|
767
|
+
const { title } = params;
|
|
768
|
+
let { users } = params;
|
|
769
|
+
if (!Array.isArray(users)) users = [users];
|
|
770
|
+
const peers = await storyViewer.resolvePeerMany(client, users, conditionVariable.toInputUser);
|
|
771
|
+
const { updates, missingInvitees } = await client.call({
|
|
772
|
+
_: "messages.createChat",
|
|
773
|
+
title,
|
|
774
|
+
users: peers
|
|
775
|
+
});
|
|
776
|
+
storyViewer.assertIsUpdatesGroup("messages.createChat", updates);
|
|
777
|
+
client.handleClientUpdate(updates);
|
|
778
|
+
return {
|
|
779
|
+
chat: new storyViewer.Chat$2(updates.chats[0]),
|
|
780
|
+
missing: missingInvitees
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
async function createSupergroup(client, params) {
|
|
784
|
+
const { title, description = "", forum, ttlPeriod = 0 } = params;
|
|
785
|
+
const res = await client.call({
|
|
786
|
+
_: "channels.createChannel",
|
|
787
|
+
title,
|
|
788
|
+
about: description,
|
|
789
|
+
megagroup: true,
|
|
790
|
+
forum,
|
|
791
|
+
ttlPeriod
|
|
792
|
+
});
|
|
793
|
+
storyViewer.assertIsUpdatesGroup("channels.createChannel", res);
|
|
794
|
+
client.handleClientUpdate(res);
|
|
795
|
+
return new storyViewer.Chat$2(res.chats[0]);
|
|
796
|
+
}
|
|
797
|
+
async function deleteChannel(client, chatId) {
|
|
798
|
+
const res = await client.call({
|
|
799
|
+
_: "channels.deleteChannel",
|
|
800
|
+
channel: await storyViewer.resolveChannel(client, chatId)
|
|
801
|
+
});
|
|
802
|
+
client.handleClientUpdate(res);
|
|
803
|
+
}
|
|
804
|
+
async function deleteChatPhoto(client, chatId) {
|
|
805
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
806
|
+
let res;
|
|
807
|
+
if (conditionVariable.isInputPeerChat(chat2)) {
|
|
808
|
+
res = await client.call({
|
|
809
|
+
_: "messages.editChatPhoto",
|
|
810
|
+
chatId: chat2.chatId,
|
|
811
|
+
photo: { _: "inputChatPhotoEmpty" }
|
|
812
|
+
});
|
|
813
|
+
} else if (conditionVariable.isInputPeerChannel(chat2)) {
|
|
814
|
+
res = await client.call({
|
|
815
|
+
_: "channels.editPhoto",
|
|
816
|
+
channel: conditionVariable.toInputChannel(chat2),
|
|
817
|
+
photo: { _: "inputChatPhotoEmpty" }
|
|
818
|
+
});
|
|
819
|
+
} else {
|
|
820
|
+
throw new controllablePromise.MtInvalidPeerTypeError(chatId, "chat or channel");
|
|
821
|
+
}
|
|
822
|
+
client.handleClientUpdate(res);
|
|
823
|
+
}
|
|
824
|
+
async function deleteGroup(client, chatId) {
|
|
825
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
826
|
+
if (!conditionVariable.isInputPeerChat(chat2)) throw new controllablePromise.MtInvalidPeerTypeError(chatId, "chat");
|
|
827
|
+
const res = await client.call({
|
|
828
|
+
_: "messages.deleteChatUser",
|
|
829
|
+
revokeHistory: true,
|
|
830
|
+
chatId: chat2.chatId,
|
|
831
|
+
userId: { _: "inputUserSelf" }
|
|
832
|
+
});
|
|
833
|
+
client.handleClientUpdate(res);
|
|
834
|
+
const r = await client.call({
|
|
835
|
+
_: "messages.deleteChat",
|
|
836
|
+
chatId: chat2.chatId
|
|
837
|
+
});
|
|
838
|
+
controllablePromise.assertTrue("messages.deleteChat", r);
|
|
839
|
+
}
|
|
840
|
+
async function deleteHistory(client, chat2, params) {
|
|
841
|
+
const { mode = "delete", maxId = 0 } = params ?? {};
|
|
842
|
+
const peer = await storyViewer.resolvePeer(client, chat2);
|
|
843
|
+
const res = await client.call({
|
|
844
|
+
_: "messages.deleteHistory",
|
|
845
|
+
justClear: mode === "clear",
|
|
846
|
+
revoke: mode === "revoke",
|
|
847
|
+
peer,
|
|
848
|
+
maxId
|
|
849
|
+
});
|
|
850
|
+
if (conditionVariable.isInputPeerChannel(peer)) {
|
|
851
|
+
client.handleClientUpdate(storyViewer.createDummyUpdate(res.pts, res.ptsCount, peer.channelId));
|
|
852
|
+
} else {
|
|
853
|
+
client.handleClientUpdate(storyViewer.createDummyUpdate(res.pts, res.ptsCount));
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
async function deleteUserHistory(client, params) {
|
|
857
|
+
const { chatId, participantId, shouldDispatch } = params;
|
|
858
|
+
const channel = await storyViewer.resolveChannel(client, chatId);
|
|
859
|
+
const peer = await storyViewer.resolvePeer(client, participantId);
|
|
860
|
+
const res = await client.call({
|
|
861
|
+
_: "channels.deleteParticipantHistory",
|
|
862
|
+
channel,
|
|
863
|
+
participant: peer
|
|
864
|
+
});
|
|
865
|
+
if (!shouldDispatch) {
|
|
866
|
+
client.handleClientUpdate(storyViewer.createDummyUpdate(res.pts, res.ptsCount, channel.channelId));
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
async function editAdminRights(client, params) {
|
|
870
|
+
const { chatId, userId, rights, rank = "" } = params;
|
|
871
|
+
const chat2 = await storyViewer.resolveChannel(client, chatId);
|
|
872
|
+
const user = await storyViewer.resolveUser(client, userId);
|
|
873
|
+
const res = await client.call({
|
|
874
|
+
_: "channels.editAdmin",
|
|
875
|
+
channel: chat2,
|
|
876
|
+
userId: user,
|
|
877
|
+
adminRights: {
|
|
878
|
+
_: "chatAdminRights",
|
|
879
|
+
...rights
|
|
880
|
+
},
|
|
881
|
+
rank
|
|
882
|
+
});
|
|
883
|
+
client.handleClientUpdate(res);
|
|
884
|
+
}
|
|
885
|
+
function normalizeChatEventFilters(input) {
|
|
886
|
+
if (!input) {
|
|
887
|
+
return {};
|
|
888
|
+
}
|
|
889
|
+
if (typeof input === "string" || Array.isArray(input)) {
|
|
890
|
+
if (!Array.isArray(input)) input = [input];
|
|
891
|
+
const serverFilter = {
|
|
892
|
+
_: "channelAdminLogEventsFilter"
|
|
893
|
+
};
|
|
894
|
+
const localFilter = {};
|
|
895
|
+
input.forEach((type) => {
|
|
896
|
+
localFilter[type] = true;
|
|
897
|
+
switch (type) {
|
|
898
|
+
case "user_joined":
|
|
899
|
+
case "user_joined_invite":
|
|
900
|
+
case "user_joined_approved":
|
|
901
|
+
serverFilter.join = true;
|
|
902
|
+
break;
|
|
903
|
+
case "user_left":
|
|
904
|
+
serverFilter.leave = true;
|
|
905
|
+
break;
|
|
906
|
+
case "user_invited":
|
|
907
|
+
serverFilter.invite = true;
|
|
908
|
+
break;
|
|
909
|
+
case "title_changed":
|
|
910
|
+
case "description_changed":
|
|
911
|
+
case "linked_chat_changed":
|
|
912
|
+
case "location_changed":
|
|
913
|
+
case "photo_changed":
|
|
914
|
+
case "username_changed":
|
|
915
|
+
case "usernames_changed":
|
|
916
|
+
case "stickerset_changed":
|
|
917
|
+
case "slow_mode_changed":
|
|
918
|
+
case "ttl_changed":
|
|
919
|
+
serverFilter.info = true;
|
|
920
|
+
break;
|
|
921
|
+
case "invites_toggled":
|
|
922
|
+
case "history_toggled":
|
|
923
|
+
case "signatures_toggled":
|
|
924
|
+
case "def_perms_changed":
|
|
925
|
+
case "forum_toggled":
|
|
926
|
+
case "no_forwards_toggled":
|
|
927
|
+
case "signature_profiles_toggled":
|
|
928
|
+
serverFilter.settings = true;
|
|
929
|
+
break;
|
|
930
|
+
case "msg_pinned":
|
|
931
|
+
serverFilter.pinned = true;
|
|
932
|
+
break;
|
|
933
|
+
case "msg_edited":
|
|
934
|
+
case "poll_stopped":
|
|
935
|
+
serverFilter.edit = true;
|
|
936
|
+
break;
|
|
937
|
+
case "msg_deleted":
|
|
938
|
+
serverFilter.delete = true;
|
|
939
|
+
break;
|
|
940
|
+
case "user_perms_changed":
|
|
941
|
+
serverFilter.ban = true;
|
|
942
|
+
serverFilter.unban = true;
|
|
943
|
+
serverFilter.kick = true;
|
|
944
|
+
serverFilter.unkick = true;
|
|
945
|
+
break;
|
|
946
|
+
case "user_admin_perms_changed":
|
|
947
|
+
serverFilter.promote = true;
|
|
948
|
+
serverFilter.demote = true;
|
|
949
|
+
break;
|
|
950
|
+
case "call_started":
|
|
951
|
+
case "call_ended":
|
|
952
|
+
serverFilter.groupCall = true;
|
|
953
|
+
break;
|
|
954
|
+
case "call_setting_changed":
|
|
955
|
+
serverFilter.groupCall = true;
|
|
956
|
+
serverFilter.settings = true;
|
|
957
|
+
serverFilter.info = true;
|
|
958
|
+
break;
|
|
959
|
+
case "invite_deleted":
|
|
960
|
+
case "invite_edited":
|
|
961
|
+
case "invite_revoked":
|
|
962
|
+
serverFilter.invites = true;
|
|
963
|
+
break;
|
|
964
|
+
case "topic_created":
|
|
965
|
+
case "topic_edited":
|
|
966
|
+
case "topic_deleted":
|
|
967
|
+
serverFilter.forums = true;
|
|
968
|
+
break;
|
|
969
|
+
case "sub_extend":
|
|
970
|
+
serverFilter.invite = true;
|
|
971
|
+
serverFilter.invites = true;
|
|
972
|
+
serverFilter.join = true;
|
|
973
|
+
serverFilter.info = true;
|
|
974
|
+
serverFilter.settings = true;
|
|
975
|
+
break;
|
|
976
|
+
default:
|
|
977
|
+
conditionVariable.assertNever();
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
return {
|
|
981
|
+
serverFilter,
|
|
982
|
+
localFilter
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
if ("_" in input) {
|
|
986
|
+
return {
|
|
987
|
+
serverFilter: input
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
return input;
|
|
991
|
+
}
|
|
992
|
+
async function getChatEventLog(client, chatId, params) {
|
|
993
|
+
const { maxId = Long.ZERO, minId = Long.ZERO, query = "", limit = 100, users, filters } = params ?? {};
|
|
994
|
+
const channel = await storyViewer.resolveChannel(client, chatId);
|
|
995
|
+
const admins = users ? await storyViewer.resolvePeerMany(client, users, conditionVariable.toInputUser) : void 0;
|
|
996
|
+
const { serverFilter, localFilter } = normalizeChatEventFilters(filters);
|
|
997
|
+
const res = await client.call({
|
|
998
|
+
_: "channels.getAdminLog",
|
|
999
|
+
channel,
|
|
1000
|
+
q: query,
|
|
1001
|
+
eventsFilter: serverFilter,
|
|
1002
|
+
admins,
|
|
1003
|
+
maxId,
|
|
1004
|
+
minId,
|
|
1005
|
+
limit
|
|
1006
|
+
});
|
|
1007
|
+
if (!res.events.length) return [];
|
|
1008
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
1009
|
+
const results = [];
|
|
1010
|
+
for (const evt of res.events) {
|
|
1011
|
+
const parsed = new storyViewer.ChatEvent$2(evt, peers);
|
|
1012
|
+
if (localFilter && (!parsed.action || !localFilter[parsed.action.type])) {
|
|
1013
|
+
continue;
|
|
1014
|
+
}
|
|
1015
|
+
results.push(parsed);
|
|
1016
|
+
}
|
|
1017
|
+
return results;
|
|
1018
|
+
}
|
|
1019
|
+
async function getChatMember(client, params) {
|
|
1020
|
+
const { chatId, userId } = params;
|
|
1021
|
+
const user = await storyViewer.resolvePeer(client, userId);
|
|
1022
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
1023
|
+
if (conditionVariable.isInputPeerChat(chat2)) {
|
|
1024
|
+
if (!conditionVariable.isInputPeerUser(user)) {
|
|
1025
|
+
throw new controllablePromise.MtInvalidPeerTypeError(userId, "user");
|
|
1026
|
+
}
|
|
1027
|
+
const res = await client.call({
|
|
1028
|
+
_: "messages.getFullChat",
|
|
1029
|
+
chatId: chat2.chatId
|
|
1030
|
+
});
|
|
1031
|
+
controllablePromise.assertTypeIs("getChatMember (@ messages.getFullChat)", res.fullChat, "chatFull");
|
|
1032
|
+
const members = res.fullChat.participants._ === "chatParticipantsForbidden" ? [] : res.fullChat.participants.participants;
|
|
1033
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
1034
|
+
for (const m of members) {
|
|
1035
|
+
if (user._ === "inputPeerSelf" && peers.user(m.userId).self || user._ === "inputPeerUser" && m.userId === user.userId) {
|
|
1036
|
+
return new storyViewer.ChatMember$2(m, peers);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return null;
|
|
1040
|
+
} else if (conditionVariable.isInputPeerChannel(chat2)) {
|
|
1041
|
+
try {
|
|
1042
|
+
const res = await client.call({
|
|
1043
|
+
_: "channels.getParticipant",
|
|
1044
|
+
channel: conditionVariable.toInputChannel(chat2),
|
|
1045
|
+
participant: user
|
|
1046
|
+
});
|
|
1047
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
1048
|
+
return new storyViewer.ChatMember$2(res.participant, peers);
|
|
1049
|
+
} catch (e) {
|
|
1050
|
+
if (tl.tl.RpcError.is(e, "USER_NOT_PARTICIPANT")) {
|
|
1051
|
+
return null;
|
|
1052
|
+
}
|
|
1053
|
+
throw e;
|
|
1054
|
+
}
|
|
1055
|
+
} else {
|
|
1056
|
+
throw new controllablePromise.MtInvalidPeerTypeError(chatId, "chat or channel");
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
async function getChatMembers(client, chatId, params) {
|
|
1060
|
+
const { query = "", offset = 0, limit = 200, type = "recent" } = params ?? {};
|
|
1061
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
1062
|
+
if (conditionVariable.isInputPeerChat(chat2)) {
|
|
1063
|
+
const res = await client.call({
|
|
1064
|
+
_: "messages.getFullChat",
|
|
1065
|
+
chatId: chat2.chatId
|
|
1066
|
+
});
|
|
1067
|
+
controllablePromise.assertTypeIs("getChatMember (@ messages.getFullChat)", res.fullChat, "chatFull");
|
|
1068
|
+
let members = res.fullChat.participants._ === "chatParticipantsForbidden" ? [] : res.fullChat.participants.participants;
|
|
1069
|
+
if (offset) members = members.slice(offset);
|
|
1070
|
+
if (limit) members = members.slice(0, limit);
|
|
1071
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
1072
|
+
const ret = members.map((m) => new storyViewer.ChatMember$2(m, peers));
|
|
1073
|
+
return conditionVariable.makeArrayWithTotal(ret, ret.length);
|
|
1074
|
+
}
|
|
1075
|
+
if (conditionVariable.isInputPeerChannel(chat2)) {
|
|
1076
|
+
const q = query;
|
|
1077
|
+
let filter;
|
|
1078
|
+
switch (type) {
|
|
1079
|
+
case "all":
|
|
1080
|
+
filter = { _: "channelParticipantsSearch", q };
|
|
1081
|
+
break;
|
|
1082
|
+
case "banned":
|
|
1083
|
+
filter = { _: "channelParticipantsKicked", q };
|
|
1084
|
+
break;
|
|
1085
|
+
case "restricted":
|
|
1086
|
+
filter = { _: "channelParticipantsBanned", q };
|
|
1087
|
+
break;
|
|
1088
|
+
case "mention":
|
|
1089
|
+
filter = { _: "channelParticipantsMentions", q };
|
|
1090
|
+
break;
|
|
1091
|
+
case "bots":
|
|
1092
|
+
filter = { _: "channelParticipantsBots" };
|
|
1093
|
+
break;
|
|
1094
|
+
case "recent":
|
|
1095
|
+
filter = { _: "channelParticipantsRecent" };
|
|
1096
|
+
break;
|
|
1097
|
+
case "admins":
|
|
1098
|
+
filter = { _: "channelParticipantsAdmins" };
|
|
1099
|
+
break;
|
|
1100
|
+
case "contacts":
|
|
1101
|
+
filter = { _: "channelParticipantsContacts", q };
|
|
1102
|
+
break;
|
|
1103
|
+
default:
|
|
1104
|
+
conditionVariable.assertNever();
|
|
1105
|
+
}
|
|
1106
|
+
const res = await client.call({
|
|
1107
|
+
_: "channels.getParticipants",
|
|
1108
|
+
channel: conditionVariable.toInputChannel(chat2),
|
|
1109
|
+
filter,
|
|
1110
|
+
offset,
|
|
1111
|
+
limit,
|
|
1112
|
+
hash: Long.ZERO
|
|
1113
|
+
});
|
|
1114
|
+
controllablePromise.assertTypeIs("getChatMembers (@ channels.getParticipants)", res, "channels.channelParticipants");
|
|
1115
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
1116
|
+
const ret = res.participants.map((i) => new storyViewer.ChatMember$2(i, peers));
|
|
1117
|
+
return conditionVariable.makeArrayWithTotal(ret, res.count);
|
|
1118
|
+
}
|
|
1119
|
+
throw new controllablePromise.MtInvalidPeerTypeError(chatId, "chat or channel");
|
|
1120
|
+
}
|
|
1121
|
+
async function getChatPreview(client, inviteLink) {
|
|
1122
|
+
const m = inviteLink.match(conditionVariable.INVITE_LINK_REGEX);
|
|
1123
|
+
if (!m) throw new platform.MtArgumentError("Invalid invite link");
|
|
1124
|
+
const res = await client.call({
|
|
1125
|
+
_: "messages.checkChatInvite",
|
|
1126
|
+
hash: m[1]
|
|
1127
|
+
});
|
|
1128
|
+
if (res._ !== "chatInvite") {
|
|
1129
|
+
throw new controllablePromise.MtPeerNotFoundError("You have already joined this chat!");
|
|
1130
|
+
}
|
|
1131
|
+
return new storyViewer.ChatPreview$2(res, inviteLink);
|
|
1132
|
+
}
|
|
1133
|
+
async function getChat(client, chatId) {
|
|
1134
|
+
if (typeof chatId === "string") {
|
|
1135
|
+
const m = chatId.match(conditionVariable.INVITE_LINK_REGEX);
|
|
1136
|
+
if (m) {
|
|
1137
|
+
const res2 = await client.call({
|
|
1138
|
+
_: "messages.checkChatInvite",
|
|
1139
|
+
hash: m[1]
|
|
1140
|
+
});
|
|
1141
|
+
if (res2._ === "chatInvite") {
|
|
1142
|
+
throw new platform.MtArgumentError(`You haven't joined ${JSON.stringify(res2.title)}`);
|
|
1143
|
+
}
|
|
1144
|
+
return new storyViewer.Chat$2(res2.chat);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
1148
|
+
const res = await storyViewer._getRawPeerBatched(client, peer);
|
|
1149
|
+
if (!res) throw new controllablePromise.MtPeerNotFoundError(`Chat ${JSON.stringify(chatId)} was not found`);
|
|
1150
|
+
return new storyViewer.Chat$2(res);
|
|
1151
|
+
}
|
|
1152
|
+
async function getFullChat(client, chatId) {
|
|
1153
|
+
if (typeof chatId === "string") {
|
|
1154
|
+
const m = chatId.match(conditionVariable.INVITE_LINK_REGEX);
|
|
1155
|
+
if (m) {
|
|
1156
|
+
const res2 = await client.call({
|
|
1157
|
+
_: "messages.checkChatInvite",
|
|
1158
|
+
hash: m[1]
|
|
1159
|
+
});
|
|
1160
|
+
if (res2._ === "chatInvite") {
|
|
1161
|
+
throw new platform.MtArgumentError(`You haven't joined ${JSON.stringify(res2.title)}`);
|
|
1162
|
+
}
|
|
1163
|
+
chatId = res2.chat.id;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
1167
|
+
let res;
|
|
1168
|
+
if (conditionVariable.isInputPeerChannel(peer)) {
|
|
1169
|
+
res = await client.call({
|
|
1170
|
+
_: "channels.getFullChannel",
|
|
1171
|
+
channel: conditionVariable.toInputChannel(peer)
|
|
1172
|
+
});
|
|
1173
|
+
} else if (conditionVariable.isInputPeerUser(peer)) {
|
|
1174
|
+
res = await client.call({
|
|
1175
|
+
_: "users.getFullUser",
|
|
1176
|
+
id: conditionVariable.toInputUser(peer)
|
|
1177
|
+
});
|
|
1178
|
+
} else if (conditionVariable.isInputPeerChat(peer)) {
|
|
1179
|
+
res = await client.call({
|
|
1180
|
+
_: "messages.getFullChat",
|
|
1181
|
+
chatId: peer.chatId
|
|
1182
|
+
});
|
|
1183
|
+
} else {
|
|
1184
|
+
throw new Error("should not happen");
|
|
1185
|
+
}
|
|
1186
|
+
return storyViewer.FullChat$2._parse(res);
|
|
1187
|
+
}
|
|
1188
|
+
async function getNearbyChats(client, latitude, longitude) {
|
|
1189
|
+
const res = await client.call({
|
|
1190
|
+
_: "contacts.getLocated",
|
|
1191
|
+
geoPoint: {
|
|
1192
|
+
_: "inputGeoPoint",
|
|
1193
|
+
lat: latitude,
|
|
1194
|
+
long: longitude
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
storyViewer.assertIsUpdatesGroup("contacts.getLocated", res);
|
|
1198
|
+
client.handleClientUpdate(res, true);
|
|
1199
|
+
if (!res.updates.length) return [];
|
|
1200
|
+
controllablePromise.assertTypeIs("contacts.getLocated (@ .updates[0])", res.updates[0], "updatePeerLocated");
|
|
1201
|
+
const chats = res.chats.map((it) => new storyViewer.Chat$2(it));
|
|
1202
|
+
const index = {};
|
|
1203
|
+
chats.forEach((c) => index[c.id] = c);
|
|
1204
|
+
res.updates[0].peers.forEach((peer) => {
|
|
1205
|
+
if (peer._ === "peerSelfLocated") return;
|
|
1206
|
+
const id = conditionVariable.getMarkedPeerId(peer.peer);
|
|
1207
|
+
if (index[id]) {
|
|
1208
|
+
index[id].distance = peer.distance;
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
return chats;
|
|
1212
|
+
}
|
|
1213
|
+
async function getSimilarChannels(client, channel) {
|
|
1214
|
+
const res = await client.call({
|
|
1215
|
+
_: "channels.getChannelRecommendations",
|
|
1216
|
+
channel: await storyViewer.resolveChannel(client, channel)
|
|
1217
|
+
});
|
|
1218
|
+
const parsed = res.chats.map((chat2) => new storyViewer.Chat$2(chat2));
|
|
1219
|
+
switch (res._) {
|
|
1220
|
+
case "messages.chatsSlice":
|
|
1221
|
+
return conditionVariable.makeArrayWithTotal(parsed, res.count);
|
|
1222
|
+
case "messages.chats":
|
|
1223
|
+
return conditionVariable.makeArrayWithTotal(parsed, parsed.length);
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
async function* iterChatEventLog(client, chatId, params) {
|
|
1227
|
+
if (!params) params = {};
|
|
1228
|
+
const channel = await storyViewer.resolveChannel(client, chatId);
|
|
1229
|
+
const { minId = Long.ZERO, query = "", limit = Infinity, chunkSize = 100, users, filters } = params;
|
|
1230
|
+
const admins = users ? await storyViewer.resolvePeerMany(client, users, conditionVariable.toInputUser) : void 0;
|
|
1231
|
+
const { serverFilter, localFilter } = normalizeChatEventFilters(filters);
|
|
1232
|
+
let current = 0;
|
|
1233
|
+
let maxId = params.maxId ?? Long.ZERO;
|
|
1234
|
+
for (; ; ) {
|
|
1235
|
+
const chunk = await getChatEventLog(client, channel, {
|
|
1236
|
+
minId,
|
|
1237
|
+
maxId,
|
|
1238
|
+
query,
|
|
1239
|
+
limit: localFilter ? chunkSize : Math.min(limit - current, chunkSize),
|
|
1240
|
+
// provide already resolved users to avoid resolving them again
|
|
1241
|
+
users: admins,
|
|
1242
|
+
// local filters may mess with pagination
|
|
1243
|
+
filters: { serverFilter }
|
|
1244
|
+
});
|
|
1245
|
+
if (!chunk.length) break;
|
|
1246
|
+
const last = chunk[chunk.length - 1];
|
|
1247
|
+
maxId = last.id;
|
|
1248
|
+
for (const item of chunk) {
|
|
1249
|
+
if (localFilter && (!item.action || !localFilter[item.action.type])) {
|
|
1250
|
+
continue;
|
|
1251
|
+
}
|
|
1252
|
+
current += 1;
|
|
1253
|
+
yield item;
|
|
1254
|
+
if (current >= limit) break;
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
async function* iterChatMembers(client, chatId, params) {
|
|
1259
|
+
if (!params) params = {};
|
|
1260
|
+
let current = 0;
|
|
1261
|
+
let total = params.limit || Infinity;
|
|
1262
|
+
const limit = Math.min(params.chunkSize ?? 200, total);
|
|
1263
|
+
let offset = params.offset ?? 0;
|
|
1264
|
+
const yielded = /* @__PURE__ */ new Set();
|
|
1265
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
1266
|
+
for (; ; ) {
|
|
1267
|
+
const members = await getChatMembers(client, chat2, {
|
|
1268
|
+
offset,
|
|
1269
|
+
limit,
|
|
1270
|
+
query: params.query,
|
|
1271
|
+
type: params.type
|
|
1272
|
+
});
|
|
1273
|
+
if (!members.length) break;
|
|
1274
|
+
if (conditionVariable.isInputPeerChat(chat2)) {
|
|
1275
|
+
total = members.length;
|
|
1276
|
+
}
|
|
1277
|
+
offset += members.length;
|
|
1278
|
+
for (const m of members) {
|
|
1279
|
+
const uid = m.user.id;
|
|
1280
|
+
if (yielded.has(uid)) continue;
|
|
1281
|
+
yielded.add(uid);
|
|
1282
|
+
yield m;
|
|
1283
|
+
current += 1;
|
|
1284
|
+
if (current >= total) return;
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
async function joinChat(client, chatId) {
|
|
1289
|
+
if (typeof chatId === "string") {
|
|
1290
|
+
const m = chatId.match(conditionVariable.INVITE_LINK_REGEX);
|
|
1291
|
+
if (m) {
|
|
1292
|
+
const res2 = await client.call({
|
|
1293
|
+
_: "messages.importChatInvite",
|
|
1294
|
+
hash: m[1]
|
|
1295
|
+
});
|
|
1296
|
+
storyViewer.assertIsUpdatesGroup("messages.importChatInvite", res2);
|
|
1297
|
+
client.handleClientUpdate(res2);
|
|
1298
|
+
return new storyViewer.Chat$2(res2.chats[0]);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
const res = await client.call({
|
|
1302
|
+
_: "channels.joinChannel",
|
|
1303
|
+
channel: await storyViewer.resolveChannel(client, chatId)
|
|
1304
|
+
});
|
|
1305
|
+
storyViewer.assertIsUpdatesGroup("channels.joinChannel", res);
|
|
1306
|
+
client.handleClientUpdate(res);
|
|
1307
|
+
return new storyViewer.Chat$2(res.chats[0]);
|
|
1308
|
+
}
|
|
1309
|
+
async function unbanChatMember(client, params) {
|
|
1310
|
+
const { chatId, participantId } = params;
|
|
1311
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
1312
|
+
const peer = await storyViewer.resolvePeer(client, participantId);
|
|
1313
|
+
if (conditionVariable.isInputPeerChannel(chat2)) {
|
|
1314
|
+
const res = await client.call({
|
|
1315
|
+
_: "channels.editBanned",
|
|
1316
|
+
channel: conditionVariable.toInputChannel(chat2),
|
|
1317
|
+
participant: peer,
|
|
1318
|
+
bannedRights: {
|
|
1319
|
+
_: "chatBannedRights",
|
|
1320
|
+
untilDate: 0
|
|
1321
|
+
}
|
|
1322
|
+
});
|
|
1323
|
+
client.handleClientUpdate(res);
|
|
1324
|
+
} else if (conditionVariable.isInputPeerChat(chat2)) ;
|
|
1325
|
+
else {
|
|
1326
|
+
throw new controllablePromise.MtInvalidPeerTypeError(chatId, "chat or channel");
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
async function kickChatMember(client, params) {
|
|
1330
|
+
const { chatId, userId } = params;
|
|
1331
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
1332
|
+
const user = await storyViewer.resolvePeer(client, userId);
|
|
1333
|
+
const msg = await banChatMember(client, { chatId: chat2, participantId: user });
|
|
1334
|
+
if (conditionVariable.isInputPeerChannel(chat2)) {
|
|
1335
|
+
await conditionVariable.sleepWithAbort(1e3, client.stopSignal);
|
|
1336
|
+
await unbanChatMember(client, { chatId: chat2, participantId: user });
|
|
1337
|
+
}
|
|
1338
|
+
return msg;
|
|
1339
|
+
}
|
|
1340
|
+
async function leaveChat(client, chatId, params) {
|
|
1341
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
1342
|
+
if (conditionVariable.isInputPeerChannel(chat2)) {
|
|
1343
|
+
const res = await client.call({
|
|
1344
|
+
_: "channels.leaveChannel",
|
|
1345
|
+
channel: conditionVariable.toInputChannel(chat2)
|
|
1346
|
+
});
|
|
1347
|
+
client.handleClientUpdate(res);
|
|
1348
|
+
} else if (conditionVariable.isInputPeerChat(chat2)) {
|
|
1349
|
+
const res = await client.call({
|
|
1350
|
+
_: "messages.deleteChatUser",
|
|
1351
|
+
chatId: chat2.chatId,
|
|
1352
|
+
userId: { _: "inputUserSelf" }
|
|
1353
|
+
});
|
|
1354
|
+
client.handleClientUpdate(res);
|
|
1355
|
+
if (params?.clear) {
|
|
1356
|
+
await deleteHistory(client, chat2);
|
|
1357
|
+
}
|
|
1358
|
+
} else {
|
|
1359
|
+
throw new controllablePromise.MtInvalidPeerTypeError(chatId, "chat or channel");
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
async function markChatUnread(client, chatId) {
|
|
1363
|
+
const r = await client.call({
|
|
1364
|
+
_: "messages.markDialogUnread",
|
|
1365
|
+
peer: {
|
|
1366
|
+
_: "inputDialogPeer",
|
|
1367
|
+
peer: await storyViewer.resolvePeer(client, chatId)
|
|
1368
|
+
},
|
|
1369
|
+
unread: true
|
|
1370
|
+
});
|
|
1371
|
+
controllablePromise.assertTrue("messages.markDialogUnread", r);
|
|
1372
|
+
}
|
|
1373
|
+
async function openChat(client, chat2) {
|
|
1374
|
+
const peer = await storyViewer.resolvePeer(client, chat2);
|
|
1375
|
+
if (conditionVariable.isInputPeerChannel(peer)) {
|
|
1376
|
+
let pts;
|
|
1377
|
+
if (!client.storage.self.getCached()?.isBot) {
|
|
1378
|
+
const [dialog] = await storyViewer.getPeerDialogs(client, peer);
|
|
1379
|
+
pts = dialog.raw.pts;
|
|
1380
|
+
} else {
|
|
1381
|
+
pts = await client.storage.updates.getChannelPts(peer.channelId) ?? void 0;
|
|
1382
|
+
}
|
|
1383
|
+
await client.notifyChannelOpened(peer.channelId, pts);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
async function closeChat(client, chat2) {
|
|
1387
|
+
const peer = await storyViewer.resolvePeer(client, chat2);
|
|
1388
|
+
if (conditionVariable.isInputPeerChannel(peer)) {
|
|
1389
|
+
await client.notifyChannelClosed(peer.channelId);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
async function reorderUsernames(client, peerId, order) {
|
|
1393
|
+
const peer = await storyViewer.resolvePeer(client, peerId);
|
|
1394
|
+
if (conditionVariable.isInputPeerUser(peer)) {
|
|
1395
|
+
if (isSelfPeer(client, peer)) {
|
|
1396
|
+
const r2 = await client.call({
|
|
1397
|
+
_: "account.reorderUsernames",
|
|
1398
|
+
order
|
|
1399
|
+
});
|
|
1400
|
+
controllablePromise.assertTrue("account.reorderUsernames", r2);
|
|
1401
|
+
return;
|
|
1402
|
+
}
|
|
1403
|
+
const r = await client.call({
|
|
1404
|
+
_: "bots.reorderUsernames",
|
|
1405
|
+
bot: conditionVariable.toInputUser(peer, peerId),
|
|
1406
|
+
order
|
|
1407
|
+
});
|
|
1408
|
+
controllablePromise.assertTrue("bots.reorderUsernames", r);
|
|
1409
|
+
} else if (conditionVariable.isInputPeerChannel(peer)) {
|
|
1410
|
+
const r = await client.call({
|
|
1411
|
+
_: "channels.reorderUsernames",
|
|
1412
|
+
channel: conditionVariable.toInputChannel(peer, peerId),
|
|
1413
|
+
order
|
|
1414
|
+
});
|
|
1415
|
+
controllablePromise.assertTrue("channels.reorderUsernames", r);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
async function restrictChatMember(client, params) {
|
|
1419
|
+
const { chatId, userId, restrictions, until = 0 } = params;
|
|
1420
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
1421
|
+
if (!conditionVariable.isInputPeerChannel(chat2)) {
|
|
1422
|
+
throw new controllablePromise.MtInvalidPeerTypeError(chatId, "channel");
|
|
1423
|
+
}
|
|
1424
|
+
const user = await storyViewer.resolvePeer(client, userId);
|
|
1425
|
+
const res = await client.call({
|
|
1426
|
+
_: "channels.editBanned",
|
|
1427
|
+
channel: conditionVariable.toInputChannel(chat2),
|
|
1428
|
+
participant: user,
|
|
1429
|
+
bannedRights: {
|
|
1430
|
+
_: "chatBannedRights",
|
|
1431
|
+
untilDate: conditionVariable.normalizeDate(until) ?? 0,
|
|
1432
|
+
...restrictions
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
client.handleClientUpdate(res);
|
|
1436
|
+
}
|
|
1437
|
+
async function saveDraft(client, chatId, draft) {
|
|
1438
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
1439
|
+
if (draft) {
|
|
1440
|
+
await client.call({
|
|
1441
|
+
_: "messages.saveDraft",
|
|
1442
|
+
peer,
|
|
1443
|
+
...draft
|
|
1444
|
+
});
|
|
1445
|
+
} else {
|
|
1446
|
+
await client.call({
|
|
1447
|
+
_: "messages.saveDraft",
|
|
1448
|
+
peer,
|
|
1449
|
+
message: ""
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
async function setChatColor(client, params) {
|
|
1454
|
+
const { color, backgroundEmojiId, forProfile } = params;
|
|
1455
|
+
const peer = await storyViewer.resolvePeer(client, params.peer ?? "me");
|
|
1456
|
+
if (conditionVariable.isInputPeerChannel(peer)) {
|
|
1457
|
+
const res = await client.call({
|
|
1458
|
+
_: "channels.updateColor",
|
|
1459
|
+
channel: conditionVariable.toInputChannel(peer),
|
|
1460
|
+
color,
|
|
1461
|
+
backgroundEmojiId
|
|
1462
|
+
});
|
|
1463
|
+
client.handleClientUpdate(res);
|
|
1464
|
+
return;
|
|
1465
|
+
}
|
|
1466
|
+
if (conditionVariable.isInputPeerUser(peer)) {
|
|
1467
|
+
if (!isSelfPeer(client, peer)) {
|
|
1468
|
+
throw new platform.MtTypeAssertionError("setChatColor", "self", peer._);
|
|
1469
|
+
}
|
|
1470
|
+
const r = await client.call({
|
|
1471
|
+
_: "account.updateColor",
|
|
1472
|
+
color,
|
|
1473
|
+
backgroundEmojiId,
|
|
1474
|
+
forProfile
|
|
1475
|
+
});
|
|
1476
|
+
controllablePromise.assertTrue("account.updateColor", r);
|
|
1477
|
+
}
|
|
1478
|
+
throw new controllablePromise.MtInvalidPeerTypeError(peer, "channel | user");
|
|
1479
|
+
}
|
|
1480
|
+
async function setChatDefaultPermissions(client, chatId, restrictions) {
|
|
1481
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
1482
|
+
const res = await client.call({
|
|
1483
|
+
_: "messages.editChatDefaultBannedRights",
|
|
1484
|
+
peer,
|
|
1485
|
+
bannedRights: {
|
|
1486
|
+
_: "chatBannedRights",
|
|
1487
|
+
untilDate: 0,
|
|
1488
|
+
...restrictions
|
|
1489
|
+
}
|
|
1490
|
+
});
|
|
1491
|
+
storyViewer.assertIsUpdatesGroup("messages.editChatDefaultBannedRights", res);
|
|
1492
|
+
client.handleClientUpdate(res);
|
|
1493
|
+
return new storyViewer.Chat$2(res.chats[0]);
|
|
1494
|
+
}
|
|
1495
|
+
async function setChatDescription(client, chatId, description) {
|
|
1496
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
1497
|
+
const r = await client.call({
|
|
1498
|
+
_: "messages.editChatAbout",
|
|
1499
|
+
peer: chat2,
|
|
1500
|
+
about: description
|
|
1501
|
+
});
|
|
1502
|
+
controllablePromise.assertTrue("messages.editChatAbout", r);
|
|
1503
|
+
}
|
|
1504
|
+
async function setChatPhoto(client, params) {
|
|
1505
|
+
const { chatId, type, media, previewSec } = params;
|
|
1506
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
1507
|
+
if (!(conditionVariable.isInputPeerChannel(chat2) || conditionVariable.isInputPeerChat(chat2))) {
|
|
1508
|
+
throw new controllablePromise.MtInvalidPeerTypeError(chatId, "chat or channel");
|
|
1509
|
+
}
|
|
1510
|
+
let photo;
|
|
1511
|
+
let inputFile;
|
|
1512
|
+
if (fileId.tdFileId.isFileIdLike(media)) {
|
|
1513
|
+
if (typeof media === "string" && media.match(/^https?:\/\//)) {
|
|
1514
|
+
throw new platform.MtArgumentError("Chat photo can't be external");
|
|
1515
|
+
}
|
|
1516
|
+
if (typeof media === "string" && media.match(/^file:/)) {
|
|
1517
|
+
const uploaded = await storyViewer.uploadFile(client, {
|
|
1518
|
+
file: media.substring(5)
|
|
1519
|
+
});
|
|
1520
|
+
inputFile = uploaded.inputFile;
|
|
1521
|
+
} else {
|
|
1522
|
+
const input = storyViewer.fileIdToInputPhoto(media);
|
|
1523
|
+
photo = {
|
|
1524
|
+
_: "inputChatPhoto",
|
|
1525
|
+
id: input
|
|
1526
|
+
};
|
|
1527
|
+
}
|
|
1528
|
+
} else if (typeof media === "object" && tl.tl.isAnyInputMedia(media)) {
|
|
1529
|
+
if (media._ === "inputMediaPhoto") {
|
|
1530
|
+
photo = {
|
|
1531
|
+
_: "inputChatPhoto",
|
|
1532
|
+
id: media.id
|
|
1533
|
+
};
|
|
1534
|
+
} else {
|
|
1535
|
+
throw new platform.MtArgumentError("Chat photo can't be InputMedia");
|
|
1536
|
+
}
|
|
1537
|
+
} else if (storyViewer.isUploadedFile(media)) {
|
|
1538
|
+
inputFile = media.inputFile;
|
|
1539
|
+
} else if (typeof media === "object" && tl.tl.isAnyInputFile(media)) {
|
|
1540
|
+
inputFile = media;
|
|
1541
|
+
} else {
|
|
1542
|
+
const uploaded = await storyViewer.uploadFile(client, {
|
|
1543
|
+
file: media
|
|
1544
|
+
});
|
|
1545
|
+
inputFile = uploaded.inputFile;
|
|
1546
|
+
}
|
|
1547
|
+
if (!photo) {
|
|
1548
|
+
photo = {
|
|
1549
|
+
_: "inputChatUploadedPhoto",
|
|
1550
|
+
[type === "photo" ? "file" : "video"]: inputFile,
|
|
1551
|
+
videoStartTs: previewSec
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
let res;
|
|
1555
|
+
if (conditionVariable.isInputPeerChat(chat2)) {
|
|
1556
|
+
res = await client.call({
|
|
1557
|
+
_: "messages.editChatPhoto",
|
|
1558
|
+
chatId: chat2.chatId,
|
|
1559
|
+
photo
|
|
1560
|
+
});
|
|
1561
|
+
} else {
|
|
1562
|
+
res = await client.call({
|
|
1563
|
+
_: "channels.editPhoto",
|
|
1564
|
+
channel: conditionVariable.toInputChannel(chat2),
|
|
1565
|
+
photo
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
client.handleClientUpdate(res);
|
|
1569
|
+
}
|
|
1570
|
+
async function setChatTitle(client, chatId, title) {
|
|
1571
|
+
const chat2 = await storyViewer.resolvePeer(client, chatId);
|
|
1572
|
+
let res;
|
|
1573
|
+
if (conditionVariable.isInputPeerChat(chat2)) {
|
|
1574
|
+
res = await client.call({
|
|
1575
|
+
_: "messages.editChatTitle",
|
|
1576
|
+
chatId: chat2.chatId,
|
|
1577
|
+
title
|
|
1578
|
+
});
|
|
1579
|
+
} else if (conditionVariable.isInputPeerChannel(chat2)) {
|
|
1580
|
+
res = await client.call({
|
|
1581
|
+
_: "channels.editTitle",
|
|
1582
|
+
channel: conditionVariable.toInputChannel(chat2),
|
|
1583
|
+
title
|
|
1584
|
+
});
|
|
1585
|
+
} else {
|
|
1586
|
+
throw new controllablePromise.MtInvalidPeerTypeError(chatId, "chat or channel");
|
|
1587
|
+
}
|
|
1588
|
+
client.handleClientUpdate(res);
|
|
1589
|
+
}
|
|
1590
|
+
async function setChatTtl(client, chatId, period) {
|
|
1591
|
+
await client.call({
|
|
1592
|
+
_: "messages.setHistoryTTL",
|
|
1593
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
1594
|
+
period
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
async function setChatUsername(client, chatId, username) {
|
|
1598
|
+
const r = await client.call({
|
|
1599
|
+
_: "channels.updateUsername",
|
|
1600
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
1601
|
+
username: username || ""
|
|
1602
|
+
});
|
|
1603
|
+
controllablePromise.assertTrue("channels.updateUsername", r);
|
|
1604
|
+
}
|
|
1605
|
+
async function setSlowMode(client, chatId, seconds = 0) {
|
|
1606
|
+
const res = await client.call({
|
|
1607
|
+
_: "channels.toggleSlowMode",
|
|
1608
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
1609
|
+
seconds
|
|
1610
|
+
});
|
|
1611
|
+
client.handleClientUpdate(res);
|
|
1612
|
+
}
|
|
1613
|
+
async function toggleContentProtection(client, chatId, enabled = false) {
|
|
1614
|
+
const res = await client.call({
|
|
1615
|
+
_: "messages.toggleNoForwards",
|
|
1616
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
1617
|
+
enabled
|
|
1618
|
+
});
|
|
1619
|
+
client.handleClientUpdate(res);
|
|
1620
|
+
}
|
|
1621
|
+
async function toggleFragmentUsername(client, params) {
|
|
1622
|
+
const { peerId, username, active } = params;
|
|
1623
|
+
const peer = await storyViewer.resolvePeer(client, peerId);
|
|
1624
|
+
if (conditionVariable.isInputPeerUser(peer)) {
|
|
1625
|
+
if (isSelfPeer(client, peer)) {
|
|
1626
|
+
const r2 = await client.call({
|
|
1627
|
+
_: "account.toggleUsername",
|
|
1628
|
+
username,
|
|
1629
|
+
active
|
|
1630
|
+
});
|
|
1631
|
+
controllablePromise.assertTrue("account.toggleUsername", r2);
|
|
1632
|
+
return;
|
|
1633
|
+
}
|
|
1634
|
+
const r = await client.call({
|
|
1635
|
+
_: "bots.toggleUsername",
|
|
1636
|
+
bot: conditionVariable.toInputUser(peer, peerId),
|
|
1637
|
+
username,
|
|
1638
|
+
active
|
|
1639
|
+
});
|
|
1640
|
+
controllablePromise.assertTrue("bots.toggleUsername", r);
|
|
1641
|
+
} else if (conditionVariable.isInputPeerChannel(peer)) {
|
|
1642
|
+
const r = await client.call({
|
|
1643
|
+
_: "channels.toggleUsername",
|
|
1644
|
+
channel: conditionVariable.toInputChannel(peer, peerId),
|
|
1645
|
+
username,
|
|
1646
|
+
active
|
|
1647
|
+
});
|
|
1648
|
+
controllablePromise.assertTrue("channels.toggleUsername", r);
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
async function toggleJoinRequests(client, chatId, enabled = false) {
|
|
1652
|
+
const res = await client.call({
|
|
1653
|
+
_: "channels.toggleJoinRequest",
|
|
1654
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
1655
|
+
enabled
|
|
1656
|
+
});
|
|
1657
|
+
client.handleClientUpdate(res);
|
|
1658
|
+
}
|
|
1659
|
+
async function toggleJoinToSend(client, chatId, enabled = false) {
|
|
1660
|
+
const res = await client.call({
|
|
1661
|
+
_: "channels.toggleJoinToSend",
|
|
1662
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
1663
|
+
enabled
|
|
1664
|
+
});
|
|
1665
|
+
client.handleClientUpdate(res);
|
|
1666
|
+
}
|
|
1667
|
+
async function unarchiveChats(client, chats) {
|
|
1668
|
+
if (!Array.isArray(chats)) chats = [chats];
|
|
1669
|
+
const folderPeers = [];
|
|
1670
|
+
for (const chat2 of chats) {
|
|
1671
|
+
folderPeers.push({
|
|
1672
|
+
_: "inputFolderPeer",
|
|
1673
|
+
peer: await storyViewer.resolvePeer(client, chat2),
|
|
1674
|
+
folderId: 0
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
const res = await client.call({
|
|
1678
|
+
_: "folders.editPeerFolders",
|
|
1679
|
+
folderPeers
|
|
1680
|
+
});
|
|
1681
|
+
client.handleClientUpdate(res);
|
|
1682
|
+
}
|
|
1683
|
+
async function addContact(client, params) {
|
|
1684
|
+
const { userId, firstName, lastName = "", phone = "", sharePhone = false } = params;
|
|
1685
|
+
const peer = await storyViewer.resolveUser(client, userId);
|
|
1686
|
+
const res = await client.call({
|
|
1687
|
+
_: "contacts.addContact",
|
|
1688
|
+
id: peer,
|
|
1689
|
+
firstName,
|
|
1690
|
+
lastName,
|
|
1691
|
+
phone,
|
|
1692
|
+
addPhonePrivacyException: sharePhone
|
|
1693
|
+
});
|
|
1694
|
+
storyViewer.assertIsUpdatesGroup("contacts.addContact", res);
|
|
1695
|
+
client.handleClientUpdate(res);
|
|
1696
|
+
return new storyViewer.User$2(res.users[0]);
|
|
1697
|
+
}
|
|
1698
|
+
async function deleteContacts(client, userIds) {
|
|
1699
|
+
if (!Array.isArray(userIds)) userIds = [userIds];
|
|
1700
|
+
const inputPeers = await storyViewer.resolvePeerMany(client, userIds, conditionVariable.toInputUser);
|
|
1701
|
+
if (!inputPeers.length) {
|
|
1702
|
+
throw new controllablePromise.MtInvalidPeerTypeError("all provided ids", "user");
|
|
1703
|
+
}
|
|
1704
|
+
const res = await client.call({
|
|
1705
|
+
_: "contacts.deleteContacts",
|
|
1706
|
+
id: inputPeers
|
|
1707
|
+
});
|
|
1708
|
+
storyViewer.assertIsUpdatesGroup("contacts.deleteContacts", res);
|
|
1709
|
+
client.handleClientUpdate(res);
|
|
1710
|
+
return res.users.map((user) => new storyViewer.User$2(user));
|
|
1711
|
+
}
|
|
1712
|
+
async function getContacts(client) {
|
|
1713
|
+
const res = await client.call({
|
|
1714
|
+
_: "contacts.getContacts",
|
|
1715
|
+
hash: Long.ZERO
|
|
1716
|
+
});
|
|
1717
|
+
controllablePromise.assertTypeIs("getContacts", res, "contacts.contacts");
|
|
1718
|
+
return res.users.map((user) => new storyViewer.User$2(user));
|
|
1719
|
+
}
|
|
1720
|
+
async function importContacts(client, contacts) {
|
|
1721
|
+
let seq = Long.ZERO;
|
|
1722
|
+
const contactsNorm = contacts.map((input) => ({
|
|
1723
|
+
_: "inputPhoneContact",
|
|
1724
|
+
clientId: seq = seq.add(1),
|
|
1725
|
+
...input
|
|
1726
|
+
}));
|
|
1727
|
+
return client.call({
|
|
1728
|
+
_: "contacts.importContacts",
|
|
1729
|
+
contacts: contactsNorm
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
async function getFolders(client) {
|
|
1733
|
+
return client.call({
|
|
1734
|
+
_: "messages.getDialogFilters"
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
async function _normalizeInputFolder(client, folder) {
|
|
1738
|
+
if (typeof folder === "string" || typeof folder === "number") {
|
|
1739
|
+
const folders = await getFolders(client);
|
|
1740
|
+
const found = folders.filters.find((it) => {
|
|
1741
|
+
if (it._ === "dialogFilterDefault") {
|
|
1742
|
+
return folder === 0;
|
|
1743
|
+
}
|
|
1744
|
+
return it.id === folder || it.title === folder;
|
|
1745
|
+
});
|
|
1746
|
+
if (!found) {
|
|
1747
|
+
throw new platform.MtArgumentError(`Could not find folder ${folder}`);
|
|
1748
|
+
}
|
|
1749
|
+
return found;
|
|
1750
|
+
}
|
|
1751
|
+
return folder;
|
|
1752
|
+
}
|
|
1753
|
+
async function createFolder(client, folder) {
|
|
1754
|
+
let id = folder.id;
|
|
1755
|
+
if (!id) {
|
|
1756
|
+
const old = await getFolders(client);
|
|
1757
|
+
let max = 1;
|
|
1758
|
+
old.filters.forEach((it) => {
|
|
1759
|
+
if (it._ === "dialogFilter" && it.id > max) max = it.id;
|
|
1760
|
+
});
|
|
1761
|
+
id = max + 1;
|
|
1762
|
+
}
|
|
1763
|
+
const filter = {
|
|
1764
|
+
_: "dialogFilter",
|
|
1765
|
+
pinnedPeers: [],
|
|
1766
|
+
includePeers: [],
|
|
1767
|
+
excludePeers: [],
|
|
1768
|
+
...folder,
|
|
1769
|
+
id
|
|
1770
|
+
};
|
|
1771
|
+
const r = await client.call({
|
|
1772
|
+
_: "messages.updateDialogFilter",
|
|
1773
|
+
id,
|
|
1774
|
+
filter
|
|
1775
|
+
});
|
|
1776
|
+
controllablePromise.assertTrue("messages.updateDialogFilter", r);
|
|
1777
|
+
return filter;
|
|
1778
|
+
}
|
|
1779
|
+
async function deleteFolder(client, id) {
|
|
1780
|
+
const r = await client.call({
|
|
1781
|
+
_: "messages.updateDialogFilter",
|
|
1782
|
+
id: typeof id === "number" ? id : id.id
|
|
1783
|
+
});
|
|
1784
|
+
controllablePromise.assertTrue("messages.updateDialogFilter", r);
|
|
1785
|
+
}
|
|
1786
|
+
async function editFolder(client, params) {
|
|
1787
|
+
const { modification } = params;
|
|
1788
|
+
let { folder } = params;
|
|
1789
|
+
if (folder === 0) {
|
|
1790
|
+
throw new platform.MtArgumentError("Cannot modify default folder");
|
|
1791
|
+
}
|
|
1792
|
+
if (typeof folder === "number" || typeof folder === "string") {
|
|
1793
|
+
const old = await getFolders(client);
|
|
1794
|
+
const found = old.filters.find((it) => it._ === "dialogFilter" && (it.id === folder || it.title === folder));
|
|
1795
|
+
if (!found) {
|
|
1796
|
+
throw new platform.MtArgumentError(`Could not find a folder ${folder}`);
|
|
1797
|
+
}
|
|
1798
|
+
folder = found;
|
|
1799
|
+
}
|
|
1800
|
+
const filter = {
|
|
1801
|
+
...folder,
|
|
1802
|
+
...modification
|
|
1803
|
+
};
|
|
1804
|
+
const r = await client.call({
|
|
1805
|
+
_: "messages.updateDialogFilter",
|
|
1806
|
+
id: folder.id,
|
|
1807
|
+
filter
|
|
1808
|
+
});
|
|
1809
|
+
controllablePromise.assertTrue("messages.updateDialogFilter", r);
|
|
1810
|
+
return filter;
|
|
1811
|
+
}
|
|
1812
|
+
async function* iterDialogs(client, params) {
|
|
1813
|
+
if (!params) params = {};
|
|
1814
|
+
const { limit = Infinity, chunkSize = 100, folder, filter, pinned = "include" } = params;
|
|
1815
|
+
let { offsetId = 0, offsetPeer = { _: "inputPeerEmpty" }, archived = "exclude" } = params;
|
|
1816
|
+
let offsetDate = conditionVariable.normalizeDate(params.offsetDate) ?? 0;
|
|
1817
|
+
let localFilters_;
|
|
1818
|
+
if (folder) {
|
|
1819
|
+
localFilters_ = await _normalizeInputFolder(client, folder);
|
|
1820
|
+
}
|
|
1821
|
+
if (filter) {
|
|
1822
|
+
if (localFilters_ && localFilters_._ !== "dialogFilterDefault") {
|
|
1823
|
+
localFilters_ = {
|
|
1824
|
+
...localFilters_,
|
|
1825
|
+
...filter
|
|
1826
|
+
};
|
|
1827
|
+
} else {
|
|
1828
|
+
localFilters_ = {
|
|
1829
|
+
_: "dialogFilter",
|
|
1830
|
+
id: 0,
|
|
1831
|
+
title: "",
|
|
1832
|
+
pinnedPeers: [],
|
|
1833
|
+
includePeers: [],
|
|
1834
|
+
excludePeers: [],
|
|
1835
|
+
...params.filter
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
if (localFilters_?._ === "dialogFilterDefault") {
|
|
1840
|
+
localFilters_ = void 0;
|
|
1841
|
+
}
|
|
1842
|
+
const localFilters = localFilters_;
|
|
1843
|
+
if (localFilters?._ === "dialogFilterChatlist") {
|
|
1844
|
+
if (offsetId !== 0 || offsetDate !== 0 || offsetPeer._ !== "inputPeerEmpty") {
|
|
1845
|
+
throw new platform.MtArgumentError("Cannot use offset parameters with chatlist filters");
|
|
1846
|
+
}
|
|
1847
|
+
let remaining = Math.min(limit, localFilters.includePeers.length + localFilters.pinnedPeers.length);
|
|
1848
|
+
if (pinned === "include" || pinned === "only") {
|
|
1849
|
+
const peers = [];
|
|
1850
|
+
for (const peer of localFilters.pinnedPeers) {
|
|
1851
|
+
if (remaining <= 0) break;
|
|
1852
|
+
remaining--;
|
|
1853
|
+
peers.push({
|
|
1854
|
+
_: "inputDialogPeer",
|
|
1855
|
+
peer
|
|
1856
|
+
});
|
|
1857
|
+
}
|
|
1858
|
+
const res = await client.call({
|
|
1859
|
+
_: "messages.getPeerDialogs",
|
|
1860
|
+
peers
|
|
1861
|
+
});
|
|
1862
|
+
res.dialogs.forEach((dialog) => dialog.pinned = true);
|
|
1863
|
+
yield* storyViewer.Dialog$2.parseTlDialogs(res);
|
|
1864
|
+
}
|
|
1865
|
+
if (pinned === "only" || remaining <= 0) {
|
|
1866
|
+
return;
|
|
1867
|
+
}
|
|
1868
|
+
let offset = 0;
|
|
1869
|
+
while (remaining > 0) {
|
|
1870
|
+
const peers = [];
|
|
1871
|
+
for (let i = 0; i < chunkSize; i++) {
|
|
1872
|
+
if (remaining <= 0) break;
|
|
1873
|
+
remaining--;
|
|
1874
|
+
peers.push({
|
|
1875
|
+
_: "inputDialogPeer",
|
|
1876
|
+
peer: localFilters.includePeers[offset + i]
|
|
1877
|
+
});
|
|
1878
|
+
}
|
|
1879
|
+
offset += chunkSize;
|
|
1880
|
+
const res = await client.call({
|
|
1881
|
+
_: "messages.getPeerDialogs",
|
|
1882
|
+
peers
|
|
1883
|
+
});
|
|
1884
|
+
yield* storyViewer.Dialog$2.parseTlDialogs(res);
|
|
1885
|
+
}
|
|
1886
|
+
return;
|
|
1887
|
+
}
|
|
1888
|
+
if (localFilters) {
|
|
1889
|
+
archived = localFilters.excludeArchived ? "exclude" : "keep";
|
|
1890
|
+
}
|
|
1891
|
+
const fetchPinnedDialogsFromFolder = async () => {
|
|
1892
|
+
if (!localFilters || !localFilters.pinnedPeers.length) {
|
|
1893
|
+
return null;
|
|
1894
|
+
}
|
|
1895
|
+
const res = await client.call({
|
|
1896
|
+
_: "messages.getPeerDialogs",
|
|
1897
|
+
peers: localFilters.pinnedPeers.map((peer) => ({
|
|
1898
|
+
_: "inputDialogPeer",
|
|
1899
|
+
peer
|
|
1900
|
+
}))
|
|
1901
|
+
});
|
|
1902
|
+
res.dialogs.forEach((dialog) => dialog.pinned = true);
|
|
1903
|
+
return res;
|
|
1904
|
+
};
|
|
1905
|
+
if (pinned === "only") {
|
|
1906
|
+
let res;
|
|
1907
|
+
if (localFilters) {
|
|
1908
|
+
res = await fetchPinnedDialogsFromFolder();
|
|
1909
|
+
} else {
|
|
1910
|
+
res = await client.call({
|
|
1911
|
+
_: "messages.getPinnedDialogs",
|
|
1912
|
+
folderId: archived === "exclude" ? 0 : 1
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
if (res) yield* storyViewer.Dialog$2.parseTlDialogs(res, limit);
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
1918
|
+
let current = 0;
|
|
1919
|
+
if (localFilters?.pinnedPeers.length && pinned === "include" && offsetId === 0 && offsetDate === 0 && offsetPeer._ === "inputPeerEmpty") {
|
|
1920
|
+
const res = await fetchPinnedDialogsFromFolder();
|
|
1921
|
+
if (res) {
|
|
1922
|
+
const dialogs = storyViewer.Dialog$2.parseTlDialogs(res, limit);
|
|
1923
|
+
for (const d of dialogs) {
|
|
1924
|
+
yield d;
|
|
1925
|
+
if (++current >= limit) return;
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
const filterFolder = localFilters ? storyViewer.Dialog$2.filterFolder(localFilters, pinned !== "keep") : void 0;
|
|
1930
|
+
let folderId;
|
|
1931
|
+
if (archived === "keep") {
|
|
1932
|
+
folderId = void 0;
|
|
1933
|
+
} else if (archived === "only") {
|
|
1934
|
+
folderId = 1;
|
|
1935
|
+
} else {
|
|
1936
|
+
folderId = 0;
|
|
1937
|
+
}
|
|
1938
|
+
for (; ; ) {
|
|
1939
|
+
const dialogs = storyViewer.Dialog$2.parseTlDialogs(
|
|
1940
|
+
await client.call({
|
|
1941
|
+
_: "messages.getDialogs",
|
|
1942
|
+
excludePinned: params.pinned === "exclude",
|
|
1943
|
+
folderId,
|
|
1944
|
+
offsetDate,
|
|
1945
|
+
offsetId,
|
|
1946
|
+
offsetPeer,
|
|
1947
|
+
limit: filterFolder ? chunkSize : Math.min(limit - current, chunkSize),
|
|
1948
|
+
hash: Long.ZERO
|
|
1949
|
+
})
|
|
1950
|
+
);
|
|
1951
|
+
if (!dialogs.length) return;
|
|
1952
|
+
const last = dialogs[dialogs.length - 1];
|
|
1953
|
+
offsetPeer = last.chat.inputPeer;
|
|
1954
|
+
offsetId = last.raw.topMessage;
|
|
1955
|
+
if (last.lastMessage) {
|
|
1956
|
+
offsetDate = last.lastMessage.raw.date;
|
|
1957
|
+
}
|
|
1958
|
+
for (const d of dialogs) {
|
|
1959
|
+
if (filterFolder && !filterFolder(d)) continue;
|
|
1960
|
+
yield d;
|
|
1961
|
+
if (++current >= limit) return;
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
async function findDialogs(client, peers) {
|
|
1966
|
+
if (!Array.isArray(peers)) peers = [peers];
|
|
1967
|
+
const resolved = await storyViewer.resolvePeerMany(client, peers);
|
|
1968
|
+
const notFoundIds = /* @__PURE__ */ new Map();
|
|
1969
|
+
const notFoundUsernames = /* @__PURE__ */ new Map();
|
|
1970
|
+
let notFoundCount = 0;
|
|
1971
|
+
const foundInputPeers = [];
|
|
1972
|
+
const foundIdxToOriginalIdx = /* @__PURE__ */ new Map();
|
|
1973
|
+
for (let i = 0; i < peers.length; i++) {
|
|
1974
|
+
const input = peers[i];
|
|
1975
|
+
const resolvedPeer = resolved[i];
|
|
1976
|
+
if (!resolvedPeer) {
|
|
1977
|
+
if (typeof input === "number") {
|
|
1978
|
+
notFoundIds.set(input, i);
|
|
1979
|
+
} else {
|
|
1980
|
+
notFoundUsernames.set(input, i);
|
|
1981
|
+
}
|
|
1982
|
+
notFoundCount += 1;
|
|
1983
|
+
continue;
|
|
1984
|
+
}
|
|
1985
|
+
foundInputPeers.push(resolvedPeer);
|
|
1986
|
+
foundIdxToOriginalIdx.set(foundInputPeers.length - 1, i);
|
|
1987
|
+
}
|
|
1988
|
+
if (foundInputPeers.length === 0) {
|
|
1989
|
+
throw new controllablePromise.MtPeerNotFoundError(`Could not find dialogs with peers: ${peers.join(", ")}`);
|
|
1990
|
+
}
|
|
1991
|
+
const dialogs = await storyViewer.getPeerDialogs(client, foundInputPeers);
|
|
1992
|
+
if (foundInputPeers.length === peers.length) {
|
|
1993
|
+
return dialogs;
|
|
1994
|
+
}
|
|
1995
|
+
const ret = Array.from({ length: peers.length });
|
|
1996
|
+
for (const [idx, origIdx] of foundIdxToOriginalIdx) {
|
|
1997
|
+
ret[origIdx] = dialogs[idx];
|
|
1998
|
+
}
|
|
1999
|
+
for await (const dialog of iterDialogs(client, {
|
|
2000
|
+
archived: "keep"
|
|
2001
|
+
})) {
|
|
2002
|
+
const chat2 = dialog.chat;
|
|
2003
|
+
const idxById = notFoundIds.get(chat2.id);
|
|
2004
|
+
if (idxById !== void 0) {
|
|
2005
|
+
ret[idxById] = dialog;
|
|
2006
|
+
notFoundIds.delete(chat2.id);
|
|
2007
|
+
notFoundCount -= 1;
|
|
2008
|
+
}
|
|
2009
|
+
if (notFoundCount === 0) break;
|
|
2010
|
+
if (!chat2.username) continue;
|
|
2011
|
+
const idxByUsername = notFoundUsernames.get(chat2.username);
|
|
2012
|
+
if (idxByUsername !== void 0) {
|
|
2013
|
+
ret[idxByUsername] = dialog;
|
|
2014
|
+
notFoundUsernames.delete(chat2.username);
|
|
2015
|
+
notFoundCount -= 1;
|
|
2016
|
+
}
|
|
2017
|
+
if (notFoundCount === 0) break;
|
|
2018
|
+
}
|
|
2019
|
+
if (notFoundCount > 0) {
|
|
2020
|
+
const notFound = [...notFoundIds.keys(), ...notFoundUsernames.keys()];
|
|
2021
|
+
throw new controllablePromise.MtPeerNotFoundError(`Could not find dialogs with peers: ${notFound.join(", ")}`);
|
|
2022
|
+
}
|
|
2023
|
+
return ret;
|
|
2024
|
+
}
|
|
2025
|
+
async function findFolder(client, params) {
|
|
2026
|
+
if (!params.title && !params.emoji && !params.id) {
|
|
2027
|
+
throw new platform.MtArgumentError("One of search parameters must be passed");
|
|
2028
|
+
}
|
|
2029
|
+
const folders = await getFolders(client);
|
|
2030
|
+
return folders.filters.find((it) => {
|
|
2031
|
+
if (it._ === "dialogFilterDefault") return false;
|
|
2032
|
+
if (params.id && it.id !== params.id) return false;
|
|
2033
|
+
if (params.title && it.title !== params.title) return false;
|
|
2034
|
+
if (params.emoji && it.emoticon !== params.emoji) return false;
|
|
2035
|
+
return true;
|
|
2036
|
+
}) ?? null;
|
|
2037
|
+
}
|
|
2038
|
+
async function getChatlistPreview(client, link) {
|
|
2039
|
+
const res = await client.call({
|
|
2040
|
+
_: "chatlists.checkChatlistInvite",
|
|
2041
|
+
slug: link
|
|
2042
|
+
});
|
|
2043
|
+
return new storyViewer.ChatlistPreview$2(res);
|
|
2044
|
+
}
|
|
2045
|
+
async function joinChatlist(client, link, params) {
|
|
2046
|
+
let peers;
|
|
2047
|
+
if (params?.peers) {
|
|
2048
|
+
const inputs = Array.isArray(params.peers) ? params.peers : [params.peers];
|
|
2049
|
+
const all = await storyViewer.resolvePeerMany(client, inputs);
|
|
2050
|
+
peers = all.filter(controllablePromise.isPresent);
|
|
2051
|
+
} else {
|
|
2052
|
+
const preview = await getChatlistPreview(client, link);
|
|
2053
|
+
peers = preview.chats.filter((it) => !it.isUnavailable).map((it) => it.inputPeer);
|
|
2054
|
+
}
|
|
2055
|
+
const res = await client.call({
|
|
2056
|
+
_: "chatlists.joinChatlistInvite",
|
|
2057
|
+
slug: link,
|
|
2058
|
+
peers
|
|
2059
|
+
});
|
|
2060
|
+
storyViewer.assertIsUpdatesGroup("joinChatlist", res);
|
|
2061
|
+
client.handleClientUpdate(res);
|
|
2062
|
+
const filter = res.updates.find((it) => it._ === "updateDialogFilter");
|
|
2063
|
+
if (!filter?.filter) {
|
|
2064
|
+
throw new platform.MtTypeAssertionError("joinChatlist", "updateDialogFilter", "nothing");
|
|
2065
|
+
}
|
|
2066
|
+
controllablePromise.assertTypeIs("joinChatlist", filter.filter, "dialogFilterChatlist");
|
|
2067
|
+
return filter.filter;
|
|
2068
|
+
}
|
|
2069
|
+
async function setFoldersOrder(client, order) {
|
|
2070
|
+
const r = await client.call({
|
|
2071
|
+
_: "messages.updateDialogFiltersOrder",
|
|
2072
|
+
order
|
|
2073
|
+
});
|
|
2074
|
+
controllablePromise.assertTrue("messages.updateDialogFiltersOrder", r);
|
|
2075
|
+
}
|
|
2076
|
+
const SMALL_FILE_MAX_SIZE = 131072;
|
|
2077
|
+
const REQUESTS_PER_CONNECTION = 3;
|
|
2078
|
+
async function* downloadAsIterable(client, input, params) {
|
|
2079
|
+
const offset = params?.offset ?? 0;
|
|
2080
|
+
if (offset % 4096 !== 0) {
|
|
2081
|
+
throw new platform.MtArgumentError(`Invalid offset: ${offset}. Must be divisible by 4096`);
|
|
2082
|
+
}
|
|
2083
|
+
let dcId = params?.dcId;
|
|
2084
|
+
let fileSize = params?.fileSize;
|
|
2085
|
+
const abortSignal = params?.abortSignal;
|
|
2086
|
+
let aborted = false;
|
|
2087
|
+
let location;
|
|
2088
|
+
if (input instanceof storyViewer.FileLocation$1) {
|
|
2089
|
+
let locationInner = input.location;
|
|
2090
|
+
if (typeof locationInner === "function") {
|
|
2091
|
+
locationInner = locationInner();
|
|
2092
|
+
}
|
|
2093
|
+
if (ArrayBuffer.isView(locationInner)) {
|
|
2094
|
+
yield locationInner;
|
|
2095
|
+
return;
|
|
2096
|
+
}
|
|
2097
|
+
if (!dcId) dcId = input.dcId;
|
|
2098
|
+
if (!fileSize) fileSize = input.fileSize;
|
|
2099
|
+
location = locationInner;
|
|
2100
|
+
} else if (typeof input === "string") {
|
|
2101
|
+
const parsed = fileId.parseFileId(platform.getPlatform(), input);
|
|
2102
|
+
if (parsed.location._ === "web") {
|
|
2103
|
+
location = storyViewer.fileIdToInputWebFileLocation(parsed);
|
|
2104
|
+
} else {
|
|
2105
|
+
location = storyViewer.fileIdToInputFileLocation(parsed);
|
|
2106
|
+
}
|
|
2107
|
+
} else {
|
|
2108
|
+
location = input;
|
|
2109
|
+
}
|
|
2110
|
+
const isWeb = tl.tl.isAnyInputWebFileLocation(location);
|
|
2111
|
+
const primaryDcId = await client.getPrimaryDcId();
|
|
2112
|
+
if (!dcId) dcId = primaryDcId;
|
|
2113
|
+
const partSizeKb = params?.partSize ?? (fileSize ? conditionVariable.determinePartSize(fileSize) : 64);
|
|
2114
|
+
if (partSizeKb % 4 !== 0) {
|
|
2115
|
+
throw new platform.MtArgumentError(`Invalid part size: ${partSizeKb}. Must be divisible by 4.`);
|
|
2116
|
+
}
|
|
2117
|
+
const chunkSize = partSizeKb * 1024;
|
|
2118
|
+
let limitBytes = params?.limit ?? fileSize ?? Infinity;
|
|
2119
|
+
if (limitBytes === 0) return;
|
|
2120
|
+
let numChunks = limitBytes === Infinity ? Infinity : ~~((limitBytes + chunkSize - offset - 1) / chunkSize);
|
|
2121
|
+
let nextChunkIdx = 0;
|
|
2122
|
+
let nextWorkerChunkIdx = 0;
|
|
2123
|
+
const nextChunkCv = new conditionVariable.ConditionVariable();
|
|
2124
|
+
const buffer = {};
|
|
2125
|
+
const isSmall = fileSize && fileSize <= SMALL_FILE_MAX_SIZE;
|
|
2126
|
+
let connectionKind;
|
|
2127
|
+
if (isSmall) {
|
|
2128
|
+
connectionKind = dcId === primaryDcId ? "main" : "downloadSmall";
|
|
2129
|
+
} else {
|
|
2130
|
+
connectionKind = "download";
|
|
2131
|
+
}
|
|
2132
|
+
const poolSize = await client.getPoolSize(connectionKind, dcId);
|
|
2133
|
+
client.log.debug(
|
|
2134
|
+
"Downloading file of size %d from dc %d using %s connection pool (pool size: %d)",
|
|
2135
|
+
limitBytes,
|
|
2136
|
+
dcId,
|
|
2137
|
+
connectionKind,
|
|
2138
|
+
poolSize
|
|
2139
|
+
);
|
|
2140
|
+
const downloadChunk = async (chunk = nextWorkerChunkIdx++) => {
|
|
2141
|
+
let result;
|
|
2142
|
+
if (aborted) {
|
|
2143
|
+
return;
|
|
2144
|
+
}
|
|
2145
|
+
try {
|
|
2146
|
+
result = await client.call(
|
|
2147
|
+
{
|
|
2148
|
+
_: isWeb ? "upload.getWebFile" : "upload.getFile",
|
|
2149
|
+
// eslint-disable-next-line
|
|
2150
|
+
location,
|
|
2151
|
+
offset: chunkSize * chunk,
|
|
2152
|
+
limit: chunkSize
|
|
2153
|
+
},
|
|
2154
|
+
{
|
|
2155
|
+
dcId,
|
|
2156
|
+
kind: connectionKind,
|
|
2157
|
+
maxRetryCount: Infinity,
|
|
2158
|
+
// retry until explicitly aborted (or finished)
|
|
2159
|
+
abortSignal
|
|
2160
|
+
}
|
|
2161
|
+
);
|
|
2162
|
+
} catch (e) {
|
|
2163
|
+
if (e instanceof DOMException && e.name === "AbortError") return;
|
|
2164
|
+
if (!tl.tl.RpcError.is(e)) throw e;
|
|
2165
|
+
if (e.is("FILE_MIGRATE_%d")) {
|
|
2166
|
+
dcId = e.newDc;
|
|
2167
|
+
return downloadChunk(chunk);
|
|
2168
|
+
} else if (e.is("FILEREF_UPGRADE_NEEDED")) {
|
|
2169
|
+
throw new platform.MtUnsupportedError("File ref expired!");
|
|
2170
|
+
} else {
|
|
2171
|
+
throw e;
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
if (result._ === "upload.fileCdnRedirect") {
|
|
2175
|
+
throw new platform.MtUnsupportedError("Received CDN redirect, which is not supported (yet)");
|
|
2176
|
+
}
|
|
2177
|
+
if (aborted) {
|
|
2178
|
+
return;
|
|
2179
|
+
}
|
|
2180
|
+
if (result._ === "upload.webFile" && result.size && limitBytes === Infinity) {
|
|
2181
|
+
limitBytes = result.size;
|
|
2182
|
+
numChunks = ~~((limitBytes + chunkSize - offset - 1) / chunkSize);
|
|
2183
|
+
}
|
|
2184
|
+
buffer[chunk] = result.bytes;
|
|
2185
|
+
if (chunk === nextChunkIdx) {
|
|
2186
|
+
nextChunkCv.notify();
|
|
2187
|
+
}
|
|
2188
|
+
if (nextWorkerChunkIdx < numChunks && result.bytes.length === chunkSize) {
|
|
2189
|
+
return downloadChunk();
|
|
2190
|
+
}
|
|
2191
|
+
};
|
|
2192
|
+
let error;
|
|
2193
|
+
void Promise.all(Array.from({ length: Math.min(poolSize * REQUESTS_PER_CONNECTION, numChunks) }, downloadChunk)).catch((e) => {
|
|
2194
|
+
client.log.debug("download workers errored: %e", e);
|
|
2195
|
+
error = e;
|
|
2196
|
+
aborted = true;
|
|
2197
|
+
nextChunkCv.notify();
|
|
2198
|
+
}).then(() => {
|
|
2199
|
+
client.log.debug("download workers finished");
|
|
2200
|
+
});
|
|
2201
|
+
abortSignal?.addEventListener("abort", () => {
|
|
2202
|
+
client.log.debug("download aborted");
|
|
2203
|
+
error = abortSignal.reason;
|
|
2204
|
+
aborted = true;
|
|
2205
|
+
nextChunkCv.notify();
|
|
2206
|
+
});
|
|
2207
|
+
let position = offset;
|
|
2208
|
+
while (position < limitBytes) {
|
|
2209
|
+
await nextChunkCv.wait();
|
|
2210
|
+
if (error) throw error;
|
|
2211
|
+
while (nextChunkIdx in buffer) {
|
|
2212
|
+
const buf = buffer[nextChunkIdx];
|
|
2213
|
+
delete buffer[nextChunkIdx];
|
|
2214
|
+
position += buf.length;
|
|
2215
|
+
params?.progressCallback?.(position, limitBytes);
|
|
2216
|
+
yield buf;
|
|
2217
|
+
nextChunkIdx++;
|
|
2218
|
+
if (buf.length < chunkSize) {
|
|
2219
|
+
return;
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
async function downloadAsBuffer(client, location, params) {
|
|
2225
|
+
if (location instanceof storyViewer.FileLocation$1 && ArrayBuffer.isView(location.location)) {
|
|
2226
|
+
return location.location;
|
|
2227
|
+
}
|
|
2228
|
+
const chunks = [];
|
|
2229
|
+
for await (const chunk of downloadAsIterable(client, location, params)) {
|
|
2230
|
+
chunks.push(chunk);
|
|
2231
|
+
}
|
|
2232
|
+
return conditionVariable.concatBuffers(chunks);
|
|
2233
|
+
}
|
|
2234
|
+
function downloadAsStream(client, location, params) {
|
|
2235
|
+
if (location instanceof storyViewer.FileLocation$1 && ArrayBuffer.isView(location.location)) {
|
|
2236
|
+
return conditionVariable.bufferToStream(location.location);
|
|
2237
|
+
}
|
|
2238
|
+
const cancel = new AbortController();
|
|
2239
|
+
if (params?.abortSignal) {
|
|
2240
|
+
params?.abortSignal.addEventListener("abort", () => {
|
|
2241
|
+
cancel.abort();
|
|
2242
|
+
});
|
|
2243
|
+
}
|
|
2244
|
+
return new ReadableStream({
|
|
2245
|
+
start(controller) {
|
|
2246
|
+
(async () => {
|
|
2247
|
+
for await (const chunk of downloadAsIterable(client, location, params)) {
|
|
2248
|
+
controller.enqueue(chunk);
|
|
2249
|
+
}
|
|
2250
|
+
controller.close();
|
|
2251
|
+
})().catch((e) => controller.error(e));
|
|
2252
|
+
},
|
|
2253
|
+
cancel() {
|
|
2254
|
+
cancel.abort();
|
|
2255
|
+
}
|
|
2256
|
+
});
|
|
2257
|
+
}
|
|
2258
|
+
async function uploadMedia(client, media, params = {}) {
|
|
2259
|
+
const normMedia = await storyViewer._normalizeInputMedia(client, media, params, false);
|
|
2260
|
+
switch (normMedia._) {
|
|
2261
|
+
case "inputMediaEmpty":
|
|
2262
|
+
case "inputMediaGeoPoint":
|
|
2263
|
+
case "inputMediaGeoLive":
|
|
2264
|
+
case "inputMediaContact":
|
|
2265
|
+
case "inputMediaVenue":
|
|
2266
|
+
case "inputMediaGame":
|
|
2267
|
+
case "inputMediaInvoice":
|
|
2268
|
+
case "inputMediaPoll":
|
|
2269
|
+
case "inputMediaDice":
|
|
2270
|
+
case "inputMediaPaidMedia":
|
|
2271
|
+
throw new platform.MtArgumentError("This media can't be uploaded");
|
|
2272
|
+
}
|
|
2273
|
+
const res = await client.call({
|
|
2274
|
+
_: "messages.uploadMedia",
|
|
2275
|
+
peer: params.peer ? await storyViewer.resolvePeer(client, params.peer) : {
|
|
2276
|
+
_: "inputPeerSelf"
|
|
2277
|
+
},
|
|
2278
|
+
media: normMedia
|
|
2279
|
+
});
|
|
2280
|
+
controllablePromise.assertTypeIsNot("uploadMedia", res, "messageMediaEmpty");
|
|
2281
|
+
switch (normMedia._) {
|
|
2282
|
+
case "inputMediaUploadedPhoto":
|
|
2283
|
+
case "inputMediaPhoto":
|
|
2284
|
+
case "inputMediaPhotoExternal":
|
|
2285
|
+
controllablePromise.assertTypeIs("uploadMedia", res, "messageMediaPhoto");
|
|
2286
|
+
controllablePromise.assertTypeIs("uploadMedia", res.photo, "photo");
|
|
2287
|
+
return new storyViewer.Photo$2(res.photo);
|
|
2288
|
+
case "inputMediaUploadedDocument":
|
|
2289
|
+
case "inputMediaDocument":
|
|
2290
|
+
case "inputMediaDocumentExternal":
|
|
2291
|
+
controllablePromise.assertTypeIs("uploadMedia", res, "messageMediaDocument");
|
|
2292
|
+
controllablePromise.assertTypeIs("uploadMedia", res.document, "document");
|
|
2293
|
+
return storyViewer.parseDocument(res.document, res);
|
|
2294
|
+
case "inputMediaStory":
|
|
2295
|
+
case "inputMediaWebPage":
|
|
2296
|
+
throw new platform.MtArgumentError(`This media (${normMedia._}) can't be uploaded`);
|
|
2297
|
+
default:
|
|
2298
|
+
conditionVariable.assertNever();
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
async function createForumTopic(client, params) {
|
|
2302
|
+
const { chatId, title, icon, sendAs, shouldDispatch } = params;
|
|
2303
|
+
const res = await client.call({
|
|
2304
|
+
_: "channels.createForumTopic",
|
|
2305
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
2306
|
+
title,
|
|
2307
|
+
iconColor: typeof icon === "number" ? icon : void 0,
|
|
2308
|
+
iconEmojiId: typeof icon !== "number" ? icon : void 0,
|
|
2309
|
+
sendAs: sendAs ? await storyViewer.resolvePeer(client, sendAs) : void 0,
|
|
2310
|
+
randomId: conditionVariable.randomLong()
|
|
2311
|
+
});
|
|
2312
|
+
return storyViewer._findMessageInUpdate(client, res, false, !shouldDispatch);
|
|
2313
|
+
}
|
|
2314
|
+
async function deleteForumTopicHistory(client, chat2, topicId, params) {
|
|
2315
|
+
const { shouldDispatch } = params ?? {};
|
|
2316
|
+
const channel = await storyViewer.resolveChannel(client, chat2);
|
|
2317
|
+
controllablePromise.assertTypeIsNot("deleteForumTopicHistory", channel, "inputChannelEmpty");
|
|
2318
|
+
const res = await client.call({
|
|
2319
|
+
_: "channels.deleteTopicHistory",
|
|
2320
|
+
channel,
|
|
2321
|
+
topMsgId: typeof topicId === "number" ? topicId : topicId.id
|
|
2322
|
+
});
|
|
2323
|
+
if (!shouldDispatch) {
|
|
2324
|
+
client.handleClientUpdate(storyViewer.createDummyUpdate(res.pts, res.ptsCount, channel.channelId));
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
async function editForumTopic(client, params) {
|
|
2328
|
+
const { chatId, topicId, title, icon, shouldDispatch } = params;
|
|
2329
|
+
const res = await client.call({
|
|
2330
|
+
_: "channels.editForumTopic",
|
|
2331
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
2332
|
+
topicId: typeof topicId === "number" ? topicId : topicId.id,
|
|
2333
|
+
title,
|
|
2334
|
+
iconEmojiId: icon ? icon ?? Long.ZERO : void 0
|
|
2335
|
+
});
|
|
2336
|
+
return storyViewer._findMessageInUpdate(client, res, false, shouldDispatch);
|
|
2337
|
+
}
|
|
2338
|
+
async function getForumTopicsById(client, chatId, ids) {
|
|
2339
|
+
if (!Array.isArray(ids)) ids = [ids];
|
|
2340
|
+
const res = await client.call({
|
|
2341
|
+
_: "channels.getForumTopicsByID",
|
|
2342
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
2343
|
+
topics: ids
|
|
2344
|
+
});
|
|
2345
|
+
return storyViewer.ForumTopic$2.parseTlForumTopics(res);
|
|
2346
|
+
}
|
|
2347
|
+
const defaultOffset$3 = {
|
|
2348
|
+
date: 0,
|
|
2349
|
+
id: 0,
|
|
2350
|
+
topic: 0
|
|
2351
|
+
};
|
|
2352
|
+
async function getForumTopics(client, chatId, params) {
|
|
2353
|
+
if (!params) params = {};
|
|
2354
|
+
const {
|
|
2355
|
+
query,
|
|
2356
|
+
offset: { date: offsetDate, id: offsetId, topic: offsetTopic } = defaultOffset$3,
|
|
2357
|
+
limit = 100
|
|
2358
|
+
} = params;
|
|
2359
|
+
const res = await client.call({
|
|
2360
|
+
_: "channels.getForumTopics",
|
|
2361
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
2362
|
+
q: query,
|
|
2363
|
+
offsetDate,
|
|
2364
|
+
offsetId,
|
|
2365
|
+
offsetTopic,
|
|
2366
|
+
limit
|
|
2367
|
+
});
|
|
2368
|
+
const topics = storyViewer.ForumTopic$2.parseTlForumTopics(res);
|
|
2369
|
+
const last = topics[topics.length - 1];
|
|
2370
|
+
const next = last ? {
|
|
2371
|
+
date: res.orderByCreateDate ? last.raw.date : last.lastMessage.raw.date,
|
|
2372
|
+
id: last.raw.topMessage,
|
|
2373
|
+
topic: last.raw.id
|
|
2374
|
+
} : void 0;
|
|
2375
|
+
return conditionVariable.makeArrayPaginated(topics, res.count, next);
|
|
2376
|
+
}
|
|
2377
|
+
async function* iterForumTopics(client, chatId, params) {
|
|
2378
|
+
if (!params) params = {};
|
|
2379
|
+
const { query, limit = Infinity, chunkSize = 100 } = params;
|
|
2380
|
+
const peer = await storyViewer.resolveChannel(client, chatId);
|
|
2381
|
+
let { offset } = params;
|
|
2382
|
+
let current = 0;
|
|
2383
|
+
for (; ; ) {
|
|
2384
|
+
const res = await getForumTopics(client, peer, {
|
|
2385
|
+
query,
|
|
2386
|
+
offset,
|
|
2387
|
+
limit: Math.min(chunkSize, limit - current)
|
|
2388
|
+
});
|
|
2389
|
+
for (const topic of res) {
|
|
2390
|
+
yield topic;
|
|
2391
|
+
if (++current >= limit) return;
|
|
2392
|
+
}
|
|
2393
|
+
if (!res.next) return;
|
|
2394
|
+
offset = res.next;
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
async function reorderPinnedForumTopics(client, params) {
|
|
2398
|
+
const { chatId, order, force } = params;
|
|
2399
|
+
await client.call({
|
|
2400
|
+
_: "channels.reorderPinnedForumTopics",
|
|
2401
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
2402
|
+
order: order.map((it) => typeof it === "number" ? it : it.id),
|
|
2403
|
+
force
|
|
2404
|
+
});
|
|
2405
|
+
}
|
|
2406
|
+
async function toggleForumTopicClosed(client, parmas) {
|
|
2407
|
+
const { chatId, topicId, closed, shouldDispatch } = parmas;
|
|
2408
|
+
const res = await client.call({
|
|
2409
|
+
_: "channels.editForumTopic",
|
|
2410
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
2411
|
+
topicId: typeof topicId === "number" ? topicId : topicId.id,
|
|
2412
|
+
closed
|
|
2413
|
+
});
|
|
2414
|
+
return storyViewer._findMessageInUpdate(client, res, false, shouldDispatch);
|
|
2415
|
+
}
|
|
2416
|
+
async function toggleForumTopicPinned(client, params) {
|
|
2417
|
+
const { chatId, topicId, pinned } = params;
|
|
2418
|
+
await client.call({
|
|
2419
|
+
_: "channels.updatePinnedForumTopic",
|
|
2420
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
2421
|
+
topicId: typeof topicId === "number" ? topicId : topicId.id,
|
|
2422
|
+
pinned
|
|
2423
|
+
});
|
|
2424
|
+
}
|
|
2425
|
+
async function toggleForum(client, chatId, enabled = false) {
|
|
2426
|
+
const res = await client.call({
|
|
2427
|
+
_: "channels.toggleForum",
|
|
2428
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
2429
|
+
enabled
|
|
2430
|
+
});
|
|
2431
|
+
client.handleClientUpdate(res);
|
|
2432
|
+
}
|
|
2433
|
+
async function toggleGeneralTopicHidden(client, params) {
|
|
2434
|
+
const { chatId, hidden, shouldDispatch } = params;
|
|
2435
|
+
const res = await client.call({
|
|
2436
|
+
_: "channels.editForumTopic",
|
|
2437
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
2438
|
+
topicId: 1,
|
|
2439
|
+
hidden
|
|
2440
|
+
});
|
|
2441
|
+
return storyViewer._findMessageInUpdate(client, res, false, shouldDispatch);
|
|
2442
|
+
}
|
|
2443
|
+
async function createInviteLink(client, chatId, params) {
|
|
2444
|
+
if (!params) params = {};
|
|
2445
|
+
const res = await client.call({
|
|
2446
|
+
_: "messages.exportChatInvite",
|
|
2447
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2448
|
+
expireDate: conditionVariable.normalizeDate(params.expires),
|
|
2449
|
+
usageLimit: params.usageLimit,
|
|
2450
|
+
requestNeeded: params.withApproval
|
|
2451
|
+
});
|
|
2452
|
+
return new storyViewer.ChatInviteLink$2(res);
|
|
2453
|
+
}
|
|
2454
|
+
async function editInviteLink(client, params) {
|
|
2455
|
+
const { chatId, link, expires, usageLimit, withApproval } = params;
|
|
2456
|
+
const res = await client.call({
|
|
2457
|
+
_: "messages.editExportedChatInvite",
|
|
2458
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2459
|
+
link: typeof link === "string" ? link : link.link,
|
|
2460
|
+
expireDate: conditionVariable.normalizeDate(expires),
|
|
2461
|
+
usageLimit,
|
|
2462
|
+
requestNeeded: withApproval
|
|
2463
|
+
});
|
|
2464
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2465
|
+
return new storyViewer.ChatInviteLink$2(res.invite, peers);
|
|
2466
|
+
}
|
|
2467
|
+
async function exportInviteLink(client, chatId) {
|
|
2468
|
+
const res = await client.call({
|
|
2469
|
+
_: "messages.exportChatInvite",
|
|
2470
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2471
|
+
legacyRevokePermanent: true
|
|
2472
|
+
});
|
|
2473
|
+
return new storyViewer.ChatInviteLink$2(res);
|
|
2474
|
+
}
|
|
2475
|
+
async function getInviteLinkMembers(client, chatId, params) {
|
|
2476
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
2477
|
+
if (!params) params = {};
|
|
2478
|
+
const { limit = 100, link, requestedSearch, requested = Boolean(requestedSearch) } = params;
|
|
2479
|
+
const { offsetUser = { _: "inputUserEmpty" } } = params;
|
|
2480
|
+
const offsetDate = conditionVariable.normalizeDate(params.offsetDate) ?? 0;
|
|
2481
|
+
const res = await client.call({
|
|
2482
|
+
_: "messages.getChatInviteImporters",
|
|
2483
|
+
limit,
|
|
2484
|
+
peer,
|
|
2485
|
+
link: typeof link === "string" ? link : link?.link,
|
|
2486
|
+
requested,
|
|
2487
|
+
q: requestedSearch,
|
|
2488
|
+
offsetDate,
|
|
2489
|
+
offsetUser
|
|
2490
|
+
});
|
|
2491
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2492
|
+
const members = res.importers.map((it) => new storyViewer.ChatInviteLinkMember$2(it, peers));
|
|
2493
|
+
const last = members[members.length - 1];
|
|
2494
|
+
const nextOffset = last ? {
|
|
2495
|
+
date: last.raw.date,
|
|
2496
|
+
user: conditionVariable.toInputUser(last.user.inputPeer)
|
|
2497
|
+
} : void 0;
|
|
2498
|
+
return conditionVariable.makeArrayPaginated(members, res.count, nextOffset);
|
|
2499
|
+
}
|
|
2500
|
+
async function getInviteLink(client, chatId, link) {
|
|
2501
|
+
const res = await client.call({
|
|
2502
|
+
_: "messages.getExportedChatInvite",
|
|
2503
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2504
|
+
link
|
|
2505
|
+
});
|
|
2506
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2507
|
+
return new storyViewer.ChatInviteLink$2(res.invite, peers);
|
|
2508
|
+
}
|
|
2509
|
+
async function getInviteLinks(client, chatId, params) {
|
|
2510
|
+
if (!params) params = {};
|
|
2511
|
+
const { revoked = false, limit = Infinity, admin, offset } = params;
|
|
2512
|
+
const res = await client.call({
|
|
2513
|
+
_: "messages.getExportedChatInvites",
|
|
2514
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2515
|
+
revoked,
|
|
2516
|
+
adminId: admin ? await storyViewer.resolveUser(client, admin) : { _: "inputUserSelf" },
|
|
2517
|
+
limit,
|
|
2518
|
+
offsetDate: offset?.date,
|
|
2519
|
+
offsetLink: offset?.link
|
|
2520
|
+
});
|
|
2521
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2522
|
+
const links = res.invites.map((it) => new storyViewer.ChatInviteLink$2(it, peers));
|
|
2523
|
+
const last = links[links.length - 1];
|
|
2524
|
+
const nextOffset = last ? {
|
|
2525
|
+
date: last.raw.date,
|
|
2526
|
+
link: last.raw.link
|
|
2527
|
+
} : void 0;
|
|
2528
|
+
return conditionVariable.makeArrayPaginated(links, res.count, nextOffset);
|
|
2529
|
+
}
|
|
2530
|
+
async function getPrimaryInviteLink(client, chatId) {
|
|
2531
|
+
const res = await client.call({
|
|
2532
|
+
_: "messages.getExportedChatInvites",
|
|
2533
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2534
|
+
adminId: { _: "inputUserSelf" },
|
|
2535
|
+
limit: 1,
|
|
2536
|
+
revoked: false
|
|
2537
|
+
});
|
|
2538
|
+
if (res.invites[0]?._ !== "chatInviteExported") {
|
|
2539
|
+
throw new platform.MtTypeAssertionError(
|
|
2540
|
+
"messages.getExportedChatInvites (@ .invites[0])",
|
|
2541
|
+
"chatInviteExported",
|
|
2542
|
+
res.invites[0]?._
|
|
2543
|
+
);
|
|
2544
|
+
}
|
|
2545
|
+
if (!res.invites[0].permanent) {
|
|
2546
|
+
throw new platform.MtTypeAssertionError("messages.getExportedChatInvites (@ .invites[0].permanent)", "true", "false");
|
|
2547
|
+
}
|
|
2548
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2549
|
+
return new storyViewer.ChatInviteLink$2(res.invites[0], peers);
|
|
2550
|
+
}
|
|
2551
|
+
async function hideAllJoinRequests(client, params) {
|
|
2552
|
+
const { chatId, action, link } = params;
|
|
2553
|
+
await client.call({
|
|
2554
|
+
_: "messages.hideAllChatJoinRequests",
|
|
2555
|
+
approved: action === "approve",
|
|
2556
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2557
|
+
link: typeof link === "string" ? link : link?.link
|
|
2558
|
+
});
|
|
2559
|
+
}
|
|
2560
|
+
async function hideJoinRequest(client, params) {
|
|
2561
|
+
const { chatId, user, action } = params;
|
|
2562
|
+
const userId = await storyViewer.resolveUser(client, user);
|
|
2563
|
+
await client.call({
|
|
2564
|
+
_: "messages.hideChatJoinRequest",
|
|
2565
|
+
approved: action === "approve",
|
|
2566
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2567
|
+
userId
|
|
2568
|
+
});
|
|
2569
|
+
}
|
|
2570
|
+
async function* iterInviteLinkMembers(client, chatId, params) {
|
|
2571
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
2572
|
+
if (!params) params = {};
|
|
2573
|
+
const { limit = Infinity, chunkSize = 100, link, requestedSearch, requested = Boolean(requestedSearch) } = params;
|
|
2574
|
+
let { offsetDate, offsetUser = { _: "inputUserEmpty" } } = params;
|
|
2575
|
+
let current = 0;
|
|
2576
|
+
for (; ; ) {
|
|
2577
|
+
const items = await getInviteLinkMembers(client, peer, {
|
|
2578
|
+
limit: Math.min(chunkSize, limit - current),
|
|
2579
|
+
link,
|
|
2580
|
+
requested,
|
|
2581
|
+
requestedSearch,
|
|
2582
|
+
offsetDate,
|
|
2583
|
+
offsetUser
|
|
2584
|
+
});
|
|
2585
|
+
if (!items.length) break;
|
|
2586
|
+
for (const it of items) {
|
|
2587
|
+
yield it;
|
|
2588
|
+
if (++current >= limit) return;
|
|
2589
|
+
}
|
|
2590
|
+
if (!items.next) return;
|
|
2591
|
+
offsetDate = items.next.date;
|
|
2592
|
+
offsetUser = items.next.user;
|
|
2593
|
+
}
|
|
2594
|
+
}
|
|
2595
|
+
async function* iterInviteLinks(client, chatId, params) {
|
|
2596
|
+
if (!params) params = {};
|
|
2597
|
+
const { revoked = false, limit = Infinity, chunkSize = 100, admin } = params;
|
|
2598
|
+
let { offset } = params;
|
|
2599
|
+
let current = 0;
|
|
2600
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
2601
|
+
const adminResolved = admin ? await storyViewer.resolvePeer(client, admin) : { _: "inputUserSelf" };
|
|
2602
|
+
for (; ; ) {
|
|
2603
|
+
const links = await getInviteLinks(client, peer, {
|
|
2604
|
+
admin: adminResolved,
|
|
2605
|
+
revoked,
|
|
2606
|
+
limit: Math.min(chunkSize, limit - current),
|
|
2607
|
+
offset
|
|
2608
|
+
});
|
|
2609
|
+
if (!links.length) return;
|
|
2610
|
+
for (const link of links) {
|
|
2611
|
+
yield link;
|
|
2612
|
+
if (++current >= limit) break;
|
|
2613
|
+
}
|
|
2614
|
+
if (!links.next) return;
|
|
2615
|
+
offset = links.next;
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
async function revokeInviteLink(client, chatId, link) {
|
|
2619
|
+
const res = await client.call({
|
|
2620
|
+
_: "messages.editExportedChatInvite",
|
|
2621
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2622
|
+
link: typeof link === "string" ? link : link.link,
|
|
2623
|
+
revoked: true
|
|
2624
|
+
});
|
|
2625
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2626
|
+
const invite = res._ === "messages.exportedChatInviteReplaced" ? res.newInvite : res.invite;
|
|
2627
|
+
return new storyViewer.ChatInviteLink$2(invite, peers);
|
|
2628
|
+
}
|
|
2629
|
+
async function closePoll(client, params) {
|
|
2630
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
2631
|
+
const res = await client.call({
|
|
2632
|
+
_: "messages.editMessage",
|
|
2633
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2634
|
+
id: message,
|
|
2635
|
+
media: {
|
|
2636
|
+
_: "inputMediaPoll",
|
|
2637
|
+
poll: {
|
|
2638
|
+
_: "poll",
|
|
2639
|
+
id: Long.ZERO,
|
|
2640
|
+
closed: true,
|
|
2641
|
+
question: { _: "textWithEntities", text: "", entities: [] },
|
|
2642
|
+
answers: []
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
});
|
|
2646
|
+
storyViewer.assertIsUpdatesGroup("messages.editMessage", res);
|
|
2647
|
+
client.handleClientUpdate(res, !params.shouldDispatch);
|
|
2648
|
+
const upd = res.updates[0];
|
|
2649
|
+
controllablePromise.assertTypeIs("messages.editMessage (@ .updates[0])", upd, "updateMessagePoll");
|
|
2650
|
+
if (!upd.poll) {
|
|
2651
|
+
throw new platform.MtTypeAssertionError("messages.editMessage (@ .updates[0].poll)", "poll", "undefined");
|
|
2652
|
+
}
|
|
2653
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2654
|
+
return new storyViewer.Poll$2(upd.poll, peers, upd.results);
|
|
2655
|
+
}
|
|
2656
|
+
async function deleteScheduledMessages(client, chatId, ids) {
|
|
2657
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
2658
|
+
const res = await client.call({
|
|
2659
|
+
_: "messages.deleteScheduledMessages",
|
|
2660
|
+
peer,
|
|
2661
|
+
id: ids
|
|
2662
|
+
});
|
|
2663
|
+
client.handleClientUpdate(res);
|
|
2664
|
+
}
|
|
2665
|
+
async function deleteMessagesById(client, chatId, ids, params) {
|
|
2666
|
+
const { revoke = true, shouldDispatch } = params ?? {};
|
|
2667
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
2668
|
+
let upd;
|
|
2669
|
+
if (conditionVariable.isInputPeerChannel(peer)) {
|
|
2670
|
+
const channel = conditionVariable.toInputChannel(peer);
|
|
2671
|
+
const res = await client.call({
|
|
2672
|
+
_: "channels.deleteMessages",
|
|
2673
|
+
channel,
|
|
2674
|
+
id: ids
|
|
2675
|
+
});
|
|
2676
|
+
upd = storyViewer.createDummyUpdate(res.pts, res.ptsCount, peer.channelId);
|
|
2677
|
+
} else {
|
|
2678
|
+
const res = await client.call({
|
|
2679
|
+
_: "messages.deleteMessages",
|
|
2680
|
+
id: ids,
|
|
2681
|
+
revoke
|
|
2682
|
+
});
|
|
2683
|
+
upd = storyViewer.createDummyUpdate(res.pts, res.ptsCount);
|
|
2684
|
+
}
|
|
2685
|
+
if (!shouldDispatch) {
|
|
2686
|
+
client.handleClientUpdate(upd);
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
async function deleteMessages(client, messages, params) {
|
|
2690
|
+
if (messages.length === 1) {
|
|
2691
|
+
return deleteMessagesById(client, messages[0].chat.inputPeer, [messages[0].id], params);
|
|
2692
|
+
}
|
|
2693
|
+
const byChat = /* @__PURE__ */ new Map();
|
|
2694
|
+
const byChatScheduled = /* @__PURE__ */ new Map();
|
|
2695
|
+
for (const msg of messages) {
|
|
2696
|
+
const map = msg.isScheduled ? byChatScheduled : byChat;
|
|
2697
|
+
if (!map.has(msg.chat.id)) {
|
|
2698
|
+
map.set(msg.chat.id, [msg.chat.inputPeer, []]);
|
|
2699
|
+
}
|
|
2700
|
+
map.get(msg.chat.id)[1].push(msg.id);
|
|
2701
|
+
}
|
|
2702
|
+
for (const [peer, ids] of byChat.values()) {
|
|
2703
|
+
await deleteMessagesById(client, peer, ids, params);
|
|
2704
|
+
}
|
|
2705
|
+
for (const [peer, ids] of byChatScheduled.values()) {
|
|
2706
|
+
await deleteScheduledMessages(client, peer, ids);
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
async function editInlineMessage(client, params) {
|
|
2710
|
+
let content;
|
|
2711
|
+
let entities;
|
|
2712
|
+
let media;
|
|
2713
|
+
const id = conditionVariable.normalizeInlineId(params.messageId);
|
|
2714
|
+
if (params.media) {
|
|
2715
|
+
media = await storyViewer._normalizeInputMedia(client, params.media, params, true);
|
|
2716
|
+
if ("caption" in params.media && params.media.caption !== void 0) {
|
|
2717
|
+
[content, entities] = await storyViewer._normalizeInputText(client, params.media.caption);
|
|
2718
|
+
}
|
|
2719
|
+
} else if (params.text !== void 0) {
|
|
2720
|
+
[content, entities] = await storyViewer._normalizeInputText(client, params.text);
|
|
2721
|
+
}
|
|
2722
|
+
let retries = 3;
|
|
2723
|
+
while (retries--) {
|
|
2724
|
+
try {
|
|
2725
|
+
await client.call(
|
|
2726
|
+
{
|
|
2727
|
+
_: "messages.editInlineBotMessage",
|
|
2728
|
+
id,
|
|
2729
|
+
noWebpage: params.disableWebPreview,
|
|
2730
|
+
replyMarkup: storyViewer._convertToTl$1(params.replyMarkup),
|
|
2731
|
+
message: content,
|
|
2732
|
+
entities,
|
|
2733
|
+
media,
|
|
2734
|
+
invertMedia: params.invertMedia
|
|
2735
|
+
},
|
|
2736
|
+
{ dcId: id.dcId }
|
|
2737
|
+
);
|
|
2738
|
+
return;
|
|
2739
|
+
} catch (e) {
|
|
2740
|
+
if (tl.tl.RpcError.is(e, "MEDIA_EMPTY")) {
|
|
2741
|
+
continue;
|
|
2742
|
+
}
|
|
2743
|
+
throw e;
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
async function editMessage(client, params) {
|
|
2748
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
2749
|
+
let content;
|
|
2750
|
+
let entities;
|
|
2751
|
+
let media;
|
|
2752
|
+
if (params.media) {
|
|
2753
|
+
media = await storyViewer._normalizeInputMedia(client, params.media, params);
|
|
2754
|
+
if ("caption" in params.media && params.media.caption !== void 0) {
|
|
2755
|
+
[content, entities] = await storyViewer._normalizeInputText(client, params.media.caption);
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
if (params.text !== void 0) {
|
|
2759
|
+
[content, entities] = await storyViewer._normalizeInputText(client, params.text);
|
|
2760
|
+
}
|
|
2761
|
+
const res = await storyViewer._maybeInvokeWithBusinessConnection(client, params.businessConnectionId, {
|
|
2762
|
+
_: "messages.editMessage",
|
|
2763
|
+
id: message,
|
|
2764
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2765
|
+
noWebpage: params.disableWebPreview,
|
|
2766
|
+
replyMarkup: storyViewer._convertToTl$1(params.replyMarkup),
|
|
2767
|
+
message: content,
|
|
2768
|
+
entities,
|
|
2769
|
+
media,
|
|
2770
|
+
invertMedia: params.invertMedia
|
|
2771
|
+
});
|
|
2772
|
+
return storyViewer._findMessageInUpdate(client, res, true, !params.shouldDispatch);
|
|
2773
|
+
}
|
|
2774
|
+
async function forwardMessagesById(client, params) {
|
|
2775
|
+
const { messages, toChatId, fromChatId, silent, schedule, forbidForwards, sendAs, noAuthor, noCaption } = params;
|
|
2776
|
+
if (messages.length > 100) {
|
|
2777
|
+
throw new platform.MtArgumentError("You can forward no more than 100 messages at once");
|
|
2778
|
+
}
|
|
2779
|
+
const toPeer = await storyViewer.resolvePeer(client, toChatId);
|
|
2780
|
+
const res = await client.call({
|
|
2781
|
+
_: "messages.forwardMessages",
|
|
2782
|
+
toPeer,
|
|
2783
|
+
fromPeer: await storyViewer.resolvePeer(client, fromChatId),
|
|
2784
|
+
id: messages,
|
|
2785
|
+
silent,
|
|
2786
|
+
scheduleDate: conditionVariable.normalizeDate(schedule),
|
|
2787
|
+
randomId: Array.from({ length: messages.length }, () => conditionVariable.randomLong()),
|
|
2788
|
+
dropAuthor: noAuthor,
|
|
2789
|
+
dropMediaCaptions: noCaption,
|
|
2790
|
+
noforwards: forbidForwards,
|
|
2791
|
+
sendAs: sendAs ? await storyViewer.resolvePeer(client, sendAs) : void 0,
|
|
2792
|
+
quickReplyShortcut: storyViewer._normalizeQuickReplyShortcut(params.quickReply)
|
|
2793
|
+
});
|
|
2794
|
+
storyViewer.assertIsUpdatesGroup("messages.forwardMessages", res);
|
|
2795
|
+
client.handleClientUpdate(res, !params.shouldDispatch);
|
|
2796
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2797
|
+
const forwarded = [];
|
|
2798
|
+
res.updates.forEach((upd) => {
|
|
2799
|
+
switch (upd._) {
|
|
2800
|
+
case "updateNewMessage":
|
|
2801
|
+
case "updateNewChannelMessage":
|
|
2802
|
+
case "updateNewScheduledMessage":
|
|
2803
|
+
forwarded.push(new storyViewer.Message$2(upd.message, peers, upd._ === "updateNewScheduledMessage"));
|
|
2804
|
+
break;
|
|
2805
|
+
}
|
|
2806
|
+
});
|
|
2807
|
+
return forwarded;
|
|
2808
|
+
}
|
|
2809
|
+
async function forwardMessages(client, params) {
|
|
2810
|
+
const { messages, ...rest } = params;
|
|
2811
|
+
return forwardMessagesById(client, {
|
|
2812
|
+
...rest,
|
|
2813
|
+
fromChatId: messages[0].chat.inputPeer,
|
|
2814
|
+
messages: messages.map((it) => it.id)
|
|
2815
|
+
});
|
|
2816
|
+
}
|
|
2817
|
+
async function getAllScheduledMessages(client, chatId) {
|
|
2818
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
2819
|
+
const res = await client.call({
|
|
2820
|
+
_: "messages.getScheduledHistory",
|
|
2821
|
+
peer,
|
|
2822
|
+
hash: Long.ZERO
|
|
2823
|
+
});
|
|
2824
|
+
controllablePromise.assertTypeIsNot("getScheduledMessages", res, "messages.messagesNotModified");
|
|
2825
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2826
|
+
const ret = res.messages.map((msg) => {
|
|
2827
|
+
controllablePromise.assertTypeIsNot("getScheduledMessages", msg, "messageEmpty");
|
|
2828
|
+
return new storyViewer.Message$2(msg, peers, true);
|
|
2829
|
+
});
|
|
2830
|
+
return ret;
|
|
2831
|
+
}
|
|
2832
|
+
async function getAvailableMessageEffects(client) {
|
|
2833
|
+
const res = await client.call({
|
|
2834
|
+
_: "messages.getAvailableEffects",
|
|
2835
|
+
hash: 0
|
|
2836
|
+
});
|
|
2837
|
+
controllablePromise.assertTypeIsNot("getAvailableMessageEffects", res, "messages.availableEffectsNotModified");
|
|
2838
|
+
const documentsMap = new conditionVariable.LongMap();
|
|
2839
|
+
for (const doc of res.documents) {
|
|
2840
|
+
if (doc._ !== "document") continue;
|
|
2841
|
+
documentsMap.set(doc.id, doc);
|
|
2842
|
+
}
|
|
2843
|
+
return res.effects.map((effect) => new storyViewer.MessageEffect$2(effect, documentsMap));
|
|
2844
|
+
}
|
|
2845
|
+
async function getCallbackQueryMessage(client, id) {
|
|
2846
|
+
let msgId;
|
|
2847
|
+
let queryId;
|
|
2848
|
+
let peer;
|
|
2849
|
+
if ("_" in id) {
|
|
2850
|
+
msgId = id.msgId;
|
|
2851
|
+
queryId = id.queryId;
|
|
2852
|
+
peer = await storyViewer.resolvePeer(client, id.peer);
|
|
2853
|
+
} else if ("raw" in id) {
|
|
2854
|
+
msgId = id.messageId;
|
|
2855
|
+
queryId = id.id;
|
|
2856
|
+
peer = id.chat.inputPeer;
|
|
2857
|
+
} else {
|
|
2858
|
+
msgId = id.messageId;
|
|
2859
|
+
queryId = id.queryId;
|
|
2860
|
+
peer = await storyViewer.resolvePeer(client, id.peer);
|
|
2861
|
+
}
|
|
2862
|
+
const inputMessage = {
|
|
2863
|
+
_: "inputMessageCallbackQuery",
|
|
2864
|
+
id: msgId,
|
|
2865
|
+
queryId
|
|
2866
|
+
};
|
|
2867
|
+
const isChannel = conditionVariable.isInputPeerChannel(peer);
|
|
2868
|
+
const res = await client.call(
|
|
2869
|
+
isChannel ? {
|
|
2870
|
+
_: "channels.getMessages",
|
|
2871
|
+
id: [inputMessage],
|
|
2872
|
+
channel: conditionVariable.toInputChannel(peer)
|
|
2873
|
+
} : {
|
|
2874
|
+
_: "messages.getMessages",
|
|
2875
|
+
id: [inputMessage]
|
|
2876
|
+
}
|
|
2877
|
+
);
|
|
2878
|
+
controllablePromise.assertTypeIsNot("getCallbackQueryMessage", res, "messages.messagesNotModified");
|
|
2879
|
+
if (res.messages[0]._ === "messageEmpty") {
|
|
2880
|
+
return null;
|
|
2881
|
+
}
|
|
2882
|
+
return new storyViewer.Message$2(res.messages[0], peersIndex.PeersIndex.from(res));
|
|
2883
|
+
}
|
|
2884
|
+
async function getFactCheck(client, chatId, msgIds) {
|
|
2885
|
+
const res = await client.call({
|
|
2886
|
+
_: "messages.getFactCheck",
|
|
2887
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2888
|
+
msgId: Array.isArray(msgIds) ? msgIds : [msgIds]
|
|
2889
|
+
});
|
|
2890
|
+
return res.map((x) => {
|
|
2891
|
+
if (x.hash.isZero()) {
|
|
2892
|
+
return null;
|
|
2893
|
+
}
|
|
2894
|
+
return new storyViewer.FactCheck$2(x);
|
|
2895
|
+
});
|
|
2896
|
+
}
|
|
2897
|
+
const defaultOffset$2 = {
|
|
2898
|
+
id: 0,
|
|
2899
|
+
date: 0
|
|
2900
|
+
};
|
|
2901
|
+
const defaultOffsetReverse = {
|
|
2902
|
+
id: 1,
|
|
2903
|
+
date: 0
|
|
2904
|
+
};
|
|
2905
|
+
async function getHistory(client, chatId, params) {
|
|
2906
|
+
if (!params) params = {};
|
|
2907
|
+
const {
|
|
2908
|
+
reverse = false,
|
|
2909
|
+
limit = 100,
|
|
2910
|
+
offset: { id: offsetId, date: offsetDate } = reverse ? defaultOffsetReverse : defaultOffset$2,
|
|
2911
|
+
addOffset = 0,
|
|
2912
|
+
minId = 0,
|
|
2913
|
+
maxId = 0
|
|
2914
|
+
} = params;
|
|
2915
|
+
const addOffsetAdjusted = addOffset + (reverse ? -limit : 0);
|
|
2916
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
2917
|
+
const res = await client.call({
|
|
2918
|
+
_: "messages.getHistory",
|
|
2919
|
+
peer,
|
|
2920
|
+
offsetId,
|
|
2921
|
+
offsetDate,
|
|
2922
|
+
addOffset: addOffsetAdjusted,
|
|
2923
|
+
limit,
|
|
2924
|
+
maxId,
|
|
2925
|
+
minId,
|
|
2926
|
+
hash: Long.ZERO
|
|
2927
|
+
});
|
|
2928
|
+
controllablePromise.assertTypeIsNot("getHistory", res, "messages.messagesNotModified");
|
|
2929
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2930
|
+
const msgs = res.messages.filter((msg) => msg._ !== "messageEmpty").map((msg) => new storyViewer.Message$2(msg, peers));
|
|
2931
|
+
if (reverse) msgs.reverse();
|
|
2932
|
+
const last = msgs[msgs.length - 1];
|
|
2933
|
+
const next = last ? {
|
|
2934
|
+
id: last.id + (reverse ? 1 : 0),
|
|
2935
|
+
date: last.raw.date
|
|
2936
|
+
} : void 0;
|
|
2937
|
+
return conditionVariable.makeArrayPaginated(msgs, res.count ?? msgs.length, next);
|
|
2938
|
+
}
|
|
2939
|
+
async function getMessageByLink(client, link) {
|
|
2940
|
+
const parsed = chat.message.parse(link);
|
|
2941
|
+
if (!parsed) {
|
|
2942
|
+
throw new platform.MtArgumentError(`Invalid message link: ${link}`);
|
|
2943
|
+
}
|
|
2944
|
+
let peer;
|
|
2945
|
+
if ("username" in parsed) {
|
|
2946
|
+
peer = await storyViewer.resolvePeer(client, parsed.username);
|
|
2947
|
+
} else {
|
|
2948
|
+
peer = await storyViewer.resolvePeer(client, conditionVariable.toggleChannelIdMark(parsed.channelId));
|
|
2949
|
+
}
|
|
2950
|
+
let msgId = parsed.id;
|
|
2951
|
+
if (parsed.commentId) {
|
|
2952
|
+
[peer] = await storyViewer._getDiscussionMessage(client, peer, parsed.id);
|
|
2953
|
+
msgId = parsed.commentId;
|
|
2954
|
+
}
|
|
2955
|
+
const [msg] = await storyViewer.getMessages(client, peer, msgId);
|
|
2956
|
+
return msg;
|
|
2957
|
+
}
|
|
2958
|
+
async function getMessageGroup(client, params) {
|
|
2959
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
2960
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
2961
|
+
const delta = conditionVariable.isInputPeerChannel(peer) ? 9 : 19;
|
|
2962
|
+
const ids = [];
|
|
2963
|
+
for (let i = Math.max(message - delta, 0); i <= message + delta; i++) {
|
|
2964
|
+
ids.push(i);
|
|
2965
|
+
}
|
|
2966
|
+
const messages = await storyViewer.getMessages(client, chatId, ids);
|
|
2967
|
+
const groupedId = messages.find((it) => it?.id === message).groupedId;
|
|
2968
|
+
if (!groupedId) throw new platform.MtArgumentError("This message is not grouped");
|
|
2969
|
+
return messages.filter(controllablePromise.isPresent).filter((it) => it.groupedId?.eq(groupedId));
|
|
2970
|
+
}
|
|
2971
|
+
async function getMessageReactionsById(client, chatId, messages) {
|
|
2972
|
+
const res = await client.call({
|
|
2973
|
+
_: "messages.getMessagesReactions",
|
|
2974
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
2975
|
+
id: messages
|
|
2976
|
+
});
|
|
2977
|
+
storyViewer.assertIsUpdatesGroup("messages.getMessagesReactions", res);
|
|
2978
|
+
client.handleClientUpdate(res);
|
|
2979
|
+
const index = {};
|
|
2980
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
2981
|
+
for (const update of res.updates) {
|
|
2982
|
+
controllablePromise.assertTypeIs("messages.getMessagesReactions", update, "updateMessageReactions");
|
|
2983
|
+
index[update.msgId] = new storyViewer.MessageReactions$2(update.msgId, conditionVariable.getMarkedPeerId(update.peer), update.reactions, peers);
|
|
2984
|
+
}
|
|
2985
|
+
return messages.map((messageId) => index[messageId] ?? null);
|
|
2986
|
+
}
|
|
2987
|
+
async function getMessageReactions(client, messages) {
|
|
2988
|
+
return getMessageReactionsById(
|
|
2989
|
+
client,
|
|
2990
|
+
messages[0].chat.inputPeer,
|
|
2991
|
+
messages.map((it) => it.id)
|
|
2992
|
+
);
|
|
2993
|
+
}
|
|
2994
|
+
async function getMessagesUnsafe(client, messageIds, fromReply = false) {
|
|
2995
|
+
if (!Array.isArray(messageIds)) messageIds = [messageIds];
|
|
2996
|
+
const type = fromReply ? "inputMessageReplyTo" : "inputMessageID";
|
|
2997
|
+
const ids = messageIds.map((it) => ({
|
|
2998
|
+
_: type,
|
|
2999
|
+
id: it
|
|
3000
|
+
}));
|
|
3001
|
+
const res = await client.call({
|
|
3002
|
+
_: "messages.getMessages",
|
|
3003
|
+
id: ids
|
|
3004
|
+
});
|
|
3005
|
+
controllablePromise.assertTypeIsNot("getMessagesUnsafe", res, "messages.messagesNotModified");
|
|
3006
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3007
|
+
return res.messages.map((msg) => {
|
|
3008
|
+
if (msg._ === "messageEmpty") return null;
|
|
3009
|
+
return new storyViewer.Message$2(msg, peers);
|
|
3010
|
+
});
|
|
3011
|
+
}
|
|
3012
|
+
async function getReactionUsers(client, params) {
|
|
3013
|
+
const { limit = 100, offset, emoji } = params;
|
|
3014
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
3015
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
3016
|
+
const reaction = storyViewer.normalizeInputReaction(emoji);
|
|
3017
|
+
const res = await client.call({
|
|
3018
|
+
_: "messages.getMessageReactionsList",
|
|
3019
|
+
peer,
|
|
3020
|
+
id: message,
|
|
3021
|
+
reaction,
|
|
3022
|
+
limit,
|
|
3023
|
+
offset
|
|
3024
|
+
});
|
|
3025
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3026
|
+
return conditionVariable.makeArrayPaginated(
|
|
3027
|
+
res.reactions.map((it) => new storyViewer.PeerReaction$2(it, peers)),
|
|
3028
|
+
res.count,
|
|
3029
|
+
res.nextOffset
|
|
3030
|
+
);
|
|
3031
|
+
}
|
|
3032
|
+
async function getReplyTo(client, message) {
|
|
3033
|
+
if (!message.replyToMessage?.id) {
|
|
3034
|
+
return null;
|
|
3035
|
+
}
|
|
3036
|
+
if (message.raw.peerId._ === "peerChannel") {
|
|
3037
|
+
const [msg2] = await storyViewer.getMessages(client, message.chat.inputPeer, message.id, true);
|
|
3038
|
+
return msg2;
|
|
3039
|
+
}
|
|
3040
|
+
const [msg] = await getMessagesUnsafe(client, message.id, true);
|
|
3041
|
+
return msg;
|
|
3042
|
+
}
|
|
3043
|
+
async function getScheduledMessages(client, chatId, messageIds) {
|
|
3044
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
3045
|
+
if (!Array.isArray(messageIds)) messageIds = [messageIds];
|
|
3046
|
+
const res = await client.call({
|
|
3047
|
+
_: "messages.getScheduledMessages",
|
|
3048
|
+
peer,
|
|
3049
|
+
id: messageIds
|
|
3050
|
+
});
|
|
3051
|
+
controllablePromise.assertTypeIsNot("getScheduledMessages", res, "messages.messagesNotModified");
|
|
3052
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3053
|
+
const ret = res.messages.map((msg) => {
|
|
3054
|
+
if (msg._ === "messageEmpty") return null;
|
|
3055
|
+
return new storyViewer.Message$2(msg, peers, true);
|
|
3056
|
+
});
|
|
3057
|
+
return ret;
|
|
3058
|
+
}
|
|
3059
|
+
async function* iterHistory(client, chatId, params) {
|
|
3060
|
+
if (!params) params = {};
|
|
3061
|
+
const { limit = Infinity, chunkSize = 100, minId = 0, maxId = 0, reverse = false } = params;
|
|
3062
|
+
let { offset, addOffset = 0 } = params;
|
|
3063
|
+
let current = 0;
|
|
3064
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
3065
|
+
for (; ; ) {
|
|
3066
|
+
const res = await getHistory(client, peer, {
|
|
3067
|
+
offset,
|
|
3068
|
+
addOffset,
|
|
3069
|
+
limit: Math.min(chunkSize, limit - current),
|
|
3070
|
+
maxId,
|
|
3071
|
+
minId,
|
|
3072
|
+
reverse
|
|
3073
|
+
});
|
|
3074
|
+
for (const msg of res) {
|
|
3075
|
+
yield msg;
|
|
3076
|
+
if (++current >= limit) return;
|
|
3077
|
+
}
|
|
3078
|
+
if (!res.next) return;
|
|
3079
|
+
offset = res.next;
|
|
3080
|
+
addOffset = 0;
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
async function* iterReactionUsers(client, params) {
|
|
3084
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
3085
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
3086
|
+
const { limit = Infinity, chunkSize = 100 } = params;
|
|
3087
|
+
let current = 0;
|
|
3088
|
+
let { offset } = params;
|
|
3089
|
+
const reaction = storyViewer.normalizeInputReaction(params.emoji);
|
|
3090
|
+
for (; ; ) {
|
|
3091
|
+
const res = await getReactionUsers(client, {
|
|
3092
|
+
chatId: peer,
|
|
3093
|
+
message,
|
|
3094
|
+
emoji: reaction,
|
|
3095
|
+
limit: Math.min(chunkSize, limit - current),
|
|
3096
|
+
offset
|
|
3097
|
+
});
|
|
3098
|
+
offset = res.next;
|
|
3099
|
+
for (const reaction2 of res) {
|
|
3100
|
+
yield reaction2;
|
|
3101
|
+
if (++current >= limit) break;
|
|
3102
|
+
}
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
const defaultOffset$1 = {
|
|
3106
|
+
rate: 0,
|
|
3107
|
+
peer: { _: "inputPeerEmpty" },
|
|
3108
|
+
id: 0
|
|
3109
|
+
};
|
|
3110
|
+
async function searchGlobal(client, params) {
|
|
3111
|
+
if (!params) params = {};
|
|
3112
|
+
const {
|
|
3113
|
+
query = "",
|
|
3114
|
+
filter = storyViewer.SearchFilters.Empty,
|
|
3115
|
+
limit = 100,
|
|
3116
|
+
offset: { rate: offsetRate, peer: offsetPeer, id: offsetId } = defaultOffset$1,
|
|
3117
|
+
onlyChannels
|
|
3118
|
+
} = params;
|
|
3119
|
+
const minDate = conditionVariable.normalizeDate(params.minDate) ?? 0;
|
|
3120
|
+
const maxDate = conditionVariable.normalizeDate(params.maxDate) ?? 0;
|
|
3121
|
+
const res = await client.call({
|
|
3122
|
+
_: "messages.searchGlobal",
|
|
3123
|
+
q: query,
|
|
3124
|
+
filter,
|
|
3125
|
+
minDate,
|
|
3126
|
+
maxDate,
|
|
3127
|
+
offsetId,
|
|
3128
|
+
offsetRate,
|
|
3129
|
+
offsetPeer,
|
|
3130
|
+
limit,
|
|
3131
|
+
broadcastsOnly: onlyChannels
|
|
3132
|
+
});
|
|
3133
|
+
controllablePromise.assertTypeIsNot("searchGlobal", res, "messages.messagesNotModified");
|
|
3134
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3135
|
+
const msgs = res.messages.filter((msg) => msg._ !== "messageEmpty").map((msg) => new storyViewer.Message$2(msg, peers));
|
|
3136
|
+
const last = msgs[msgs.length - 1];
|
|
3137
|
+
const next = last ? {
|
|
3138
|
+
rate: res.nextRate ?? last.raw.date,
|
|
3139
|
+
peer: last.chat.inputPeer,
|
|
3140
|
+
id: last.id
|
|
3141
|
+
} : void 0;
|
|
3142
|
+
return conditionVariable.makeArrayPaginated(msgs, res.count ?? msgs.length, next);
|
|
3143
|
+
}
|
|
3144
|
+
async function* iterSearchGlobal(client, params) {
|
|
3145
|
+
if (!params) params = {};
|
|
3146
|
+
const { query = "", filter = storyViewer.SearchFilters.Empty, limit = Infinity, chunkSize = 100, onlyChannels } = params;
|
|
3147
|
+
const minDate = conditionVariable.normalizeDate(params.minDate) ?? 0;
|
|
3148
|
+
const maxDate = conditionVariable.normalizeDate(params.maxDate) ?? 0;
|
|
3149
|
+
let { offset } = params;
|
|
3150
|
+
let current = 0;
|
|
3151
|
+
for (; ; ) {
|
|
3152
|
+
const res = await searchGlobal(client, {
|
|
3153
|
+
query,
|
|
3154
|
+
filter,
|
|
3155
|
+
limit: Math.min(chunkSize, limit - current),
|
|
3156
|
+
minDate,
|
|
3157
|
+
maxDate,
|
|
3158
|
+
offset,
|
|
3159
|
+
onlyChannels
|
|
3160
|
+
});
|
|
3161
|
+
if (!res.length) return;
|
|
3162
|
+
for (const msg of res) {
|
|
3163
|
+
yield msg;
|
|
3164
|
+
if (++current >= limit) return;
|
|
3165
|
+
}
|
|
3166
|
+
if (!res.next) return;
|
|
3167
|
+
offset = res.next;
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
async function searchMessages(client, params) {
|
|
3171
|
+
if (!params) params = {};
|
|
3172
|
+
const {
|
|
3173
|
+
query = "",
|
|
3174
|
+
chatId = { _: "inputPeerEmpty" },
|
|
3175
|
+
offset = 0,
|
|
3176
|
+
addOffset = 0,
|
|
3177
|
+
minId = 0,
|
|
3178
|
+
maxId = 0,
|
|
3179
|
+
threadId,
|
|
3180
|
+
limit = 100,
|
|
3181
|
+
filter = storyViewer.SearchFilters.Empty
|
|
3182
|
+
} = params;
|
|
3183
|
+
const minDate = conditionVariable.normalizeDate(params.minDate) ?? 0;
|
|
3184
|
+
const maxDate = conditionVariable.normalizeDate(params.maxDate) ?? 0;
|
|
3185
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
3186
|
+
const fromUser = params.fromUser ? await storyViewer.resolvePeer(client, params.fromUser) : void 0;
|
|
3187
|
+
const res = await client.call({
|
|
3188
|
+
_: "messages.search",
|
|
3189
|
+
peer,
|
|
3190
|
+
q: query,
|
|
3191
|
+
filter,
|
|
3192
|
+
minDate,
|
|
3193
|
+
maxDate,
|
|
3194
|
+
offsetId: offset,
|
|
3195
|
+
addOffset,
|
|
3196
|
+
limit,
|
|
3197
|
+
minId,
|
|
3198
|
+
maxId,
|
|
3199
|
+
fromId: fromUser,
|
|
3200
|
+
topMsgId: threadId,
|
|
3201
|
+
hash: Long.ZERO
|
|
3202
|
+
});
|
|
3203
|
+
controllablePromise.assertTypeIsNot("searchMessages", res, "messages.messagesNotModified");
|
|
3204
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3205
|
+
const msgs = res.messages.filter((msg) => msg._ !== "messageEmpty").map((msg) => new storyViewer.Message$2(msg, peers));
|
|
3206
|
+
const last = msgs[msgs.length - 1];
|
|
3207
|
+
const next = last ? last.id : void 0;
|
|
3208
|
+
return conditionVariable.makeArrayPaginated(msgs, res.count ?? msgs.length, next);
|
|
3209
|
+
}
|
|
3210
|
+
async function* iterSearchMessages(client, params) {
|
|
3211
|
+
if (!params) params = {};
|
|
3212
|
+
const {
|
|
3213
|
+
query = "",
|
|
3214
|
+
chatId = { _: "inputPeerEmpty" },
|
|
3215
|
+
minId = 0,
|
|
3216
|
+
maxId = 0,
|
|
3217
|
+
threadId,
|
|
3218
|
+
limit = Infinity,
|
|
3219
|
+
chunkSize = 100,
|
|
3220
|
+
filter = storyViewer.SearchFilters.Empty
|
|
3221
|
+
} = params;
|
|
3222
|
+
const minDate = conditionVariable.normalizeDate(params.minDate) ?? 0;
|
|
3223
|
+
const maxDate = conditionVariable.normalizeDate(params.maxDate) ?? 0;
|
|
3224
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
3225
|
+
const fromUser = params.fromUser ? await storyViewer.resolvePeer(client, params.fromUser) : void 0;
|
|
3226
|
+
let { offset, addOffset } = params;
|
|
3227
|
+
let current = 0;
|
|
3228
|
+
for (; ; ) {
|
|
3229
|
+
const res = await searchMessages(client, {
|
|
3230
|
+
query,
|
|
3231
|
+
chatId: peer,
|
|
3232
|
+
offset,
|
|
3233
|
+
addOffset,
|
|
3234
|
+
minId,
|
|
3235
|
+
maxId,
|
|
3236
|
+
threadId,
|
|
3237
|
+
filter,
|
|
3238
|
+
fromUser,
|
|
3239
|
+
minDate,
|
|
3240
|
+
maxDate,
|
|
3241
|
+
limit: Math.min(chunkSize, limit - current)
|
|
3242
|
+
});
|
|
3243
|
+
if (!res.length) break;
|
|
3244
|
+
for (const msg of res) {
|
|
3245
|
+
yield msg;
|
|
3246
|
+
if (++current >= limit) return;
|
|
3247
|
+
}
|
|
3248
|
+
if (!res.next) break;
|
|
3249
|
+
offset = res.next;
|
|
3250
|
+
addOffset = void 0;
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
async function pinMessage(client, params) {
|
|
3254
|
+
const { notify, bothSides, shouldDispatch } = params ?? {};
|
|
3255
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
3256
|
+
const res = await client.call({
|
|
3257
|
+
_: "messages.updatePinnedMessage",
|
|
3258
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
3259
|
+
id: message,
|
|
3260
|
+
silent: !notify,
|
|
3261
|
+
pmOneside: !bothSides
|
|
3262
|
+
});
|
|
3263
|
+
return storyViewer._findMessageInUpdate(client, res, false, !shouldDispatch, true);
|
|
3264
|
+
}
|
|
3265
|
+
async function readReactions(client, chatId, params) {
|
|
3266
|
+
const { shouldDispatch } = params ?? {};
|
|
3267
|
+
const res = await client.call({
|
|
3268
|
+
_: "messages.readReactions",
|
|
3269
|
+
peer: await storyViewer.resolvePeer(client, chatId)
|
|
3270
|
+
});
|
|
3271
|
+
if (!shouldDispatch) {
|
|
3272
|
+
client.handleClientUpdate(storyViewer.createDummyUpdate(res.pts, res.ptsCount));
|
|
3273
|
+
}
|
|
3274
|
+
}
|
|
3275
|
+
const defaultOffset = {
|
|
3276
|
+
rate: 0,
|
|
3277
|
+
peer: { _: "inputPeerEmpty" },
|
|
3278
|
+
id: 0
|
|
3279
|
+
};
|
|
3280
|
+
async function searchHashtag(client, hashtag, params) {
|
|
3281
|
+
const { offset: { rate: offsetRate, peer: offsetPeer, id: offsetId } = defaultOffset, limit = 100 } = params ?? {};
|
|
3282
|
+
const res = await client.call({
|
|
3283
|
+
_: "channels.searchPosts",
|
|
3284
|
+
hashtag,
|
|
3285
|
+
offsetId,
|
|
3286
|
+
offsetRate,
|
|
3287
|
+
offsetPeer,
|
|
3288
|
+
limit
|
|
3289
|
+
});
|
|
3290
|
+
controllablePromise.assertTypeIsNot("searchHashtag", res, "messages.messagesNotModified");
|
|
3291
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3292
|
+
const msgs = res.messages.filter((msg) => msg._ !== "messageEmpty").map((msg) => new storyViewer.Message$2(msg, peers));
|
|
3293
|
+
const last = msgs[msgs.length - 1];
|
|
3294
|
+
const next = last ? {
|
|
3295
|
+
rate: res.nextRate ?? last.raw.date,
|
|
3296
|
+
peer: last.chat.inputPeer,
|
|
3297
|
+
id: last.id
|
|
3298
|
+
} : void 0;
|
|
3299
|
+
return conditionVariable.makeArrayPaginated(msgs, res.count ?? msgs.length, next);
|
|
3300
|
+
}
|
|
3301
|
+
async function* iterSearchHashtag(client, hashtag, params) {
|
|
3302
|
+
if (!params) params = {};
|
|
3303
|
+
const { limit = Infinity, chunkSize = 100 } = params;
|
|
3304
|
+
let { offset } = params;
|
|
3305
|
+
let current = 0;
|
|
3306
|
+
for (; ; ) {
|
|
3307
|
+
const res = await searchHashtag(client, hashtag, {
|
|
3308
|
+
offset,
|
|
3309
|
+
limit: Math.min(chunkSize, limit - current)
|
|
3310
|
+
});
|
|
3311
|
+
if (!res.length) return;
|
|
3312
|
+
for (const msg of res) {
|
|
3313
|
+
yield msg;
|
|
3314
|
+
if (++current >= limit) return;
|
|
3315
|
+
}
|
|
3316
|
+
if (!res.next) return;
|
|
3317
|
+
offset = res.next;
|
|
3318
|
+
}
|
|
3319
|
+
}
|
|
3320
|
+
function answerText(client, message, ...params) {
|
|
3321
|
+
if (!message.isTopicMessage || !message.replyToMessage?.threadId) {
|
|
3322
|
+
return storyViewer.sendText(client, message.chat.inputPeer, ...params);
|
|
3323
|
+
}
|
|
3324
|
+
const [text, params_ = {}] = params;
|
|
3325
|
+
params_.replyTo = message.replyToMessage.threadId;
|
|
3326
|
+
return storyViewer.sendText(client, message.chat.inputPeer, text, params_);
|
|
3327
|
+
}
|
|
3328
|
+
function answerMedia(client, message, ...params) {
|
|
3329
|
+
if (!message.isTopicMessage || !message.replyToMessage?.threadId) {
|
|
3330
|
+
return storyViewer.sendMedia(client, message.chat.inputPeer, ...params);
|
|
3331
|
+
}
|
|
3332
|
+
const [media, params_ = {}] = params;
|
|
3333
|
+
params_.replyTo = message.replyToMessage.threadId;
|
|
3334
|
+
return storyViewer.sendMedia(client, message.chat.inputPeer, media, params_);
|
|
3335
|
+
}
|
|
3336
|
+
function answerMediaGroup(client, message, ...params) {
|
|
3337
|
+
if (!message.isTopicMessage || !message.replyToMessage?.threadId) {
|
|
3338
|
+
return storyViewer.sendMediaGroup(client, message.chat.inputPeer, ...params);
|
|
3339
|
+
}
|
|
3340
|
+
const [media, params_ = {}] = params;
|
|
3341
|
+
params_.replyTo = message.replyToMessage.threadId;
|
|
3342
|
+
return storyViewer.sendMediaGroup(client, message.chat.inputPeer, media, params_);
|
|
3343
|
+
}
|
|
3344
|
+
function replyText(client, message, ...params) {
|
|
3345
|
+
const [text, params_ = {}] = params;
|
|
3346
|
+
params_.replyTo = message.id;
|
|
3347
|
+
return storyViewer.sendText(client, message.chat.inputPeer, text, params_);
|
|
3348
|
+
}
|
|
3349
|
+
function replyMedia(client, message, ...params) {
|
|
3350
|
+
const [media, params_ = {}] = params;
|
|
3351
|
+
params_.replyTo = message.id;
|
|
3352
|
+
return storyViewer.sendMedia(client, message.chat.inputPeer, media, params_);
|
|
3353
|
+
}
|
|
3354
|
+
function replyMediaGroup(client, message, ...params) {
|
|
3355
|
+
const [media, params_ = {}] = params;
|
|
3356
|
+
params_.replyTo = message.id;
|
|
3357
|
+
return storyViewer.sendMediaGroup(client, message.chat.inputPeer, media, params_);
|
|
3358
|
+
}
|
|
3359
|
+
function commentText(client, message, ...params) {
|
|
3360
|
+
if (message.chat.chatType !== "channel") {
|
|
3361
|
+
return replyText(client, message, ...params);
|
|
3362
|
+
}
|
|
3363
|
+
if (!message.replies || !message.replies.hasComments) {
|
|
3364
|
+
throw new platform.MtArgumentError("This message does not have comments section");
|
|
3365
|
+
}
|
|
3366
|
+
const [text, params_ = {}] = params;
|
|
3367
|
+
params_.commentTo = message.id;
|
|
3368
|
+
return storyViewer.sendText(client, message.chat.inputPeer, text, params_);
|
|
3369
|
+
}
|
|
3370
|
+
function commentMedia(client, message, ...params) {
|
|
3371
|
+
if (message.chat.chatType !== "channel") {
|
|
3372
|
+
return replyMedia(client, message, ...params);
|
|
3373
|
+
}
|
|
3374
|
+
if (!message.replies || !message.replies.hasComments) {
|
|
3375
|
+
throw new platform.MtArgumentError("This message does not have comments section");
|
|
3376
|
+
}
|
|
3377
|
+
const [media, params_ = {}] = params;
|
|
3378
|
+
params_.commentTo = message.id;
|
|
3379
|
+
return storyViewer.sendMedia(client, message.chat.inputPeer, media, params_);
|
|
3380
|
+
}
|
|
3381
|
+
function commentMediaGroup(client, message, ...params) {
|
|
3382
|
+
if (message.chat.chatType !== "channel") {
|
|
3383
|
+
return replyMediaGroup(client, message, ...params);
|
|
3384
|
+
}
|
|
3385
|
+
if (!message.replies || !message.replies.hasComments) {
|
|
3386
|
+
throw new platform.MtArgumentError("This message does not have comments section");
|
|
3387
|
+
}
|
|
3388
|
+
const [media, params_ = {}] = params;
|
|
3389
|
+
params_.commentTo = message.id;
|
|
3390
|
+
return storyViewer.sendMediaGroup(client, message.chat.inputPeer, media, params_);
|
|
3391
|
+
}
|
|
3392
|
+
async function sendCopyGroup(client, params) {
|
|
3393
|
+
const { toChatId, ...rest } = params;
|
|
3394
|
+
let msgs;
|
|
3395
|
+
if ("fromChatId" in params) {
|
|
3396
|
+
const fromPeer = await storyViewer.resolvePeer(client, params.fromChatId);
|
|
3397
|
+
msgs = await storyViewer.getMessages(client, fromPeer, params.messages).then((r) => r.filter(controllablePromise.isPresent));
|
|
3398
|
+
} else {
|
|
3399
|
+
msgs = params.messages;
|
|
3400
|
+
}
|
|
3401
|
+
const messageGroupId = msgs[0].groupedId;
|
|
3402
|
+
for (let i = 1; i < msgs.length; i++) {
|
|
3403
|
+
if (!msgs[i].groupedId?.eq(messageGroupId) || !msgs[i].media) {
|
|
3404
|
+
throw new platform.MtArgumentError("All messages must be in the same message group");
|
|
3405
|
+
}
|
|
3406
|
+
}
|
|
3407
|
+
return storyViewer.sendMediaGroup(
|
|
3408
|
+
client,
|
|
3409
|
+
toChatId,
|
|
3410
|
+
msgs.map((msg) => {
|
|
3411
|
+
const raw = msg.raw;
|
|
3412
|
+
return {
|
|
3413
|
+
type: "auto",
|
|
3414
|
+
file: msg.media.inputMedia,
|
|
3415
|
+
caption: raw.message,
|
|
3416
|
+
entities: raw.entities
|
|
3417
|
+
};
|
|
3418
|
+
}),
|
|
3419
|
+
rest
|
|
3420
|
+
);
|
|
3421
|
+
}
|
|
3422
|
+
async function sendCopy(client, params) {
|
|
3423
|
+
const { toChatId, ...rest } = params;
|
|
3424
|
+
let msg;
|
|
3425
|
+
if ("fromChatId" in params) {
|
|
3426
|
+
const fromPeer = await storyViewer.resolvePeer(client, params.fromChatId);
|
|
3427
|
+
[msg] = await storyViewer.getMessages(client, fromPeer, params.message);
|
|
3428
|
+
if (!msg) {
|
|
3429
|
+
throw new controllablePromise.MtMessageNotFoundError(conditionVariable.getMarkedPeerId(fromPeer), params.message, "to copy");
|
|
3430
|
+
}
|
|
3431
|
+
} else {
|
|
3432
|
+
msg = params.message;
|
|
3433
|
+
}
|
|
3434
|
+
if (msg.raw._ === "messageService") {
|
|
3435
|
+
throw new platform.MtArgumentError("Service messages can't be copied");
|
|
3436
|
+
}
|
|
3437
|
+
if (msg.media && msg.media.type !== "webpage" && msg.media.type !== "invoice") {
|
|
3438
|
+
let caption = params.caption;
|
|
3439
|
+
if (!caption) {
|
|
3440
|
+
if (msg.raw.entities?.length) {
|
|
3441
|
+
caption = {
|
|
3442
|
+
text: msg.raw.message,
|
|
3443
|
+
entities: msg.raw.entities
|
|
3444
|
+
};
|
|
3445
|
+
} else {
|
|
3446
|
+
caption = msg.raw.message;
|
|
3447
|
+
}
|
|
3448
|
+
}
|
|
3449
|
+
return storyViewer.sendMedia(
|
|
3450
|
+
client,
|
|
3451
|
+
toChatId,
|
|
3452
|
+
{
|
|
3453
|
+
type: "auto",
|
|
3454
|
+
file: msg.media.inputMedia,
|
|
3455
|
+
caption
|
|
3456
|
+
},
|
|
3457
|
+
rest
|
|
3458
|
+
);
|
|
3459
|
+
}
|
|
3460
|
+
return storyViewer.sendText(client, toChatId, msg.raw.message, rest);
|
|
3461
|
+
}
|
|
3462
|
+
async function sendPaidReaction(client, params) {
|
|
3463
|
+
const { anonymous, count = 1 } = params;
|
|
3464
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
3465
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
3466
|
+
let res;
|
|
3467
|
+
for (let i = 0; i < 3; i++) {
|
|
3468
|
+
try {
|
|
3469
|
+
res = await client.call({
|
|
3470
|
+
_: "messages.sendPaidReaction",
|
|
3471
|
+
peer,
|
|
3472
|
+
msgId: message,
|
|
3473
|
+
count,
|
|
3474
|
+
private: anonymous,
|
|
3475
|
+
randomId: await client.getMtprotoMessageId()
|
|
3476
|
+
});
|
|
3477
|
+
break;
|
|
3478
|
+
} catch (e) {
|
|
3479
|
+
if (tl.tl.RpcError.is(e, "RANDOM_ID_EXPIRED")) {
|
|
3480
|
+
continue;
|
|
3481
|
+
}
|
|
3482
|
+
throw e;
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
if (!res) {
|
|
3486
|
+
throw new platform.MtcuteError("Could not send paid reaction");
|
|
3487
|
+
}
|
|
3488
|
+
storyViewer.assertIsUpdatesGroup("messages.sendReaction", res);
|
|
3489
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3490
|
+
const upd = res.updates[0];
|
|
3491
|
+
controllablePromise.assertTypeIs("messages.sendPaidReaction (@ .updates[0])", upd, "updateMessageReactions");
|
|
3492
|
+
return new storyViewer.MessageReactions$2(upd.msgId, conditionVariable.getMarkedPeerId(upd.peer), upd.reactions, peers);
|
|
3493
|
+
}
|
|
3494
|
+
function extractQuote(message, from, to) {
|
|
3495
|
+
const { raw } = message;
|
|
3496
|
+
if (raw._ === "messageService") throw new platform.MtArgumentError("Cannot quote service message");
|
|
3497
|
+
if (!raw.message) throw new platform.MtArgumentError("Cannot quote empty message");
|
|
3498
|
+
const text = raw.message;
|
|
3499
|
+
if (from < 0) from = 0;
|
|
3500
|
+
if (to > text.length) to = text.length;
|
|
3501
|
+
if (from >= to) throw new platform.MtArgumentError("Invalid quote range");
|
|
3502
|
+
if (!raw.entities) return { text: text.slice(from, to), entities: void 0 };
|
|
3503
|
+
const entities = [];
|
|
3504
|
+
for (const ent of raw.entities) {
|
|
3505
|
+
const start2 = ent.offset;
|
|
3506
|
+
const end = ent.offset + ent.length;
|
|
3507
|
+
if (start2 >= to || end <= from) continue;
|
|
3508
|
+
const newStart = Math.max(start2, from) - from;
|
|
3509
|
+
const newEnd = Math.min(end, to) - from;
|
|
3510
|
+
const newEnt = { ...ent, offset: newStart, length: newEnd - newStart };
|
|
3511
|
+
entities.push(newEnt);
|
|
3512
|
+
}
|
|
3513
|
+
return { text: text.slice(from, to), entities };
|
|
3514
|
+
}
|
|
3515
|
+
function quoteWithText(client, message, params) {
|
|
3516
|
+
const { toChatId = message.chat, start: start2, end, text, ...params__ } = params;
|
|
3517
|
+
const params_ = params__;
|
|
3518
|
+
params_.replyTo = message;
|
|
3519
|
+
params_.quote = extractQuote(message, params.start, params.end);
|
|
3520
|
+
params_.quoteOffset = params.start;
|
|
3521
|
+
return storyViewer.sendText(client, toChatId, text, params_);
|
|
3522
|
+
}
|
|
3523
|
+
function quoteWithMedia(client, message, params) {
|
|
3524
|
+
const { toChatId = message.chat, start: start2, end, media, ...params__ } = params;
|
|
3525
|
+
const params_ = params__;
|
|
3526
|
+
params_.replyTo = message;
|
|
3527
|
+
params_.quote = extractQuote(message, params.start, params.end);
|
|
3528
|
+
params_.quoteOffset = params.start;
|
|
3529
|
+
return storyViewer.sendMedia(client, toChatId, media, params_);
|
|
3530
|
+
}
|
|
3531
|
+
function quoteWithMediaGroup(client, message, params) {
|
|
3532
|
+
const { toChatId, start: start2, end, medias, ...params__ } = params;
|
|
3533
|
+
const params_ = params__;
|
|
3534
|
+
params_.replyTo = message;
|
|
3535
|
+
params_.quote = extractQuote(message, params.start, params.end);
|
|
3536
|
+
params_.quoteOffset = params.start;
|
|
3537
|
+
return storyViewer.sendMediaGroup(client, message.chat.inputPeer, medias, params_);
|
|
3538
|
+
}
|
|
3539
|
+
async function sendReaction(client, params) {
|
|
3540
|
+
const { emoji, big } = params;
|
|
3541
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
3542
|
+
const emojis = Array.isArray(emoji) ? emoji : [emoji];
|
|
3543
|
+
const reactions = emojis.map(storyViewer.normalizeInputReaction);
|
|
3544
|
+
const res = await client.call({
|
|
3545
|
+
_: "messages.sendReaction",
|
|
3546
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
3547
|
+
msgId: message,
|
|
3548
|
+
reaction: reactions,
|
|
3549
|
+
big
|
|
3550
|
+
});
|
|
3551
|
+
storyViewer.assertIsUpdatesGroup("messages.sendReaction", res);
|
|
3552
|
+
return storyViewer._findMessageInUpdate(client, res, true, !params.shouldDispatch, true);
|
|
3553
|
+
}
|
|
3554
|
+
async function sendScheduled(client, peer, ids) {
|
|
3555
|
+
if (!Array.isArray(ids)) ids = [ids];
|
|
3556
|
+
const res = await client.call({
|
|
3557
|
+
_: "messages.sendScheduledMessages",
|
|
3558
|
+
peer: await storyViewer.resolvePeer(client, peer),
|
|
3559
|
+
id: ids
|
|
3560
|
+
});
|
|
3561
|
+
storyViewer.assertIsUpdatesGroup("sendScheduled", res);
|
|
3562
|
+
client.handleClientUpdate(res, true);
|
|
3563
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3564
|
+
const msgs = res.updates.filter(
|
|
3565
|
+
(u) => u._ === "updateNewMessage" || u._ === "updateNewChannelMessage"
|
|
3566
|
+
).map((u) => new storyViewer.Message$2(u.message, peers));
|
|
3567
|
+
return msgs;
|
|
3568
|
+
}
|
|
3569
|
+
async function sendTyping(client, chatId, status = "typing", params) {
|
|
3570
|
+
if (typeof status === "string") {
|
|
3571
|
+
const progress = params?.progress ?? 0;
|
|
3572
|
+
switch (status) {
|
|
3573
|
+
case "typing":
|
|
3574
|
+
status = { _: "sendMessageTypingAction" };
|
|
3575
|
+
break;
|
|
3576
|
+
case "cancel":
|
|
3577
|
+
status = { _: "sendMessageCancelAction" };
|
|
3578
|
+
break;
|
|
3579
|
+
case "record_video":
|
|
3580
|
+
status = { _: "sendMessageRecordVideoAction" };
|
|
3581
|
+
break;
|
|
3582
|
+
case "upload_video":
|
|
3583
|
+
status = { _: "sendMessageUploadVideoAction", progress };
|
|
3584
|
+
break;
|
|
3585
|
+
case "record_voice":
|
|
3586
|
+
status = { _: "sendMessageRecordAudioAction" };
|
|
3587
|
+
break;
|
|
3588
|
+
case "upload_voice":
|
|
3589
|
+
status = { _: "sendMessageUploadAudioAction", progress };
|
|
3590
|
+
break;
|
|
3591
|
+
case "upload_photo":
|
|
3592
|
+
status = { _: "sendMessageUploadPhotoAction", progress };
|
|
3593
|
+
break;
|
|
3594
|
+
case "upload_document":
|
|
3595
|
+
status = { _: "sendMessageUploadDocumentAction", progress };
|
|
3596
|
+
break;
|
|
3597
|
+
case "geo":
|
|
3598
|
+
status = { _: "sendMessageGeoLocationAction" };
|
|
3599
|
+
break;
|
|
3600
|
+
case "contact":
|
|
3601
|
+
status = { _: "sendMessageChooseContactAction" };
|
|
3602
|
+
break;
|
|
3603
|
+
case "game":
|
|
3604
|
+
status = { _: "sendMessageGamePlayAction" };
|
|
3605
|
+
break;
|
|
3606
|
+
case "record_round":
|
|
3607
|
+
status = { _: "sendMessageRecordRoundAction" };
|
|
3608
|
+
break;
|
|
3609
|
+
case "upload_round":
|
|
3610
|
+
status = { _: "sendMessageUploadRoundAction", progress };
|
|
3611
|
+
break;
|
|
3612
|
+
case "speak_call":
|
|
3613
|
+
status = { _: "speakingInGroupCallAction" };
|
|
3614
|
+
break;
|
|
3615
|
+
case "history_import":
|
|
3616
|
+
status = { _: "sendMessageHistoryImportAction", progress };
|
|
3617
|
+
break;
|
|
3618
|
+
case "sticker":
|
|
3619
|
+
status = { _: "sendMessageChooseStickerAction" };
|
|
3620
|
+
break;
|
|
3621
|
+
default:
|
|
3622
|
+
conditionVariable.assertNever();
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
const r = await storyViewer._maybeInvokeWithBusinessConnection(client, params?.businessConnectionId, {
|
|
3626
|
+
_: "messages.setTyping",
|
|
3627
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
3628
|
+
action: status,
|
|
3629
|
+
topMsgId: params?.threadId
|
|
3630
|
+
});
|
|
3631
|
+
controllablePromise.assertTrue("messages.setTyping", r);
|
|
3632
|
+
}
|
|
3633
|
+
async function sendVote(client, params) {
|
|
3634
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
3635
|
+
let { options } = params;
|
|
3636
|
+
if (options === null) options = [];
|
|
3637
|
+
if (!Array.isArray(options)) options = [options];
|
|
3638
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
3639
|
+
let poll;
|
|
3640
|
+
if (options.some((it) => typeof it === "number")) {
|
|
3641
|
+
const [msg] = await storyViewer.getMessages(client, peer, message);
|
|
3642
|
+
if (!msg) {
|
|
3643
|
+
throw new controllablePromise.MtMessageNotFoundError(conditionVariable.getMarkedPeerId(peer), message, "to vote in");
|
|
3644
|
+
}
|
|
3645
|
+
if (!(msg.media instanceof storyViewer.Poll$2)) {
|
|
3646
|
+
throw new platform.MtArgumentError("This message does not contain a poll");
|
|
3647
|
+
}
|
|
3648
|
+
poll = msg.media;
|
|
3649
|
+
options = options.map((opt) => {
|
|
3650
|
+
if (typeof opt === "number") {
|
|
3651
|
+
return poll.raw.answers[opt].option;
|
|
3652
|
+
}
|
|
3653
|
+
return opt;
|
|
3654
|
+
});
|
|
3655
|
+
}
|
|
3656
|
+
const res = await client.call({
|
|
3657
|
+
_: "messages.sendVote",
|
|
3658
|
+
peer,
|
|
3659
|
+
msgId: message,
|
|
3660
|
+
options
|
|
3661
|
+
});
|
|
3662
|
+
storyViewer.assertIsUpdatesGroup("messages.sendVote", res);
|
|
3663
|
+
client.handleClientUpdate(res, true);
|
|
3664
|
+
const upd = res.updates[0];
|
|
3665
|
+
controllablePromise.assertTypeIs("messages.sendVote (@ .updates[0])", upd, "updateMessagePoll");
|
|
3666
|
+
if (!upd.poll) {
|
|
3667
|
+
throw new platform.MtTypeAssertionError("messages.sendVote (@ .updates[0].poll)", "poll", "undefined");
|
|
3668
|
+
}
|
|
3669
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3670
|
+
return new storyViewer.Poll$2(upd.poll, peers, upd.results);
|
|
3671
|
+
}
|
|
3672
|
+
async function translateMessage(client, params) {
|
|
3673
|
+
const { toLanguage } = params;
|
|
3674
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
3675
|
+
const res = await client.call({
|
|
3676
|
+
_: "messages.translateText",
|
|
3677
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
3678
|
+
id: [message],
|
|
3679
|
+
toLang: toLanguage
|
|
3680
|
+
});
|
|
3681
|
+
return {
|
|
3682
|
+
text: res.result[0].text,
|
|
3683
|
+
entities: res.result[0].entities
|
|
3684
|
+
};
|
|
3685
|
+
}
|
|
3686
|
+
async function translateText(client, text, toLanguage) {
|
|
3687
|
+
const [message, entities] = await storyViewer._normalizeInputText(client, text);
|
|
3688
|
+
const res = await client.call({
|
|
3689
|
+
_: "messages.translateText",
|
|
3690
|
+
text: [
|
|
3691
|
+
{
|
|
3692
|
+
_: "textWithEntities",
|
|
3693
|
+
text: message,
|
|
3694
|
+
entities: entities || []
|
|
3695
|
+
}
|
|
3696
|
+
],
|
|
3697
|
+
toLang: toLanguage
|
|
3698
|
+
});
|
|
3699
|
+
if (!res.result[0]) {
|
|
3700
|
+
throw new platform.MtTypeAssertionError("messages.translateResult#result", "not empty", "empty");
|
|
3701
|
+
}
|
|
3702
|
+
return {
|
|
3703
|
+
text: res.result[0].text,
|
|
3704
|
+
entities: res.result[0].entities
|
|
3705
|
+
};
|
|
3706
|
+
}
|
|
3707
|
+
async function unpinAllMessages(client, chatId, params) {
|
|
3708
|
+
const { topicId, shouldDispatch } = params ?? {};
|
|
3709
|
+
const peer = await storyViewer.resolvePeer(client, chatId);
|
|
3710
|
+
const res = await client.call({
|
|
3711
|
+
_: "messages.unpinAllMessages",
|
|
3712
|
+
peer,
|
|
3713
|
+
topMsgId: topicId
|
|
3714
|
+
});
|
|
3715
|
+
if (!shouldDispatch) {
|
|
3716
|
+
if (conditionVariable.isInputPeerChannel(peer)) {
|
|
3717
|
+
client.handleClientUpdate(storyViewer.createDummyUpdate(res.pts, res.ptsCount, peer.channelId));
|
|
3718
|
+
} else {
|
|
3719
|
+
client.handleClientUpdate(storyViewer.createDummyUpdate(res.pts, res.ptsCount));
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
async function unpinMessage(client, params) {
|
|
3724
|
+
const { chatId, message } = storyViewer.normalizeInputMessageId(params);
|
|
3725
|
+
const res = await client.call({
|
|
3726
|
+
_: "messages.updatePinnedMessage",
|
|
3727
|
+
peer: await storyViewer.resolvePeer(client, chatId),
|
|
3728
|
+
id: message,
|
|
3729
|
+
unpin: true
|
|
3730
|
+
});
|
|
3731
|
+
client.handleClientUpdate(res);
|
|
3732
|
+
}
|
|
3733
|
+
async function getCollectibleInfo(client, kind, item) {
|
|
3734
|
+
const res = await client.call({
|
|
3735
|
+
_: "fragment.getCollectibleInfo",
|
|
3736
|
+
collectible: kind === "phone" ? {
|
|
3737
|
+
_: "inputCollectiblePhone",
|
|
3738
|
+
phone: conditionVariable.normalizePhoneNumber(item)
|
|
3739
|
+
} : {
|
|
3740
|
+
_: "inputCollectibleUsername",
|
|
3741
|
+
username: item
|
|
3742
|
+
}
|
|
3743
|
+
});
|
|
3744
|
+
return new storyViewer.CollectibleInfo$1(res);
|
|
3745
|
+
}
|
|
3746
|
+
async function initTakeoutSession(client, params) {
|
|
3747
|
+
return new storyViewer.TakeoutSession$1(
|
|
3748
|
+
client,
|
|
3749
|
+
await client.call({
|
|
3750
|
+
_: "account.initTakeoutSession",
|
|
3751
|
+
...params
|
|
3752
|
+
})
|
|
3753
|
+
);
|
|
3754
|
+
}
|
|
3755
|
+
async function _normalizePrivacyRules(client, rules) {
|
|
3756
|
+
const res = [];
|
|
3757
|
+
for (const rule of rules) {
|
|
3758
|
+
if ("_" in rule) {
|
|
3759
|
+
res.push(rule);
|
|
3760
|
+
continue;
|
|
3761
|
+
}
|
|
3762
|
+
if ("users" in rule) {
|
|
3763
|
+
const users = await storyViewer.resolvePeerMany(client, rule.users, conditionVariable.toInputUser);
|
|
3764
|
+
res.push({
|
|
3765
|
+
_: rule.allow ? "inputPrivacyValueAllowUsers" : "inputPrivacyValueDisallowUsers",
|
|
3766
|
+
users
|
|
3767
|
+
});
|
|
3768
|
+
continue;
|
|
3769
|
+
}
|
|
3770
|
+
if ("chats" in rule) {
|
|
3771
|
+
const chats = await storyViewer.resolvePeerMany(client, rule.chats);
|
|
3772
|
+
res.push({
|
|
3773
|
+
_: rule.allow ? "inputPrivacyValueAllowChatParticipants" : "inputPrivacyValueDisallowChatParticipants",
|
|
3774
|
+
chats: chats.filter(controllablePromise.isPresent).map((peer) => {
|
|
3775
|
+
if ("channelId" in peer) return peer.channelId;
|
|
3776
|
+
if ("chatId" in peer) return peer.chatId;
|
|
3777
|
+
throw new Error("UNREACHABLE");
|
|
3778
|
+
})
|
|
3779
|
+
});
|
|
3780
|
+
continue;
|
|
3781
|
+
}
|
|
3782
|
+
}
|
|
3783
|
+
return res;
|
|
3784
|
+
}
|
|
3785
|
+
async function changeCloudPassword(client, params) {
|
|
3786
|
+
const { currentPassword, newPassword, hint } = params;
|
|
3787
|
+
const pwd = await client.call({ _: "account.getPassword" });
|
|
3788
|
+
if (!pwd.hasPassword) {
|
|
3789
|
+
throw new platform.MtArgumentError("Cloud password is not enabled");
|
|
3790
|
+
}
|
|
3791
|
+
const algo = pwd.newAlgo;
|
|
3792
|
+
const oldSrp = await client.computeSrpParams(pwd, currentPassword);
|
|
3793
|
+
const newHash = await client.computeNewPasswordHash(algo, newPassword);
|
|
3794
|
+
await client.call({
|
|
3795
|
+
_: "account.updatePasswordSettings",
|
|
3796
|
+
password: oldSrp,
|
|
3797
|
+
newSettings: {
|
|
3798
|
+
_: "account.passwordInputSettings",
|
|
3799
|
+
newAlgo: algo,
|
|
3800
|
+
newPasswordHash: newHash,
|
|
3801
|
+
hint
|
|
3802
|
+
}
|
|
3803
|
+
});
|
|
3804
|
+
}
|
|
3805
|
+
async function enableCloudPassword(client, params) {
|
|
3806
|
+
const { password, hint, email } = params;
|
|
3807
|
+
const pwd = await client.call({ _: "account.getPassword" });
|
|
3808
|
+
if (pwd.hasPassword) {
|
|
3809
|
+
throw new platform.MtArgumentError("Cloud password is already enabled");
|
|
3810
|
+
}
|
|
3811
|
+
const algo = pwd.newAlgo;
|
|
3812
|
+
controllablePromise.assertTypeIs("account.getPassword", algo, "passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow");
|
|
3813
|
+
const newHash = await client.computeNewPasswordHash(algo, password);
|
|
3814
|
+
await client.call({
|
|
3815
|
+
_: "account.updatePasswordSettings",
|
|
3816
|
+
password: { _: "inputCheckPasswordEmpty" },
|
|
3817
|
+
newSettings: {
|
|
3818
|
+
_: "account.passwordInputSettings",
|
|
3819
|
+
newAlgo: algo,
|
|
3820
|
+
newPasswordHash: newHash,
|
|
3821
|
+
hint,
|
|
3822
|
+
email
|
|
3823
|
+
}
|
|
3824
|
+
});
|
|
3825
|
+
}
|
|
3826
|
+
async function verifyPasswordEmail(client, code) {
|
|
3827
|
+
const r = await client.call({
|
|
3828
|
+
_: "account.confirmPasswordEmail",
|
|
3829
|
+
code
|
|
3830
|
+
});
|
|
3831
|
+
controllablePromise.assertTrue("account.confirmPasswordEmail", r);
|
|
3832
|
+
}
|
|
3833
|
+
async function resendPasswordEmail(client) {
|
|
3834
|
+
const r = await client.call({
|
|
3835
|
+
_: "account.resendPasswordEmail"
|
|
3836
|
+
});
|
|
3837
|
+
controllablePromise.assertTrue("account.resendPasswordEmail", r);
|
|
3838
|
+
}
|
|
3839
|
+
async function cancelPasswordEmail(client) {
|
|
3840
|
+
const r = await client.call({
|
|
3841
|
+
_: "account.cancelPasswordEmail"
|
|
3842
|
+
});
|
|
3843
|
+
controllablePromise.assertTrue("account.cancelPasswordEmail", r);
|
|
3844
|
+
}
|
|
3845
|
+
async function removeCloudPassword(client, password) {
|
|
3846
|
+
const pwd = await client.call({ _: "account.getPassword" });
|
|
3847
|
+
if (!pwd.hasPassword) {
|
|
3848
|
+
throw new platform.MtArgumentError("Cloud password is not enabled");
|
|
3849
|
+
}
|
|
3850
|
+
const oldSrp = await client.computeSrpParams(pwd, password);
|
|
3851
|
+
await client.call({
|
|
3852
|
+
_: "account.updatePasswordSettings",
|
|
3853
|
+
password: oldSrp,
|
|
3854
|
+
newSettings: {
|
|
3855
|
+
_: "account.passwordInputSettings",
|
|
3856
|
+
newAlgo: { _: "passwordKdfAlgoUnknown" },
|
|
3857
|
+
newPasswordHash: new Uint8Array(0),
|
|
3858
|
+
hint: ""
|
|
3859
|
+
}
|
|
3860
|
+
});
|
|
3861
|
+
}
|
|
3862
|
+
async function applyBoost(client, peerId) {
|
|
3863
|
+
await client.call({
|
|
3864
|
+
_: "premium.applyBoost",
|
|
3865
|
+
peer: await storyViewer.resolvePeer(client, peerId)
|
|
3866
|
+
});
|
|
3867
|
+
}
|
|
3868
|
+
async function getMyBoostSlots(client) {
|
|
3869
|
+
const res = await client.call({
|
|
3870
|
+
_: "premium.getMyBoosts"
|
|
3871
|
+
});
|
|
3872
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3873
|
+
return res.myBoosts.map((it) => new storyViewer.BoostSlot$2(it, peers));
|
|
3874
|
+
}
|
|
3875
|
+
async function canApplyBoost(client) {
|
|
3876
|
+
const myBoosts = await getMyBoostSlots(client);
|
|
3877
|
+
if (!myBoosts.length) {
|
|
3878
|
+
return { can: false, reason: "need_premium", slots: myBoosts };
|
|
3879
|
+
}
|
|
3880
|
+
const emptySlots = myBoosts.filter((it) => !it.occupied);
|
|
3881
|
+
if (emptySlots.length > 0) {
|
|
3882
|
+
return { can: true, slots: myBoosts };
|
|
3883
|
+
}
|
|
3884
|
+
const replaceableSlots = myBoosts.filter((it) => it.cooldownUntil === null);
|
|
3885
|
+
if (replaceableSlots.length) {
|
|
3886
|
+
return { can: true, replace: replaceableSlots.map((it) => it.chat), slots: myBoosts };
|
|
3887
|
+
}
|
|
3888
|
+
return { can: false, reason: "no_slots", slots: myBoosts };
|
|
3889
|
+
}
|
|
3890
|
+
async function createBusinessChatLink(client, text, params) {
|
|
3891
|
+
const [message, entities] = await storyViewer._normalizeInputText(client, text);
|
|
3892
|
+
const res = await client.call({
|
|
3893
|
+
_: "account.createBusinessChatLink",
|
|
3894
|
+
link: {
|
|
3895
|
+
_: "inputBusinessChatLink",
|
|
3896
|
+
message,
|
|
3897
|
+
entities,
|
|
3898
|
+
title: params?.title
|
|
3899
|
+
}
|
|
3900
|
+
});
|
|
3901
|
+
return new storyViewer.BusinessChatLink$2(res);
|
|
3902
|
+
}
|
|
3903
|
+
async function editBusinessChatLink(client, link, params) {
|
|
3904
|
+
const [message, entities] = await storyViewer._normalizeInputText(client, params.text);
|
|
3905
|
+
const res = await client.call({
|
|
3906
|
+
_: "account.editBusinessChatLink",
|
|
3907
|
+
slug: link instanceof storyViewer.BusinessChatLink$2 ? link.link : link,
|
|
3908
|
+
link: {
|
|
3909
|
+
_: "inputBusinessChatLink",
|
|
3910
|
+
message,
|
|
3911
|
+
entities,
|
|
3912
|
+
title: params?.title
|
|
3913
|
+
}
|
|
3914
|
+
});
|
|
3915
|
+
return new storyViewer.BusinessChatLink$2(res);
|
|
3916
|
+
}
|
|
3917
|
+
async function deleteBusinessChatLink(client, link) {
|
|
3918
|
+
const res = await client.call({
|
|
3919
|
+
_: "account.deleteBusinessChatLink",
|
|
3920
|
+
slug: typeof link === "string" ? link : link.link
|
|
3921
|
+
});
|
|
3922
|
+
controllablePromise.assertTrue("account.deleteBusinessChatLink", res);
|
|
3923
|
+
}
|
|
3924
|
+
async function getBoostStats(client, peerId) {
|
|
3925
|
+
const res = await client.call({
|
|
3926
|
+
_: "premium.getBoostsStatus",
|
|
3927
|
+
peer: await storyViewer.resolvePeer(client, peerId)
|
|
3928
|
+
});
|
|
3929
|
+
return new storyViewer.BoostStats$1(res);
|
|
3930
|
+
}
|
|
3931
|
+
async function getBoosts(client, peerId, params) {
|
|
3932
|
+
const { offset = "", limit = 100 } = params ?? {};
|
|
3933
|
+
const res = await client.call({
|
|
3934
|
+
_: "premium.getBoostsList",
|
|
3935
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
3936
|
+
offset,
|
|
3937
|
+
limit
|
|
3938
|
+
});
|
|
3939
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
3940
|
+
return conditionVariable.makeArrayPaginated(
|
|
3941
|
+
res.boosts.map((it) => new storyViewer.Boost$2(it, peers)),
|
|
3942
|
+
res.count,
|
|
3943
|
+
res.nextOffset
|
|
3944
|
+
);
|
|
3945
|
+
}
|
|
3946
|
+
async function getBusinessChatLinks(client) {
|
|
3947
|
+
const res = await client.call({ _: "account.getBusinessChatLinks" });
|
|
3948
|
+
return res.links.map((x) => new storyViewer.BusinessChatLink$2(x));
|
|
3949
|
+
}
|
|
3950
|
+
async function getStarsTransactions(client, peerId, params) {
|
|
3951
|
+
const { direction, sort, subscriptionId, offset = "", limit = 100 } = params ?? {};
|
|
3952
|
+
const res = await client.call({
|
|
3953
|
+
_: "payments.getStarsTransactions",
|
|
3954
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
3955
|
+
offset,
|
|
3956
|
+
limit,
|
|
3957
|
+
outbound: direction === "outgoing",
|
|
3958
|
+
inbound: direction === "incoming",
|
|
3959
|
+
ascending: sort === "asc",
|
|
3960
|
+
subscriptionId
|
|
3961
|
+
});
|
|
3962
|
+
return new storyViewer.StarsStatus$2(res);
|
|
3963
|
+
}
|
|
3964
|
+
async function* iterBoosters(client, peerId, params) {
|
|
3965
|
+
if (!params) params = {};
|
|
3966
|
+
const { limit = Infinity, chunkSize = 100 } = params;
|
|
3967
|
+
let { offset } = params;
|
|
3968
|
+
let current = 0;
|
|
3969
|
+
const peer = await storyViewer.resolvePeer(client, peerId);
|
|
3970
|
+
for (; ; ) {
|
|
3971
|
+
const res = await getBoosts(client, peer, {
|
|
3972
|
+
offset,
|
|
3973
|
+
limit: Math.min(limit - current, chunkSize)
|
|
3974
|
+
});
|
|
3975
|
+
for (const booster of res) {
|
|
3976
|
+
yield booster;
|
|
3977
|
+
if (++current >= limit) return;
|
|
3978
|
+
}
|
|
3979
|
+
if (!res.next) return;
|
|
3980
|
+
offset = res.next;
|
|
3981
|
+
}
|
|
3982
|
+
}
|
|
3983
|
+
async function* iterStarsTransactions(client, peerId, params) {
|
|
3984
|
+
if (!params) params = {};
|
|
3985
|
+
const { limit = Infinity, chunkSize = 100 } = params;
|
|
3986
|
+
let { offset } = params;
|
|
3987
|
+
let current = 0;
|
|
3988
|
+
const peer = await storyViewer.resolvePeer(client, peerId);
|
|
3989
|
+
for (; ; ) {
|
|
3990
|
+
const res = await getStarsTransactions(client, peer, {
|
|
3991
|
+
offset,
|
|
3992
|
+
limit: Math.min(limit - current, chunkSize)
|
|
3993
|
+
});
|
|
3994
|
+
for (const transaction of res.transactions) {
|
|
3995
|
+
yield transaction;
|
|
3996
|
+
if (++current >= limit) return;
|
|
3997
|
+
}
|
|
3998
|
+
if (!res.transactionsNextOffset) return;
|
|
3999
|
+
offset = res.transactionsNextOffset;
|
|
4000
|
+
}
|
|
4001
|
+
}
|
|
4002
|
+
async function _normalizeFileToDocument(client, file, params) {
|
|
4003
|
+
if (typeof file === "object" && tl.tl.isAnyInputDocument(file)) {
|
|
4004
|
+
return file;
|
|
4005
|
+
}
|
|
4006
|
+
const media = await storyViewer._normalizeInputMedia(
|
|
4007
|
+
client,
|
|
4008
|
+
{
|
|
4009
|
+
type: "document",
|
|
4010
|
+
file
|
|
4011
|
+
},
|
|
4012
|
+
params,
|
|
4013
|
+
true
|
|
4014
|
+
);
|
|
4015
|
+
controllablePromise.assertTypeIs("_normalizeFileToDocument", media, "inputMediaDocument");
|
|
4016
|
+
controllablePromise.assertTypeIs("_normalizeFileToDocument", media.id, "inputDocument");
|
|
4017
|
+
return media.id;
|
|
4018
|
+
}
|
|
4019
|
+
function isInputMediaSticker(media) {
|
|
4020
|
+
return typeof media === "object" && media !== null && "type" in media && media.type === "sticker";
|
|
4021
|
+
}
|
|
4022
|
+
async function setBusinessIntro(client, intro) {
|
|
4023
|
+
let tlIntro;
|
|
4024
|
+
if (intro) {
|
|
4025
|
+
let sticker;
|
|
4026
|
+
if (intro.sticker) {
|
|
4027
|
+
if (isInputMediaSticker(intro.sticker)) {
|
|
4028
|
+
const media = await storyViewer._normalizeInputMedia(client, intro.sticker, void 0, true);
|
|
4029
|
+
controllablePromise.assertTypeIs("_normalizeInputMedia", media, "inputMediaDocument");
|
|
4030
|
+
sticker = media.id;
|
|
4031
|
+
} else {
|
|
4032
|
+
sticker = await _normalizeFileToDocument(client, intro.sticker, {});
|
|
4033
|
+
}
|
|
4034
|
+
}
|
|
4035
|
+
tlIntro = {
|
|
4036
|
+
_: "inputBusinessIntro",
|
|
4037
|
+
title: intro.title ?? "",
|
|
4038
|
+
description: intro.description ?? "",
|
|
4039
|
+
sticker
|
|
4040
|
+
};
|
|
4041
|
+
}
|
|
4042
|
+
const res = await client.call({
|
|
4043
|
+
_: "account.updateBusinessIntro",
|
|
4044
|
+
intro: tlIntro
|
|
4045
|
+
});
|
|
4046
|
+
controllablePromise.assertTrue("account.updateBusinessIntro", res);
|
|
4047
|
+
}
|
|
4048
|
+
async function setBusinessWorkHours(client, params) {
|
|
4049
|
+
let businessWorkHours;
|
|
4050
|
+
if (params) {
|
|
4051
|
+
let weeklyOpen;
|
|
4052
|
+
if ("hours" in params) {
|
|
4053
|
+
weeklyOpen = storyViewer.businessWorkHoursDaysToRaw(params.hours);
|
|
4054
|
+
} else {
|
|
4055
|
+
weeklyOpen = params.intervals;
|
|
4056
|
+
}
|
|
4057
|
+
businessWorkHours = {
|
|
4058
|
+
_: "businessWorkHours",
|
|
4059
|
+
timezoneId: params.timezone,
|
|
4060
|
+
weeklyOpen
|
|
4061
|
+
};
|
|
4062
|
+
}
|
|
4063
|
+
const res = await client.call({
|
|
4064
|
+
_: "account.updateBusinessWorkHours",
|
|
4065
|
+
businessWorkHours
|
|
4066
|
+
});
|
|
4067
|
+
controllablePromise.assertTrue("account.updateBusinessWorkHours", res);
|
|
4068
|
+
}
|
|
4069
|
+
async function _normalizeInputStickerSetItem(client, sticker, params) {
|
|
4070
|
+
return {
|
|
4071
|
+
_: "inputStickerSetItem",
|
|
4072
|
+
document: await _normalizeFileToDocument(client, sticker.file, params ?? {}),
|
|
4073
|
+
emoji: sticker.emojis,
|
|
4074
|
+
maskCoords: sticker.maskPosition ? {
|
|
4075
|
+
_: "maskCoords",
|
|
4076
|
+
n: storyViewer.MASK_POSITION_POINT_TO_TL[sticker.maskPosition.point],
|
|
4077
|
+
x: sticker.maskPosition.x,
|
|
4078
|
+
y: sticker.maskPosition.y,
|
|
4079
|
+
zoom: sticker.maskPosition.scale
|
|
4080
|
+
} : void 0
|
|
4081
|
+
};
|
|
4082
|
+
}
|
|
4083
|
+
async function addStickerToSet(client, setId, sticker, params) {
|
|
4084
|
+
const res = await client.call({
|
|
4085
|
+
_: "stickers.addStickerToSet",
|
|
4086
|
+
stickerset: storyViewer.normalizeInputStickerSet(setId),
|
|
4087
|
+
sticker: await _normalizeInputStickerSetItem(client, sticker, params)
|
|
4088
|
+
});
|
|
4089
|
+
return new storyViewer.StickerSet$2(res);
|
|
4090
|
+
}
|
|
4091
|
+
async function createStickerSet(client, params) {
|
|
4092
|
+
const owner = await storyViewer.resolveUser(client, params.owner);
|
|
4093
|
+
const inputStickers = [];
|
|
4094
|
+
let i = 0;
|
|
4095
|
+
for (const sticker of params.stickers) {
|
|
4096
|
+
const progressCallback = params.progressCallback?.bind(null, i);
|
|
4097
|
+
inputStickers.push(await _normalizeInputStickerSetItem(client, sticker, { progressCallback }));
|
|
4098
|
+
i += 1;
|
|
4099
|
+
}
|
|
4100
|
+
const res = await client.call({
|
|
4101
|
+
_: "stickers.createStickerSet",
|
|
4102
|
+
animated: params.sourceType === "animated",
|
|
4103
|
+
videos: params.sourceType === "video",
|
|
4104
|
+
masks: params.type === "mask",
|
|
4105
|
+
emojis: params.type === "emoji",
|
|
4106
|
+
textColor: params.adaptive,
|
|
4107
|
+
userId: owner,
|
|
4108
|
+
title: params.title,
|
|
4109
|
+
shortName: params.shortName,
|
|
4110
|
+
stickers: inputStickers,
|
|
4111
|
+
thumb: params.thumb ? await _normalizeFileToDocument(client, params.thumb, {}) : void 0
|
|
4112
|
+
});
|
|
4113
|
+
return new storyViewer.StickerSet$2(res);
|
|
4114
|
+
}
|
|
4115
|
+
async function deleteStickerFromSet(client, sticker) {
|
|
4116
|
+
if (fileId.tdFileId.isFileIdLike(sticker)) {
|
|
4117
|
+
sticker = storyViewer.fileIdToInputDocument(sticker);
|
|
4118
|
+
}
|
|
4119
|
+
const res = await client.call({
|
|
4120
|
+
_: "stickers.removeStickerFromSet",
|
|
4121
|
+
sticker
|
|
4122
|
+
});
|
|
4123
|
+
return new storyViewer.StickerSet$2(res);
|
|
4124
|
+
}
|
|
4125
|
+
async function getCustomEmojis(client, ids) {
|
|
4126
|
+
const res = await client.call({
|
|
4127
|
+
_: "messages.getCustomEmojiDocuments",
|
|
4128
|
+
documentId: ids
|
|
4129
|
+
});
|
|
4130
|
+
return res.map((it) => {
|
|
4131
|
+
controllablePromise.assertTypeIs("getCustomEmojis", it, "document");
|
|
4132
|
+
const doc = storyViewer.parseDocument(it);
|
|
4133
|
+
if (doc.type !== "sticker") {
|
|
4134
|
+
throw new platform.MtTypeAssertionError("getCustomEmojis", "sticker", doc.type);
|
|
4135
|
+
}
|
|
4136
|
+
return doc;
|
|
4137
|
+
});
|
|
4138
|
+
}
|
|
4139
|
+
async function getCustomEmojisFromMessages(client, messages) {
|
|
4140
|
+
const set = new conditionVariable.LongSet();
|
|
4141
|
+
if (!Array.isArray(messages)) messages = [messages];
|
|
4142
|
+
for (const { raw } of messages) {
|
|
4143
|
+
if (raw._ === "messageService" || !raw.entities) continue;
|
|
4144
|
+
for (const entity of raw.entities) {
|
|
4145
|
+
if (entity._ === "messageEntityCustomEmoji") {
|
|
4146
|
+
set.add(entity.documentId);
|
|
4147
|
+
}
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
const arr = set.toArray();
|
|
4151
|
+
if (!arr.length) return [];
|
|
4152
|
+
return getCustomEmojis(client, arr);
|
|
4153
|
+
}
|
|
4154
|
+
async function getInstalledStickers(client) {
|
|
4155
|
+
const res = await client.call({
|
|
4156
|
+
_: "messages.getAllStickers",
|
|
4157
|
+
hash: Long.ZERO
|
|
4158
|
+
});
|
|
4159
|
+
controllablePromise.assertTypeIs("getInstalledStickers", res, "messages.allStickers");
|
|
4160
|
+
return res.sets.map((set) => new storyViewer.StickerSet$2(set));
|
|
4161
|
+
}
|
|
4162
|
+
async function getMyStickerSets(client, params) {
|
|
4163
|
+
const res = await client.call({
|
|
4164
|
+
_: "messages.getMyStickers",
|
|
4165
|
+
offsetId: params?.offset ?? Long.ZERO,
|
|
4166
|
+
limit: params?.limit ?? 100
|
|
4167
|
+
});
|
|
4168
|
+
const items = res.sets.map((x) => new storyViewer.StickerSet$2(x));
|
|
4169
|
+
return conditionVariable.makeArrayPaginated(items, res.count, items[items.length - 1]?.brief.id);
|
|
4170
|
+
}
|
|
4171
|
+
async function getStickerSet(client, setId) {
|
|
4172
|
+
const res = await client.call({
|
|
4173
|
+
_: "messages.getStickerSet",
|
|
4174
|
+
stickerset: storyViewer.normalizeInputStickerSet(setId),
|
|
4175
|
+
hash: 0
|
|
4176
|
+
});
|
|
4177
|
+
return new storyViewer.StickerSet$2(res);
|
|
4178
|
+
}
|
|
4179
|
+
async function moveStickerInSet(client, sticker, position) {
|
|
4180
|
+
if (fileId.tdFileId.isFileIdLike(sticker)) {
|
|
4181
|
+
sticker = storyViewer.fileIdToInputDocument(sticker);
|
|
4182
|
+
}
|
|
4183
|
+
const res = await client.call({
|
|
4184
|
+
_: "stickers.changeStickerPosition",
|
|
4185
|
+
sticker,
|
|
4186
|
+
position
|
|
4187
|
+
});
|
|
4188
|
+
return new storyViewer.StickerSet$2(res);
|
|
4189
|
+
}
|
|
4190
|
+
async function replaceStickerInSet(client, sticker, newSticker, params) {
|
|
4191
|
+
if (fileId.tdFileId.isFileIdLike(sticker)) {
|
|
4192
|
+
sticker = storyViewer.fileIdToInputDocument(sticker);
|
|
4193
|
+
}
|
|
4194
|
+
const res = await client.call({
|
|
4195
|
+
_: "stickers.replaceSticker",
|
|
4196
|
+
sticker,
|
|
4197
|
+
newSticker: await _normalizeInputStickerSetItem(client, newSticker, params)
|
|
4198
|
+
});
|
|
4199
|
+
return new storyViewer.StickerSet$2(res);
|
|
4200
|
+
}
|
|
4201
|
+
async function setChatStickerSet(client, chatId, setId) {
|
|
4202
|
+
const r = await client.call({
|
|
4203
|
+
_: "channels.setStickers",
|
|
4204
|
+
channel: await storyViewer.resolveChannel(client, chatId),
|
|
4205
|
+
stickerset: storyViewer.normalizeInputStickerSet(setId)
|
|
4206
|
+
});
|
|
4207
|
+
controllablePromise.assertTrue("channels.setStickers", r);
|
|
4208
|
+
}
|
|
4209
|
+
async function setStickerSetThumb(client, id, thumb, params) {
|
|
4210
|
+
const res = await client.call({
|
|
4211
|
+
_: "stickers.setStickerSetThumb",
|
|
4212
|
+
stickerset: storyViewer.normalizeInputStickerSet(id),
|
|
4213
|
+
thumb: await _normalizeFileToDocument(client, thumb, params ?? {})
|
|
4214
|
+
});
|
|
4215
|
+
return new storyViewer.StickerSet$2(res);
|
|
4216
|
+
}
|
|
4217
|
+
async function canSendStory(client, peerId) {
|
|
4218
|
+
try {
|
|
4219
|
+
const res = await client.call({
|
|
4220
|
+
_: "stories.canSendStory",
|
|
4221
|
+
peer: await storyViewer.resolvePeer(client, peerId)
|
|
4222
|
+
});
|
|
4223
|
+
if (!res) return "need_admin";
|
|
4224
|
+
return true;
|
|
4225
|
+
} catch (e) {
|
|
4226
|
+
if (tl.tl.RpcError.is(e, "CHAT_ADMIN_REQUIRED")) {
|
|
4227
|
+
return "need_admin";
|
|
4228
|
+
}
|
|
4229
|
+
if (tl.tl.RpcError.is(e, "BOOSTS_REQUIRED")) {
|
|
4230
|
+
return "need_boosts";
|
|
4231
|
+
}
|
|
4232
|
+
throw e;
|
|
4233
|
+
}
|
|
4234
|
+
}
|
|
4235
|
+
async function deleteStories(client, params) {
|
|
4236
|
+
const { ids, peer = "me" } = params;
|
|
4237
|
+
return client.call({
|
|
4238
|
+
_: "stories.deleteStories",
|
|
4239
|
+
peer: await storyViewer.resolvePeer(client, peer),
|
|
4240
|
+
id: Array.isArray(ids) ? ids : [ids]
|
|
4241
|
+
});
|
|
4242
|
+
}
|
|
4243
|
+
function _findStoryInUpdate(client, res) {
|
|
4244
|
+
storyViewer.assertIsUpdatesGroup("_findStoryInUpdate", res);
|
|
4245
|
+
client.handleClientUpdate(res, true);
|
|
4246
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
4247
|
+
const updateStory = res.updates.find(controllablePromise.hasValueAtKey("_", "updateStory"));
|
|
4248
|
+
if (!updateStory) {
|
|
4249
|
+
throw new platform.MtTypeAssertionError("_findStoryInUpdate (@ .updates[*])", "updateStory", "none");
|
|
4250
|
+
}
|
|
4251
|
+
controllablePromise.assertTypeIs("updateStory.story", updateStory.story, "storyItem");
|
|
4252
|
+
return new storyViewer.Story$2(updateStory.story, peers);
|
|
4253
|
+
}
|
|
4254
|
+
async function editStory(client, params) {
|
|
4255
|
+
const { id, peer = "me", interactiveElements } = params;
|
|
4256
|
+
let caption;
|
|
4257
|
+
let entities;
|
|
4258
|
+
let media;
|
|
4259
|
+
if (params.media) {
|
|
4260
|
+
media = await storyViewer._normalizeInputMedia(client, params.media);
|
|
4261
|
+
if ("caption" in params.media && params.media.caption !== void 0) {
|
|
4262
|
+
[caption, entities] = await storyViewer._normalizeInputText(client, params.media.caption);
|
|
4263
|
+
}
|
|
4264
|
+
}
|
|
4265
|
+
if (params.caption) {
|
|
4266
|
+
[caption, entities] = await storyViewer._normalizeInputText(client, params.caption);
|
|
4267
|
+
}
|
|
4268
|
+
const privacyRules = params.privacyRules ? await _normalizePrivacyRules(client, params.privacyRules) : void 0;
|
|
4269
|
+
const res = await client.call({
|
|
4270
|
+
_: "stories.editStory",
|
|
4271
|
+
peer: await storyViewer.resolvePeer(client, peer),
|
|
4272
|
+
id,
|
|
4273
|
+
media,
|
|
4274
|
+
mediaAreas: interactiveElements,
|
|
4275
|
+
caption,
|
|
4276
|
+
entities,
|
|
4277
|
+
privacyRules
|
|
4278
|
+
});
|
|
4279
|
+
return _findStoryInUpdate(client, res);
|
|
4280
|
+
}
|
|
4281
|
+
async function getAllStories(client, params) {
|
|
4282
|
+
if (!params) params = {};
|
|
4283
|
+
const { offset, archived } = params;
|
|
4284
|
+
const res = await client.call({
|
|
4285
|
+
_: "stories.getAllStories",
|
|
4286
|
+
state: offset,
|
|
4287
|
+
next: Boolean(offset),
|
|
4288
|
+
hidden: archived
|
|
4289
|
+
});
|
|
4290
|
+
controllablePromise.assertTypeIsNot("getAllStories", res, "stories.allStoriesNotModified");
|
|
4291
|
+
return new storyViewer.AllStories$2(res);
|
|
4292
|
+
}
|
|
4293
|
+
async function getPeerStories(client, peerId) {
|
|
4294
|
+
const res = await client.call({
|
|
4295
|
+
_: "stories.getPeerStories",
|
|
4296
|
+
peer: await storyViewer.resolvePeer(client, peerId)
|
|
4297
|
+
});
|
|
4298
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
4299
|
+
return new storyViewer.PeerStories$2(res.stories, peers);
|
|
4300
|
+
}
|
|
4301
|
+
async function getProfileStories(client, peerId, params) {
|
|
4302
|
+
if (!params) params = {};
|
|
4303
|
+
const { kind = "pinned", offsetId = 0, limit = 100 } = params;
|
|
4304
|
+
const res = await client.call({
|
|
4305
|
+
_: kind === "pinned" ? "stories.getPinnedStories" : "stories.getStoriesArchive",
|
|
4306
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
4307
|
+
offsetId,
|
|
4308
|
+
limit
|
|
4309
|
+
});
|
|
4310
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
4311
|
+
const stories = res.stories.map((it) => {
|
|
4312
|
+
controllablePromise.assertTypeIs("getProfileStories", it, "storyItem");
|
|
4313
|
+
return new storyViewer.Story$2(it, peers);
|
|
4314
|
+
});
|
|
4315
|
+
const last = stories[stories.length - 1];
|
|
4316
|
+
const next = last?.id;
|
|
4317
|
+
return conditionVariable.makeArrayPaginated(stories, res.count, next);
|
|
4318
|
+
}
|
|
4319
|
+
async function getStoriesById(client, peerId, storyIds) {
|
|
4320
|
+
if (!Array.isArray(storyIds)) storyIds = [storyIds];
|
|
4321
|
+
const res = await client.call({
|
|
4322
|
+
_: "stories.getStoriesByID",
|
|
4323
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
4324
|
+
id: storyIds
|
|
4325
|
+
});
|
|
4326
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
4327
|
+
const stories = res.stories.map((it) => {
|
|
4328
|
+
controllablePromise.assertTypeIs("getProfileStories", it, "storyItem");
|
|
4329
|
+
return new storyViewer.Story$2(it, peers);
|
|
4330
|
+
});
|
|
4331
|
+
return stories;
|
|
4332
|
+
}
|
|
4333
|
+
async function getStoriesInteractions(client, peerId, storyIds) {
|
|
4334
|
+
if (!Array.isArray(storyIds)) storyIds = [storyIds];
|
|
4335
|
+
const res = await client.call({
|
|
4336
|
+
_: "stories.getStoriesViews",
|
|
4337
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
4338
|
+
id: storyIds
|
|
4339
|
+
});
|
|
4340
|
+
const peers = peersIndex.PeersIndex.from(res);
|
|
4341
|
+
const infos = res.views.map((it) => new storyViewer.StoryInteractions$2(it, peers));
|
|
4342
|
+
return infos;
|
|
4343
|
+
}
|
|
4344
|
+
async function getStoryLink(client, peerId, storyId) {
|
|
4345
|
+
return client.call({
|
|
4346
|
+
_: "stories.exportStoryLink",
|
|
4347
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
4348
|
+
id: storyId
|
|
4349
|
+
}).then((r) => r.link);
|
|
4350
|
+
}
|
|
4351
|
+
async function getStoryViewers(client, peerId, storyId, params) {
|
|
4352
|
+
if (!params) params = {};
|
|
4353
|
+
const { onlyContacts, sortBy = "reaction", query, offset = "", limit = 100 } = params;
|
|
4354
|
+
const res = await client.call({
|
|
4355
|
+
_: "stories.getStoryViewsList",
|
|
4356
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
4357
|
+
justContacts: onlyContacts,
|
|
4358
|
+
reactionsFirst: sortBy === "reaction",
|
|
4359
|
+
q: query,
|
|
4360
|
+
id: storyId,
|
|
4361
|
+
offset,
|
|
4362
|
+
limit
|
|
4363
|
+
});
|
|
4364
|
+
return new storyViewer.StoryViewersList$2(res);
|
|
4365
|
+
}
|
|
4366
|
+
async function hideMyStoriesViews(client, params) {
|
|
4367
|
+
const { past = true, future = true } = params ?? {};
|
|
4368
|
+
const res = await client.call({
|
|
4369
|
+
_: "stories.activateStealthMode",
|
|
4370
|
+
past,
|
|
4371
|
+
future
|
|
4372
|
+
});
|
|
4373
|
+
storyViewer.assertIsUpdatesGroup("hideMyStoriesViews", res);
|
|
4374
|
+
client.handleClientUpdate(res, true);
|
|
4375
|
+
const upd = res.updates.find(controllablePromise.hasValueAtKey("_", "updateStoriesStealthMode"));
|
|
4376
|
+
if (!upd) {
|
|
4377
|
+
throw new platform.MtTypeAssertionError("hideMyStoriesViews (@ res.updates[*])", "updateStoriesStealthMode", "none");
|
|
4378
|
+
}
|
|
4379
|
+
return new storyViewer.StoriesStealthMode$1(upd.stealthMode);
|
|
4380
|
+
}
|
|
4381
|
+
async function incrementStoriesViews(client, peerId, ids) {
|
|
4382
|
+
const r = await client.call({
|
|
4383
|
+
_: "stories.incrementStoryViews",
|
|
4384
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
4385
|
+
id: Array.isArray(ids) ? ids : [ids]
|
|
4386
|
+
});
|
|
4387
|
+
controllablePromise.assertTrue("stories.incrementStoryViews", r);
|
|
4388
|
+
}
|
|
4389
|
+
async function* iterAllStories(client, params) {
|
|
4390
|
+
if (!params) params = {};
|
|
4391
|
+
const { archived, limit = Infinity } = params;
|
|
4392
|
+
let { offset } = params;
|
|
4393
|
+
let current = 0;
|
|
4394
|
+
for (; ; ) {
|
|
4395
|
+
const res = await getAllStories(client, {
|
|
4396
|
+
offset,
|
|
4397
|
+
archived
|
|
4398
|
+
});
|
|
4399
|
+
for (const peer of res.peerStories) {
|
|
4400
|
+
yield peer;
|
|
4401
|
+
if (++current >= limit) return;
|
|
4402
|
+
}
|
|
4403
|
+
if (!res.hasMore) return;
|
|
4404
|
+
offset = res.next;
|
|
4405
|
+
}
|
|
4406
|
+
}
|
|
4407
|
+
async function* iterProfileStories(client, peerId, params) {
|
|
4408
|
+
if (!params) params = {};
|
|
4409
|
+
const { kind = "pinned", limit = Infinity, chunkSize = 100 } = params;
|
|
4410
|
+
let { offsetId } = params;
|
|
4411
|
+
let current = 0;
|
|
4412
|
+
const peer = await storyViewer.resolvePeer(client, peerId);
|
|
4413
|
+
for (; ; ) {
|
|
4414
|
+
const res = await getProfileStories(client, peer, {
|
|
4415
|
+
kind,
|
|
4416
|
+
offsetId,
|
|
4417
|
+
limit: Math.min(limit - current, chunkSize)
|
|
4418
|
+
});
|
|
4419
|
+
for (const peer2 of res) {
|
|
4420
|
+
yield peer2;
|
|
4421
|
+
if (++current >= limit) return;
|
|
4422
|
+
}
|
|
4423
|
+
if (!res.next) return;
|
|
4424
|
+
offsetId = res.next;
|
|
4425
|
+
}
|
|
4426
|
+
}
|
|
4427
|
+
async function* iterStoryViewers(client, peerId, storyId, params) {
|
|
4428
|
+
if (!params) params = {};
|
|
4429
|
+
const { onlyContacts, sortBy = "reaction", query, limit = Infinity, chunkSize = 100 } = params;
|
|
4430
|
+
let { offset = "" } = params;
|
|
4431
|
+
let current = 0;
|
|
4432
|
+
const peer = await storyViewer.resolvePeer(client, peerId);
|
|
4433
|
+
for (; ; ) {
|
|
4434
|
+
const res = await getStoryViewers(client, peer, storyId, {
|
|
4435
|
+
onlyContacts,
|
|
4436
|
+
sortBy,
|
|
4437
|
+
query,
|
|
4438
|
+
offset,
|
|
4439
|
+
limit: Math.min(limit - current, chunkSize)
|
|
4440
|
+
});
|
|
4441
|
+
for (const peer2 of res.viewers) {
|
|
4442
|
+
yield peer2;
|
|
4443
|
+
if (++current >= limit) return;
|
|
4444
|
+
}
|
|
4445
|
+
if (!res.next) return;
|
|
4446
|
+
offset = res.next;
|
|
4447
|
+
}
|
|
4448
|
+
}
|
|
4449
|
+
async function readStories(client, peerId, maxId) {
|
|
4450
|
+
return client.call({
|
|
4451
|
+
_: "stories.readStories",
|
|
4452
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
4453
|
+
maxId
|
|
4454
|
+
});
|
|
4455
|
+
}
|
|
4456
|
+
async function reportStory(client, peerId, storyIds, params) {
|
|
4457
|
+
const { reason = { _: "inputReportReasonSpam" }, message = "" } = params ?? {};
|
|
4458
|
+
const r = await client.call({
|
|
4459
|
+
_: "stories.report",
|
|
4460
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
4461
|
+
id: Array.isArray(storyIds) ? storyIds : [storyIds],
|
|
4462
|
+
message,
|
|
4463
|
+
reason
|
|
4464
|
+
});
|
|
4465
|
+
controllablePromise.assertTrue("stories.report", r);
|
|
4466
|
+
}
|
|
4467
|
+
async function sendStoryReaction(client, params) {
|
|
4468
|
+
const { peerId, storyId, reaction, addToRecent } = params;
|
|
4469
|
+
const res = await client.call({
|
|
4470
|
+
_: "stories.sendReaction",
|
|
4471
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
4472
|
+
storyId,
|
|
4473
|
+
reaction: storyViewer.normalizeInputReaction(reaction),
|
|
4474
|
+
addToRecent
|
|
4475
|
+
});
|
|
4476
|
+
client.handleClientUpdate(res, true);
|
|
4477
|
+
}
|
|
4478
|
+
async function sendStory(client, params) {
|
|
4479
|
+
const { peer = "me", pinned, forbidForwards, interactiveElements, period } = params;
|
|
4480
|
+
let { media } = params;
|
|
4481
|
+
if (typeof media === "string") {
|
|
4482
|
+
media = {
|
|
4483
|
+
type: "auto",
|
|
4484
|
+
file: media
|
|
4485
|
+
};
|
|
4486
|
+
}
|
|
4487
|
+
const inputMedia = await storyViewer._normalizeInputMedia(client, media);
|
|
4488
|
+
const privacyRules = params.privacyRules ? await _normalizePrivacyRules(client, params.privacyRules) : [{ _: "inputPrivacyValueAllowAll" }];
|
|
4489
|
+
const [caption, entities] = await storyViewer._normalizeInputText(
|
|
4490
|
+
client,
|
|
4491
|
+
// some types dont have `caption` field, and ts warns us,
|
|
4492
|
+
// but since it's JS, they'll just be `undefined` and properly handled by the method
|
|
4493
|
+
params.caption || media.caption
|
|
4494
|
+
);
|
|
4495
|
+
const res = await client.call({
|
|
4496
|
+
_: "stories.sendStory",
|
|
4497
|
+
pinned,
|
|
4498
|
+
noforwards: forbidForwards,
|
|
4499
|
+
peer: await storyViewer.resolvePeer(client, peer),
|
|
4500
|
+
media: inputMedia,
|
|
4501
|
+
mediaAreas: interactiveElements,
|
|
4502
|
+
caption,
|
|
4503
|
+
entities,
|
|
4504
|
+
privacyRules,
|
|
4505
|
+
randomId: conditionVariable.randomLong(),
|
|
4506
|
+
period
|
|
4507
|
+
});
|
|
4508
|
+
return _findStoryInUpdate(client, res);
|
|
4509
|
+
}
|
|
4510
|
+
async function togglePeerStoriesArchived(client, peerId, archived) {
|
|
4511
|
+
const r = await client.call({
|
|
4512
|
+
_: "stories.togglePeerStoriesHidden",
|
|
4513
|
+
peer: await storyViewer.resolvePeer(client, peerId),
|
|
4514
|
+
hidden: archived
|
|
4515
|
+
});
|
|
4516
|
+
controllablePromise.assertTrue("stories.togglePeerStoriesHidden", r);
|
|
4517
|
+
}
|
|
4518
|
+
async function toggleStoriesPinned(client, params) {
|
|
4519
|
+
const { ids, pinned, peer = "me" } = params;
|
|
4520
|
+
return client.call({
|
|
4521
|
+
_: "stories.togglePinned",
|
|
4522
|
+
peer: await storyViewer.resolvePeer(client, peer),
|
|
4523
|
+
id: Array.isArray(ids) ? ids : [ids],
|
|
4524
|
+
pinned
|
|
4525
|
+
});
|
|
4526
|
+
}
|
|
4527
|
+
async function blockUser(client, id) {
|
|
4528
|
+
const r = await client.call({
|
|
4529
|
+
_: "contacts.block",
|
|
4530
|
+
id: await storyViewer.resolvePeer(client, id)
|
|
4531
|
+
});
|
|
4532
|
+
controllablePromise.assertTrue("contacts.block", r);
|
|
4533
|
+
}
|
|
4534
|
+
async function deleteProfilePhotos(client, ids) {
|
|
4535
|
+
if (!Array.isArray(ids)) ids = [ids];
|
|
4536
|
+
const photos = ids.map((id) => {
|
|
4537
|
+
if (typeof id === "string") {
|
|
4538
|
+
return storyViewer.fileIdToInputPhoto(id);
|
|
4539
|
+
}
|
|
4540
|
+
return id;
|
|
4541
|
+
});
|
|
4542
|
+
await client.call({
|
|
4543
|
+
_: "photos.deletePhotos",
|
|
4544
|
+
id: photos
|
|
4545
|
+
});
|
|
4546
|
+
}
|
|
4547
|
+
async function editCloseFriendsRaw(client, ids) {
|
|
4548
|
+
const r = await client.call({
|
|
4549
|
+
_: "contacts.editCloseFriends",
|
|
4550
|
+
id: ids
|
|
4551
|
+
});
|
|
4552
|
+
controllablePromise.assertTrue("contacts.editCloseFriends", r);
|
|
4553
|
+
}
|
|
4554
|
+
async function editCloseFriends(client, ids) {
|
|
4555
|
+
const r = await client.call({
|
|
4556
|
+
_: "contacts.editCloseFriends",
|
|
4557
|
+
id: await storyViewer.resolvePeerMany(client, ids, conditionVariable.toInputUser).then(
|
|
4558
|
+
(r2) => r2.map((u) => {
|
|
4559
|
+
if ("userId" in u) return u.userId;
|
|
4560
|
+
return 0;
|
|
4561
|
+
})
|
|
4562
|
+
)
|
|
4563
|
+
});
|
|
4564
|
+
controllablePromise.assertTrue("contacts.editCloseFriends", r);
|
|
4565
|
+
}
|
|
4566
|
+
async function getCommonChats(client, userId) {
|
|
4567
|
+
return client.call({
|
|
4568
|
+
_: "messages.getCommonChats",
|
|
4569
|
+
userId: await storyViewer.resolveUser(client, userId),
|
|
4570
|
+
maxId: 0,
|
|
4571
|
+
limit: 100
|
|
4572
|
+
}).then((res) => res.chats.map((it) => new storyViewer.Chat$2(it)));
|
|
4573
|
+
}
|
|
4574
|
+
async function getGlobalTtl(client) {
|
|
4575
|
+
return client.call({
|
|
4576
|
+
_: "messages.getDefaultHistoryTTL"
|
|
4577
|
+
}).then((r) => r.period);
|
|
4578
|
+
}
|
|
4579
|
+
async function getMyUsername(client) {
|
|
4580
|
+
return client.storage.self.fetch().then((self) => self?.usernames[0] ?? null);
|
|
4581
|
+
}
|
|
4582
|
+
async function getProfilePhoto(client, userId, photoId) {
|
|
4583
|
+
const res = await client.call({
|
|
4584
|
+
_: "photos.getUserPhotos",
|
|
4585
|
+
userId: await storyViewer.resolveUser(client, userId),
|
|
4586
|
+
offset: -1,
|
|
4587
|
+
limit: 1,
|
|
4588
|
+
maxId: photoId
|
|
4589
|
+
});
|
|
4590
|
+
const photo = res.photos[0];
|
|
4591
|
+
controllablePromise.assertTypeIs("getProfilePhotos", photo, "photo");
|
|
4592
|
+
return new storyViewer.Photo$2(photo);
|
|
4593
|
+
}
|
|
4594
|
+
async function getProfilePhotos(client, userId, params) {
|
|
4595
|
+
if (!params) params = {};
|
|
4596
|
+
const { offset = 0, limit = 100 } = params;
|
|
4597
|
+
const res = await client.call({
|
|
4598
|
+
_: "photos.getUserPhotos",
|
|
4599
|
+
userId: await storyViewer.resolveUser(client, userId),
|
|
4600
|
+
offset,
|
|
4601
|
+
limit,
|
|
4602
|
+
maxId: Long.ZERO
|
|
4603
|
+
});
|
|
4604
|
+
return conditionVariable.makeArrayPaginated(
|
|
4605
|
+
res.photos.map((it) => {
|
|
4606
|
+
controllablePromise.assertTypeIs("getProfilePhotos", it, "photo");
|
|
4607
|
+
return new storyViewer.Photo$2(it);
|
|
4608
|
+
}),
|
|
4609
|
+
res.count ?? res.photos.length,
|
|
4610
|
+
offset + res.photos.length
|
|
4611
|
+
);
|
|
4612
|
+
}
|
|
4613
|
+
async function getUsers(client, ids) {
|
|
4614
|
+
if (!Array.isArray(ids)) {
|
|
4615
|
+
const res2 = await storyViewer._getUsersBatched(client, await storyViewer.resolveUser(client, ids));
|
|
4616
|
+
return [res2 ? new storyViewer.User$2(res2) : null];
|
|
4617
|
+
}
|
|
4618
|
+
const inputPeers = await storyViewer.resolvePeerMany(client, ids, conditionVariable.toInputUser);
|
|
4619
|
+
const res = await Promise.all(inputPeers.map((peer) => storyViewer._getUsersBatched(client, peer)));
|
|
4620
|
+
return res.map((it) => it ? new storyViewer.User$2(it) : null);
|
|
4621
|
+
}
|
|
4622
|
+
async function* iterProfilePhotos(client, userId, params) {
|
|
4623
|
+
if (!params) params = {};
|
|
4624
|
+
const peer = await storyViewer.resolveUser(client, userId);
|
|
4625
|
+
const { limit = Infinity, chunkSize = 100 } = params;
|
|
4626
|
+
let { offset } = params;
|
|
4627
|
+
let current = 0;
|
|
4628
|
+
for (; ; ) {
|
|
4629
|
+
const res = await getProfilePhotos(client, peer, {
|
|
4630
|
+
offset,
|
|
4631
|
+
limit: Math.min(chunkSize, limit - current)
|
|
4632
|
+
});
|
|
4633
|
+
for (const it of res) {
|
|
4634
|
+
yield it;
|
|
4635
|
+
if (++current >= limit) return;
|
|
4636
|
+
}
|
|
4637
|
+
if (!res.next) return;
|
|
4638
|
+
offset = res.next;
|
|
4639
|
+
}
|
|
4640
|
+
}
|
|
4641
|
+
async function setGlobalTtl(client, period) {
|
|
4642
|
+
const r = await client.call({
|
|
4643
|
+
_: "messages.setDefaultHistoryTTL",
|
|
4644
|
+
period
|
|
4645
|
+
});
|
|
4646
|
+
controllablePromise.assertTrue("messages.setDefaultHistoryTTL", r);
|
|
4647
|
+
}
|
|
4648
|
+
async function setMyBirthday(client, birthday) {
|
|
4649
|
+
const res = await client.call({
|
|
4650
|
+
_: "account.updateBirthday",
|
|
4651
|
+
birthday: birthday ? {
|
|
4652
|
+
_: "birthday",
|
|
4653
|
+
...birthday
|
|
4654
|
+
} : void 0
|
|
4655
|
+
});
|
|
4656
|
+
controllablePromise.assertTrue("account.updateBirthday", res);
|
|
4657
|
+
}
|
|
4658
|
+
async function setMyEmojiStatus(client, emoji, params) {
|
|
4659
|
+
const { until } = params ?? {};
|
|
4660
|
+
let emojiStatus;
|
|
4661
|
+
if (emoji === null) {
|
|
4662
|
+
emojiStatus = { _: "emojiStatusEmpty" };
|
|
4663
|
+
} else if (until) {
|
|
4664
|
+
emojiStatus = {
|
|
4665
|
+
_: "emojiStatusUntil",
|
|
4666
|
+
documentId: emoji,
|
|
4667
|
+
until: conditionVariable.normalizeDate(until)
|
|
4668
|
+
};
|
|
4669
|
+
} else {
|
|
4670
|
+
emojiStatus = {
|
|
4671
|
+
_: "emojiStatus",
|
|
4672
|
+
documentId: emoji
|
|
4673
|
+
};
|
|
4674
|
+
}
|
|
4675
|
+
const r = await client.call({
|
|
4676
|
+
_: "account.updateEmojiStatus",
|
|
4677
|
+
emojiStatus
|
|
4678
|
+
});
|
|
4679
|
+
controllablePromise.assertTrue("account.updateEmojiStatus", r);
|
|
4680
|
+
}
|
|
4681
|
+
async function setMyProfilePhoto(client, params) {
|
|
4682
|
+
const { type, previewSec } = params;
|
|
4683
|
+
let { media } = params;
|
|
4684
|
+
if (fileId.tdFileId.isFileIdLike(media) || typeof media === "object" && tl.tl.isAnyInputPhoto(media)) {
|
|
4685
|
+
if (typeof media === "string" && media.match(/^https?:\/\//)) {
|
|
4686
|
+
throw new platform.MtArgumentError("Profile photo can't be set from URL.");
|
|
4687
|
+
}
|
|
4688
|
+
if (typeof media !== "string" || !media.match(/^file:/)) {
|
|
4689
|
+
if (fileId.tdFileId.isFileIdLike(media)) {
|
|
4690
|
+
media = storyViewer.fileIdToInputPhoto(media);
|
|
4691
|
+
}
|
|
4692
|
+
const res2 = await client.call({
|
|
4693
|
+
_: "photos.updateProfilePhoto",
|
|
4694
|
+
id: media
|
|
4695
|
+
});
|
|
4696
|
+
return new storyViewer.Photo$2(res2.photo);
|
|
4697
|
+
}
|
|
4698
|
+
}
|
|
4699
|
+
const res = await client.call({
|
|
4700
|
+
_: "photos.uploadProfilePhoto",
|
|
4701
|
+
[type === "photo" ? "file" : "video"]: await storyViewer._normalizeInputFile(client, media, {}),
|
|
4702
|
+
videoStartTs: previewSec
|
|
4703
|
+
});
|
|
4704
|
+
return new storyViewer.Photo$2(res.photo);
|
|
4705
|
+
}
|
|
4706
|
+
async function setMyUsername(client, username) {
|
|
4707
|
+
if (username === null) username = "";
|
|
4708
|
+
const res = await client.call({
|
|
4709
|
+
_: "account.updateUsername",
|
|
4710
|
+
username
|
|
4711
|
+
});
|
|
4712
|
+
await client.storage.self.update({ username });
|
|
4713
|
+
return new storyViewer.User$2(res);
|
|
4714
|
+
}
|
|
4715
|
+
async function setOffline(client, offline = true) {
|
|
4716
|
+
await client.call({
|
|
4717
|
+
_: "account.updateStatus",
|
|
4718
|
+
offline
|
|
4719
|
+
});
|
|
4720
|
+
}
|
|
4721
|
+
async function unblockUser(client, id) {
|
|
4722
|
+
const r = await client.call({
|
|
4723
|
+
_: "contacts.unblock",
|
|
4724
|
+
id: await storyViewer.resolvePeer(client, id)
|
|
4725
|
+
});
|
|
4726
|
+
controllablePromise.assertTrue("contacts.unblock", r);
|
|
4727
|
+
}
|
|
4728
|
+
async function updateProfile(client, params) {
|
|
4729
|
+
const res = await client.call({
|
|
4730
|
+
_: "account.updateProfile",
|
|
4731
|
+
firstName: params.firstName,
|
|
4732
|
+
lastName: params.lastName,
|
|
4733
|
+
about: params.bio
|
|
4734
|
+
});
|
|
4735
|
+
return new storyViewer.User$2(res);
|
|
4736
|
+
}
|
|
4737
|
+
exports._normalizePrivacyRules = _normalizePrivacyRules;
|
|
4738
|
+
exports.addChatMembers = addChatMembers;
|
|
4739
|
+
exports.addContact = addContact;
|
|
4740
|
+
exports.addStickerToSet = addStickerToSet;
|
|
4741
|
+
exports.answerCallbackQuery = answerCallbackQuery;
|
|
4742
|
+
exports.answerInlineQuery = answerInlineQuery;
|
|
4743
|
+
exports.answerMedia = answerMedia;
|
|
4744
|
+
exports.answerMediaGroup = answerMediaGroup;
|
|
4745
|
+
exports.answerPreCheckoutQuery = answerPreCheckoutQuery;
|
|
4746
|
+
exports.answerText = answerText;
|
|
4747
|
+
exports.applyBoost = applyBoost;
|
|
4748
|
+
exports.archiveChats = archiveChats;
|
|
4749
|
+
exports.banChatMember = banChatMember;
|
|
4750
|
+
exports.blockUser = blockUser;
|
|
4751
|
+
exports.canApplyBoost = canApplyBoost;
|
|
4752
|
+
exports.canSendStory = canSendStory;
|
|
4753
|
+
exports.cancelPasswordEmail = cancelPasswordEmail;
|
|
4754
|
+
exports.changeCloudPassword = changeCloudPassword;
|
|
4755
|
+
exports.checkPassword = checkPassword;
|
|
4756
|
+
exports.closeChat = closeChat;
|
|
4757
|
+
exports.closePoll = closePoll;
|
|
4758
|
+
exports.commentMedia = commentMedia;
|
|
4759
|
+
exports.commentMediaGroup = commentMediaGroup;
|
|
4760
|
+
exports.commentText = commentText;
|
|
4761
|
+
exports.createBusinessChatLink = createBusinessChatLink;
|
|
4762
|
+
exports.createChannel = createChannel;
|
|
4763
|
+
exports.createFolder = createFolder;
|
|
4764
|
+
exports.createForumTopic = createForumTopic;
|
|
4765
|
+
exports.createGroup = createGroup;
|
|
4766
|
+
exports.createInviteLink = createInviteLink;
|
|
4767
|
+
exports.createStickerSet = createStickerSet;
|
|
4768
|
+
exports.createSupergroup = createSupergroup;
|
|
4769
|
+
exports.deleteBusinessChatLink = deleteBusinessChatLink;
|
|
4770
|
+
exports.deleteChannel = deleteChannel;
|
|
4771
|
+
exports.deleteChatPhoto = deleteChatPhoto;
|
|
4772
|
+
exports.deleteContacts = deleteContacts;
|
|
4773
|
+
exports.deleteFolder = deleteFolder;
|
|
4774
|
+
exports.deleteForumTopicHistory = deleteForumTopicHistory;
|
|
4775
|
+
exports.deleteGroup = deleteGroup;
|
|
4776
|
+
exports.deleteHistory = deleteHistory;
|
|
4777
|
+
exports.deleteMessages = deleteMessages;
|
|
4778
|
+
exports.deleteMessagesById = deleteMessagesById;
|
|
4779
|
+
exports.deleteMyCommands = deleteMyCommands;
|
|
4780
|
+
exports.deleteProfilePhotos = deleteProfilePhotos;
|
|
4781
|
+
exports.deleteScheduledMessages = deleteScheduledMessages;
|
|
4782
|
+
exports.deleteStickerFromSet = deleteStickerFromSet;
|
|
4783
|
+
exports.deleteStories = deleteStories;
|
|
4784
|
+
exports.deleteUserHistory = deleteUserHistory;
|
|
4785
|
+
exports.downloadAsBuffer = downloadAsBuffer;
|
|
4786
|
+
exports.downloadAsIterable = downloadAsIterable;
|
|
4787
|
+
exports.downloadAsStream = downloadAsStream;
|
|
4788
|
+
exports.editAdminRights = editAdminRights;
|
|
4789
|
+
exports.editBusinessChatLink = editBusinessChatLink;
|
|
4790
|
+
exports.editCloseFriends = editCloseFriends;
|
|
4791
|
+
exports.editCloseFriendsRaw = editCloseFriendsRaw;
|
|
4792
|
+
exports.editFolder = editFolder;
|
|
4793
|
+
exports.editForumTopic = editForumTopic;
|
|
4794
|
+
exports.editInlineMessage = editInlineMessage;
|
|
4795
|
+
exports.editInviteLink = editInviteLink;
|
|
4796
|
+
exports.editMessage = editMessage;
|
|
4797
|
+
exports.editStory = editStory;
|
|
4798
|
+
exports.enableCloudPassword = enableCloudPassword;
|
|
4799
|
+
exports.exportInviteLink = exportInviteLink;
|
|
4800
|
+
exports.findDialogs = findDialogs;
|
|
4801
|
+
exports.findFolder = findFolder;
|
|
4802
|
+
exports.forwardMessages = forwardMessages;
|
|
4803
|
+
exports.forwardMessagesById = forwardMessagesById;
|
|
4804
|
+
exports.getAllScheduledMessages = getAllScheduledMessages;
|
|
4805
|
+
exports.getAllStories = getAllStories;
|
|
4806
|
+
exports.getAvailableMessageEffects = getAvailableMessageEffects;
|
|
4807
|
+
exports.getBoostStats = getBoostStats;
|
|
4808
|
+
exports.getBoosts = getBoosts;
|
|
4809
|
+
exports.getBotInfo = getBotInfo;
|
|
4810
|
+
exports.getBotMenuButton = getBotMenuButton;
|
|
4811
|
+
exports.getBusinessChatLinks = getBusinessChatLinks;
|
|
4812
|
+
exports.getCallbackAnswer = getCallbackAnswer;
|
|
4813
|
+
exports.getCallbackQueryMessage = getCallbackQueryMessage;
|
|
4814
|
+
exports.getChat = getChat;
|
|
4815
|
+
exports.getChatEventLog = getChatEventLog;
|
|
4816
|
+
exports.getChatMember = getChatMember;
|
|
4817
|
+
exports.getChatMembers = getChatMembers;
|
|
4818
|
+
exports.getChatPreview = getChatPreview;
|
|
4819
|
+
exports.getChatlistPreview = getChatlistPreview;
|
|
4820
|
+
exports.getCollectibleInfo = getCollectibleInfo;
|
|
4821
|
+
exports.getCommonChats = getCommonChats;
|
|
4822
|
+
exports.getContacts = getContacts;
|
|
4823
|
+
exports.getCustomEmojis = getCustomEmojis;
|
|
4824
|
+
exports.getCustomEmojisFromMessages = getCustomEmojisFromMessages;
|
|
4825
|
+
exports.getFactCheck = getFactCheck;
|
|
4826
|
+
exports.getFolders = getFolders;
|
|
4827
|
+
exports.getForumTopics = getForumTopics;
|
|
4828
|
+
exports.getForumTopicsById = getForumTopicsById;
|
|
4829
|
+
exports.getFullChat = getFullChat;
|
|
4830
|
+
exports.getGameHighScores = getGameHighScores;
|
|
4831
|
+
exports.getGlobalTtl = getGlobalTtl;
|
|
4832
|
+
exports.getHistory = getHistory;
|
|
4833
|
+
exports.getInlineGameHighScores = getInlineGameHighScores;
|
|
4834
|
+
exports.getInstalledStickers = getInstalledStickers;
|
|
4835
|
+
exports.getInviteLink = getInviteLink;
|
|
4836
|
+
exports.getInviteLinkMembers = getInviteLinkMembers;
|
|
4837
|
+
exports.getInviteLinks = getInviteLinks;
|
|
4838
|
+
exports.getMe = getMe;
|
|
4839
|
+
exports.getMessageByLink = getMessageByLink;
|
|
4840
|
+
exports.getMessageGroup = getMessageGroup;
|
|
4841
|
+
exports.getMessageReactions = getMessageReactions;
|
|
4842
|
+
exports.getMessageReactionsById = getMessageReactionsById;
|
|
4843
|
+
exports.getMessagesUnsafe = getMessagesUnsafe;
|
|
4844
|
+
exports.getMyBoostSlots = getMyBoostSlots;
|
|
4845
|
+
exports.getMyCommands = getMyCommands;
|
|
4846
|
+
exports.getMyStickerSets = getMyStickerSets;
|
|
4847
|
+
exports.getMyUsername = getMyUsername;
|
|
4848
|
+
exports.getNearbyChats = getNearbyChats;
|
|
4849
|
+
exports.getPasswordHint = getPasswordHint;
|
|
4850
|
+
exports.getPeerStories = getPeerStories;
|
|
4851
|
+
exports.getPrimaryInviteLink = getPrimaryInviteLink;
|
|
4852
|
+
exports.getProfilePhoto = getProfilePhoto;
|
|
4853
|
+
exports.getProfilePhotos = getProfilePhotos;
|
|
4854
|
+
exports.getProfileStories = getProfileStories;
|
|
4855
|
+
exports.getReactionUsers = getReactionUsers;
|
|
4856
|
+
exports.getReplyTo = getReplyTo;
|
|
4857
|
+
exports.getScheduledMessages = getScheduledMessages;
|
|
4858
|
+
exports.getSimilarChannels = getSimilarChannels;
|
|
4859
|
+
exports.getStarsTransactions = getStarsTransactions;
|
|
4860
|
+
exports.getStickerSet = getStickerSet;
|
|
4861
|
+
exports.getStoriesById = getStoriesById;
|
|
4862
|
+
exports.getStoriesInteractions = getStoriesInteractions;
|
|
4863
|
+
exports.getStoryLink = getStoryLink;
|
|
4864
|
+
exports.getStoryViewers = getStoryViewers;
|
|
4865
|
+
exports.getUsers = getUsers;
|
|
4866
|
+
exports.hideAllJoinRequests = hideAllJoinRequests;
|
|
4867
|
+
exports.hideJoinRequest = hideJoinRequest;
|
|
4868
|
+
exports.hideMyStoriesViews = hideMyStoriesViews;
|
|
4869
|
+
exports.importContacts = importContacts;
|
|
4870
|
+
exports.incrementStoriesViews = incrementStoriesViews;
|
|
4871
|
+
exports.initTakeoutSession = initTakeoutSession;
|
|
4872
|
+
exports.isSelfPeer = isSelfPeer;
|
|
4873
|
+
exports.iterAllStories = iterAllStories;
|
|
4874
|
+
exports.iterBoosters = iterBoosters;
|
|
4875
|
+
exports.iterChatEventLog = iterChatEventLog;
|
|
4876
|
+
exports.iterChatMembers = iterChatMembers;
|
|
4877
|
+
exports.iterDialogs = iterDialogs;
|
|
4878
|
+
exports.iterForumTopics = iterForumTopics;
|
|
4879
|
+
exports.iterHistory = iterHistory;
|
|
4880
|
+
exports.iterInviteLinkMembers = iterInviteLinkMembers;
|
|
4881
|
+
exports.iterInviteLinks = iterInviteLinks;
|
|
4882
|
+
exports.iterProfilePhotos = iterProfilePhotos;
|
|
4883
|
+
exports.iterProfileStories = iterProfileStories;
|
|
4884
|
+
exports.iterReactionUsers = iterReactionUsers;
|
|
4885
|
+
exports.iterSearchGlobal = iterSearchGlobal;
|
|
4886
|
+
exports.iterSearchHashtag = iterSearchHashtag;
|
|
4887
|
+
exports.iterSearchMessages = iterSearchMessages;
|
|
4888
|
+
exports.iterStarsTransactions = iterStarsTransactions;
|
|
4889
|
+
exports.iterStoryViewers = iterStoryViewers;
|
|
4890
|
+
exports.joinChat = joinChat;
|
|
4891
|
+
exports.joinChatlist = joinChatlist;
|
|
4892
|
+
exports.kickChatMember = kickChatMember;
|
|
4893
|
+
exports.leaveChat = leaveChat;
|
|
4894
|
+
exports.logOut = logOut;
|
|
4895
|
+
exports.markChatUnread = markChatUnread;
|
|
4896
|
+
exports.moveStickerInSet = moveStickerInSet;
|
|
4897
|
+
exports.openChat = openChat;
|
|
4898
|
+
exports.pinMessage = pinMessage;
|
|
4899
|
+
exports.quoteWithMedia = quoteWithMedia;
|
|
4900
|
+
exports.quoteWithMediaGroup = quoteWithMediaGroup;
|
|
4901
|
+
exports.quoteWithText = quoteWithText;
|
|
4902
|
+
exports.readReactions = readReactions;
|
|
4903
|
+
exports.readStories = readStories;
|
|
4904
|
+
exports.recoverPassword = recoverPassword;
|
|
4905
|
+
exports.removeCloudPassword = removeCloudPassword;
|
|
4906
|
+
exports.reorderPinnedForumTopics = reorderPinnedForumTopics;
|
|
4907
|
+
exports.reorderUsernames = reorderUsernames;
|
|
4908
|
+
exports.replaceStickerInSet = replaceStickerInSet;
|
|
4909
|
+
exports.replyMedia = replyMedia;
|
|
4910
|
+
exports.replyMediaGroup = replyMediaGroup;
|
|
4911
|
+
exports.replyText = replyText;
|
|
4912
|
+
exports.reportStory = reportStory;
|
|
4913
|
+
exports.resendCode = resendCode;
|
|
4914
|
+
exports.resendPasswordEmail = resendPasswordEmail;
|
|
4915
|
+
exports.restrictChatMember = restrictChatMember;
|
|
4916
|
+
exports.revokeInviteLink = revokeInviteLink;
|
|
4917
|
+
exports.run = run;
|
|
4918
|
+
exports.saveDraft = saveDraft;
|
|
4919
|
+
exports.searchGlobal = searchGlobal;
|
|
4920
|
+
exports.searchHashtag = searchHashtag;
|
|
4921
|
+
exports.searchMessages = searchMessages;
|
|
4922
|
+
exports.sendCode = sendCode;
|
|
4923
|
+
exports.sendCopy = sendCopy;
|
|
4924
|
+
exports.sendCopyGroup = sendCopyGroup;
|
|
4925
|
+
exports.sendPaidReaction = sendPaidReaction;
|
|
4926
|
+
exports.sendReaction = sendReaction;
|
|
4927
|
+
exports.sendRecoveryCode = sendRecoveryCode;
|
|
4928
|
+
exports.sendScheduled = sendScheduled;
|
|
4929
|
+
exports.sendStory = sendStory;
|
|
4930
|
+
exports.sendStoryReaction = sendStoryReaction;
|
|
4931
|
+
exports.sendTyping = sendTyping;
|
|
4932
|
+
exports.sendVote = sendVote;
|
|
4933
|
+
exports.setBotInfo = setBotInfo;
|
|
4934
|
+
exports.setBotMenuButton = setBotMenuButton;
|
|
4935
|
+
exports.setBusinessIntro = setBusinessIntro;
|
|
4936
|
+
exports.setBusinessWorkHours = setBusinessWorkHours;
|
|
4937
|
+
exports.setChatColor = setChatColor;
|
|
4938
|
+
exports.setChatDefaultPermissions = setChatDefaultPermissions;
|
|
4939
|
+
exports.setChatDescription = setChatDescription;
|
|
4940
|
+
exports.setChatPhoto = setChatPhoto;
|
|
4941
|
+
exports.setChatStickerSet = setChatStickerSet;
|
|
4942
|
+
exports.setChatTitle = setChatTitle;
|
|
4943
|
+
exports.setChatTtl = setChatTtl;
|
|
4944
|
+
exports.setChatUsername = setChatUsername;
|
|
4945
|
+
exports.setFoldersOrder = setFoldersOrder;
|
|
4946
|
+
exports.setGameScore = setGameScore;
|
|
4947
|
+
exports.setGlobalTtl = setGlobalTtl;
|
|
4948
|
+
exports.setInlineGameScore = setInlineGameScore;
|
|
4949
|
+
exports.setMyBirthday = setMyBirthday;
|
|
4950
|
+
exports.setMyCommands = setMyCommands;
|
|
4951
|
+
exports.setMyDefaultRights = setMyDefaultRights;
|
|
4952
|
+
exports.setMyEmojiStatus = setMyEmojiStatus;
|
|
4953
|
+
exports.setMyProfilePhoto = setMyProfilePhoto;
|
|
4954
|
+
exports.setMyUsername = setMyUsername;
|
|
4955
|
+
exports.setOffline = setOffline;
|
|
4956
|
+
exports.setSlowMode = setSlowMode;
|
|
4957
|
+
exports.setStickerSetThumb = setStickerSetThumb;
|
|
4958
|
+
exports.signIn = signIn;
|
|
4959
|
+
exports.signInBot = signInBot;
|
|
4960
|
+
exports.signInQr = signInQr;
|
|
4961
|
+
exports.start = start;
|
|
4962
|
+
exports.startTest = startTest;
|
|
4963
|
+
exports.toggleContentProtection = toggleContentProtection;
|
|
4964
|
+
exports.toggleForum = toggleForum;
|
|
4965
|
+
exports.toggleForumTopicClosed = toggleForumTopicClosed;
|
|
4966
|
+
exports.toggleForumTopicPinned = toggleForumTopicPinned;
|
|
4967
|
+
exports.toggleFragmentUsername = toggleFragmentUsername;
|
|
4968
|
+
exports.toggleGeneralTopicHidden = toggleGeneralTopicHidden;
|
|
4969
|
+
exports.toggleJoinRequests = toggleJoinRequests;
|
|
4970
|
+
exports.toggleJoinToSend = toggleJoinToSend;
|
|
4971
|
+
exports.togglePeerStoriesArchived = togglePeerStoriesArchived;
|
|
4972
|
+
exports.toggleStoriesPinned = toggleStoriesPinned;
|
|
4973
|
+
exports.translateMessage = translateMessage;
|
|
4974
|
+
exports.translateText = translateText;
|
|
4975
|
+
exports.unarchiveChats = unarchiveChats;
|
|
4976
|
+
exports.unbanChatMember = unbanChatMember;
|
|
4977
|
+
exports.unblockUser = unblockUser;
|
|
4978
|
+
exports.unpinAllMessages = unpinAllMessages;
|
|
4979
|
+
exports.unpinMessage = unpinMessage;
|
|
4980
|
+
exports.updateProfile = updateProfile;
|
|
4981
|
+
exports.uploadMedia = uploadMedia;
|
|
4982
|
+
exports.verifyPasswordEmail = verifyPasswordEmail;
|