@mtcute/core 0.18.0-rc.5 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.d.cts +1 -0
- package/highlevel/base.d.cts +115 -0
- package/highlevel/base.test.d.cts +1 -0
- package/highlevel/client.d.cts +5045 -0
- package/highlevel/client.types.d.cts +61 -0
- package/highlevel/index.d.cts +4 -0
- package/highlevel/managers/app-config-manager.d.cts +11 -0
- package/highlevel/managers/timers.d.cts +10 -0
- package/highlevel/methods/_imports.d.cts +1 -0
- package/highlevel/methods/_init.d.cts +1 -0
- package/highlevel/methods/auth/check-password.d.cts +10 -0
- package/highlevel/methods/auth/get-password-hint.d.cts +7 -0
- package/highlevel/methods/auth/log-out.d.cts +17 -0
- package/highlevel/methods/auth/recover-password.d.cts +12 -0
- package/highlevel/methods/auth/resend-code.d.cts +16 -0
- package/highlevel/methods/auth/run.d.cts +16 -0
- package/highlevel/methods/auth/send-code.d.cts +18 -0
- package/highlevel/methods/auth/send-recovery-code.d.cts +7 -0
- package/highlevel/methods/auth/sign-in-bot.d.cts +10 -0
- package/highlevel/methods/auth/sign-in-qr.d.cts +33 -0
- package/highlevel/methods/auth/sign-in.d.cts +19 -0
- package/highlevel/methods/auth/start-test.d.cts +30 -0
- package/highlevel/methods/auth/start.d.cts +89 -0
- package/highlevel/methods/auth/utils.d.cts +9 -0
- package/highlevel/methods/bots/answer-callback-query.d.cts +41 -0
- package/highlevel/methods/bots/answer-inline-query.d.cts +88 -0
- package/highlevel/methods/bots/answer-pre-checkout-query.d.cts +12 -0
- package/highlevel/methods/bots/delete-my-commands.d.cts +22 -0
- package/highlevel/methods/bots/get-bot-info.d.cts +18 -0
- package/highlevel/methods/bots/get-bot-menu-button.d.cts +7 -0
- package/highlevel/methods/bots/get-callback-answer.d.cts +41 -0
- package/highlevel/methods/bots/get-game-high-scores.d.cts +17 -0
- package/highlevel/methods/bots/get-my-commands.d.cts +21 -0
- package/highlevel/methods/bots/normalize-command-scope.d.cts +5 -0
- package/highlevel/methods/bots/open-webview.d.cts +73 -0
- package/highlevel/methods/bots/prepare-inline-message.d.cts +32 -0
- package/highlevel/methods/bots/set-bot-info.d.cts +23 -0
- package/highlevel/methods/bots/set-bot-menu-button.d.cts +7 -0
- package/highlevel/methods/bots/set-game-score.d.cts +54 -0
- package/highlevel/methods/bots/set-my-commands.d.cts +26 -0
- package/highlevel/methods/bots/set-my-default-rights.d.cts +11 -0
- package/highlevel/methods/bots/toggle-emoji-status-permission.d.cts +11 -0
- package/highlevel/methods/chats/add-chat-members.d.cts +20 -0
- package/highlevel/methods/chats/archive-chats.d.cts +9 -0
- package/highlevel/methods/chats/ban-chat-member.d.cts +24 -0
- package/highlevel/methods/chats/batched-queries.d.cts +11 -0
- package/highlevel/methods/chats/create-channel.d.cts +17 -0
- package/highlevel/methods/chats/create-group.d.cts +33 -0
- package/highlevel/methods/chats/create-supergroup.d.cts +27 -0
- package/highlevel/methods/chats/delete-channel.d.cts +8 -0
- package/highlevel/methods/chats/delete-chat-photo.d.cts +10 -0
- package/highlevel/methods/chats/delete-group.d.cts +8 -0
- package/highlevel/methods/chats/delete-history.d.cts +22 -0
- package/highlevel/methods/chats/delete-user-history.d.cts +16 -0
- package/highlevel/methods/chats/edit-admin-rights.d.cts +16 -0
- package/highlevel/methods/chats/get-chat-event-log.d.cts +61 -0
- package/highlevel/methods/chats/get-chat-member.d.cts +15 -0
- package/highlevel/methods/chats/get-chat-members.d.cts +51 -0
- package/highlevel/methods/chats/get-chat-preview.d.cts +12 -0
- package/highlevel/methods/chats/get-chat.d.cts +11 -0
- package/highlevel/methods/chats/get-full-chat.d.cts +11 -0
- package/highlevel/methods/chats/get-full-user.d.cts +8 -0
- package/highlevel/methods/chats/get-nearby-chats.d.cts +9 -0
- package/highlevel/methods/chats/get-similar-channels.d.cts +12 -0
- package/highlevel/methods/chats/get-user.d.cts +8 -0
- package/highlevel/methods/chats/iter-chat-event-log.d.cts +26 -0
- package/highlevel/methods/chats/iter-chat-members.d.cts +22 -0
- package/highlevel/methods/chats/join-chat.d.cts +14 -0
- package/highlevel/methods/chats/kick-chat-member.d.cts +15 -0
- package/highlevel/methods/chats/leave-chat.d.cts +13 -0
- package/highlevel/methods/chats/mark-chat-unread.d.cts +8 -0
- package/highlevel/methods/chats/open-chat.d.cts +26 -0
- package/highlevel/methods/chats/reorder-usernames.d.cts +8 -0
- package/highlevel/methods/chats/restrict-chat-member.d.cts +28 -0
- package/highlevel/methods/chats/save-draft.d.cts +10 -0
- package/highlevel/methods/chats/set-chat-color.d.cts +38 -0
- package/highlevel/methods/chats/set-chat-default-permissions.d.cts +16 -0
- package/highlevel/methods/chats/set-chat-description.d.cts +11 -0
- package/highlevel/methods/chats/set-chat-photo.d.cts +20 -0
- package/highlevel/methods/chats/set-chat-title.d.cts +11 -0
- package/highlevel/methods/chats/set-chat-ttl.d.cts +9 -0
- package/highlevel/methods/chats/set-chat-username.d.cts +11 -0
- package/highlevel/methods/chats/set-slow-mode.d.cts +12 -0
- package/highlevel/methods/chats/toggle-content-protection.d.cts +9 -0
- package/highlevel/methods/chats/toggle-fragment-username.d.cts +20 -0
- package/highlevel/methods/chats/toggle-join-requests.d.cts +12 -0
- package/highlevel/methods/chats/toggle-join-to-send.d.cts +12 -0
- package/highlevel/methods/chats/unarchive-chats.d.cts +9 -0
- package/highlevel/methods/chats/unban-chat-member.d.cts +16 -0
- package/highlevel/methods/contacts/add-contact.d.cts +28 -0
- package/highlevel/methods/contacts/delete-contacts.d.cts +12 -0
- package/highlevel/methods/contacts/get-contacts.d.cts +6 -0
- package/highlevel/methods/contacts/import-contacts.d.cts +9 -0
- package/highlevel/methods/dialogs/create-folder.d.cts +13 -0
- package/highlevel/methods/dialogs/delete-folder.d.cts +8 -0
- package/highlevel/methods/dialogs/edit-folder.d.cts +18 -0
- package/highlevel/methods/dialogs/find-dialogs.d.cts +12 -0
- package/highlevel/methods/dialogs/find-folder.d.cts +19 -0
- package/highlevel/methods/dialogs/get-chatlist-preview.d.cts +8 -0
- package/highlevel/methods/dialogs/get-folders.d.cts +9 -0
- package/highlevel/methods/dialogs/get-peer-dialogs.d.cts +10 -0
- package/highlevel/methods/dialogs/iter-dialogs.d.cts +103 -0
- package/highlevel/methods/dialogs/join-chatlist.d.cts +15 -0
- package/highlevel/methods/dialogs/set-folders-order.d.cts +7 -0
- package/highlevel/methods/files/download-buffer.d.cts +11 -0
- package/highlevel/methods/files/download-file.d.cts +1 -0
- package/highlevel/methods/files/download-iterable.cjs +9 -7
- package/highlevel/methods/files/download-iterable.d.cts +10 -0
- package/highlevel/methods/files/download-iterable.js +9 -7
- package/highlevel/methods/files/download-node-stream.d.cts +1 -0
- package/highlevel/methods/files/download-stream.d.cts +9 -0
- package/highlevel/methods/files/normalize-file-to-document.d.cts +9 -0
- package/highlevel/methods/files/normalize-input-file.d.cts +13 -0
- package/highlevel/methods/files/normalize-input-media.d.cts +12 -0
- package/highlevel/methods/files/upload-file.d.cts +72 -0
- package/highlevel/methods/files/upload-media.d.cts +28 -0
- package/highlevel/methods/forums/create-forum-topic.d.cts +36 -0
- package/highlevel/methods/forums/delete-forum-topic-history.d.cts +15 -0
- package/highlevel/methods/forums/edit-forum-topic.d.cts +34 -0
- package/highlevel/methods/forums/get-forum-topics-by-id.d.cts +9 -0
- package/highlevel/methods/forums/get-forum-topics.d.cts +28 -0
- package/highlevel/methods/forums/iter-forum-topics.d.cts +20 -0
- package/highlevel/methods/forums/reorder-pinned-forum-topics.d.cts +19 -0
- package/highlevel/methods/forums/toggle-forum-topic-closed.d.cts +22 -0
- package/highlevel/methods/forums/toggle-forum-topic-pinned.d.cts +15 -0
- package/highlevel/methods/forums/toggle-forum.d.cts +11 -0
- package/highlevel/methods/forums/toggle-general-topic-hidden.d.cts +20 -0
- package/highlevel/methods/invite-links/create-invite-link.d.cts +38 -0
- package/highlevel/methods/invite-links/edit-invite-link.d.cts +36 -0
- package/highlevel/methods/invite-links/export-invite-link.d.cts +12 -0
- package/highlevel/methods/invite-links/get-invite-link-members.d.cts +45 -0
- package/highlevel/methods/invite-links/get-invite-link.d.cts +9 -0
- package/highlevel/methods/invite-links/get-invite-links.d.cts +39 -0
- package/highlevel/methods/invite-links/get-primary-invite-link.d.cts +8 -0
- package/highlevel/methods/invite-links/hide-all-join-requests.d.cts +13 -0
- package/highlevel/methods/invite-links/hide-join-request.d.cts +13 -0
- package/highlevel/methods/invite-links/iter-invite-link-members.d.cts +25 -0
- package/highlevel/methods/invite-links/iter-invite-links.d.cts +27 -0
- package/highlevel/methods/invite-links/revoke-invite-link.d.cts +13 -0
- package/highlevel/methods/messages/_business-connection.d.cts +8 -0
- package/highlevel/methods/messages/close-poll.d.cts +15 -0
- package/highlevel/methods/messages/delete-messages.d.cts +29 -0
- package/highlevel/methods/messages/delete-scheduled-messages.d.cts +9 -0
- package/highlevel/methods/messages/edit-inline-message.d.cts +51 -0
- package/highlevel/methods/messages/edit-message.d.cts +55 -0
- package/highlevel/methods/messages/find-in-update.d.cts +13 -0
- package/highlevel/methods/messages/forward-messages.d.cts +84 -0
- package/highlevel/methods/messages/get-all-scheduled-messages.d.cts +8 -0
- package/highlevel/methods/messages/get-available-effects.d.cts +6 -0
- package/highlevel/methods/messages/get-callback-query-message.d.cts +14 -0
- package/highlevel/methods/messages/get-discussion-message.d.cts +21 -0
- package/highlevel/methods/messages/get-fact-check.d.cts +11 -0
- package/highlevel/methods/messages/get-history.d.cts +59 -0
- package/highlevel/methods/messages/get-message-by-link.d.cts +6 -0
- package/highlevel/methods/messages/get-message-group.d.cts +9 -0
- package/highlevel/methods/messages/get-message-reactions.d.cts +28 -0
- package/highlevel/methods/messages/get-messages-unsafe.d.cts +19 -0
- package/highlevel/methods/messages/get-messages.d.cts +17 -0
- package/highlevel/methods/messages/get-reaction-users.d.cts +24 -0
- package/highlevel/methods/messages/get-reply-to.d.cts +10 -0
- package/highlevel/methods/messages/get-scheduled-messages.d.cts +13 -0
- package/highlevel/methods/messages/iter-history.d.cts +23 -0
- package/highlevel/methods/messages/iter-reaction-users.d.cts +26 -0
- package/highlevel/methods/messages/iter-search-global.d.cts +27 -0
- package/highlevel/methods/messages/iter-search-messages.d.cts +26 -0
- package/highlevel/methods/messages/pin-message.d.cts +21 -0
- package/highlevel/methods/messages/read-history.d.cts +24 -0
- package/highlevel/methods/messages/read-reactions.d.cts +14 -0
- package/highlevel/methods/messages/search-global.d.cts +51 -0
- package/highlevel/methods/messages/search-hashtag.d.cts +44 -0
- package/highlevel/methods/messages/search-messages.d.cts +93 -0
- package/highlevel/methods/messages/send-answer.d.cts +12 -0
- package/highlevel/methods/messages/send-comment.d.cts +39 -0
- package/highlevel/methods/messages/send-common.d.cts +122 -0
- package/highlevel/methods/messages/send-copy-group.d.cts +21 -0
- package/highlevel/methods/messages/send-copy.d.cts +32 -0
- package/highlevel/methods/messages/send-media-group.d.cts +35 -0
- package/highlevel/methods/messages/send-media.d.cts +48 -0
- package/highlevel/methods/messages/send-paid-reaction.d.cts +24 -0
- package/highlevel/methods/messages/send-quote.d.cts +33 -0
- package/highlevel/methods/messages/send-reaction.d.cts +21 -0
- package/highlevel/methods/messages/send-reply.d.cts +12 -0
- package/highlevel/methods/messages/send-scheduled.d.cts +14 -0
- package/highlevel/methods/messages/send-text.d.cts +31 -0
- package/highlevel/methods/messages/send-text.test.d.cts +1 -0
- package/highlevel/methods/messages/send-typing.d.cts +32 -0
- package/highlevel/methods/messages/send-vote.d.cts +15 -0
- package/highlevel/methods/messages/set-typing.d.cts +33 -0
- package/highlevel/methods/messages/translate-message.d.cts +11 -0
- package/highlevel/methods/messages/translate-text.d.cts +9 -0
- package/highlevel/methods/messages/unpin-all-messages.d.cts +18 -0
- package/highlevel/methods/messages/unpin-message.d.cts +12 -0
- package/highlevel/methods/misc/chain-id.d.cts +4 -0
- package/highlevel/methods/misc/get-collectible-info.d.cts +6 -0
- package/highlevel/methods/misc/init-takeout-session.d.cts +9 -0
- package/highlevel/methods/misc/normalize-privacy-rules.d.cts +8 -0
- package/highlevel/methods/misc/normalize-text.d.cts +5 -0
- package/highlevel/methods/misc/with-params.d.cts +10 -0
- package/highlevel/methods/password/change-cloud-password.d.cts +12 -0
- package/highlevel/methods/password/enable-cloud-password.d.cts +17 -0
- package/highlevel/methods/password/password-email.d.cts +15 -0
- package/highlevel/methods/password/remove-cloud-password.d.cts +7 -0
- package/highlevel/methods/premium/accept-star-gift.d.cts +16 -0
- package/highlevel/methods/premium/apply-boost.d.cts +8 -0
- package/highlevel/methods/premium/can-apply-boost.d.cts +29 -0
- package/highlevel/methods/premium/create-business-chat-link.d.cts +12 -0
- package/highlevel/methods/premium/edit-business-chat-link.d.cts +20 -0
- package/highlevel/methods/premium/get-boost-stats.d.cts +9 -0
- package/highlevel/methods/premium/get-boosts.d.cts +18 -0
- package/highlevel/methods/premium/get-business-chat-links.d.cts +6 -0
- package/highlevel/methods/premium/get-business-connection.d.cts +8 -0
- package/highlevel/methods/premium/get-my-boost-slots.d.cts +9 -0
- package/highlevel/methods/premium/get-star-gift-options.d.cts +6 -0
- package/highlevel/methods/premium/get-star-gifts.d.cts +22 -0
- package/highlevel/methods/premium/get-stars-transactions.d.cts +34 -0
- package/highlevel/methods/premium/iter-boosters.d.cts +24 -0
- package/highlevel/methods/premium/iter-star-gifts.d.cts +26 -0
- package/highlevel/methods/premium/iter-stars-transactions.d.cts +29 -0
- package/highlevel/methods/premium/send-star-gift.d.cts +35 -0
- package/highlevel/methods/premium/set-business-intro.d.cts +22 -0
- package/highlevel/methods/premium/set-business-work-hours.d.cts +18 -0
- package/highlevel/methods/stickers/_utils.d.cts +10 -0
- package/highlevel/methods/stickers/add-sticker-to-set.d.cts +21 -0
- package/highlevel/methods/stickers/create-sticker-set.d.cts +66 -0
- package/highlevel/methods/stickers/delete-sticker-from-set.d.cts +15 -0
- package/highlevel/methods/stickers/get-custom-emojis.d.cts +14 -0
- package/highlevel/methods/stickers/get-installed-stickers.d.cts +10 -0
- package/highlevel/methods/stickers/get-my-sticker-sets.d.cts +13 -0
- package/highlevel/methods/stickers/get-sticker-set.d.cts +8 -0
- package/highlevel/methods/stickers/move-sticker-in-set.d.cts +17 -0
- package/highlevel/methods/stickers/replace-sticker-in-set.d.cts +24 -0
- package/highlevel/methods/stickers/set-chat-sticker-set.d.cts +11 -0
- package/highlevel/methods/stickers/set-sticker-set-thumb.d.cts +20 -0
- package/highlevel/methods/stories/can-send-story.d.cts +13 -0
- package/highlevel/methods/stories/delete-stories.d.cts +20 -0
- package/highlevel/methods/stories/edit-story.d.cts +38 -0
- package/highlevel/methods/stories/find-in-update.d.cts +5 -0
- package/highlevel/methods/stories/get-all-stories.d.cts +15 -0
- package/highlevel/methods/stories/get-peer-stories.d.cts +8 -0
- package/highlevel/methods/stories/get-profile-stories.d.cts +25 -0
- package/highlevel/methods/stories/get-stories-by-id.d.cts +10 -0
- package/highlevel/methods/stories/get-stories-interactions.d.cts +9 -0
- package/highlevel/methods/stories/get-story-link.d.cts +11 -0
- package/highlevel/methods/stories/get-story-viewers.d.cts +33 -0
- package/highlevel/methods/stories/hide-my-stories-views.d.cts +21 -0
- package/highlevel/methods/stories/increment-stories-views.d.cts +13 -0
- package/highlevel/methods/stories/iter-all-stories.d.cts +16 -0
- package/highlevel/methods/stories/iter-profile-stories.d.cts +21 -0
- package/highlevel/methods/stories/iter-story-viewers.d.cts +22 -0
- package/highlevel/methods/stories/read-stories.d.cts +11 -0
- package/highlevel/methods/stories/send-story-reaction.d.cts +14 -0
- package/highlevel/methods/stories/send-story.d.cts +51 -0
- package/highlevel/methods/stories/toggle-peer-stories-archived.d.cts +8 -0
- package/highlevel/methods/stories/toggle-stories-pinned.d.cts +24 -0
- package/highlevel/methods/users/block-user.d.cts +8 -0
- package/highlevel/methods/users/delete-profile-photos.d.cts +9 -0
- package/highlevel/methods/users/edit-close-friends.d.cts +14 -0
- package/highlevel/methods/users/get-common-chats.d.cts +9 -0
- package/highlevel/methods/users/get-global-ttl.d.cts +5 -0
- package/highlevel/methods/users/get-me.d.cts +6 -0
- package/highlevel/methods/users/get-my-username.d.cts +8 -0
- package/highlevel/methods/users/get-profile-photo.d.cts +11 -0
- package/highlevel/methods/users/get-profile-photos.d.cts +22 -0
- package/highlevel/methods/users/get-users.d.cts +12 -0
- package/highlevel/methods/users/get-users.test.d.cts +1 -0
- package/highlevel/methods/users/is-peer-available.d.cts +20 -0
- package/highlevel/methods/users/iter-profile-photos.d.cts +23 -0
- package/highlevel/methods/users/resolve-peer-many.d.cts +26 -0
- package/highlevel/methods/users/resolve-peer.d.cts +20 -0
- package/highlevel/methods/users/resolve-peer.test.d.cts +1 -0
- package/highlevel/methods/users/set-emoji-status.d.cts +32 -0
- package/highlevel/methods/users/set-global-ttl.d.cts +8 -0
- package/highlevel/methods/users/set-my-birthday.d.cts +12 -0
- package/highlevel/methods/users/set-my-profile-photo.d.cts +16 -0
- package/highlevel/methods/users/set-my-username.d.cts +11 -0
- package/highlevel/methods/users/set-online.d.cts +19 -0
- package/highlevel/methods/users/unblock-user.d.cts +8 -0
- package/highlevel/methods/users/update-profile.d.cts +23 -0
- package/highlevel/methods.d.cts +291 -0
- package/highlevel/storage/index.d.cts +4 -0
- package/highlevel/storage/provider.d.cts +7 -0
- package/highlevel/storage/repository/peers.d.cts +44 -0
- package/highlevel/storage/repository/ref-messages.d.cts +20 -0
- package/highlevel/storage/service/current-user.d.cts +23 -0
- package/highlevel/storage/service/peers.d.cts +23 -0
- package/highlevel/storage/service/ref-messages.d.cts +15 -0
- package/highlevel/storage/service/updates.d.cts +16 -0
- package/highlevel/storage/storage.d.cts +27 -0
- package/highlevel/types/auth/index.d.cts +1 -0
- package/highlevel/types/auth/sent-code.d.cts +56 -0
- package/highlevel/types/bots/command-scope/index.d.cts +10 -0
- package/highlevel/types/bots/command-scope/inner.d.cts +54 -0
- package/highlevel/types/bots/game-high-score.d.cts +23 -0
- package/highlevel/types/bots/index.d.cts +6 -0
- package/highlevel/types/bots/inline-message/factories.d.cts +47 -0
- package/highlevel/types/bots/inline-message/index.d.cts +3 -0
- package/highlevel/types/bots/inline-message/types.d.cts +114 -0
- package/highlevel/types/bots/inline-result/factories.d.cts +97 -0
- package/highlevel/types/bots/inline-result/index.d.cts +3 -0
- package/highlevel/types/bots/inline-result/types.d.cts +417 -0
- package/highlevel/types/bots/keyboards/builder.d.cts +38 -0
- package/highlevel/types/bots/keyboards/builder.test.d.cts +1 -0
- package/highlevel/types/bots/keyboards/factories.d.cts +208 -0
- package/highlevel/types/bots/keyboards/index.d.cts +15 -0
- package/highlevel/types/bots/keyboards/keyboards.test.d.cts +1 -0
- package/highlevel/types/bots/keyboards/types.d.cts +34 -0
- package/highlevel/types/bots/webview.d.cts +114 -0
- package/highlevel/types/calls/discard-reason.d.cts +13 -0
- package/highlevel/types/calls/index.d.cts +1 -0
- package/highlevel/types/conversation.d.cts +210 -0
- package/highlevel/types/errors.d.cts +33 -0
- package/highlevel/types/files/file-location.d.cts +48 -0
- package/highlevel/types/files/index.d.cts +4 -0
- package/highlevel/types/files/uploaded-file.d.cts +24 -0
- package/highlevel/types/files/utils.d.cts +89 -0
- package/highlevel/types/files/web-document.d.cts +32 -0
- package/highlevel/types/index.d.cts +15 -0
- package/highlevel/types/media/audio.d.cts +31 -0
- package/highlevel/types/media/contact.d.cts +31 -0
- package/highlevel/types/media/dice.d.cts +155 -0
- package/highlevel/types/media/document-utils.d.cts +11 -0
- package/highlevel/types/media/document.d.cts +75 -0
- package/highlevel/types/media/extended-media.d.cts +20 -0
- package/highlevel/types/media/game.d.cts +38 -0
- package/highlevel/types/media/index.d.cts +19 -0
- package/highlevel/types/media/input-media/factories.d.cts +142 -0
- package/highlevel/types/media/input-media/index.d.cts +3 -0
- package/highlevel/types/media/input-media/types.d.cts +520 -0
- package/highlevel/types/media/invoice.d.cts +89 -0
- package/highlevel/types/media/location.d.cts +83 -0
- package/highlevel/types/media/paid-media.d.cts +33 -0
- package/highlevel/types/media/photo.d.cts +72 -0
- package/highlevel/types/media/poll.d.cts +110 -0
- package/highlevel/types/media/sticker.d.cts +123 -0
- package/highlevel/types/media/story.d.cts +33 -0
- package/highlevel/types/media/thumbnail.d.cts +70 -0
- package/highlevel/types/media/venue.d.cts +58 -0
- package/highlevel/types/media/video.d.cts +48 -0
- package/highlevel/types/media/voice.d.cts +23 -0
- package/highlevel/types/media/web-page.d.cts +151 -0
- package/highlevel/types/messages/dialog.d.cts +110 -0
- package/highlevel/types/messages/draft-message.d.cts +29 -0
- package/highlevel/types/messages/fact-check.d.cts +30 -0
- package/highlevel/types/messages/index.d.cts +14 -0
- package/highlevel/types/messages/input-message-id.d.cts +20 -0
- package/highlevel/types/messages/message-action.d.cts +420 -0
- package/highlevel/types/messages/message-effect.d.cts +20 -0
- package/highlevel/types/messages/message-entity.d.cts +89 -0
- package/highlevel/types/messages/message-forward.d.cts +39 -0
- package/highlevel/types/messages/message-media.d.cts +23 -0
- package/highlevel/types/messages/message-reactions.d.cts +31 -0
- package/highlevel/types/messages/message-replies.d.cts +42 -0
- package/highlevel/types/messages/message.d.cts +249 -0
- package/highlevel/types/messages/replied-message.d.cts +103 -0
- package/highlevel/types/messages/search-filters.d.cts +82 -0
- package/highlevel/types/misc/app-config.d.cts +887 -0
- package/highlevel/types/misc/collectible-info.d.cts +27 -0
- package/highlevel/types/misc/entities.d.cts +22 -0
- package/highlevel/types/misc/index.d.cts +6 -0
- package/highlevel/types/misc/input-privacy-rule/allow.d.cts +22 -0
- package/highlevel/types/misc/input-privacy-rule/bundle.d.cts +3 -0
- package/highlevel/types/misc/input-privacy-rule/disallow.d.cts +20 -0
- package/highlevel/types/misc/input-privacy-rule/index.d.cts +3 -0
- package/highlevel/types/misc/input-privacy-rule/types.d.cts +11 -0
- package/highlevel/types/misc/sticker-set.d.cts +154 -0
- package/highlevel/types/misc/takeout-session.d.cts +49 -0
- package/highlevel/types/peers/bot-info.d.cts +21 -0
- package/highlevel/types/peers/chat-colors.d.cts +25 -0
- package/highlevel/types/peers/chat-event/actions.d.cts +279 -0
- package/highlevel/types/peers/chat-event/filters.d.cts +10 -0
- package/highlevel/types/peers/chat-event/index.d.cts +27 -0
- package/highlevel/types/peers/chat-invite-link-member.d.cts +33 -0
- package/highlevel/types/peers/chat-invite-link.d.cts +72 -0
- package/highlevel/types/peers/chat-location.d.cts +17 -0
- package/highlevel/types/peers/chat-member.d.cts +86 -0
- package/highlevel/types/peers/chat-permissions.d.cts +127 -0
- package/highlevel/types/peers/chat-photo.d.cts +39 -0
- package/highlevel/types/peers/chat-preview.d.cts +55 -0
- package/highlevel/types/peers/chat.d.cts +250 -0
- package/highlevel/types/peers/chatlist-preview.d.cts +21 -0
- package/highlevel/types/peers/forum-topic.d.cts +96 -0
- package/highlevel/types/peers/full-chat.cjs +1 -1
- package/highlevel/types/peers/full-chat.d.cts +161 -0
- package/highlevel/types/peers/full-chat.js +1 -1
- package/highlevel/types/peers/full-user.d.cts +115 -0
- package/highlevel/types/peers/index.d.cts +19 -0
- package/highlevel/types/peers/index.d.ts +1 -0
- package/highlevel/types/peers/peer.d.cts +49 -0
- package/highlevel/types/peers/peers-index.d.cts +15 -0
- package/highlevel/types/peers/peers-index.test.d.cts +1 -0
- package/highlevel/types/peers/typing-status.d.cts +26 -0
- package/highlevel/types/peers/user.d.cts +268 -0
- package/highlevel/types/peers/user.test.d.cts +1 -0
- package/highlevel/types/premium/boost-slot.d.cts +37 -0
- package/highlevel/types/premium/boost-stats.d.cts +54 -0
- package/highlevel/types/premium/boost.d.cts +56 -0
- package/highlevel/types/premium/boost.d.ts +1 -2
- package/highlevel/types/premium/business-account.d.cts +19 -0
- package/highlevel/types/premium/business-chat-link.d.cts +19 -0
- package/highlevel/types/premium/business-connection.d.cts +23 -0
- package/highlevel/types/premium/business-intro.d.cts +22 -0
- package/highlevel/types/premium/business-location.d.cts +10 -0
- package/highlevel/types/premium/business-work-hours.d.cts +42 -0
- package/highlevel/types/premium/business-work-hours.test.d.cts +1 -0
- package/highlevel/types/premium/index.d.cts +12 -0
- package/highlevel/types/premium/index.d.ts +1 -0
- package/highlevel/types/premium/stars-gift.d.cts +68 -0
- package/highlevel/types/premium/stars-status.d.cts +16 -0
- package/highlevel/types/premium/stars-status.d.ts +1 -1
- package/highlevel/types/premium/stars-transaction.cjs +7 -3
- package/highlevel/types/premium/stars-transaction.d.cts +134 -0
- package/highlevel/types/premium/stars-transaction.d.ts +1 -1
- package/highlevel/types/premium/stars-transaction.js +7 -3
- package/highlevel/types/reactions/emoji-status.d.cts +12 -0
- package/highlevel/types/reactions/index.d.cts +4 -0
- package/highlevel/types/reactions/index.d.ts +2 -0
- package/highlevel/types/reactions/peer-reaction.d.cts +53 -0
- package/highlevel/types/reactions/reaction-count.d.cts +25 -0
- package/highlevel/types/reactions/types.d.cts +16 -0
- package/highlevel/types/stories/all-stories.d.cts +28 -0
- package/highlevel/types/stories/index.d.cts +7 -0
- package/highlevel/types/stories/interactive/base.d.cts +16 -0
- package/highlevel/types/stories/interactive/channel-post.d.cts +17 -0
- package/highlevel/types/stories/interactive/index.d.cts +12 -0
- package/highlevel/types/stories/interactive/input.d.cts +68 -0
- package/highlevel/types/stories/interactive/location.d.cts +15 -0
- package/highlevel/types/stories/interactive/reaction.d.cts +21 -0
- package/highlevel/types/stories/interactive/url.d.cts +11 -0
- package/highlevel/types/stories/interactive/venue.d.cts +28 -0
- package/highlevel/types/stories/interactive/weather.d.cts +15 -0
- package/highlevel/types/stories/peer-stories.d.cts +20 -0
- package/highlevel/types/stories/stealth-mode.d.cts +9 -0
- package/highlevel/types/stories/story-interactions.d.cts +34 -0
- package/highlevel/types/stories/story-viewer.d.cts +75 -0
- package/highlevel/types/stories/story.d.cts +79 -0
- package/highlevel/types/updates/bot-chat-join-request.d.cts +42 -0
- package/highlevel/types/updates/bot-reaction.d.cts +71 -0
- package/highlevel/types/updates/bot-stopped.d.cts +28 -0
- package/highlevel/types/updates/business-message.d.cts +18 -0
- package/highlevel/types/updates/callback-query.d.cts +95 -0
- package/highlevel/types/updates/chat-join-request.d.cts +30 -0
- package/highlevel/types/updates/chat-member-update.cjs +1 -0
- package/highlevel/types/updates/chat-member-update.d.cts +76 -0
- package/highlevel/types/updates/chat-member-update.js +1 -0
- package/highlevel/types/updates/chosen-inline-result.d.cts +50 -0
- package/highlevel/types/updates/delete-business-message-update.d.cts +21 -0
- package/highlevel/types/updates/delete-message-update.d.cts +16 -0
- package/highlevel/types/updates/delete-story-update.d.cts +18 -0
- package/highlevel/types/updates/history-read-update.d.cts +39 -0
- package/highlevel/types/updates/index.d.cts +107 -0
- package/highlevel/types/updates/inline-query.d.cts +42 -0
- package/highlevel/types/updates/parse-update.d.cts +4 -0
- package/highlevel/types/updates/poll-update.d.cts +39 -0
- package/highlevel/types/updates/poll-vote.d.cts +52 -0
- package/highlevel/types/updates/pre-checkout-query.d.cts +36 -0
- package/highlevel/types/updates/story-update.d.cts +22 -0
- package/highlevel/types/updates/user-status-update.d.cts +28 -0
- package/highlevel/types/updates/user-typing-update.d.cts +31 -0
- package/highlevel/types/utils.d.cts +12 -0
- package/highlevel/updates/index.d.cts +2 -0
- package/highlevel/updates/manager.d.cts +121 -0
- package/highlevel/updates/parsed.d.cts +26 -0
- package/highlevel/updates/types.d.cts +147 -0
- package/highlevel/updates/utils.d.cts +21 -0
- package/highlevel/utils/convert-file-id.d.cts +46 -0
- package/highlevel/utils/entities.d.cts +19 -0
- package/highlevel/utils/entities.test.d.cts +1 -0
- package/highlevel/utils/file-type.d.cts +2 -0
- package/highlevel/utils/file-type.test.d.cts +1 -0
- package/highlevel/utils/file-utils.d.cts +31 -0
- package/highlevel/utils/file-utils.test.d.cts +1 -0
- package/highlevel/utils/index.d.cts +11 -0
- package/highlevel/utils/inline-utils.d.cts +14 -0
- package/highlevel/utils/inline-utils.test.d.cts +1 -0
- package/highlevel/utils/inspectable.d.cts +9 -0
- package/highlevel/utils/inspectable.test.d.cts +1 -0
- package/highlevel/utils/memoize.d.cts +1 -0
- package/highlevel/utils/memoize.test.d.cts +1 -0
- package/highlevel/utils/misc-utils.d.cts +12 -0
- package/highlevel/utils/peer-utils.d.cts +11 -0
- package/highlevel/utils/peer-utils.test.d.cts +1 -0
- package/highlevel/utils/query-batcher.d.cts +49 -0
- package/highlevel/utils/query-batcher.test.d.cts +1 -0
- package/highlevel/utils/rps-meter.d.cts +9 -0
- package/highlevel/utils/stream-utils.d.cts +1 -0
- package/highlevel/utils/string-session.d.cts +16 -0
- package/highlevel/utils/string-session.test.d.cts +1 -0
- package/highlevel/utils/voice-utils.d.cts +14 -0
- package/highlevel/utils/voice-utils.test.d.cts +1 -0
- package/highlevel/worker/app-config.d.cts +9 -0
- package/highlevel/worker/errors.d.cts +8 -0
- package/highlevel/worker/index.d.cts +3 -0
- package/highlevel/worker/invoker.d.cts +18 -0
- package/highlevel/worker/port.d.cts +60 -0
- package/highlevel/worker/protocol.d.cts +57 -0
- package/highlevel/worker/storage.d.cts +39 -0
- package/highlevel/worker/worker.d.cts +15 -0
- package/index.cjs +8 -0
- package/index.d.cts +10 -0
- package/index.js +8 -0
- package/methods.d.cts +1 -0
- package/network/auth-key.d.cts +21 -0
- package/network/auth-key.test.d.cts +1 -0
- package/network/authorization.d.cts +9 -0
- package/network/client.d.cts +218 -0
- package/network/config-manager.d.cts +19 -0
- package/network/config-manager.test.d.cts +1 -0
- package/network/index.d.cts +6 -0
- package/network/middlewares/bundle.d.cts +3 -0
- package/network/middlewares/default.d.cts +8 -0
- package/network/middlewares/flood-waiter.d.cts +37 -0
- package/network/middlewares/index.d.cts +4 -0
- package/network/middlewares/index.d.ts +2 -0
- package/network/middlewares/internal-errors.d.cts +17 -0
- package/network/middlewares/on-error.d.cts +30 -0
- package/network/middlewares/on-method.d.cts +39 -0
- package/network/mtproto-session.d.cts +127 -0
- package/network/mtproxy/_fake-tls.d.cts +22 -0
- package/network/mtproxy/index.d.cts +42 -0
- package/network/multi-session-connection.cjs +25 -43
- package/network/multi-session-connection.d.cts +43 -0
- package/network/multi-session-connection.d.ts +5 -5
- package/network/multi-session-connection.js +25 -43
- package/network/network-manager.cjs +7 -20
- package/network/network-manager.d.cts +256 -0
- package/network/network-manager.js +7 -20
- package/network/persistent-connection.cjs +8 -0
- package/network/persistent-connection.d.cts +55 -0
- package/network/persistent-connection.d.ts +3 -1
- package/network/persistent-connection.js +8 -0
- package/network/server-salt.d.cts +12 -0
- package/network/session-connection.cjs +35 -18
- package/network/session-connection.d.cts +94 -0
- package/network/session-connection.d.ts +5 -3
- package/network/session-connection.js +35 -18
- package/network/transports/abstract.d.cts +47 -0
- package/network/transports/index.d.cts +3 -0
- package/network/transports/intermediate.d.cts +23 -0
- package/network/transports/intermediate.test.d.cts +1 -0
- package/network/transports/obfuscated.d.cts +23 -0
- package/network/transports/obfuscated.test.d.cts +1 -0
- package/package.json +13 -13
- package/storage/driver.d.cts +58 -0
- package/storage/index.d.cts +6 -0
- package/storage/memory/driver.d.cts +6 -0
- package/storage/memory/index.d.cts +22 -0
- package/storage/memory/memory.test.d.cts +1 -0
- package/storage/memory/repository/auth-keys.d.cts +19 -0
- package/storage/memory/repository/kv.d.cts +11 -0
- package/storage/memory/repository/peers.d.cts +18 -0
- package/storage/memory/repository/ref-messages.d.cts +16 -0
- package/storage/provider.d.cts +10 -0
- package/storage/repository/auth-keys.d.cts +41 -0
- package/storage/repository/index.d.cts +2 -0
- package/storage/repository/key-value.d.cts +10 -0
- package/storage/service/auth-keys.d.cts +9 -0
- package/storage/service/auth-keys.test.d.cts +1 -0
- package/storage/service/base.d.cts +19 -0
- package/storage/service/default-dcs.d.cts +10 -0
- package/storage/service/future-salts.d.cts +11 -0
- package/storage/service/updates.test.d.cts +1 -0
- package/storage/service/utils.test-utils.d.cts +2 -0
- package/storage/sqlite/driver.d.cts +24 -0
- package/storage/sqlite/index.d.cts +17 -0
- package/storage/sqlite/repository/auth-keys.d.cts +20 -0
- package/storage/sqlite/repository/kv.d.cts +14 -0
- package/storage/sqlite/repository/peers.d.cts +19 -0
- package/storage/sqlite/repository/ref-messages.d.cts +16 -0
- package/storage/sqlite/types.d.cts +18 -0
- package/storage/storage.d.cts +55 -0
- package/types/errors.d.cts +53 -0
- package/types/index.d.cts +4 -0
- package/types/peers.d.cts +4 -0
- package/types/platform.d.cts +15 -0
- package/types/utils.d.cts +9 -0
- package/utils/abort-signal.d.cts +1 -0
- package/utils/bigint-utils.d.cts +18 -0
- package/utils/bigint-utils.test.d.cts +1 -0
- package/utils/binary/asn1-parser.d.cts +17 -0
- package/utils/crypto/abstract.d.cts +29 -0
- package/utils/crypto/factorization.d.cts +6 -0
- package/utils/crypto/factorization.test.d.cts +1 -0
- package/utils/crypto/index.d.cts +6 -0
- package/utils/crypto/keys.d.cts +27 -0
- package/utils/crypto/keys.test.d.cts +1 -0
- package/utils/crypto/miller-rabin.d.cts +2 -0
- package/utils/crypto/miller-rabin.test.d.cts +1 -0
- package/utils/crypto/mtproto.d.cts +31 -0
- package/utils/crypto/mtproto.test.d.cts +1 -0
- package/utils/crypto/password.d.cts +29 -0
- package/utils/crypto/password.test.d.cts +1 -0
- package/utils/dcs.d.cts +18 -0
- package/utils/early-timer.d.cts +41 -0
- package/utils/error-reporting.d.cts +3 -0
- package/utils/function-utils.d.cts +22 -0
- package/utils/function-utils.test.d.cts +1 -0
- package/utils/index.d.cts +20 -0
- package/utils/linked-list.d.cts +21 -0
- package/utils/linked-list.test.d.cts +1 -0
- package/utils/links/bots.d.cts +72 -0
- package/utils/links/bots.test.d.cts +1 -0
- package/utils/links/bundle.d.cts +7 -0
- package/utils/links/calls.d.cts +17 -0
- package/utils/links/chat.d.cts +47 -0
- package/utils/links/chat.test.d.cts +1 -0
- package/utils/links/common.d.cts +31 -0
- package/utils/links/index.d.cts +2 -0
- package/utils/links/misc.d.cts +26 -0
- package/utils/links/misc.test.d.cts +1 -0
- package/utils/links/proxy.d.cts +18 -0
- package/utils/links/proxy.test.d.cts +1 -0
- package/utils/links/stickers.d.cts +10 -0
- package/utils/links/user.d.cts +28 -0
- package/utils/links/user.test.d.cts +1 -0
- package/utils/logger.d.cts +54 -0
- package/utils/logger.test.d.cts +1 -0
- package/utils/long-utils.d.cts +67 -0
- package/utils/long-utils.test.d.cts +1 -0
- package/utils/misc-utils.d.cts +2 -0
- package/utils/peer-utils.d.cts +29 -0
- package/utils/peer-utils.test.d.cts +1 -0
- package/utils/sorted-array.d.cts +17 -0
- package/utils/sorted-array.test.d.cts +1 -0
- package/utils/timers.d.cts +1 -0
- package/utils/tl-json.d.cts +13 -0
- package/utils/tl-json.test.d.cts +1 -0
- package/utils/type-assertions.d.cts +29 -0
- package/utils/type-assertions.test.d.cts +1 -0
- package/utils.d.cts +1 -0
- package/worker.d.cts +1 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
/**
|
|
3
|
+
* Reply keyboard markup
|
|
4
|
+
*/
|
|
5
|
+
export interface ReplyKeyboardMarkup extends Omit<tl.RawReplyKeyboardMarkup, '_' | 'rows'> {
|
|
6
|
+
readonly type: 'reply';
|
|
7
|
+
/**
|
|
8
|
+
* Two-dimensional array of buttons
|
|
9
|
+
*/
|
|
10
|
+
readonly buttons: tl.TypeKeyboardButton[][];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Hide previously sent bot keyboard
|
|
14
|
+
*/
|
|
15
|
+
export interface ReplyKeyboardHide extends Omit<tl.RawReplyKeyboardHide, '_'> {
|
|
16
|
+
readonly type: 'reply_hide';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Force the user to send a reply
|
|
20
|
+
*/
|
|
21
|
+
export interface ReplyKeyboardForceReply extends Omit<tl.RawReplyKeyboardForceReply, '_'> {
|
|
22
|
+
readonly type: 'force_reply';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Inline keyboard markup
|
|
26
|
+
*/
|
|
27
|
+
export interface InlineKeyboardMarkup {
|
|
28
|
+
readonly type: 'inline';
|
|
29
|
+
/**
|
|
30
|
+
* Two-dimensional array of buttons
|
|
31
|
+
*/
|
|
32
|
+
readonly buttons: tl.TypeKeyboardButton[][];
|
|
33
|
+
}
|
|
34
|
+
export type ReplyMarkup = ReplyKeyboardMarkup | ReplyKeyboardHide | ReplyKeyboardForceReply | InlineKeyboardMarkup | tl.TypeReplyMarkup;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
import { InputPeerLike } from '../peers/peer.js';
|
|
3
|
+
/**
|
|
4
|
+
* Information about the mini app for {@link openWebview} method
|
|
5
|
+
*
|
|
6
|
+
* - `main` - the ["main"](https://corefork.telegram.org/api/bots/webapps#main-mini-apps) mini-app, configured via BotFather
|
|
7
|
+
* - `from_reply_keyboard` - webview button found in [reply keyboards](https://corefork.telegram.org/api/bots/webapps#keyboard-button-mini-apps)
|
|
8
|
+
* - `from_switch_inline` - webview button found [at the top of inline results](https://corefork.telegram.org/api/bots/webapps#inline-mode-mini-apps)
|
|
9
|
+
* - `from_side_menu` - webview button found in the [side menu](https://corefork.telegram.org/api/bots/webapps#side-menu-mini-apps)
|
|
10
|
+
* - `from_inline_keyboard` - webview button found in [inline keyboards](https://corefork.telegram.org/api/bots/webapps#inline-button-mini-apps)
|
|
11
|
+
* - `from_bot_menu` - webview button found in [bot menus](https://corefork.telegram.org/api/bots/webapps#menu-button-mini-apps)
|
|
12
|
+
* - `from_attach_menu` - webview button found in [attachment menus](https://corefork.telegram.org/api/bots/webapps#attachment-menu-mini-apps)
|
|
13
|
+
* - `from_link` - webview opened via [direct links](https://corefork.telegram.org/api/bots/webapps#direct-link-mini-apps)
|
|
14
|
+
*/
|
|
15
|
+
export type InputWebview = {
|
|
16
|
+
type: 'main';
|
|
17
|
+
/**
|
|
18
|
+
* If set, requests to open the mini app in compact mode (as opposed to fullview mode).
|
|
19
|
+
* Must be set if the `mode` parameter of the Main Mini App link is equal to `compact`.
|
|
20
|
+
*/
|
|
21
|
+
compact?: boolean;
|
|
22
|
+
/** Start parameter from the deep link for the mini app */
|
|
23
|
+
startParam?: string;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'from_reply_keyboard' | 'from_switch_inline';
|
|
26
|
+
/** URL of the mini app found in the button */
|
|
27
|
+
url: string;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'from_side_menu';
|
|
30
|
+
} | {
|
|
31
|
+
type: 'from_inline_keyboard' | 'from_bot_menu';
|
|
32
|
+
/** URL of the mini app found in the button */
|
|
33
|
+
url: string;
|
|
34
|
+
/**
|
|
35
|
+
* If set, requests to open the mini app in compact mode (as opposed to fullview mode).
|
|
36
|
+
* Must be set if the `mode` parameter of the Main Mini App link is equal to `compact`.
|
|
37
|
+
*/
|
|
38
|
+
compact?: boolean;
|
|
39
|
+
/** ID of the message to which we should reply if the mini app asks to do so */
|
|
40
|
+
replyTo?: number | tl.TypeInputReplyTo;
|
|
41
|
+
/**
|
|
42
|
+
* Peer to use when sending the message.
|
|
43
|
+
*/
|
|
44
|
+
sendAs?: InputPeerLike;
|
|
45
|
+
/** If the mini app asks to send a message, whether to send it silently */
|
|
46
|
+
silent?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Telegram asks us to keep sending `messages.prolongWebView` requests every minute until the webview is closed.
|
|
49
|
+
* If this parameter is set to `true`, the timer will not be started, and the webview will never be prolonged.
|
|
50
|
+
*/
|
|
51
|
+
fireAndForget?: boolean;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'from_attach_menu';
|
|
54
|
+
/**
|
|
55
|
+
* If set, requests to open the mini app in compact mode (as opposed to fullview mode).
|
|
56
|
+
* Must be set if the `mode` parameter of the Main Mini App link is equal to `compact`.
|
|
57
|
+
*/
|
|
58
|
+
compact?: boolean;
|
|
59
|
+
/** ID of the message to which we should reply if the mini app asks to do so */
|
|
60
|
+
replyTo?: number | tl.TypeInputReplyTo;
|
|
61
|
+
/**
|
|
62
|
+
* Peer to use when sending the message.
|
|
63
|
+
*/
|
|
64
|
+
sendAs?: InputPeerLike;
|
|
65
|
+
/** If the mini app asks to send a message, whether to send it silently */
|
|
66
|
+
silent?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Telegram asks us to keep sending `messages.prolongWebView` requests every minute until the webview is closed.
|
|
69
|
+
* If this parameter is set to `true`, the timer will not be started, and the webview will never be prolonged.
|
|
70
|
+
*/
|
|
71
|
+
fireAndForget?: boolean;
|
|
72
|
+
} | {
|
|
73
|
+
type: 'from_link';
|
|
74
|
+
/** Short name of the app (from the link) */
|
|
75
|
+
shortName: string;
|
|
76
|
+
/**
|
|
77
|
+
* If the bot is asking permission to send messages to the user,
|
|
78
|
+
* whether to allow it to do so
|
|
79
|
+
*/
|
|
80
|
+
allowWrite?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* If set, requests to open the mini app in compact mode (as opposed to fullview mode).
|
|
83
|
+
* Must be set if the `mode` parameter of the Main Mini App link is equal to `compact`.
|
|
84
|
+
*/
|
|
85
|
+
compact?: boolean;
|
|
86
|
+
/** Start parameter from the deep link for the mini app */
|
|
87
|
+
startParam?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Telegram asks us to keep sending `messages.prolongWebView` requests every minute until the webview is closed.
|
|
90
|
+
* If this parameter is set to `true`, the timer will not be started, and the webview will never be prolonged.
|
|
91
|
+
*/
|
|
92
|
+
fireAndForget?: boolean;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Result of {@link openWebview} method call
|
|
96
|
+
*/
|
|
97
|
+
export declare class WebviewResult {
|
|
98
|
+
readonly raw: tl.RawWebViewResultUrl;
|
|
99
|
+
/** If true, the caller should use `closeWebview` method eventually to close the webview */
|
|
100
|
+
readonly shouldBeClosed: boolean;
|
|
101
|
+
constructor(raw: tl.RawWebViewResultUrl,
|
|
102
|
+
/** If true, the caller should use `closeWebview` method eventually to close the webview */
|
|
103
|
+
shouldBeClosed?: boolean);
|
|
104
|
+
/** Whether the webview should be opened as a landscape fullscreen app */
|
|
105
|
+
get isFullscreen(): boolean;
|
|
106
|
+
/** Whether the webview should be opened in "compact" mode */
|
|
107
|
+
get isCompact(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Webview session ID (only returned by inline button mini apps, menu button mini apps, attachment menu mini apps).
|
|
110
|
+
*/
|
|
111
|
+
get queryId(): tl.Long | null;
|
|
112
|
+
/** Actual URL to open */
|
|
113
|
+
get url(): string;
|
|
114
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
/**
|
|
3
|
+
* Phone call discard reason. Can be:
|
|
4
|
+
* - `missed`: The call was missed
|
|
5
|
+
* - `disconnect`: The connection has interrupted
|
|
6
|
+
* - `hangup`: The call was ended normally
|
|
7
|
+
* - `busy`: The call was discarded because the user is in another call
|
|
8
|
+
*/
|
|
9
|
+
export type CallDiscardReason = 'missed' | 'disconnect' | 'hangup' | 'busy';
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare function _callDiscardReasonFromTl(raw: tl.TypePhoneCallDiscardReason): CallDiscardReason;
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare function _callDiscardReasonToTl(r: CallDiscardReason): tl.TypePhoneCallDiscardReason;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './discard-reason.js';
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
import { MaybePromise } from '../../types/utils.js';
|
|
3
|
+
import { ITelegramClient } from '../client.types.js';
|
|
4
|
+
import { Message } from './messages/message.js';
|
|
5
|
+
import { InputPeerLike } from './peers/index.js';
|
|
6
|
+
import { ParsedUpdate } from './updates/index.js';
|
|
7
|
+
import { ParametersSkip2 } from './utils.js';
|
|
8
|
+
import { sendMediaGroup } from '../methods/messages/send-media-group.js';
|
|
9
|
+
import { sendMedia } from '../methods/messages/send-media.js';
|
|
10
|
+
import { sendText } from '../methods/messages/send-text.js';
|
|
11
|
+
/**
|
|
12
|
+
* Represents a conversation inside some chat.
|
|
13
|
+
*
|
|
14
|
+
* A conversation keeps track of any messages sent or edited
|
|
15
|
+
* since it was started and until it was stopped,
|
|
16
|
+
* and allows waiting for events in it.
|
|
17
|
+
*
|
|
18
|
+
* If you need a conversation across multiple chats,
|
|
19
|
+
* you should use multiple {@link Conversation} objects
|
|
20
|
+
* and synchronize them manually.
|
|
21
|
+
*/
|
|
22
|
+
export declare class Conversation {
|
|
23
|
+
readonly client: ITelegramClient;
|
|
24
|
+
readonly chat: InputPeerLike;
|
|
25
|
+
private _inputPeer;
|
|
26
|
+
private _chatId;
|
|
27
|
+
private _started;
|
|
28
|
+
private _lastMessage;
|
|
29
|
+
private _lastReceivedMessage;
|
|
30
|
+
private _queuedNewMessage;
|
|
31
|
+
private _pendingNewMessages;
|
|
32
|
+
private _lock;
|
|
33
|
+
private _pendingEditMessage;
|
|
34
|
+
private _recentEdits;
|
|
35
|
+
private _pendingRead;
|
|
36
|
+
constructor(client: ITelegramClient, chat: InputPeerLike);
|
|
37
|
+
private static _getState;
|
|
38
|
+
/**
|
|
39
|
+
* Pass the update to the conversation manager and all registered
|
|
40
|
+
* conversations on this client.
|
|
41
|
+
*
|
|
42
|
+
* @returns `true` if the update was handled by some conversation
|
|
43
|
+
*/
|
|
44
|
+
static handleUpdate(client: ITelegramClient, update: ParsedUpdate): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Get the input peer that this conversation is with
|
|
47
|
+
*/
|
|
48
|
+
get inputPeer(): tl.TypeInputPeer;
|
|
49
|
+
/**
|
|
50
|
+
* ID of the very last message in this conversation.
|
|
51
|
+
*/
|
|
52
|
+
get lastMessage(): number;
|
|
53
|
+
/**
|
|
54
|
+
* ID of the last incoming message in this conversation.
|
|
55
|
+
*
|
|
56
|
+
* Note that before any messages were received since the {@link start}
|
|
57
|
+
* of the conversation, this will equal to {@link lastMessage}
|
|
58
|
+
*/
|
|
59
|
+
get lastReceivedMessage(): number;
|
|
60
|
+
/**
|
|
61
|
+
* Start the conversation
|
|
62
|
+
*/
|
|
63
|
+
start(): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Stop the conversation
|
|
66
|
+
*/
|
|
67
|
+
stop(): void;
|
|
68
|
+
private _recordMessage;
|
|
69
|
+
/**
|
|
70
|
+
* Send a text message to this conversation.
|
|
71
|
+
*
|
|
72
|
+
* Wrapper over {@link sendText}
|
|
73
|
+
*/
|
|
74
|
+
sendText(...params: ParametersSkip2<typeof sendText>): ReturnType<typeof sendText>;
|
|
75
|
+
/**
|
|
76
|
+
* Send a media to this conversation.
|
|
77
|
+
*
|
|
78
|
+
* Wrapper over {@link sendMedia}
|
|
79
|
+
*/
|
|
80
|
+
sendMedia(...params: ParametersSkip2<typeof sendMedia>): ReturnType<typeof sendMedia>;
|
|
81
|
+
/**
|
|
82
|
+
* Send a media group to this conversation.
|
|
83
|
+
*
|
|
84
|
+
* Wrapper over {@link sendMediaGroup}
|
|
85
|
+
*/
|
|
86
|
+
sendMediaGroup(...params: ParametersSkip2<typeof sendMediaGroup>): ReturnType<typeof sendMediaGroup>;
|
|
87
|
+
/**
|
|
88
|
+
* Mark the conversation as read up to a certain point.
|
|
89
|
+
*
|
|
90
|
+
* By default, reads until the last message.
|
|
91
|
+
* You can pass `message=null` to read the entire conversation,
|
|
92
|
+
* or pass message ID to read up until that ID.
|
|
93
|
+
*/
|
|
94
|
+
markRead({ message, clearMentions, }?: {
|
|
95
|
+
message?: number | null;
|
|
96
|
+
clearMentions?: boolean;
|
|
97
|
+
}): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Helper method that calls {@link start},
|
|
100
|
+
* the provided function and then {@link stop}.
|
|
101
|
+
*
|
|
102
|
+
* It is preferred that you use this function rather than
|
|
103
|
+
* manually starting and stopping the conversation.
|
|
104
|
+
*
|
|
105
|
+
* If you don't stop the conversation when you're done,
|
|
106
|
+
* it *will* lead to memory leaks.
|
|
107
|
+
*
|
|
108
|
+
* @param handler
|
|
109
|
+
*/
|
|
110
|
+
with<T>(handler: () => MaybePromise<T>): Promise<T>;
|
|
111
|
+
/**
|
|
112
|
+
* Wait for a new message in the conversation
|
|
113
|
+
*
|
|
114
|
+
* @param filter Filter for the handler. You can use any filter you can use for dispatcher
|
|
115
|
+
* @param [timeout] Timeout for the handler in ms. Pass `null` to disable.
|
|
116
|
+
* When the timeout is reached, `MtTimeoutError` is thrown.
|
|
117
|
+
*/
|
|
118
|
+
waitForNewMessage(filter?: (msg: Message) => MaybePromise<boolean>, timeout?: number | null): Promise<Message>;
|
|
119
|
+
/**
|
|
120
|
+
* Wait for a response for the given message
|
|
121
|
+
* (def. the last one) in the conversation.
|
|
122
|
+
*
|
|
123
|
+
* A message is considered to be a response if
|
|
124
|
+
* it was sent after the given one.
|
|
125
|
+
*
|
|
126
|
+
* @param filter Filter for the handler. You can use any filter you can use for dispatcher
|
|
127
|
+
* @param params
|
|
128
|
+
*/
|
|
129
|
+
waitForResponse(filter?: (msg: Message) => MaybePromise<boolean>, params?: {
|
|
130
|
+
/**
|
|
131
|
+
* Message for which to wait for response for.
|
|
132
|
+
*
|
|
133
|
+
* @default last sent/received message
|
|
134
|
+
*/
|
|
135
|
+
message?: number;
|
|
136
|
+
/**
|
|
137
|
+
* Timeout for the handler in ms. Pass `null` to disable.
|
|
138
|
+
*
|
|
139
|
+
* When the timeout is reached, `TimeoutError` is thrown.
|
|
140
|
+
*
|
|
141
|
+
* @default `15000` (15 sec)
|
|
142
|
+
*/
|
|
143
|
+
timeout?: number | null;
|
|
144
|
+
}): Promise<Message>;
|
|
145
|
+
/**
|
|
146
|
+
* Wait for the reply for the given message'
|
|
147
|
+
* (def. the last one) in the conversation.
|
|
148
|
+
*
|
|
149
|
+
* @param filter Filter for the handler. You can use any filter you can use for dispatcher
|
|
150
|
+
* @param params
|
|
151
|
+
*/
|
|
152
|
+
waitForReply(filter?: (msg: Message) => MaybePromise<boolean>, params?: {
|
|
153
|
+
/**
|
|
154
|
+
* Message for which to wait for reply for.
|
|
155
|
+
*
|
|
156
|
+
* @default last sent/received message
|
|
157
|
+
*/
|
|
158
|
+
message?: number;
|
|
159
|
+
/**
|
|
160
|
+
* Timeout for the handler in ms. Pass `null` to disable.
|
|
161
|
+
*
|
|
162
|
+
* When the timeout is reached, `TimeoutError` is thrown.
|
|
163
|
+
*
|
|
164
|
+
* @default `15000` (15 sec)
|
|
165
|
+
*/
|
|
166
|
+
timeout?: number | null;
|
|
167
|
+
}): Promise<Message>;
|
|
168
|
+
/**
|
|
169
|
+
* Wait for a message to be edited in the conversation.
|
|
170
|
+
* By defaults wait for the last message sent by the other party
|
|
171
|
+
* (at the moment) to be edited.
|
|
172
|
+
*
|
|
173
|
+
* Returns the edited message.
|
|
174
|
+
*
|
|
175
|
+
* @param filter Filter for the handler. You can use any filter you can use for dispatcher
|
|
176
|
+
* @param params
|
|
177
|
+
*/
|
|
178
|
+
waitForEdit(filter?: (msg: Message) => MaybePromise<boolean>, params?: {
|
|
179
|
+
/**
|
|
180
|
+
* Message for which to wait for reply for.
|
|
181
|
+
*
|
|
182
|
+
* @default last received message
|
|
183
|
+
*/
|
|
184
|
+
message?: number;
|
|
185
|
+
/**
|
|
186
|
+
* Timeout for the handler in ms. Pass `null` to disable.
|
|
187
|
+
*
|
|
188
|
+
* When the timeout is reached, `TimeoutError` is thrown.
|
|
189
|
+
*
|
|
190
|
+
* @default `15000` (15 sec)
|
|
191
|
+
*/
|
|
192
|
+
timeout?: number | null;
|
|
193
|
+
}): Promise<Message>;
|
|
194
|
+
/**
|
|
195
|
+
* Wait for the message to be read by the other party.
|
|
196
|
+
*
|
|
197
|
+
* Note that reading the message doesn't mean the response was sent,
|
|
198
|
+
* and if the response was sent, it doesn't mean that the message was read.
|
|
199
|
+
*
|
|
200
|
+
* @param message Message for which to wait for read for. Defaults to last message.
|
|
201
|
+
* @param timeout Timeout for the handler in ms, def. 15 sec. Pass `null` to disable.
|
|
202
|
+
* When the timeout is reached, `TimeoutError` is thrown.
|
|
203
|
+
*/
|
|
204
|
+
waitForRead(message?: number, timeout?: number | null): Promise<void>;
|
|
205
|
+
private _onNewMessage;
|
|
206
|
+
private _onEditMessage;
|
|
207
|
+
private _onHistoryRead;
|
|
208
|
+
private _processPendingNewMessages;
|
|
209
|
+
private _processRecentEdits;
|
|
210
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { InputPeerLike } from './peers/index.js';
|
|
2
|
+
import { MtcuteError } from '../../types/errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* Could not find a peer by the provided information
|
|
5
|
+
*/
|
|
6
|
+
export declare class MtPeerNotFoundError extends MtcuteError {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Could not find a message by the provided information
|
|
10
|
+
*/
|
|
11
|
+
export declare class MtMessageNotFoundError extends MtcuteError {
|
|
12
|
+
readonly peerId: number;
|
|
13
|
+
readonly messageId: number;
|
|
14
|
+
readonly context?: string | undefined;
|
|
15
|
+
constructor(peerId: number, messageId: number, context?: string | undefined);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Some method that requires a particular type of peer
|
|
19
|
+
* is called, but the resolved peer type is invalid.
|
|
20
|
+
*
|
|
21
|
+
* For example, when trying to get common chats
|
|
22
|
+
* while providing another chat as `userId`
|
|
23
|
+
*/
|
|
24
|
+
export declare class MtInvalidPeerTypeError extends MtcuteError {
|
|
25
|
+
constructor(peer: InputPeerLike, expected: string);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Trying to access to some property on an object that does not
|
|
29
|
+
* contain that information.
|
|
30
|
+
*/
|
|
31
|
+
export declare class MtEmptyError extends MtcuteError {
|
|
32
|
+
constructor();
|
|
33
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
/**
|
|
3
|
+
* Information about file location.
|
|
4
|
+
*
|
|
5
|
+
* Catch-all class for all kinds of Telegram file locations,
|
|
6
|
+
* including ones that are embedded directly into the entity.
|
|
7
|
+
*/
|
|
8
|
+
export declare class FileLocation {
|
|
9
|
+
/**
|
|
10
|
+
* Location of the file.
|
|
11
|
+
*
|
|
12
|
+
* Either a TL object declaring remote file location,
|
|
13
|
+
* a Buffer containing actual file content (for stripped thumbnails and vector previews),
|
|
14
|
+
* or a function that will return either of those.
|
|
15
|
+
*
|
|
16
|
+
* When a function is passed, it will be lazily resolved the
|
|
17
|
+
* first time downloading the file.
|
|
18
|
+
*/
|
|
19
|
+
readonly location: tl.TypeInputFileLocation | tl.TypeInputWebFileLocation | Uint8Array | (() => tl.TypeInputFileLocation | tl.TypeInputWebFileLocation | Uint8Array);
|
|
20
|
+
/**
|
|
21
|
+
* File size in bytes, when available
|
|
22
|
+
*/
|
|
23
|
+
readonly fileSize?: number | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* DC ID of the file, when available
|
|
26
|
+
*/
|
|
27
|
+
readonly dcId?: number | undefined;
|
|
28
|
+
constructor(
|
|
29
|
+
/**
|
|
30
|
+
* Location of the file.
|
|
31
|
+
*
|
|
32
|
+
* Either a TL object declaring remote file location,
|
|
33
|
+
* a Buffer containing actual file content (for stripped thumbnails and vector previews),
|
|
34
|
+
* or a function that will return either of those.
|
|
35
|
+
*
|
|
36
|
+
* When a function is passed, it will be lazily resolved the
|
|
37
|
+
* first time downloading the file.
|
|
38
|
+
*/
|
|
39
|
+
location: tl.TypeInputFileLocation | tl.TypeInputWebFileLocation | Uint8Array | (() => tl.TypeInputFileLocation | tl.TypeInputWebFileLocation | Uint8Array),
|
|
40
|
+
/**
|
|
41
|
+
* File size in bytes, when available
|
|
42
|
+
*/
|
|
43
|
+
fileSize?: number | undefined,
|
|
44
|
+
/**
|
|
45
|
+
* DC ID of the file, when available
|
|
46
|
+
*/
|
|
47
|
+
dcId?: number | undefined);
|
|
48
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
/**
|
|
3
|
+
* Describes a file uploaded to the Telegram servers
|
|
4
|
+
* using {@link TelegramClient.uploadFile} method.
|
|
5
|
+
*/
|
|
6
|
+
export interface UploadedFile {
|
|
7
|
+
/**
|
|
8
|
+
* Raw TL input file to be used in other methods.
|
|
9
|
+
*
|
|
10
|
+
* Very low-level stuff, usually you shouldn't care about it.
|
|
11
|
+
*/
|
|
12
|
+
inputFile: tl.TypeInputFile;
|
|
13
|
+
/**
|
|
14
|
+
* File size in bytes
|
|
15
|
+
*/
|
|
16
|
+
size: number;
|
|
17
|
+
/**
|
|
18
|
+
* File MIME type, either the one passed or
|
|
19
|
+
* the one derived from file contents.
|
|
20
|
+
*/
|
|
21
|
+
mime: string;
|
|
22
|
+
}
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare function isUploadedFile(obj: unknown): obj is UploadedFile;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { IReadable } from '@fuman/io';
|
|
2
|
+
import { tdFileId } from '@mtcute/file-id';
|
|
3
|
+
import { tl } from '@mtcute/tl';
|
|
4
|
+
import { AnyToNever } from '../../../types/utils.js';
|
|
5
|
+
import { FileLocation } from './file-location.js';
|
|
6
|
+
import { UploadedFile } from './uploaded-file.js';
|
|
7
|
+
/**
|
|
8
|
+
* Describes types that can be used in {@link TelegramClient.uploadFile}
|
|
9
|
+
* method. Can be one of:
|
|
10
|
+
* - `Uint8Array`/`Buffer`, which will be interpreted as raw file contents
|
|
11
|
+
* - `File`, `Blob` (from the Web API)
|
|
12
|
+
* - `string`, which will be interpreted as file path (**non-browser only!**)
|
|
13
|
+
* - `URL` (from the Web API, will be `fetch()`-ed; `file://` URLs are not available in browsers)
|
|
14
|
+
* - `ReadStream` (for Node.js/Bun, from the `node:fs` module)
|
|
15
|
+
* - `BunFile` (from `Bun.file()`)
|
|
16
|
+
* - `Deno.FsFile` (from `Deno.open()` in Deno)
|
|
17
|
+
* - `ReadableStream` (Web API readable stream)
|
|
18
|
+
* - `Readable` (Node.js/Bun readable stream)
|
|
19
|
+
* - `Response` (from `window.fetch`)
|
|
20
|
+
*/
|
|
21
|
+
export type UploadFileLike = URL | Uint8Array | File | Blob | string | IReadable | AnyToNever<import('node:fs').ReadStream> | AnyToNever<ReadableStream<Uint8Array>> | AnyToNever<NodeJS.ReadableStream> | AnyToNever<Response> | AnyToNever<Deno.FsFile>;
|
|
22
|
+
/**
|
|
23
|
+
* Describes types that can be used as an input
|
|
24
|
+
* to any methods that send media (like {@link TelegramClient.sendPhoto})
|
|
25
|
+
*
|
|
26
|
+
* Can be one of:
|
|
27
|
+
* - `Buffer`, which will be interpreted as raw file contents
|
|
28
|
+
* - `File` (from the Web API)
|
|
29
|
+
* - `ReadStream` (for Node.js/Bun, from the `fs` module)
|
|
30
|
+
* - `ReadableStream` (from the Web API, base readable stream)
|
|
31
|
+
* - `Readable` (for Node.js/Bun, base readable stream)
|
|
32
|
+
* - `BunFile` (from `Bun.file()`)
|
|
33
|
+
* - `Deno.FsFile` (from `Deno.open()` in Deno)
|
|
34
|
+
* - {@link UploadedFile} returned from {@link TelegramClient.uploadFile}
|
|
35
|
+
* - `tl.TypeInputFile` and `tl.TypeInputMedia` TL objects
|
|
36
|
+
* - `string` with a path to a local file prepended with `file:` (non-browser only) (e.g. `file:image.jpg`)
|
|
37
|
+
* - `string` with a URL to remote files (e.g. `https://example.com/image.jpg`)
|
|
38
|
+
* - `string` with TDLib and Bot API compatible File ID.
|
|
39
|
+
* - `URL` (from the Web API, will be `fetch()`-ed if needed; `file://` URLs are not available in browsers)
|
|
40
|
+
* - `td.RawFullRemoteFileLocation` (parsed File ID)
|
|
41
|
+
*/
|
|
42
|
+
export type InputFileLike = UploadFileLike | UploadedFile | tl.TypeInputFile | tl.TypeInputMedia | tdFileId.RawFullRemoteFileLocation;
|
|
43
|
+
/**
|
|
44
|
+
* File location which should be downloaded.
|
|
45
|
+
* You can also provide TDLib and Bot API compatible File ID
|
|
46
|
+
*/
|
|
47
|
+
export type FileDownloadLocation = tl.TypeInputFileLocation | tl.TypeInputWebFileLocation | FileLocation | string;
|
|
48
|
+
export interface FileDownloadParameters {
|
|
49
|
+
/**
|
|
50
|
+
* Total file size, if known.
|
|
51
|
+
* Used to determine upload part size.
|
|
52
|
+
* In some cases can be inferred from `file` automatically.
|
|
53
|
+
*/
|
|
54
|
+
fileSize?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Download part size (in KB).
|
|
57
|
+
* By default, automatically selected depending on the file size
|
|
58
|
+
* (or 64, if not provided). Must not be bigger than 512,
|
|
59
|
+
* must not be a fraction, and must be divisible by 4.
|
|
60
|
+
*/
|
|
61
|
+
partSize?: number;
|
|
62
|
+
/**
|
|
63
|
+
* DC id from which the file will be downloaded.
|
|
64
|
+
*
|
|
65
|
+
* If provided DC is not the one storing the file,
|
|
66
|
+
* redirection will be handled automatically.
|
|
67
|
+
*/
|
|
68
|
+
dcId?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Offset in bytes. Must be divisible by 4096 (4 KB).
|
|
71
|
+
*/
|
|
72
|
+
offset?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Number of bytes to be downloaded.
|
|
75
|
+
* By default, downloads the entire file
|
|
76
|
+
*/
|
|
77
|
+
limit?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Function that will be called after some part has been downloaded.
|
|
80
|
+
*
|
|
81
|
+
* @param uploaded Number of bytes already downloaded
|
|
82
|
+
* @param total Total file size (`Infinity` if not available)
|
|
83
|
+
*/
|
|
84
|
+
progressCallback?: (downloaded: number, total: number) => void;
|
|
85
|
+
/**
|
|
86
|
+
* Abort signal that can be used to cancel the download.
|
|
87
|
+
*/
|
|
88
|
+
abortSignal?: AbortSignal;
|
|
89
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
import { FileLocation } from './file-location.js';
|
|
3
|
+
/**
|
|
4
|
+
* An external web document, that is not
|
|
5
|
+
* stored on Telegram severs, and is available
|
|
6
|
+
* by a HTTP(s) url.
|
|
7
|
+
*
|
|
8
|
+
* > **Note**: not all web documents are downloadable
|
|
9
|
+
* > through Telegram. Media files usually are,
|
|
10
|
+
* > and web pages (i.e. `mimeType = text/html`) usually aren't.
|
|
11
|
+
* > To be sure, check `isDownloadable` property.
|
|
12
|
+
*/
|
|
13
|
+
export declare class WebDocument extends FileLocation {
|
|
14
|
+
readonly raw: tl.TypeWebDocument;
|
|
15
|
+
constructor(raw: tl.TypeWebDocument);
|
|
16
|
+
/**
|
|
17
|
+
* URL to the file
|
|
18
|
+
*/
|
|
19
|
+
get url(): string;
|
|
20
|
+
/**
|
|
21
|
+
* MIME type of the file
|
|
22
|
+
*/
|
|
23
|
+
get mimeType(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether this file can be downloaded through Telegram.
|
|
26
|
+
*
|
|
27
|
+
* If `false`, you should use {@link url} to manually
|
|
28
|
+
* fetch data via HTTP(s), and trying to use `download*` methods
|
|
29
|
+
* will result in an error
|
|
30
|
+
*/
|
|
31
|
+
get isDownloadable(): boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './auth/index.js';
|
|
2
|
+
export * from './bots/index.js';
|
|
3
|
+
export * from './calls/index.js';
|
|
4
|
+
export * from './conversation.js';
|
|
5
|
+
export * from './errors.js';
|
|
6
|
+
export * from './files/index.js';
|
|
7
|
+
export * from './media/index.js';
|
|
8
|
+
export * from './messages/index.js';
|
|
9
|
+
export * from './misc/index.js';
|
|
10
|
+
export * from './peers/index.js';
|
|
11
|
+
export * from './premium/index.js';
|
|
12
|
+
export * from './reactions/index.js';
|
|
13
|
+
export * from './stories/index.js';
|
|
14
|
+
export * from './updates/index.js';
|
|
15
|
+
export * from './utils.js';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
import { tdFileId } from '@mtcute/file-id';
|
|
3
|
+
import { RawDocument } from './document.js';
|
|
4
|
+
/**
|
|
5
|
+
* An audio file
|
|
6
|
+
*/
|
|
7
|
+
export declare class Audio extends RawDocument {
|
|
8
|
+
/** TL object describing the audio */
|
|
9
|
+
readonly attr: tl.RawDocumentAttributeAudio;
|
|
10
|
+
/** Type of the media (for use in a tagged union) */
|
|
11
|
+
readonly type: "audio";
|
|
12
|
+
/** Type of the file for File ID generation */
|
|
13
|
+
protected _fileIdType(): tdFileId.FileType;
|
|
14
|
+
constructor(doc: tl.RawDocument,
|
|
15
|
+
/** TL object describing the audio */
|
|
16
|
+
attr: tl.RawDocumentAttributeAudio);
|
|
17
|
+
/**
|
|
18
|
+
* Duration of the audio in seconds.
|
|
19
|
+
*
|
|
20
|
+
* May not be accurate since provided by the sender.
|
|
21
|
+
*/
|
|
22
|
+
get duration(): number;
|
|
23
|
+
/**
|
|
24
|
+
* Performer of the audio track.
|
|
25
|
+
*/
|
|
26
|
+
get performer(): string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Title of the audio track.
|
|
29
|
+
*/
|
|
30
|
+
get title(): string | null;
|
|
31
|
+
}
|