@mtcute/core 0.18.0-rc.5 → 0.19.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,8 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { ChatlistPreview } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get a preview of a chatlist by its invite link
|
|
5
|
+
*
|
|
6
|
+
* @param link Invite link
|
|
7
|
+
*/
|
|
8
|
+
export declare function getChatlistPreview(client: ITelegramClient, link: string): Promise<ChatlistPreview>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
3
|
+
import { InputDialogFolder } from '../../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Get list of folders.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getFolders(client: ITelegramClient): Promise<tl.messages.RawDialogFilters>;
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare function _normalizeInputFolder(client: ITelegramClient, folder: InputDialogFolder): Promise<tl.TypeDialogFilter>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MaybeArray } from '../../../types/utils.js';
|
|
2
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
3
|
+
import { InputPeerLike } from '../../types/peers/index.js';
|
|
4
|
+
import { Dialog } from '../../types/messages/dialog.js';
|
|
5
|
+
/**
|
|
6
|
+
* Get dialogs with certain peers.
|
|
7
|
+
*
|
|
8
|
+
* @param peers Peers for which to fetch dialogs.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getPeerDialogs(client: ITelegramClient, peers: MaybeArray<InputPeerLike>): Promise<Dialog[]>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
3
|
+
import { InputDialogFolder, Dialog } from '../../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Iterate over dialogs.
|
|
6
|
+
*
|
|
7
|
+
* Note that due to Telegram API limitations,
|
|
8
|
+
* ordering here can only be anti-chronological
|
|
9
|
+
* (i.e. newest - first), and draft update date
|
|
10
|
+
* is not considered when sorting.
|
|
11
|
+
*
|
|
12
|
+
* @param params Fetch parameters
|
|
13
|
+
*/
|
|
14
|
+
export declare function iterDialogs(client: ITelegramClient, params?: {
|
|
15
|
+
/**
|
|
16
|
+
* Offset message date used as an anchor for pagination.
|
|
17
|
+
*/
|
|
18
|
+
offsetDate?: Date | number;
|
|
19
|
+
/**
|
|
20
|
+
* Offset message ID used as an anchor for pagination
|
|
21
|
+
*/
|
|
22
|
+
offsetId?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Offset peer used as an anchor for pagination
|
|
25
|
+
*/
|
|
26
|
+
offsetPeer?: tl.TypeInputPeer;
|
|
27
|
+
/**
|
|
28
|
+
* Limits the number of dialogs to be received.
|
|
29
|
+
*
|
|
30
|
+
* @default `Infinity`, i.e. all dialogs are fetched
|
|
31
|
+
*/
|
|
32
|
+
limit?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Chunk size which will be passed to `messages.getDialogs`.
|
|
35
|
+
* You shouldn't usually care about this.
|
|
36
|
+
*
|
|
37
|
+
* @default 100.
|
|
38
|
+
*/
|
|
39
|
+
chunkSize?: number;
|
|
40
|
+
/**
|
|
41
|
+
* How to handle pinned dialogs?
|
|
42
|
+
*
|
|
43
|
+
* Whether to `include` them at the start of the list,
|
|
44
|
+
* `exclude` them at all, or `only` return pinned dialogs.
|
|
45
|
+
*
|
|
46
|
+
* Additionally, for folders you can specify
|
|
47
|
+
* `keep`, which will return pinned dialogs
|
|
48
|
+
* ordered by date among other non-pinned dialogs.
|
|
49
|
+
*
|
|
50
|
+
* > **Note**: When using `include` mode with folders,
|
|
51
|
+
* > pinned dialogs will only be fetched if all offset
|
|
52
|
+
* > parameters are unset.
|
|
53
|
+
*
|
|
54
|
+
* @default `include`.
|
|
55
|
+
*/
|
|
56
|
+
pinned?: 'include' | 'exclude' | 'only' | 'keep';
|
|
57
|
+
/**
|
|
58
|
+
* How to handle archived chats?
|
|
59
|
+
*
|
|
60
|
+
* Whether to `keep` them among other dialogs,
|
|
61
|
+
* `exclude` them from the list, or `only`
|
|
62
|
+
* return archived dialogs
|
|
63
|
+
*
|
|
64
|
+
* Ignored for folders, since folders
|
|
65
|
+
* themselves contain information about archived chats.
|
|
66
|
+
*
|
|
67
|
+
* > **Note**: when `pinned=only`, `archived=keep` will act as `only`
|
|
68
|
+
* > because of Telegram API limitations.
|
|
69
|
+
*
|
|
70
|
+
* @default `exclude`
|
|
71
|
+
*/
|
|
72
|
+
archived?: 'keep' | 'exclude' | 'only';
|
|
73
|
+
/**
|
|
74
|
+
* Folder from which the dialogs will be fetched.
|
|
75
|
+
*
|
|
76
|
+
* You can pass folder object, id or title
|
|
77
|
+
*
|
|
78
|
+
* Note that passing anything except object will
|
|
79
|
+
* cause the list of the folders to be fetched,
|
|
80
|
+
* and passing a title may fetch from
|
|
81
|
+
* a wrong folder if you have multiple with the same title.
|
|
82
|
+
*
|
|
83
|
+
* Also note that fetching dialogs in a folder is
|
|
84
|
+
* orders of magnitudes* slower than normal because
|
|
85
|
+
* of Telegram API limitations - we have to fetch all dialogs
|
|
86
|
+
* and filter the ones we need manually. If possible,
|
|
87
|
+
* use {@link Dialog.filterFolder} instead.
|
|
88
|
+
*
|
|
89
|
+
* When a folder with given ID or title is not found,
|
|
90
|
+
* {@link MtArgumentError} is thrown
|
|
91
|
+
*
|
|
92
|
+
* @default <empty> (fetches from "All" folder)
|
|
93
|
+
*/
|
|
94
|
+
folder?: InputDialogFolder;
|
|
95
|
+
/**
|
|
96
|
+
* Additional filtering for the dialogs.
|
|
97
|
+
*
|
|
98
|
+
* If `folder` is not provided, this filter is used instead.
|
|
99
|
+
* If `folder` is provided, fields from this object are used
|
|
100
|
+
* to override filters inside the folder.
|
|
101
|
+
*/
|
|
102
|
+
filter?: Partial<Omit<tl.RawDialogFilter, '_' | 'id' | 'title'>>;
|
|
103
|
+
}): AsyncIterableIterator<Dialog>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
import { MaybeArray } from '../../../types/utils.js';
|
|
3
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
4
|
+
import { InputPeerLike } from '../../types/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Join a chatlist by its link
|
|
7
|
+
*
|
|
8
|
+
* @param link Invite link to the chatlist
|
|
9
|
+
* @param params Additional parameters
|
|
10
|
+
* @returns Folder representing the chatlist
|
|
11
|
+
*/
|
|
12
|
+
export declare function joinChatlist(client: ITelegramClient, link: string, params?: {
|
|
13
|
+
/** Chats to join from the chatlist (all by default) */
|
|
14
|
+
peers?: MaybeArray<InputPeerLike>;
|
|
15
|
+
}): Promise<tl.RawDialogFilterChatlist>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { FileDownloadLocation, FileDownloadParameters } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Download a file and return its contents as a Buffer.
|
|
5
|
+
*
|
|
6
|
+
* > **Note**: This method _will_ download the entire file
|
|
7
|
+
* > into memory at once. This might cause an issue, so use wisely!
|
|
8
|
+
*
|
|
9
|
+
* @param params File download parameters
|
|
10
|
+
*/
|
|
11
|
+
export declare function downloadAsBuffer(client: ITelegramClient, location: FileDownloadLocation, params?: FileDownloadParameters): Promise<Uint8Array>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -22,7 +22,7 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
22
22
|
let dcId = params?.dcId;
|
|
23
23
|
let fileSize = params?.fileSize;
|
|
24
24
|
const abortSignal = params?.abortSignal;
|
|
25
|
-
let
|
|
25
|
+
let ended = false;
|
|
26
26
|
let location;
|
|
27
27
|
if (input instanceof fileLocation.FileLocation) {
|
|
28
28
|
let locationInner = input.location;
|
|
@@ -61,7 +61,7 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
61
61
|
let nextWorkerChunkIdx = 0;
|
|
62
62
|
const nextChunkCv = new utils.ConditionVariable();
|
|
63
63
|
const buffer = {};
|
|
64
|
-
const isSmall = fileSize && fileSize <= SMALL_FILE_MAX_SIZE;
|
|
64
|
+
const isSmall = fileSize && fileSize <= SMALL_FILE_MAX_SIZE || location._ === "inputPeerPhotoFileLocation";
|
|
65
65
|
let connectionKind;
|
|
66
66
|
if (isSmall) {
|
|
67
67
|
connectionKind = dcId === primaryDcId ? "main" : "downloadSmall";
|
|
@@ -78,7 +78,7 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
78
78
|
);
|
|
79
79
|
const downloadChunk = async (chunk = nextWorkerChunkIdx++) => {
|
|
80
80
|
let result;
|
|
81
|
-
if (
|
|
81
|
+
if (ended) {
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
try {
|
|
@@ -117,7 +117,7 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
117
117
|
if (result._ === "upload.fileCdnRedirect") {
|
|
118
118
|
throw new errors.MtUnsupportedError("Received CDN redirect, which is not supported (yet)");
|
|
119
119
|
}
|
|
120
|
-
if (
|
|
120
|
+
if (ended) {
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
if (result._ === "upload.webFile" && result.size && limitBytes === Infinity) {
|
|
@@ -133,10 +133,12 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
let error;
|
|
136
|
-
void Promise.all(Array.from({
|
|
136
|
+
void Promise.all(Array.from({
|
|
137
|
+
length: Math.min(poolSize * (isSmall ? 1 : REQUESTS_PER_CONNECTION), numChunks)
|
|
138
|
+
}, downloadChunk)).catch((e) => {
|
|
137
139
|
client.log.debug("download workers errored: %e", e);
|
|
138
140
|
error = e;
|
|
139
|
-
|
|
141
|
+
ended = true;
|
|
140
142
|
nextChunkCv.notify();
|
|
141
143
|
}).then(() => {
|
|
142
144
|
client.log.debug("download workers finished");
|
|
@@ -144,7 +146,7 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
144
146
|
abortSignal?.addEventListener("abort", () => {
|
|
145
147
|
client.log.debug("download aborted");
|
|
146
148
|
error = abortSignal.reason;
|
|
147
|
-
|
|
149
|
+
ended = true;
|
|
148
150
|
nextChunkCv.notify();
|
|
149
151
|
});
|
|
150
152
|
let position = offset;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { FileDownloadLocation, FileDownloadParameters } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Download a file and return it as an iterable, which yields file contents
|
|
5
|
+
* in chunks of a given size. Order of the chunks is guaranteed to be
|
|
6
|
+
* consecutive.
|
|
7
|
+
*
|
|
8
|
+
* @param params Download parameters
|
|
9
|
+
*/
|
|
10
|
+
export declare function downloadAsIterable(client: ITelegramClient, input: FileDownloadLocation, params?: FileDownloadParameters): AsyncIterableIterator<Uint8Array>;
|
|
@@ -15,7 +15,7 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
15
15
|
let dcId = params?.dcId;
|
|
16
16
|
let fileSize = params?.fileSize;
|
|
17
17
|
const abortSignal = params?.abortSignal;
|
|
18
|
-
let
|
|
18
|
+
let ended = false;
|
|
19
19
|
let location;
|
|
20
20
|
if (input instanceof FileLocation$1) {
|
|
21
21
|
let locationInner = input.location;
|
|
@@ -54,7 +54,7 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
54
54
|
let nextWorkerChunkIdx = 0;
|
|
55
55
|
const nextChunkCv = new ConditionVariable();
|
|
56
56
|
const buffer = {};
|
|
57
|
-
const isSmall = fileSize && fileSize <= SMALL_FILE_MAX_SIZE;
|
|
57
|
+
const isSmall = fileSize && fileSize <= SMALL_FILE_MAX_SIZE || location._ === "inputPeerPhotoFileLocation";
|
|
58
58
|
let connectionKind;
|
|
59
59
|
if (isSmall) {
|
|
60
60
|
connectionKind = dcId === primaryDcId ? "main" : "downloadSmall";
|
|
@@ -71,7 +71,7 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
71
71
|
);
|
|
72
72
|
const downloadChunk = async (chunk = nextWorkerChunkIdx++) => {
|
|
73
73
|
let result;
|
|
74
|
-
if (
|
|
74
|
+
if (ended) {
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
try {
|
|
@@ -110,7 +110,7 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
110
110
|
if (result._ === "upload.fileCdnRedirect") {
|
|
111
111
|
throw new MtUnsupportedError("Received CDN redirect, which is not supported (yet)");
|
|
112
112
|
}
|
|
113
|
-
if (
|
|
113
|
+
if (ended) {
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
if (result._ === "upload.webFile" && result.size && limitBytes === Infinity) {
|
|
@@ -126,10 +126,12 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
let error;
|
|
129
|
-
void Promise.all(Array.from({
|
|
129
|
+
void Promise.all(Array.from({
|
|
130
|
+
length: Math.min(poolSize * (isSmall ? 1 : REQUESTS_PER_CONNECTION), numChunks)
|
|
131
|
+
}, downloadChunk)).catch((e) => {
|
|
130
132
|
client.log.debug("download workers errored: %e", e);
|
|
131
133
|
error = e;
|
|
132
|
-
|
|
134
|
+
ended = true;
|
|
133
135
|
nextChunkCv.notify();
|
|
134
136
|
}).then(() => {
|
|
135
137
|
client.log.debug("download workers finished");
|
|
@@ -137,7 +139,7 @@ async function* downloadAsIterable(client, input, params) {
|
|
|
137
139
|
abortSignal?.addEventListener("abort", () => {
|
|
138
140
|
client.log.debug("download aborted");
|
|
139
141
|
error = abortSignal.reason;
|
|
140
|
-
|
|
142
|
+
ended = true;
|
|
141
143
|
nextChunkCv.notify();
|
|
142
144
|
});
|
|
143
145
|
let position = offset;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { FileDownloadLocation, FileDownloadParameters } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Download a file and return it as a `@fuman/io` stream,
|
|
5
|
+
* streaming file contents.
|
|
6
|
+
*
|
|
7
|
+
* @param params File download parameters
|
|
8
|
+
*/
|
|
9
|
+
export declare function downloadAsStream(client: ITelegramClient, location: FileDownloadLocation, params?: FileDownloadParameters): ReadableStream<Uint8Array>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { InputFileLike } from '../../types/index.js';
|
|
3
|
+
import { tl } from '@mtcute/tl';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function _normalizeFileToDocument(client: ITelegramClient, file: InputFileLike | tl.TypeInputDocument, params: {
|
|
8
|
+
progressCallback?: (uploaded: number, total: number) => void;
|
|
9
|
+
}): Promise<tl.TypeInputDocument>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { InputFileLike } from '../../types/files/index.js';
|
|
3
|
+
import { tl } from '@mtcute/tl';
|
|
4
|
+
/**
|
|
5
|
+
* Normalize a {@link InputFileLike} to `InputFile`,
|
|
6
|
+
* uploading it if needed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function _normalizeInputFile(client: ITelegramClient, input: InputFileLike, params: {
|
|
9
|
+
progressCallback?: (uploaded: number, total: number) => void;
|
|
10
|
+
fileName?: string;
|
|
11
|
+
fileSize?: number;
|
|
12
|
+
fileMime?: string;
|
|
13
|
+
}): Promise<tl.TypeInputFile>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { InputMediaLike } from '../../types/media/input-media/types.js';
|
|
3
|
+
import { tl } from '@mtcute/tl';
|
|
4
|
+
/**
|
|
5
|
+
* Normalize an {@link InputMediaLike} to `InputMedia`,
|
|
6
|
+
* uploading the file if needed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function _normalizeInputMedia(client: ITelegramClient, media: InputMediaLike, params?: {
|
|
9
|
+
progressCallback?: (uploaded: number, total: number) => void;
|
|
10
|
+
uploadPeer?: tl.TypeInputPeer;
|
|
11
|
+
businessConnectionId?: string;
|
|
12
|
+
}, uploadMedia?: boolean): Promise<tl.TypeInputMedia>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { UploadedFile, UploadFileLike } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Upload a file to Telegram servers, without actually
|
|
5
|
+
* sending a message anywhere. Useful when an `InputFile` is required.
|
|
6
|
+
*
|
|
7
|
+
* This method is quite low-level, and you should use other
|
|
8
|
+
* methods like {@link sendMedia} that handle this under the hood.
|
|
9
|
+
*
|
|
10
|
+
* @param params Upload parameters
|
|
11
|
+
*/
|
|
12
|
+
export declare function uploadFile(client: ITelegramClient, params: {
|
|
13
|
+
/**
|
|
14
|
+
* Upload file source.
|
|
15
|
+
*/
|
|
16
|
+
file: UploadFileLike;
|
|
17
|
+
/**
|
|
18
|
+
* File name for the uploaded file. Is usually inferred from path,
|
|
19
|
+
* but should be provided for files sent as `Buffer` or stream.
|
|
20
|
+
*
|
|
21
|
+
* When file name can't be inferred, it falls back to "unnamed"
|
|
22
|
+
*/
|
|
23
|
+
fileName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Total file size. Automatically inferred for Buffer, File and local files.
|
|
26
|
+
*/
|
|
27
|
+
fileSize?: number;
|
|
28
|
+
/**
|
|
29
|
+
* If the file size is unknown, you can provide an estimate,
|
|
30
|
+
* which will be used to determine appropriate part size.
|
|
31
|
+
*/
|
|
32
|
+
estimatedSize?: number;
|
|
33
|
+
/**
|
|
34
|
+
* File MIME type. By default is automatically inferred from magic number
|
|
35
|
+
* If MIME can't be inferred, it defaults to `application/octet-stream`
|
|
36
|
+
*/
|
|
37
|
+
fileMime?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Upload part size (in KB).
|
|
40
|
+
*
|
|
41
|
+
* By default, automatically selected by file size.
|
|
42
|
+
* Must not be bigger than 512 and must not be a fraction.
|
|
43
|
+
*/
|
|
44
|
+
partSize?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Number of parts to be sent in parallel per connection.
|
|
47
|
+
*/
|
|
48
|
+
requestsPerConnection?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Function that will be called after some part has been uploaded.
|
|
51
|
+
*
|
|
52
|
+
* @param uploaded Number of bytes already uploaded
|
|
53
|
+
* @param total Total file size, if known
|
|
54
|
+
*/
|
|
55
|
+
progressCallback?: (uploaded: number, total: number) => void;
|
|
56
|
+
/**
|
|
57
|
+
* When using `inputMediaUploadedPhoto` (e.g. when sending an uploaded photo) require
|
|
58
|
+
* the file size to be known beforehand.
|
|
59
|
+
*
|
|
60
|
+
* In case this is set to `true`, a stream is passed as `file` and the file size is unknown,
|
|
61
|
+
* the stream will be buffered in memory and the file size will be inferred from the buffer.
|
|
62
|
+
*/
|
|
63
|
+
requireFileSize?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* When using `inputMediaUploadedPhoto` (e.g. when sending an uploaded photo) require
|
|
66
|
+
* the file extension to be known beforehand.
|
|
67
|
+
*
|
|
68
|
+
* This will make the library try to guess the file extension from the file mime type,
|
|
69
|
+
* or throw an error if it cannot be guessed.
|
|
70
|
+
*/
|
|
71
|
+
requireExtension?: boolean;
|
|
72
|
+
}): Promise<UploadedFile>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { InputMediaLike, InputPeerLike, MessageMedia, RawDocument, Photo } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Upload a media to Telegram servers, without actually
|
|
5
|
+
* sending a message anywhere. Useful when File ID is needed.
|
|
6
|
+
*
|
|
7
|
+
* The difference with {@link uploadFile} is that
|
|
8
|
+
* the returned object will act like a message media
|
|
9
|
+
* and contain fields like File ID.
|
|
10
|
+
*
|
|
11
|
+
* @param media Media to upload
|
|
12
|
+
* @param params Upload parameters
|
|
13
|
+
*/
|
|
14
|
+
export declare function uploadMedia(client: ITelegramClient, media: InputMediaLike, params?: {
|
|
15
|
+
/**
|
|
16
|
+
* Peer to associate this media with.
|
|
17
|
+
*
|
|
18
|
+
* @default `self`
|
|
19
|
+
*/
|
|
20
|
+
peer?: InputPeerLike;
|
|
21
|
+
/**
|
|
22
|
+
* Upload progress callback
|
|
23
|
+
*
|
|
24
|
+
* @param uploaded Number of bytes uploaded
|
|
25
|
+
* @param total Total file size
|
|
26
|
+
*/
|
|
27
|
+
progressCallback?: (uploaded: number, total: number) => void;
|
|
28
|
+
}): Promise<Extract<MessageMedia, Photo | RawDocument>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
3
|
+
import { InputPeerLike, Message } from '../../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Create a topic in a forum
|
|
6
|
+
*
|
|
7
|
+
* Only admins with `manageTopics` permission can do this.
|
|
8
|
+
*
|
|
9
|
+
* @returns Service message for the created topic
|
|
10
|
+
*/
|
|
11
|
+
export declare function createForumTopic(client: ITelegramClient, params: {
|
|
12
|
+
/** Chat ID or username */
|
|
13
|
+
chatId: InputPeerLike;
|
|
14
|
+
/**
|
|
15
|
+
* Topic title
|
|
16
|
+
*/
|
|
17
|
+
title: string;
|
|
18
|
+
/**
|
|
19
|
+
* Icon of the topic.
|
|
20
|
+
*
|
|
21
|
+
* Can be a number (color in RGB, see {@link ForumTopic} static members for allowed values)
|
|
22
|
+
* or a custom emoji ID.
|
|
23
|
+
*
|
|
24
|
+
* Icon color can't be changed after the topic is created.
|
|
25
|
+
*/
|
|
26
|
+
icon?: number | tl.Long;
|
|
27
|
+
/**
|
|
28
|
+
* Send as a specific channel
|
|
29
|
+
*/
|
|
30
|
+
sendAs?: InputPeerLike;
|
|
31
|
+
/**
|
|
32
|
+
* Whether to dispatch the returned service message (if any)
|
|
33
|
+
* to the client's update handler.
|
|
34
|
+
*/
|
|
35
|
+
shouldDispatch?: true;
|
|
36
|
+
}): Promise<Message>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { ForumTopic, InputPeerLike } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Delete a forum topic and all its history
|
|
5
|
+
*
|
|
6
|
+
* @param chat Chat or user ID, username, phone number, `"me"` or `"self"`
|
|
7
|
+
* @param topicId ID of the topic (i.e. its top message ID)
|
|
8
|
+
*/
|
|
9
|
+
export declare function deleteForumTopicHistory(client: ITelegramClient, chat: InputPeerLike, topicId: number | ForumTopic, params?: {
|
|
10
|
+
/**
|
|
11
|
+
* Whether to dispatch updates that will be generated by this call.
|
|
12
|
+
* Doesn't follow `disableNoDispatch`
|
|
13
|
+
*/
|
|
14
|
+
shouldDispatch?: true;
|
|
15
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
3
|
+
import { ForumTopic, InputPeerLike, Message } from '../../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Modify a topic in a forum
|
|
6
|
+
*
|
|
7
|
+
* Only admins with `manageTopics` permission can do this.
|
|
8
|
+
*
|
|
9
|
+
* @param chatId Chat ID or username
|
|
10
|
+
* @param topicId ID of the topic (i.e. its top message ID)
|
|
11
|
+
* @returns Service message about the modification
|
|
12
|
+
*/
|
|
13
|
+
export declare function editForumTopic(client: ITelegramClient, params: {
|
|
14
|
+
/** Chat ID or username */
|
|
15
|
+
chatId: InputPeerLike;
|
|
16
|
+
/** ID of the topic (i.e. its top message ID) */
|
|
17
|
+
topicId: number | ForumTopic;
|
|
18
|
+
/**
|
|
19
|
+
* New topic title
|
|
20
|
+
*/
|
|
21
|
+
title?: string;
|
|
22
|
+
/**
|
|
23
|
+
* New icon of the topic.
|
|
24
|
+
*
|
|
25
|
+
* Can be a custom emoji ID, or `null` to remove the icon
|
|
26
|
+
* and use static color instead
|
|
27
|
+
*/
|
|
28
|
+
icon?: tl.Long | null;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to dispatch the returned service message (if any)
|
|
31
|
+
* to the client's update handler.
|
|
32
|
+
*/
|
|
33
|
+
shouldDispatch?: true;
|
|
34
|
+
}): Promise<Message>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MaybeArray } from '../../../types/utils.js';
|
|
2
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
3
|
+
import { InputPeerLike, ForumTopic } from '../../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Get forum topics by their IDs
|
|
6
|
+
*
|
|
7
|
+
* @param chatId Chat ID or username
|
|
8
|
+
*/
|
|
9
|
+
export declare function getForumTopicsById(client: ITelegramClient, chatId: InputPeerLike, ids: MaybeArray<number>): Promise<ForumTopic[]>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { ArrayPaginated, InputPeerLike, ForumTopic } from '../../types/index.js';
|
|
3
|
+
export interface GetForumTopicsOffset {
|
|
4
|
+
date: number;
|
|
5
|
+
id: number;
|
|
6
|
+
topic: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Get forum topics
|
|
10
|
+
*
|
|
11
|
+
* @param chatId Chat ID or username
|
|
12
|
+
*/
|
|
13
|
+
export declare function getForumTopics(client: ITelegramClient, chatId: InputPeerLike, params?: {
|
|
14
|
+
/**
|
|
15
|
+
* Search query
|
|
16
|
+
*/
|
|
17
|
+
query?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Offset for pagination
|
|
20
|
+
*/
|
|
21
|
+
offset?: GetForumTopicsOffset;
|
|
22
|
+
/**
|
|
23
|
+
* Maximum number of topics to return.
|
|
24
|
+
*
|
|
25
|
+
* @default 100
|
|
26
|
+
*/
|
|
27
|
+
limit?: number;
|
|
28
|
+
}): Promise<ArrayPaginated<ForumTopic, GetForumTopicsOffset>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { ForumTopic, InputPeerLike } from '../../types/index.js';
|
|
3
|
+
import { getForumTopics } from './get-forum-topics.js';
|
|
4
|
+
/**
|
|
5
|
+
* Iterate over forum topics. Wrapper over {@link getForumTopics}.
|
|
6
|
+
*
|
|
7
|
+
* @param chatId Chat ID or username
|
|
8
|
+
*/
|
|
9
|
+
export declare function iterForumTopics(client: ITelegramClient, chatId: InputPeerLike, params?: Parameters<typeof getForumTopics>[2] & {
|
|
10
|
+
/**
|
|
11
|
+
* Maximum number of topics to return.
|
|
12
|
+
*
|
|
13
|
+
* @default `Infinity`, i.e. return all topics
|
|
14
|
+
*/
|
|
15
|
+
limit?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Chunk size. Usually you shouldn't care about this.
|
|
18
|
+
*/
|
|
19
|
+
chunkSize?: number;
|
|
20
|
+
}): AsyncIterableIterator<ForumTopic>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { ForumTopic, InputPeerLike } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Reorder pinned forum topics
|
|
5
|
+
*
|
|
6
|
+
* Only admins with `manageTopics` permission can do this.
|
|
7
|
+
*/
|
|
8
|
+
export declare function reorderPinnedForumTopics(client: ITelegramClient, params: {
|
|
9
|
+
/** Chat ID or username */
|
|
10
|
+
chatId: InputPeerLike;
|
|
11
|
+
/**
|
|
12
|
+
* Order of the pinned topics
|
|
13
|
+
*/
|
|
14
|
+
order: (number | ForumTopic)[];
|
|
15
|
+
/**
|
|
16
|
+
* Whether to un-pin topics not present in the order
|
|
17
|
+
*/
|
|
18
|
+
force?: boolean;
|
|
19
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { ForumTopic, InputPeerLike, Message } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Toggle open/close status of a topic in a forum
|
|
5
|
+
*
|
|
6
|
+
* Only admins with `manageTopics` permission can do this.
|
|
7
|
+
*
|
|
8
|
+
* @returns Service message about the modification
|
|
9
|
+
*/
|
|
10
|
+
export declare function toggleForumTopicClosed(client: ITelegramClient, parmas: {
|
|
11
|
+
/** Chat ID or username */
|
|
12
|
+
chatId: InputPeerLike;
|
|
13
|
+
/** ID of the topic (i.e. its top message ID) */
|
|
14
|
+
topicId: number | ForumTopic;
|
|
15
|
+
/** Whether the topic should be closed */
|
|
16
|
+
closed: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to dispatch the returned service message (if any)
|
|
19
|
+
* to the client's update handler.
|
|
20
|
+
*/
|
|
21
|
+
shouldDispatch?: true;
|
|
22
|
+
}): Promise<Message>;
|