@mtcute/core 0.28.2 → 0.29.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.cjs +0 -4
- package/client.js +0 -4
- package/highlevel/base.cjs +8 -9
- package/highlevel/base.d.cts +1 -1
- package/highlevel/base.d.ts +1 -1
- package/highlevel/base.js +8 -9
- package/highlevel/client.d.cts +9 -18
- package/highlevel/client.d.ts +9 -18
- package/highlevel/client.types.d.cts +5 -2
- package/highlevel/client.types.d.ts +5 -2
- package/highlevel/managers/timers.cjs +38 -18
- package/highlevel/managers/timers.d.cts +18 -4
- package/highlevel/managers/timers.d.ts +18 -4
- package/highlevel/managers/timers.js +38 -18
- package/highlevel/managers/timers.test.d.cts +1 -0
- package/highlevel/managers/timers.test.d.ts +1 -0
- package/highlevel/methods/auth/check-password.d.cts +1 -1
- package/highlevel/methods/auth/check-password.d.ts +1 -1
- package/highlevel/methods/auth/send-code.d.cts +1 -1
- package/highlevel/methods/auth/send-code.d.ts +1 -1
- package/highlevel/methods/auth/sign-in-qr.cjs +4 -4
- package/highlevel/methods/auth/sign-in-qr.js +4 -4
- package/highlevel/methods/auth/start.cjs +6 -6
- package/highlevel/methods/auth/start.d.cts +1 -1
- package/highlevel/methods/auth/start.d.ts +1 -1
- package/highlevel/methods/auth/start.js +6 -6
- package/highlevel/methods/auth/utils.d.cts +1 -1
- package/highlevel/methods/auth/utils.d.ts +1 -1
- package/highlevel/methods/bots/answer-inline-query.d.cts +1 -1
- package/highlevel/methods/bots/answer-inline-query.d.ts +1 -1
- package/highlevel/methods/bots/answer-pre-checkout-query.d.cts +1 -1
- package/highlevel/methods/bots/answer-pre-checkout-query.d.ts +1 -1
- package/highlevel/methods/bots/delete-my-commands.d.cts +1 -1
- package/highlevel/methods/bots/delete-my-commands.d.ts +1 -1
- package/highlevel/methods/bots/get-bot-info.d.cts +1 -1
- package/highlevel/methods/bots/get-bot-info.d.ts +1 -1
- package/highlevel/methods/bots/get-bot-menu-button.d.cts +1 -1
- package/highlevel/methods/bots/get-bot-menu-button.d.ts +1 -1
- package/highlevel/methods/bots/get-callback-answer.d.cts +1 -1
- package/highlevel/methods/bots/get-callback-answer.d.ts +1 -1
- package/highlevel/methods/bots/get-game-high-scores.d.cts +1 -1
- package/highlevel/methods/bots/get-game-high-scores.d.ts +1 -1
- package/highlevel/methods/bots/get-my-commands.d.cts +1 -1
- package/highlevel/methods/bots/get-my-commands.d.ts +1 -1
- package/highlevel/methods/bots/normalize-command-scope.cjs +2 -2
- package/highlevel/methods/bots/normalize-command-scope.d.cts +1 -1
- package/highlevel/methods/bots/normalize-command-scope.d.ts +1 -1
- package/highlevel/methods/bots/normalize-command-scope.js +2 -2
- package/highlevel/methods/bots/open-webview.cjs +15 -9
- package/highlevel/methods/bots/open-webview.d.cts +1 -1
- package/highlevel/methods/bots/open-webview.d.ts +1 -1
- package/highlevel/methods/bots/open-webview.js +15 -9
- package/highlevel/methods/bots/prepare-inline-message.d.cts +1 -1
- package/highlevel/methods/bots/prepare-inline-message.d.ts +1 -1
- package/highlevel/methods/bots/set-bot-menu-button.d.cts +1 -1
- package/highlevel/methods/bots/set-bot-menu-button.d.ts +1 -1
- package/highlevel/methods/bots/set-game-score.d.cts +1 -1
- package/highlevel/methods/bots/set-game-score.d.ts +1 -1
- package/highlevel/methods/bots/set-my-commands.d.cts +1 -1
- package/highlevel/methods/bots/set-my-commands.d.ts +1 -1
- package/highlevel/methods/bots/set-my-default-rights.d.cts +1 -1
- package/highlevel/methods/bots/set-my-default-rights.d.ts +1 -1
- package/highlevel/methods/chats/add-chat-members.d.cts +1 -1
- package/highlevel/methods/chats/add-chat-members.d.ts +1 -1
- package/highlevel/methods/chats/batched-queries.cjs +3 -3
- package/highlevel/methods/chats/batched-queries.d.cts +1 -1
- package/highlevel/methods/chats/batched-queries.d.ts +1 -1
- package/highlevel/methods/chats/batched-queries.js +3 -3
- package/highlevel/methods/chats/create-group.d.cts +1 -1
- package/highlevel/methods/chats/create-group.d.ts +1 -1
- package/highlevel/methods/chats/edit-admin-rights.d.cts +1 -1
- package/highlevel/methods/chats/edit-admin-rights.d.ts +1 -1
- package/highlevel/methods/chats/get-chat-event-log.d.cts +1 -1
- package/highlevel/methods/chats/get-chat-event-log.d.ts +1 -1
- package/highlevel/methods/chats/get-chat-member.cjs +2 -2
- package/highlevel/methods/chats/get-chat-member.js +2 -2
- package/highlevel/methods/chats/restrict-chat-member.d.cts +1 -1
- package/highlevel/methods/chats/restrict-chat-member.d.ts +1 -1
- package/highlevel/methods/chats/save-draft.d.cts +1 -1
- package/highlevel/methods/chats/save-draft.d.ts +1 -1
- package/highlevel/methods/chats/set-chat-color.d.cts +1 -1
- package/highlevel/methods/chats/set-chat-color.d.ts +1 -1
- package/highlevel/methods/chats/set-chat-default-permissions.d.cts +1 -1
- package/highlevel/methods/chats/set-chat-default-permissions.d.ts +1 -1
- package/highlevel/methods/chats/set-chat-photo.cjs +3 -3
- package/highlevel/methods/chats/set-chat-photo.js +3 -3
- package/highlevel/methods/contacts/import-contacts.d.cts +1 -1
- package/highlevel/methods/contacts/import-contacts.d.ts +1 -1
- package/highlevel/methods/contacts/set-contact-note.cjs +0 -2
- package/highlevel/methods/contacts/set-contact-note.js +0 -2
- package/highlevel/methods/dialogs/create-folder.d.cts +1 -1
- package/highlevel/methods/dialogs/create-folder.d.ts +1 -1
- package/highlevel/methods/dialogs/delete-folder.d.cts +1 -1
- package/highlevel/methods/dialogs/delete-folder.d.ts +1 -1
- package/highlevel/methods/dialogs/edit-folder.d.cts +1 -1
- package/highlevel/methods/dialogs/edit-folder.d.ts +1 -1
- package/highlevel/methods/dialogs/find-folder.cjs +1 -1
- package/highlevel/methods/dialogs/find-folder.d.cts +1 -1
- package/highlevel/methods/dialogs/find-folder.d.ts +1 -1
- package/highlevel/methods/dialogs/find-folder.js +1 -1
- package/highlevel/methods/dialogs/get-folders.d.cts +1 -1
- package/highlevel/methods/dialogs/get-folders.d.ts +1 -1
- package/highlevel/methods/dialogs/iter-dialogs.d.cts +1 -1
- package/highlevel/methods/dialogs/iter-dialogs.d.ts +1 -1
- package/highlevel/methods/dialogs/join-chatlist.d.cts +1 -1
- package/highlevel/methods/dialogs/join-chatlist.d.ts +1 -1
- package/highlevel/methods/files/download-chunk.cjs +2 -2
- package/highlevel/methods/files/download-chunk.js +2 -2
- package/highlevel/methods/files/download-iterable.cjs +3 -3
- package/highlevel/methods/files/download-iterable.d.cts +1 -1
- package/highlevel/methods/files/download-iterable.d.ts +1 -1
- package/highlevel/methods/files/download-iterable.js +3 -3
- package/highlevel/methods/files/normalize-file-to-document.cjs +2 -2
- package/highlevel/methods/files/normalize-file-to-document.d.cts +1 -1
- package/highlevel/methods/files/normalize-file-to-document.d.ts +1 -1
- package/highlevel/methods/files/normalize-file-to-document.js +2 -2
- package/highlevel/methods/files/normalize-input-file.cjs +3 -3
- package/highlevel/methods/files/normalize-input-file.d.cts +1 -1
- package/highlevel/methods/files/normalize-input-file.d.ts +1 -1
- package/highlevel/methods/files/normalize-input-file.js +3 -3
- package/highlevel/methods/files/normalize-input-media.cjs +5 -5
- package/highlevel/methods/files/normalize-input-media.d.cts +1 -1
- package/highlevel/methods/files/normalize-input-media.d.ts +1 -1
- package/highlevel/methods/files/normalize-input-media.js +5 -5
- package/highlevel/methods/forums/create-forum-topic.d.cts +1 -1
- package/highlevel/methods/forums/create-forum-topic.d.ts +1 -1
- package/highlevel/methods/forums/edit-forum-topic.d.cts +1 -1
- package/highlevel/methods/forums/edit-forum-topic.d.ts +1 -1
- package/highlevel/methods/gifts/_normalize-input-star-gift.d.cts +1 -1
- package/highlevel/methods/gifts/_normalize-input-star-gift.d.ts +1 -1
- package/highlevel/methods/gifts/get-resale-star-gifts.d.cts +1 -1
- package/highlevel/methods/gifts/get-resale-star-gifts.d.ts +1 -1
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.cts +1 -1
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.ts +1 -1
- package/highlevel/methods/gifts/send-star-gift-offer.d.cts +1 -1
- package/highlevel/methods/gifts/send-star-gift-offer.d.ts +1 -1
- package/highlevel/methods/gifts/transfer-star-gift.cjs +2 -2
- package/highlevel/methods/gifts/transfer-star-gift.js +2 -2
- package/highlevel/methods/gifts/upgrade-star-gift.cjs +2 -2
- package/highlevel/methods/gifts/upgrade-star-gift.js +2 -2
- package/highlevel/methods/invite-links/create-invite-link.d.cts +1 -1
- package/highlevel/methods/invite-links/create-invite-link.d.ts +1 -1
- package/highlevel/methods/invite-links/get-invite-link-members.d.cts +1 -1
- package/highlevel/methods/invite-links/get-invite-link-members.d.ts +1 -1
- package/highlevel/methods/messages/edit-inline-message.cjs +2 -2
- package/highlevel/methods/messages/edit-inline-message.d.cts +1 -1
- package/highlevel/methods/messages/edit-inline-message.d.ts +1 -1
- package/highlevel/methods/messages/edit-inline-message.js +2 -2
- package/highlevel/methods/messages/edit-message.cjs +3 -2
- package/highlevel/methods/messages/edit-message.js +3 -2
- package/highlevel/methods/messages/find-in-update.d.cts +1 -1
- package/highlevel/methods/messages/find-in-update.d.ts +1 -1
- package/highlevel/methods/messages/forward-messages.cjs +1 -1
- package/highlevel/methods/messages/forward-messages.d.cts +1 -1
- package/highlevel/methods/messages/forward-messages.d.ts +1 -1
- package/highlevel/methods/messages/forward-messages.js +1 -1
- package/highlevel/methods/messages/get-callback-query-message.d.cts +1 -1
- package/highlevel/methods/messages/get-callback-query-message.d.ts +1 -1
- package/highlevel/methods/messages/get-discussion-message.d.cts +1 -1
- package/highlevel/methods/messages/get-discussion-message.d.ts +1 -1
- package/highlevel/methods/messages/search-global.d.cts +1 -1
- package/highlevel/methods/messages/search-global.d.ts +1 -1
- package/highlevel/methods/messages/search-hashtag.d.cts +1 -1
- package/highlevel/methods/messages/search-hashtag.d.ts +1 -1
- package/highlevel/methods/messages/search-messages.d.cts +1 -1
- package/highlevel/methods/messages/search-messages.d.ts +1 -1
- package/highlevel/methods/messages/search-posts-global.d.cts +1 -1
- package/highlevel/methods/messages/search-posts-global.d.ts +1 -1
- package/highlevel/methods/messages/send-common.cjs +1 -1
- package/highlevel/methods/messages/send-common.d.cts +1 -1
- package/highlevel/methods/messages/send-common.d.ts +1 -1
- package/highlevel/methods/messages/send-common.js +1 -1
- package/highlevel/methods/messages/send-media-group.cjs +6 -5
- package/highlevel/methods/messages/send-media-group.js +6 -5
- package/highlevel/methods/messages/send-media.cjs +6 -5
- package/highlevel/methods/messages/send-media.js +6 -5
- package/highlevel/methods/messages/send-paid-reaction.cjs +2 -2
- package/highlevel/methods/messages/send-paid-reaction.js +2 -2
- package/highlevel/methods/messages/send-text.cjs +6 -5
- package/highlevel/methods/messages/send-text.js +6 -5
- package/highlevel/methods/messages/send-typing.cjs +3 -2
- package/highlevel/methods/messages/send-typing.d.cts +1 -1
- package/highlevel/methods/messages/send-typing.d.ts +1 -1
- package/highlevel/methods/messages/send-typing.js +3 -2
- package/highlevel/methods/messages/set-typing.cjs +12 -8
- package/highlevel/methods/messages/set-typing.d.cts +1 -1
- package/highlevel/methods/messages/set-typing.d.ts +1 -1
- package/highlevel/methods/messages/set-typing.js +12 -8
- package/highlevel/methods/messages/set-typing.test.d.cts +1 -0
- package/highlevel/methods/messages/set-typing.test.d.ts +1 -0
- package/highlevel/methods/misc/chain-id.d.cts +1 -1
- package/highlevel/methods/misc/chain-id.d.ts +1 -1
- package/highlevel/methods/misc/init-takeout-session.d.cts +1 -1
- package/highlevel/methods/misc/init-takeout-session.d.ts +1 -1
- package/highlevel/methods/misc/normalize-privacy-rules.d.cts +1 -1
- package/highlevel/methods/misc/normalize-privacy-rules.d.ts +1 -1
- package/highlevel/methods/misc/normalize-text.d.cts +1 -1
- package/highlevel/methods/misc/normalize-text.d.ts +1 -1
- package/highlevel/methods/premium/_normalize-stars-amount.d.cts +1 -1
- package/highlevel/methods/premium/_normalize-stars-amount.d.ts +1 -1
- package/highlevel/methods/premium/set-business-intro.d.cts +1 -1
- package/highlevel/methods/premium/set-business-intro.d.ts +1 -1
- package/highlevel/methods/premium/set-business-work-hours.d.cts +1 -1
- package/highlevel/methods/premium/set-business-work-hours.d.ts +1 -1
- package/highlevel/methods/stickers/_utils.d.cts +1 -1
- package/highlevel/methods/stickers/_utils.d.ts +1 -1
- package/highlevel/methods/stickers/get-custom-emojis.cjs +4 -5
- package/highlevel/methods/stickers/get-custom-emojis.d.cts +3 -3
- package/highlevel/methods/stickers/get-custom-emojis.d.ts +3 -3
- package/highlevel/methods/stickers/get-custom-emojis.js +4 -5
- package/highlevel/methods/stickers/set-sticker-set-thumb.d.cts +1 -1
- package/highlevel/methods/stickers/set-sticker-set-thumb.d.ts +1 -1
- package/highlevel/methods/stories/can-send-story.cjs +3 -3
- package/highlevel/methods/stories/can-send-story.js +3 -3
- package/highlevel/methods/stories/edit-story.d.cts +1 -1
- package/highlevel/methods/stories/edit-story.d.ts +1 -1
- package/highlevel/methods/stories/find-in-update.d.cts +1 -1
- package/highlevel/methods/stories/find-in-update.d.ts +1 -1
- package/highlevel/methods/stories/get-profile-stories.cjs +3 -3
- package/highlevel/methods/stories/get-profile-stories.js +3 -3
- package/highlevel/methods/stories/get-stories-by-id.cjs +3 -3
- package/highlevel/methods/stories/get-stories-by-id.js +3 -3
- package/highlevel/methods/stories/send-story.d.cts +1 -1
- package/highlevel/methods/stories/send-story.d.ts +1 -1
- package/highlevel/methods/users/_resolve-common.cjs +74 -0
- package/highlevel/methods/users/_resolve-common.d.cts +4 -0
- package/highlevel/methods/users/_resolve-common.d.ts +4 -0
- package/highlevel/methods/users/_resolve-common.js +69 -0
- package/highlevel/methods/users/delete-profile-photos.d.cts +1 -1
- package/highlevel/methods/users/delete-profile-photos.d.ts +1 -1
- package/highlevel/methods/users/get-profile-photo.cjs +1 -2
- package/highlevel/methods/users/get-profile-photo.d.cts +2 -2
- package/highlevel/methods/users/get-profile-photo.d.ts +2 -2
- package/highlevel/methods/users/get-profile-photo.js +1 -2
- package/highlevel/methods/users/get-profile-photos.cjs +3 -3
- package/highlevel/methods/users/get-profile-photos.js +3 -3
- package/highlevel/methods/users/get-saved-music.cjs +1 -0
- package/highlevel/methods/users/get-saved-music.js +1 -0
- package/highlevel/methods/users/is-peer-available.cjs +2 -2
- package/highlevel/methods/users/is-peer-available.js +1 -1
- package/highlevel/methods/users/resolve-peer-many.d.cts +1 -1
- package/highlevel/methods/users/resolve-peer-many.d.ts +1 -1
- package/highlevel/methods/users/resolve-peer.cjs +7 -68
- package/highlevel/methods/users/resolve-peer.d.cts +1 -3
- package/highlevel/methods/users/resolve-peer.d.ts +1 -3
- package/highlevel/methods/users/resolve-peer.js +8 -69
- package/highlevel/methods/users/resolve-phone-number.cjs +4 -4
- package/highlevel/methods/users/resolve-phone-number.d.cts +1 -1
- package/highlevel/methods/users/resolve-phone-number.d.ts +1 -1
- package/highlevel/methods/users/resolve-phone-number.js +3 -3
- package/highlevel/methods/users/save-music-to-profile.cjs +2 -2
- package/highlevel/methods/users/save-music-to-profile.js +2 -2
- package/highlevel/methods/users/set-emoji-status.d.cts +1 -1
- package/highlevel/methods/users/set-emoji-status.d.ts +1 -1
- package/highlevel/methods/users/set-my-profile-photo.cjs +5 -2
- package/highlevel/methods/users/set-my-profile-photo.d.cts +1 -1
- package/highlevel/methods/users/set-my-profile-photo.d.ts +1 -1
- package/highlevel/methods/users/set-my-profile-photo.js +5 -2
- package/highlevel/methods/users/set-online.cjs +9 -5
- package/highlevel/methods/users/set-online.js +9 -5
- package/highlevel/methods.d.cts +0 -1
- package/highlevel/methods.d.ts +0 -1
- package/highlevel/storage/service/current-user.cjs +1 -1
- package/highlevel/storage/service/current-user.d.cts +1 -1
- package/highlevel/storage/service/current-user.d.ts +1 -1
- package/highlevel/storage/service/current-user.js +1 -1
- package/highlevel/storage/service/peers.d.cts +1 -1
- package/highlevel/storage/service/peers.d.ts +1 -1
- package/highlevel/types/auth/sent-code.d.cts +1 -1
- package/highlevel/types/auth/sent-code.d.ts +1 -1
- package/highlevel/types/bots/command-scope/inner.d.cts +1 -1
- package/highlevel/types/bots/command-scope/inner.d.ts +1 -1
- package/highlevel/types/bots/game-high-score.d.cts +1 -1
- package/highlevel/types/bots/game-high-score.d.ts +1 -1
- package/highlevel/types/bots/inline-message/factories.d.cts +1 -1
- package/highlevel/types/bots/inline-message/factories.d.ts +1 -1
- package/highlevel/types/bots/inline-result/factories.d.cts +1 -1
- package/highlevel/types/bots/inline-result/factories.d.ts +1 -1
- package/highlevel/types/bots/inline-result/types.d.cts +1 -1
- package/highlevel/types/bots/inline-result/types.d.ts +1 -1
- package/highlevel/types/bots/keyboards/builder.d.cts +1 -1
- package/highlevel/types/bots/keyboards/builder.d.ts +1 -1
- package/highlevel/types/bots/keyboards/factories.cjs +2 -2
- package/highlevel/types/bots/keyboards/factories.d.cts +1 -1
- package/highlevel/types/bots/keyboards/factories.d.ts +1 -1
- package/highlevel/types/bots/keyboards/factories.js +2 -2
- package/highlevel/types/bots/keyboards/types.d.cts +1 -1
- package/highlevel/types/bots/keyboards/types.d.ts +1 -1
- package/highlevel/types/bots/webview.d.cts +1 -1
- package/highlevel/types/bots/webview.d.ts +1 -1
- package/highlevel/types/conversation.d.cts +1 -1
- package/highlevel/types/conversation.d.ts +1 -1
- package/highlevel/types/files/file-location.d.cts +1 -1
- package/highlevel/types/files/file-location.d.ts +1 -1
- package/highlevel/types/files/uploaded-file.d.cts +1 -1
- package/highlevel/types/files/uploaded-file.d.ts +1 -1
- package/highlevel/types/files/utils.d.cts +1 -1
- package/highlevel/types/files/utils.d.ts +1 -1
- package/highlevel/types/files/web-document.d.cts +1 -1
- package/highlevel/types/files/web-document.d.ts +1 -1
- package/highlevel/types/media/audio.d.cts +1 -1
- package/highlevel/types/media/audio.d.ts +1 -1
- package/highlevel/types/media/contact.d.cts +1 -1
- package/highlevel/types/media/contact.d.ts +1 -1
- package/highlevel/types/media/dice.d.cts +1 -1
- package/highlevel/types/media/dice.d.ts +1 -1
- package/highlevel/types/media/document-utils.d.cts +1 -1
- package/highlevel/types/media/document-utils.d.ts +1 -1
- package/highlevel/types/media/document.d.cts +1 -1
- package/highlevel/types/media/document.d.ts +1 -1
- package/highlevel/types/media/extended-media.d.cts +1 -1
- package/highlevel/types/media/extended-media.d.ts +1 -1
- package/highlevel/types/media/game.d.cts +1 -1
- package/highlevel/types/media/game.d.ts +1 -1
- package/highlevel/types/media/input-media/factories.d.cts +1 -1
- package/highlevel/types/media/input-media/factories.d.ts +1 -1
- package/highlevel/types/media/input-media/types.d.cts +1 -1
- package/highlevel/types/media/input-media/types.d.ts +1 -1
- package/highlevel/types/media/invoice.d.cts +1 -1
- package/highlevel/types/media/invoice.d.ts +1 -1
- package/highlevel/types/media/location.d.cts +1 -1
- package/highlevel/types/media/location.d.ts +1 -1
- package/highlevel/types/media/paid-media.d.cts +1 -1
- package/highlevel/types/media/paid-media.d.ts +1 -1
- package/highlevel/types/media/photo.d.cts +1 -1
- package/highlevel/types/media/photo.d.ts +1 -1
- package/highlevel/types/media/poll.d.cts +1 -1
- package/highlevel/types/media/poll.d.ts +1 -1
- package/highlevel/types/media/sticker.d.cts +1 -1
- package/highlevel/types/media/sticker.d.ts +1 -1
- package/highlevel/types/media/story.d.cts +1 -1
- package/highlevel/types/media/story.d.ts +1 -1
- package/highlevel/types/media/thumbnail.d.cts +1 -1
- package/highlevel/types/media/thumbnail.d.ts +1 -1
- package/highlevel/types/media/todo.d.cts +1 -1
- package/highlevel/types/media/todo.d.ts +1 -1
- package/highlevel/types/media/venue.cjs +2 -2
- package/highlevel/types/media/venue.d.cts +1 -1
- package/highlevel/types/media/venue.d.ts +1 -1
- package/highlevel/types/media/venue.js +2 -2
- package/highlevel/types/media/video.d.cts +1 -1
- package/highlevel/types/media/video.d.ts +1 -1
- package/highlevel/types/media/voice.d.cts +1 -1
- package/highlevel/types/media/voice.d.ts +1 -1
- package/highlevel/types/media/web-page.d.cts +1 -1
- package/highlevel/types/media/web-page.d.ts +1 -1
- package/highlevel/types/messages/dialog.d.cts +1 -1
- package/highlevel/types/messages/dialog.d.ts +1 -1
- package/highlevel/types/messages/draft-message.d.cts +1 -1
- package/highlevel/types/messages/draft-message.d.ts +1 -1
- package/highlevel/types/messages/fact-check.d.cts +1 -1
- package/highlevel/types/messages/fact-check.d.ts +1 -1
- package/highlevel/types/messages/message-action.cjs +4 -0
- package/highlevel/types/messages/message-action.d.cts +1 -1
- package/highlevel/types/messages/message-action.d.ts +1 -1
- package/highlevel/types/messages/message-action.js +4 -0
- package/highlevel/types/messages/message-effect.cjs +2 -6
- package/highlevel/types/messages/message-effect.d.cts +1 -1
- package/highlevel/types/messages/message-effect.d.ts +1 -1
- package/highlevel/types/messages/message-effect.js +2 -6
- package/highlevel/types/messages/message-entity.d.cts +1 -1
- package/highlevel/types/messages/message-entity.d.ts +1 -1
- package/highlevel/types/messages/message-forward.d.cts +1 -1
- package/highlevel/types/messages/message-forward.d.ts +1 -1
- package/highlevel/types/messages/message-media.d.cts +1 -1
- package/highlevel/types/messages/message-media.d.ts +1 -1
- package/highlevel/types/messages/message-reactions.d.cts +1 -1
- package/highlevel/types/messages/message-reactions.d.ts +1 -1
- package/highlevel/types/messages/message-replies.d.cts +1 -1
- package/highlevel/types/messages/message-replies.d.ts +1 -1
- package/highlevel/types/messages/message.d.cts +1 -1
- package/highlevel/types/messages/message.d.ts +1 -1
- package/highlevel/types/messages/replied-message.cjs +4 -14
- package/highlevel/types/messages/replied-message.d.cts +2 -2
- package/highlevel/types/messages/replied-message.d.ts +2 -2
- package/highlevel/types/messages/replied-message.js +2 -12
- package/highlevel/types/messages/suggested-post.d.cts +1 -1
- package/highlevel/types/messages/suggested-post.d.ts +1 -1
- package/highlevel/types/misc/collectible-info.d.cts +1 -1
- package/highlevel/types/misc/collectible-info.d.ts +1 -1
- package/highlevel/types/misc/entities.d.cts +1 -1
- package/highlevel/types/misc/entities.d.ts +1 -1
- package/highlevel/types/misc/input-privacy-rule/allow.d.cts +1 -1
- package/highlevel/types/misc/input-privacy-rule/allow.d.ts +1 -1
- package/highlevel/types/misc/input-privacy-rule/disallow.d.cts +1 -1
- package/highlevel/types/misc/input-privacy-rule/disallow.d.ts +1 -1
- package/highlevel/types/misc/input-privacy-rule/types.d.cts +1 -1
- package/highlevel/types/misc/input-privacy-rule/types.d.ts +1 -1
- package/highlevel/types/misc/sticker-set.cjs +5 -3
- package/highlevel/types/misc/sticker-set.d.cts +1 -1
- package/highlevel/types/misc/sticker-set.d.ts +1 -1
- package/highlevel/types/misc/sticker-set.js +5 -3
- package/highlevel/types/misc/takeout-session.d.cts +1 -1
- package/highlevel/types/misc/takeout-session.d.ts +1 -1
- package/highlevel/types/peers/bot-info.d.cts +1 -1
- package/highlevel/types/peers/bot-info.d.ts +1 -1
- package/highlevel/types/peers/bot-verification.d.cts +1 -1
- package/highlevel/types/peers/bot-verification.d.ts +1 -1
- package/highlevel/types/peers/chat-colors.d.cts +1 -1
- package/highlevel/types/peers/chat-colors.d.ts +1 -1
- package/highlevel/types/peers/chat-event/actions.cjs +4 -5
- package/highlevel/types/peers/chat-event/actions.d.cts +5 -6
- package/highlevel/types/peers/chat-event/actions.d.ts +5 -6
- package/highlevel/types/peers/chat-event/actions.js +4 -5
- package/highlevel/types/peers/chat-event/filters.d.cts +1 -1
- package/highlevel/types/peers/chat-event/filters.d.ts +1 -1
- package/highlevel/types/peers/chat-event/index.d.cts +1 -1
- package/highlevel/types/peers/chat-event/index.d.ts +1 -1
- package/highlevel/types/peers/chat-invite-link-member.d.cts +1 -1
- package/highlevel/types/peers/chat-invite-link-member.d.ts +1 -1
- package/highlevel/types/peers/chat-invite-link.d.cts +1 -1
- package/highlevel/types/peers/chat-invite-link.d.ts +1 -1
- package/highlevel/types/peers/chat-member.d.cts +1 -1
- package/highlevel/types/peers/chat-member.d.ts +1 -1
- package/highlevel/types/peers/chat-permissions.d.cts +1 -1
- package/highlevel/types/peers/chat-permissions.d.ts +1 -1
- package/highlevel/types/peers/chat-photo.d.cts +1 -1
- package/highlevel/types/peers/chat-photo.d.ts +1 -1
- package/highlevel/types/peers/chat-preview.d.cts +1 -1
- package/highlevel/types/peers/chat-preview.d.ts +1 -1
- package/highlevel/types/peers/chat.d.cts +1 -1
- package/highlevel/types/peers/chat.d.ts +1 -1
- package/highlevel/types/peers/chatlist-preview.d.cts +1 -1
- package/highlevel/types/peers/chatlist-preview.d.ts +1 -1
- package/highlevel/types/peers/forum-topic.d.cts +1 -1
- package/highlevel/types/peers/forum-topic.d.ts +1 -1
- package/highlevel/types/peers/full-chat.cjs +0 -11
- package/highlevel/types/peers/full-chat.d.cts +1 -6
- package/highlevel/types/peers/full-chat.d.ts +1 -6
- package/highlevel/types/peers/full-chat.js +0 -11
- package/highlevel/types/peers/full-user.d.cts +1 -1
- package/highlevel/types/peers/full-user.d.ts +1 -1
- package/highlevel/types/peers/index.d.cts +0 -1
- package/highlevel/types/peers/index.d.ts +0 -1
- package/highlevel/types/peers/peer-settings.d.cts +1 -1
- package/highlevel/types/peers/peer-settings.d.ts +1 -1
- package/highlevel/types/peers/peer.d.cts +1 -1
- package/highlevel/types/peers/peer.d.ts +1 -1
- package/highlevel/types/peers/peers-index.cjs +3 -1
- package/highlevel/types/peers/peers-index.d.cts +1 -1
- package/highlevel/types/peers/peers-index.d.ts +1 -1
- package/highlevel/types/peers/peers-index.js +3 -1
- package/highlevel/types/peers/user.d.cts +1 -1
- package/highlevel/types/peers/user.d.ts +1 -1
- package/highlevel/types/premium/boost-slot.d.cts +1 -1
- package/highlevel/types/premium/boost-slot.d.ts +1 -1
- package/highlevel/types/premium/boost-stats.d.cts +1 -1
- package/highlevel/types/premium/boost-stats.d.ts +1 -1
- package/highlevel/types/premium/boost.d.cts +1 -1
- package/highlevel/types/premium/boost.d.ts +1 -1
- package/highlevel/types/premium/business-account.d.cts +1 -1
- package/highlevel/types/premium/business-account.d.ts +1 -1
- package/highlevel/types/premium/business-chat-link.d.cts +1 -1
- package/highlevel/types/premium/business-chat-link.d.ts +1 -1
- package/highlevel/types/premium/business-connection.d.cts +1 -1
- package/highlevel/types/premium/business-connection.d.ts +1 -1
- package/highlevel/types/premium/business-intro.d.cts +1 -1
- package/highlevel/types/premium/business-intro.d.ts +1 -1
- package/highlevel/types/premium/business-location.d.cts +1 -1
- package/highlevel/types/premium/business-location.d.ts +1 -1
- package/highlevel/types/premium/business-work-hours.d.cts +1 -1
- package/highlevel/types/premium/business-work-hours.d.ts +1 -1
- package/highlevel/types/premium/saved-star-gift.d.cts +1 -1
- package/highlevel/types/premium/saved-star-gift.d.ts +1 -1
- package/highlevel/types/premium/star-gift-unique.d.cts +1 -1
- package/highlevel/types/premium/star-gift-unique.d.ts +1 -1
- package/highlevel/types/premium/star-gift-value.d.cts +1 -1
- package/highlevel/types/premium/star-gift-value.d.ts +1 -1
- package/highlevel/types/premium/star-gift.cjs +0 -4
- package/highlevel/types/premium/star-gift.d.cts +1 -3
- package/highlevel/types/premium/star-gift.d.ts +1 -3
- package/highlevel/types/premium/star-gift.js +0 -4
- package/highlevel/types/premium/stars-status.d.cts +1 -1
- package/highlevel/types/premium/stars-status.d.ts +1 -1
- package/highlevel/types/premium/stars-transaction.d.cts +1 -1
- package/highlevel/types/premium/stars-transaction.d.ts +1 -1
- package/highlevel/types/reactions/emoji-status.d.cts +1 -1
- package/highlevel/types/reactions/emoji-status.d.ts +1 -1
- package/highlevel/types/reactions/peer-reaction.cjs +5 -8
- package/highlevel/types/reactions/peer-reaction.d.cts +4 -5
- package/highlevel/types/reactions/peer-reaction.d.ts +4 -5
- package/highlevel/types/reactions/peer-reaction.js +5 -8
- package/highlevel/types/reactions/reaction-count.d.cts +1 -1
- package/highlevel/types/reactions/reaction-count.d.ts +1 -1
- package/highlevel/types/reactions/types.d.cts +1 -1
- package/highlevel/types/reactions/types.d.ts +1 -1
- package/highlevel/types/stories/all-stories.d.cts +1 -1
- package/highlevel/types/stories/all-stories.d.ts +1 -1
- package/highlevel/types/stories/interactive/base.d.cts +1 -1
- package/highlevel/types/stories/interactive/base.d.ts +1 -1
- package/highlevel/types/stories/interactive/channel-post.d.cts +1 -1
- package/highlevel/types/stories/interactive/channel-post.d.ts +1 -1
- package/highlevel/types/stories/interactive/index.d.cts +1 -1
- package/highlevel/types/stories/interactive/index.d.ts +1 -1
- package/highlevel/types/stories/interactive/input.d.cts +1 -1
- package/highlevel/types/stories/interactive/input.d.ts +1 -1
- package/highlevel/types/stories/interactive/location.d.cts +1 -1
- package/highlevel/types/stories/interactive/location.d.ts +1 -1
- package/highlevel/types/stories/interactive/reaction.d.cts +1 -1
- package/highlevel/types/stories/interactive/reaction.d.ts +1 -1
- package/highlevel/types/stories/interactive/star-gift.d.cts +1 -1
- package/highlevel/types/stories/interactive/star-gift.d.ts +1 -1
- package/highlevel/types/stories/interactive/url.d.cts +1 -1
- package/highlevel/types/stories/interactive/url.d.ts +1 -1
- package/highlevel/types/stories/interactive/venue.d.cts +1 -1
- package/highlevel/types/stories/interactive/venue.d.ts +1 -1
- package/highlevel/types/stories/interactive/weather.d.cts +1 -1
- package/highlevel/types/stories/interactive/weather.d.ts +1 -1
- package/highlevel/types/stories/peer-stories.cjs +4 -4
- package/highlevel/types/stories/peer-stories.d.cts +1 -1
- package/highlevel/types/stories/peer-stories.d.ts +1 -1
- package/highlevel/types/stories/peer-stories.js +4 -4
- package/highlevel/types/stories/stealth-mode.d.cts +1 -1
- package/highlevel/types/stories/stealth-mode.d.ts +1 -1
- package/highlevel/types/stories/story-interactions.d.cts +1 -1
- package/highlevel/types/stories/story-interactions.d.ts +1 -1
- package/highlevel/types/stories/story-viewer.cjs +3 -4
- package/highlevel/types/stories/story-viewer.d.cts +3 -3
- package/highlevel/types/stories/story-viewer.d.ts +3 -3
- package/highlevel/types/stories/story-viewer.js +3 -4
- package/highlevel/types/stories/story.d.cts +1 -1
- package/highlevel/types/stories/story.d.ts +1 -1
- package/highlevel/types/updates/bot-chat-join-request.d.cts +1 -1
- package/highlevel/types/updates/bot-chat-join-request.d.ts +1 -1
- package/highlevel/types/updates/bot-reaction.d.cts +1 -1
- package/highlevel/types/updates/bot-reaction.d.ts +1 -1
- package/highlevel/types/updates/bot-stopped.d.cts +1 -1
- package/highlevel/types/updates/bot-stopped.d.ts +1 -1
- package/highlevel/types/updates/business-message.d.cts +1 -1
- package/highlevel/types/updates/business-message.d.ts +1 -1
- package/highlevel/types/updates/callback-query.d.cts +1 -1
- package/highlevel/types/updates/callback-query.d.ts +1 -1
- package/highlevel/types/updates/chat-join-request.d.cts +1 -1
- package/highlevel/types/updates/chat-join-request.d.ts +1 -1
- package/highlevel/types/updates/chat-member-update.cjs +2 -2
- package/highlevel/types/updates/chat-member-update.d.cts +1 -1
- package/highlevel/types/updates/chat-member-update.d.ts +1 -1
- package/highlevel/types/updates/chat-member-update.js +2 -2
- package/highlevel/types/updates/chosen-inline-result.d.cts +1 -1
- package/highlevel/types/updates/chosen-inline-result.d.ts +1 -1
- package/highlevel/types/updates/delete-business-message-update.d.cts +1 -1
- package/highlevel/types/updates/delete-business-message-update.d.ts +1 -1
- package/highlevel/types/updates/delete-message-update.d.cts +1 -1
- package/highlevel/types/updates/delete-message-update.d.ts +1 -1
- package/highlevel/types/updates/delete-story-update.d.cts +1 -1
- package/highlevel/types/updates/delete-story-update.d.ts +1 -1
- package/highlevel/types/updates/history-read-update.d.cts +1 -1
- package/highlevel/types/updates/history-read-update.d.ts +1 -1
- package/highlevel/types/updates/inline-query.d.cts +1 -1
- package/highlevel/types/updates/inline-query.d.ts +1 -1
- package/highlevel/types/updates/poll-update.d.cts +1 -1
- package/highlevel/types/updates/poll-update.d.ts +1 -1
- package/highlevel/types/updates/poll-vote.d.cts +1 -1
- package/highlevel/types/updates/poll-vote.d.ts +1 -1
- package/highlevel/types/updates/pre-checkout-query.d.cts +1 -1
- package/highlevel/types/updates/pre-checkout-query.d.ts +1 -1
- package/highlevel/types/updates/story-update.d.cts +1 -1
- package/highlevel/types/updates/story-update.d.ts +1 -1
- package/highlevel/types/updates/user-status-update.d.cts +1 -1
- package/highlevel/types/updates/user-status-update.d.ts +1 -1
- package/highlevel/types/updates/user-typing-update.d.cts +1 -1
- package/highlevel/types/updates/user-typing-update.d.ts +1 -1
- package/highlevel/updates/manager.cjs +8 -9
- package/highlevel/updates/manager.d.cts +4 -2
- package/highlevel/updates/manager.d.ts +4 -2
- package/highlevel/updates/manager.js +8 -9
- package/highlevel/updates/types.d.cts +1 -1
- package/highlevel/updates/types.d.ts +1 -1
- package/highlevel/updates/utils.d.cts +1 -1
- package/highlevel/updates/utils.d.ts +1 -1
- package/highlevel/utils/convert-file-id.d.cts +1 -1
- package/highlevel/utils/convert-file-id.d.ts +1 -1
- package/highlevel/utils/file-utils.d.cts +1 -1
- package/highlevel/utils/file-utils.d.ts +1 -1
- package/highlevel/utils/inline-utils.d.cts +1 -1
- package/highlevel/utils/inline-utils.d.ts +1 -1
- package/highlevel/utils/peer-utils.cjs +4 -4
- package/highlevel/utils/peer-utils.d.cts +1 -1
- package/highlevel/utils/peer-utils.d.ts +1 -1
- package/highlevel/utils/peer-utils.js +4 -4
- package/highlevel/worker/errors.cjs +3 -3
- package/highlevel/worker/errors.js +3 -3
- package/highlevel/worker/invoker.cjs +67 -9
- package/highlevel/worker/invoker.d.cts +9 -1
- package/highlevel/worker/invoker.d.ts +9 -1
- package/highlevel/worker/invoker.js +67 -9
- package/highlevel/worker/invoker.test.d.cts +1 -0
- package/highlevel/worker/invoker.test.d.ts +1 -0
- package/highlevel/worker/port.cjs +50 -16
- package/highlevel/worker/port.d.cts +9 -5
- package/highlevel/worker/port.d.ts +9 -5
- package/highlevel/worker/port.js +51 -17
- package/highlevel/worker/protocol.cjs +19 -7
- package/highlevel/worker/protocol.d.cts +28 -4
- package/highlevel/worker/protocol.d.ts +28 -4
- package/highlevel/worker/protocol.js +19 -7
- package/highlevel/worker/protocol.test.d.cts +1 -0
- package/highlevel/worker/protocol.test.d.ts +1 -0
- package/highlevel/worker/storage.cjs +4 -1
- package/highlevel/worker/storage.d.cts +2 -1
- package/highlevel/worker/storage.d.ts +2 -1
- package/highlevel/worker/storage.js +4 -1
- package/highlevel/worker/timers.cjs +19 -0
- package/highlevel/worker/timers.d.cts +11 -0
- package/highlevel/worker/timers.d.ts +11 -0
- package/highlevel/worker/timers.js +14 -0
- package/highlevel/worker/timers.test.d.cts +1 -0
- package/highlevel/worker/timers.test.d.ts +1 -0
- package/highlevel/worker/worker.cjs +266 -53
- package/highlevel/worker/worker.d.cts +30 -2
- package/highlevel/worker/worker.d.ts +30 -2
- package/highlevel/worker/worker.js +267 -54
- package/highlevel/worker/worker.test.d.cts +1 -0
- package/highlevel/worker/worker.test.d.ts +1 -0
- package/index.cjs +4 -11
- package/index.d.cts +2 -2
- package/index.d.ts +2 -2
- package/index.js +4 -5
- package/methods.cjs +0 -2
- package/methods.js +0 -2
- package/network/auth-key.d.cts +1 -1
- package/network/auth-key.d.ts +1 -1
- package/network/authorization.cjs +2 -2
- package/network/authorization.js +2 -2
- package/network/client.cjs +6 -7
- package/network/client.d.cts +1 -12
- package/network/client.d.ts +1 -12
- package/network/client.js +4 -5
- package/network/config-manager.d.cts +1 -1
- package/network/config-manager.d.ts +1 -1
- package/network/middlewares/internal-errors.cjs +8 -8
- package/network/middlewares/internal-errors.js +8 -8
- package/network/middlewares/on-error.d.cts +1 -1
- package/network/middlewares/on-error.d.ts +1 -1
- package/network/middlewares/on-method.d.cts +1 -1
- package/network/middlewares/on-method.d.ts +1 -1
- package/network/mtproto-session.cjs +0 -3
- package/network/mtproto-session.d.cts +1 -2
- package/network/mtproto-session.d.ts +1 -2
- package/network/mtproto-session.js +0 -3
- package/network/mtproxy/index.d.cts +1 -1
- package/network/mtproxy/index.d.ts +1 -1
- package/network/multi-session-connection.d.cts +1 -1
- package/network/multi-session-connection.d.ts +1 -1
- package/network/network-manager.cjs +40 -2
- package/network/network-manager.d.cts +12 -3
- package/network/network-manager.d.ts +12 -3
- package/network/network-manager.js +41 -3
- package/network/persistent-connection.d.cts +1 -1
- package/network/persistent-connection.d.ts +1 -1
- package/network/server-salt.d.cts +1 -1
- package/network/server-salt.d.ts +1 -1
- package/network/session-connection.cjs +10 -17
- package/network/session-connection.d.cts +1 -3
- package/network/session-connection.d.ts +1 -3
- package/network/session-connection.js +10 -17
- package/network/transports/abstract.d.cts +1 -1
- package/network/transports/abstract.d.ts +1 -1
- package/network/transports/intermediate.cjs +0 -2
- package/network/transports/intermediate.js +0 -2
- package/package.json +9 -6
- package/storage/service/base.d.cts +1 -1
- package/storage/service/base.d.ts +1 -1
- package/storage/service/future-salts.d.cts +1 -1
- package/storage/service/future-salts.d.ts +1 -1
- package/storage/sqlite/driver.cjs +0 -22
- package/storage/sqlite/driver.d.cts +0 -3
- package/storage/sqlite/driver.d.ts +0 -3
- package/storage/sqlite/driver.js +0 -22
- package/storage/sqlite/repository/kv.cjs +5 -47
- package/storage/sqlite/repository/kv.js +5 -47
- package/storage/sqlite/repository/peers.cjs +0 -3
- package/storage/sqlite/repository/peers.js +0 -3
- package/storage/storage.cjs +1 -3
- package/storage/storage.js +1 -3
- package/tl/api-schema.json +1 -0
- package/tl/app-config.json +1 -0
- package/tl/binary/reader.cjs +5248 -0
- package/tl/binary/reader.d.cts +3 -0
- package/tl/binary/reader.d.ts +3 -0
- package/tl/binary/reader.js +5243 -0
- package/tl/binary/rsa-keys.cjs +9 -0
- package/tl/binary/rsa-keys.d.cts +38 -0
- package/tl/binary/rsa-keys.d.ts +38 -0
- package/tl/binary/rsa-keys.js +4 -0
- package/tl/binary/writer.cjs +18718 -0
- package/tl/binary/writer.d.cts +4 -0
- package/tl/binary/writer.d.ts +4 -0
- package/tl/binary/writer.js +18713 -0
- package/tl/compat/reader.cjs +313 -0
- package/tl/compat/reader.d.cts +1 -0
- package/tl/compat/reader.d.ts +1 -0
- package/tl/compat/reader.js +308 -0
- package/tl/index.d.cts +58614 -0
- package/tl/index.d.ts +58614 -0
- package/tl/inner-mtp.cjs +63 -0
- package/tl/inner-mtp.js +58 -0
- package/tl/inner-tl.cjs +1261 -0
- package/tl/inner-tl.js +1256 -0
- package/tl/mtp-schema.json +1 -0
- package/tl/raw-errors.json +1 -0
- package/utils/binary/compat.cjs +10 -10
- package/utils/binary/compat.d.cts +1 -1
- package/utils/binary/compat.d.ts +1 -1
- package/utils/binary/compat.js +5 -5
- package/utils/binary/serialization.cjs +7 -7
- package/utils/binary/serialization.d.cts +1 -1
- package/utils/binary/serialization.d.ts +1 -1
- package/utils/binary/serialization.js +5 -5
- package/utils/crypto/keys.cjs +5 -5
- package/utils/crypto/keys.d.cts +1 -1
- package/utils/crypto/keys.d.ts +1 -1
- package/utils/crypto/keys.js +1 -1
- package/utils/crypto/password.d.cts +1 -1
- package/utils/crypto/password.d.ts +1 -1
- package/utils/date-entity-format.d.cts +1 -1
- package/utils/date-entity-format.d.ts +1 -1
- package/utils/index.d.cts +2 -6
- package/utils/index.d.ts +2 -6
- package/utils/links/bots.d.cts +1 -1
- package/utils/links/bots.d.ts +1 -1
- package/utils/logger.cjs +2 -2
- package/utils/logger.js +2 -2
- package/utils/peer-utils.d.cts +1 -1
- package/utils/peer-utils.d.ts +1 -1
- package/utils/tl-json.d.cts +1 -1
- package/utils/tl-json.d.ts +1 -1
- package/utils/type-assertions.d.cts +1 -1
- package/utils/type-assertions.d.ts +1 -1
- package/utils.cjs +4 -18
- package/utils.js +2 -10
- package/highlevel/methods/chats/get-nearby-chats.cjs +0 -37
- package/highlevel/methods/chats/get-nearby-chats.d.cts +0 -9
- package/highlevel/methods/chats/get-nearby-chats.d.ts +0 -9
- package/highlevel/methods/chats/get-nearby-chats.js +0 -32
- package/highlevel/methods/messages/_business-connection.cjs +0 -42
- package/highlevel/methods/messages/_business-connection.d.cts +0 -8
- package/highlevel/methods/messages/_business-connection.d.ts +0 -8
- package/highlevel/methods/messages/_business-connection.js +0 -37
- package/highlevel/types/peers/chat-location.cjs +0 -30
- package/highlevel/types/peers/chat-location.d.cts +0 -17
- package/highlevel/types/peers/chat-location.d.ts +0 -17
- package/highlevel/types/peers/chat-location.js +0 -25
- package/utils/error-reporting.cjs +0 -23
- package/utils/error-reporting.d.cts +0 -3
- package/utils/error-reporting.d.ts +0 -3
- package/utils/error-reporting.js +0 -18
|
@@ -5,76 +5,17 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
5
5
|
}
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
|
-
const utils = require("@fuman/utils");
|
|
9
|
-
const tl = require("@mtcute/tl");
|
|
10
8
|
const Long = require("long");
|
|
11
9
|
const errors = require("../../../types/errors.cjs");
|
|
12
10
|
const peerUtils = require("../../../utils/peer-utils.cjs");
|
|
13
11
|
const errors$1 = require("../../types/errors.cjs");
|
|
14
12
|
const peerUtils$1 = require("../../utils/peer-utils.cjs");
|
|
15
13
|
const batchedQueries = require("../chats/batched-queries.cjs");
|
|
14
|
+
const _resolveCommon = require("./_resolve-common.cjs");
|
|
16
15
|
const resolvePhoneNumber = require("./resolve-phone-number.cjs");
|
|
17
|
-
|
|
18
|
-
if (typeof peerId === "object") {
|
|
19
|
-
if (tl.tl.isAnyPeer(peerId)) {
|
|
20
|
-
peerId = peerUtils.getMarkedPeerId(peerId);
|
|
21
|
-
} else if ("inputPeer" in peerId) {
|
|
22
|
-
peerId = peerId.inputPeer;
|
|
23
|
-
} else {
|
|
24
|
-
peerId = peerUtils$1.toInputPeer(peerId);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (typeof peerId === "object") {
|
|
28
|
-
switch (peerId._) {
|
|
29
|
-
case "mtcute.dummyInputPeerMinUser":
|
|
30
|
-
return peerId.userId;
|
|
31
|
-
case "mtcute.dummyInputPeerMinChannel":
|
|
32
|
-
return peerUtils.toggleChannelIdMark(peerId.channelId);
|
|
33
|
-
default:
|
|
34
|
-
return peerId;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return peerId;
|
|
38
|
-
}
|
|
39
|
-
function _handleContactsResolvedPeer(peerId, res) {
|
|
40
|
-
if (res.peer._ === "peerUser") {
|
|
41
|
-
const id = res.peer.userId;
|
|
42
|
-
const found = res.users.find((it) => it.id === id);
|
|
43
|
-
if (found && found._ === "user") {
|
|
44
|
-
if (!found.accessHash) {
|
|
45
|
-
throw new errors$1.MtPeerNotFoundError(
|
|
46
|
-
`Peer (user) with username ${peerId} was found, but it has no access hash`
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
_: "inputPeerUser",
|
|
51
|
-
userId: found.id,
|
|
52
|
-
accessHash: found.accessHash
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
} else if (res.peer._ === "peerChannel") {
|
|
56
|
-
const id = res.peer.channelId;
|
|
57
|
-
const found = res.chats.find((it) => it.id === id);
|
|
58
|
-
if (found) {
|
|
59
|
-
if (!(found._ === "channel" || found._ === "channelForbidden")) {
|
|
60
|
-
throw new errors.MtTypeAssertionError("ResolvedPeer#chats", "channel", found._);
|
|
61
|
-
}
|
|
62
|
-
if (!found.accessHash) {
|
|
63
|
-
throw new errors$1.MtPeerNotFoundError(`Peer (channel) with ${peerId} was found, but it has no access hash`);
|
|
64
|
-
}
|
|
65
|
-
return {
|
|
66
|
-
_: "inputPeerChannel",
|
|
67
|
-
channelId: found.id,
|
|
68
|
-
accessHash: found.accessHash
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
throw new errors.MtTypeAssertionError("ResolvedPeer#peer", "user or channel", res.peer._);
|
|
73
|
-
}
|
|
74
|
-
utils.unreachable();
|
|
75
|
-
}
|
|
16
|
+
const innerTl = require("../../../tl/inner-tl.cjs");
|
|
76
17
|
async function resolvePeer(client, peerId, force = false) {
|
|
77
|
-
peerId = _normalizePeerId(peerId);
|
|
18
|
+
peerId = _resolveCommon._normalizePeerId(peerId);
|
|
78
19
|
if (typeof peerId === "object") {
|
|
79
20
|
return peerId;
|
|
80
21
|
}
|
|
@@ -99,9 +40,9 @@ async function resolvePeer(client, peerId, force = false) {
|
|
|
99
40
|
_: "contacts.resolveUsername",
|
|
100
41
|
username: peerId
|
|
101
42
|
});
|
|
102
|
-
return _handleContactsResolvedPeer(peerId, res);
|
|
43
|
+
return _resolveCommon._handleContactsResolvedPeer(peerId, res);
|
|
103
44
|
} catch (e) {
|
|
104
|
-
if (
|
|
45
|
+
if (innerTl.RpcError.is(e, "USERNAME_NOT_OCCUPIED") || innerTl.RpcError.is(e, "USERNAME_INVALID")) {
|
|
105
46
|
throw new errors$1.MtPeerNotFoundError(`Peer with username ${peerId} was not found`);
|
|
106
47
|
} else {
|
|
107
48
|
throw e;
|
|
@@ -147,7 +88,7 @@ async function resolvePeer(client, peerId, force = false) {
|
|
|
147
88
|
};
|
|
148
89
|
}
|
|
149
90
|
} catch (e) {
|
|
150
|
-
if (!
|
|
91
|
+
if (!innerTl.RpcError.is(e, "USER_INVALID")) throw e;
|
|
151
92
|
}
|
|
152
93
|
break;
|
|
153
94
|
}
|
|
@@ -166,7 +107,7 @@ async function resolvePeer(client, peerId, force = false) {
|
|
|
166
107
|
};
|
|
167
108
|
}
|
|
168
109
|
} catch (e) {
|
|
169
|
-
if (!
|
|
110
|
+
if (!innerTl.RpcError.is(e, "CHANNEL_INVALID")) throw e;
|
|
170
111
|
}
|
|
171
112
|
break;
|
|
172
113
|
}
|
|
@@ -179,8 +120,6 @@ async function resolveUser(client, peerId, force = false) {
|
|
|
179
120
|
async function resolveChannel(client, peerId, force = false) {
|
|
180
121
|
return peerUtils$1.toInputChannel(await resolvePeer(client, peerId, force), peerId);
|
|
181
122
|
}
|
|
182
|
-
exports._handleContactsResolvedPeer = _handleContactsResolvedPeer;
|
|
183
|
-
exports._normalizePeerId = _normalizePeerId;
|
|
184
123
|
exports.resolveChannel = resolveChannel;
|
|
185
124
|
exports.resolvePeer = resolvePeer;
|
|
186
125
|
exports.resolveUser = resolveUser;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ITelegramClient } from '../../client.types.js';
|
|
2
2
|
import { InputPeerLike } from '../../types/peers/index.js';
|
|
3
|
-
import { tl } from '
|
|
4
|
-
export declare function _normalizePeerId(peerId: InputPeerLike): number | string | tl.TypeInputPeer;
|
|
5
|
-
export declare function _handleContactsResolvedPeer(peerId: string, res: tl.contacts.TypeResolvedPeer): tl.TypeInputPeer;
|
|
3
|
+
import { tl } from '../../../tl/index.js';
|
|
6
4
|
/**
|
|
7
5
|
* Get the `InputPeer` of a known peer id.
|
|
8
6
|
* Useful when an `InputPeer` is needed in Raw API.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ITelegramClient } from '../../client.types.js';
|
|
2
2
|
import { InputPeerLike } from '../../types/peers/index.js';
|
|
3
|
-
import { tl } from '
|
|
4
|
-
export declare function _normalizePeerId(peerId: InputPeerLike): number | string | tl.TypeInputPeer;
|
|
5
|
-
export declare function _handleContactsResolvedPeer(peerId: string, res: tl.contacts.TypeResolvedPeer): tl.TypeInputPeer;
|
|
3
|
+
import { tl } from '../../../tl/index.js';
|
|
6
4
|
/**
|
|
7
5
|
* Get the `InputPeer` of a known peer id.
|
|
8
6
|
* Useful when an `InputPeer` is needed in Raw API.
|
|
@@ -1,71 +1,12 @@
|
|
|
1
|
-
import { unreachable } from "@fuman/utils";
|
|
2
|
-
import { tl } from "@mtcute/tl";
|
|
3
1
|
import Long from "long";
|
|
4
|
-
import { MtArgumentError
|
|
5
|
-
import { parseMarkedPeerId, getMarkedPeerId
|
|
2
|
+
import { MtArgumentError } from "../../../types/errors.js";
|
|
3
|
+
import { parseMarkedPeerId, getMarkedPeerId } from "../../../utils/peer-utils.js";
|
|
6
4
|
import { MtPeerNotFoundError } from "../../types/errors.js";
|
|
7
|
-
import { extractUsernames, toInputUser, toInputChannel
|
|
5
|
+
import { extractUsernames, toInputUser, toInputChannel } from "../../utils/peer-utils.js";
|
|
8
6
|
import { _getChannelsBatched, _getUsersBatched } from "../chats/batched-queries.js";
|
|
7
|
+
import { _normalizePeerId, _handleContactsResolvedPeer } from "./_resolve-common.js";
|
|
9
8
|
import { resolvePhoneNumber } from "./resolve-phone-number.js";
|
|
10
|
-
|
|
11
|
-
if (typeof peerId === "object") {
|
|
12
|
-
if (tl.isAnyPeer(peerId)) {
|
|
13
|
-
peerId = getMarkedPeerId(peerId);
|
|
14
|
-
} else if ("inputPeer" in peerId) {
|
|
15
|
-
peerId = peerId.inputPeer;
|
|
16
|
-
} else {
|
|
17
|
-
peerId = toInputPeer(peerId);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
if (typeof peerId === "object") {
|
|
21
|
-
switch (peerId._) {
|
|
22
|
-
case "mtcute.dummyInputPeerMinUser":
|
|
23
|
-
return peerId.userId;
|
|
24
|
-
case "mtcute.dummyInputPeerMinChannel":
|
|
25
|
-
return toggleChannelIdMark(peerId.channelId);
|
|
26
|
-
default:
|
|
27
|
-
return peerId;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return peerId;
|
|
31
|
-
}
|
|
32
|
-
function _handleContactsResolvedPeer(peerId, res) {
|
|
33
|
-
if (res.peer._ === "peerUser") {
|
|
34
|
-
const id = res.peer.userId;
|
|
35
|
-
const found = res.users.find((it) => it.id === id);
|
|
36
|
-
if (found && found._ === "user") {
|
|
37
|
-
if (!found.accessHash) {
|
|
38
|
-
throw new MtPeerNotFoundError(
|
|
39
|
-
`Peer (user) with username ${peerId} was found, but it has no access hash`
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
return {
|
|
43
|
-
_: "inputPeerUser",
|
|
44
|
-
userId: found.id,
|
|
45
|
-
accessHash: found.accessHash
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
} else if (res.peer._ === "peerChannel") {
|
|
49
|
-
const id = res.peer.channelId;
|
|
50
|
-
const found = res.chats.find((it) => it.id === id);
|
|
51
|
-
if (found) {
|
|
52
|
-
if (!(found._ === "channel" || found._ === "channelForbidden")) {
|
|
53
|
-
throw new MtTypeAssertionError("ResolvedPeer#chats", "channel", found._);
|
|
54
|
-
}
|
|
55
|
-
if (!found.accessHash) {
|
|
56
|
-
throw new MtPeerNotFoundError(`Peer (channel) with ${peerId} was found, but it has no access hash`);
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
_: "inputPeerChannel",
|
|
60
|
-
channelId: found.id,
|
|
61
|
-
accessHash: found.accessHash
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
throw new MtTypeAssertionError("ResolvedPeer#peer", "user or channel", res.peer._);
|
|
66
|
-
}
|
|
67
|
-
unreachable();
|
|
68
|
-
}
|
|
9
|
+
import { RpcError } from "../../../tl/inner-tl.js";
|
|
69
10
|
async function resolvePeer(client, peerId, force = false) {
|
|
70
11
|
peerId = _normalizePeerId(peerId);
|
|
71
12
|
if (typeof peerId === "object") {
|
|
@@ -94,7 +35,7 @@ async function resolvePeer(client, peerId, force = false) {
|
|
|
94
35
|
});
|
|
95
36
|
return _handleContactsResolvedPeer(peerId, res);
|
|
96
37
|
} catch (e) {
|
|
97
|
-
if (
|
|
38
|
+
if (RpcError.is(e, "USERNAME_NOT_OCCUPIED") || RpcError.is(e, "USERNAME_INVALID")) {
|
|
98
39
|
throw new MtPeerNotFoundError(`Peer with username ${peerId} was not found`);
|
|
99
40
|
} else {
|
|
100
41
|
throw e;
|
|
@@ -140,7 +81,7 @@ async function resolvePeer(client, peerId, force = false) {
|
|
|
140
81
|
};
|
|
141
82
|
}
|
|
142
83
|
} catch (e) {
|
|
143
|
-
if (!
|
|
84
|
+
if (!RpcError.is(e, "USER_INVALID")) throw e;
|
|
144
85
|
}
|
|
145
86
|
break;
|
|
146
87
|
}
|
|
@@ -159,7 +100,7 @@ async function resolvePeer(client, peerId, force = false) {
|
|
|
159
100
|
};
|
|
160
101
|
}
|
|
161
102
|
} catch (e) {
|
|
162
|
-
if (!
|
|
103
|
+
if (!RpcError.is(e, "CHANNEL_INVALID")) throw e;
|
|
163
104
|
}
|
|
164
105
|
break;
|
|
165
106
|
}
|
|
@@ -173,8 +114,6 @@ async function resolveChannel(client, peerId, force = false) {
|
|
|
173
114
|
return toInputChannel(await resolvePeer(client, peerId, force), peerId);
|
|
174
115
|
}
|
|
175
116
|
export {
|
|
176
|
-
_handleContactsResolvedPeer,
|
|
177
|
-
_normalizePeerId,
|
|
178
117
|
resolveChannel,
|
|
179
118
|
resolvePeer,
|
|
180
119
|
resolveUser
|
|
@@ -5,10 +5,10 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
5
5
|
}
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
|
-
const tl = require("@mtcute/tl");
|
|
9
8
|
const errors = require("../../../types/errors.cjs");
|
|
10
9
|
const errors$1 = require("../../types/errors.cjs");
|
|
11
|
-
const
|
|
10
|
+
const _resolveCommon = require("./_resolve-common.cjs");
|
|
11
|
+
const innerTl = require("../../../tl/inner-tl.cjs");
|
|
12
12
|
async function resolvePhoneNumber(client, phone, force = false) {
|
|
13
13
|
phone = phone.replace(/[@+\s()]/g, "");
|
|
14
14
|
if (!phone.match(/^\d+$/)) {
|
|
@@ -25,12 +25,12 @@ async function resolvePhoneNumber(client, phone, force = false) {
|
|
|
25
25
|
phone
|
|
26
26
|
});
|
|
27
27
|
} catch (e) {
|
|
28
|
-
if (
|
|
28
|
+
if (innerTl.RpcError.is(e, "PHONE_NOT_OCCUPIED")) {
|
|
29
29
|
throw new errors$1.MtPeerNotFoundError(`Peer with phone number ${phone} was not found`);
|
|
30
30
|
} else {
|
|
31
31
|
throw e;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return _resolveCommon._handleContactsResolvedPeer(phone, res);
|
|
35
35
|
}
|
|
36
36
|
exports.resolvePhoneNumber = resolvePhoneNumber;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { tl } from "@mtcute/tl";
|
|
2
1
|
import { MtArgumentError } from "../../../types/errors.js";
|
|
3
2
|
import { MtPeerNotFoundError } from "../../types/errors.js";
|
|
4
|
-
import { _handleContactsResolvedPeer } from "./
|
|
3
|
+
import { _handleContactsResolvedPeer } from "./_resolve-common.js";
|
|
4
|
+
import { RpcError } from "../../../tl/inner-tl.js";
|
|
5
5
|
async function resolvePhoneNumber(client, phone, force = false) {
|
|
6
6
|
phone = phone.replace(/[@+\s()]/g, "");
|
|
7
7
|
if (!phone.match(/^\d+$/)) {
|
|
@@ -18,7 +18,7 @@ async function resolvePhoneNumber(client, phone, force = false) {
|
|
|
18
18
|
phone
|
|
19
19
|
});
|
|
20
20
|
} catch (e) {
|
|
21
|
-
if (
|
|
21
|
+
if (RpcError.is(e, "PHONE_NOT_OCCUPIED")) {
|
|
22
22
|
throw new MtPeerNotFoundError(`Peer with phone number ${phone} was not found`);
|
|
23
23
|
} else {
|
|
24
24
|
throw e;
|
|
@@ -7,10 +7,10 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const utils = require("@fuman/utils");
|
|
9
9
|
const fileId = require("@mtcute/file-id");
|
|
10
|
-
const tl = require("@mtcute/tl");
|
|
11
10
|
const typeAssertions = require("../../../utils/type-assertions.cjs");
|
|
12
11
|
const convertFileId = require("../../utils/convert-file-id.cjs");
|
|
13
12
|
const normalizeInputMedia = require("../files/normalize-input-media.cjs");
|
|
13
|
+
const innerTl = require("../../../tl/inner-tl.cjs");
|
|
14
14
|
async function saveMusicToProfile(client, params) {
|
|
15
15
|
let after = params.after;
|
|
16
16
|
if (fileId.tdFileId.isFileIdLike(after)) {
|
|
@@ -24,7 +24,7 @@ async function saveMusicToProfile(client, params) {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
let audioId;
|
|
27
|
-
if (
|
|
27
|
+
if (innerTl.isAnyInputDocument(audio)) {
|
|
28
28
|
audioId = audio;
|
|
29
29
|
} else {
|
|
30
30
|
const media = await normalizeInputMedia._normalizeInputMedia(client, audio, {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { assert } from "@fuman/utils";
|
|
2
2
|
import { tdFileId } from "@mtcute/file-id";
|
|
3
|
-
import { tl } from "@mtcute/tl";
|
|
4
3
|
import { assertTrue } from "../../../utils/type-assertions.js";
|
|
5
4
|
import { fileIdToInputDocument } from "../../utils/convert-file-id.js";
|
|
6
5
|
import { _normalizeInputMedia } from "../files/normalize-input-media.js";
|
|
6
|
+
import { isAnyInputDocument } from "../../../tl/inner-tl.js";
|
|
7
7
|
async function saveMusicToProfile(client, params) {
|
|
8
8
|
let after = params.after;
|
|
9
9
|
if (tdFileId.isFileIdLike(after)) {
|
|
@@ -17,7 +17,7 @@ async function saveMusicToProfile(client, params) {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
let audioId;
|
|
20
|
-
if (
|
|
20
|
+
if (isAnyInputDocument(audio)) {
|
|
21
21
|
audioId = audio;
|
|
22
22
|
} else {
|
|
23
23
|
const media = await _normalizeInputMedia(client, audio, {
|
|
@@ -6,15 +6,16 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const fileId = require("@mtcute/file-id");
|
|
9
|
-
const tl = require("@mtcute/tl");
|
|
10
9
|
const errors = require("../../../types/errors.cjs");
|
|
10
|
+
const typeAssertions = require("../../../utils/type-assertions.cjs");
|
|
11
11
|
const convertFileId = require("../../utils/convert-file-id.cjs");
|
|
12
12
|
const normalizeInputFile = require("../files/normalize-input-file.cjs");
|
|
13
|
+
const innerTl = require("../../../tl/inner-tl.cjs");
|
|
13
14
|
const photo = require("../../types/media/photo.cjs");
|
|
14
15
|
async function setMyProfilePhoto(client, params) {
|
|
15
16
|
const { type, previewSec } = params;
|
|
16
17
|
let { media } = params;
|
|
17
|
-
if (fileId.tdFileId.isFileIdLike(media) || typeof media === "object" &&
|
|
18
|
+
if (fileId.tdFileId.isFileIdLike(media) || typeof media === "object" && innerTl.isAnyInputPhoto(media)) {
|
|
18
19
|
if (typeof media === "string" && media.match(/^https?:\/\//)) {
|
|
19
20
|
throw new errors.MtArgumentError("Profile photo can't be set from URL.");
|
|
20
21
|
}
|
|
@@ -26,6 +27,7 @@ async function setMyProfilePhoto(client, params) {
|
|
|
26
27
|
_: "photos.updateProfilePhoto",
|
|
27
28
|
id: media
|
|
28
29
|
});
|
|
30
|
+
typeAssertions.assertTypeIs("photos.updateProfilePhoto", res2.photo, "photo");
|
|
29
31
|
return new photo.Photo(res2.photo);
|
|
30
32
|
}
|
|
31
33
|
}
|
|
@@ -34,6 +36,7 @@ async function setMyProfilePhoto(client, params) {
|
|
|
34
36
|
[type === "photo" ? "file" : "video"]: await normalizeInputFile._normalizeInputFile(client, media, {}),
|
|
35
37
|
videoStartTs: previewSec
|
|
36
38
|
});
|
|
39
|
+
typeAssertions.assertTypeIs("photos.updateProfilePhoto", res.photo, "photo");
|
|
37
40
|
return new photo.Photo(res.photo);
|
|
38
41
|
}
|
|
39
42
|
exports.setMyProfilePhoto = setMyProfilePhoto;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITelegramClient } from '../../client.types.js';
|
|
2
2
|
import { InputFileLike, Photo } from '../../types/index.js';
|
|
3
|
-
import { tl } from '
|
|
3
|
+
import { tl } from '../../../tl/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Set a new profile photo or video for the current user.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITelegramClient } from '../../client.types.js';
|
|
2
2
|
import { InputFileLike, Photo } from '../../types/index.js';
|
|
3
|
-
import { tl } from '
|
|
3
|
+
import { tl } from '../../../tl/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Set a new profile photo or video for the current user.
|
|
6
6
|
*
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { tdFileId } from "@mtcute/file-id";
|
|
2
|
-
import { tl } from "@mtcute/tl";
|
|
3
2
|
import { MtArgumentError } from "../../../types/errors.js";
|
|
3
|
+
import { assertTypeIs } from "../../../utils/type-assertions.js";
|
|
4
4
|
import { fileIdToInputPhoto } from "../../utils/convert-file-id.js";
|
|
5
5
|
import { _normalizeInputFile } from "../files/normalize-input-file.js";
|
|
6
|
+
import { isAnyInputPhoto } from "../../../tl/inner-tl.js";
|
|
6
7
|
import { Photo as Photo$2 } from "../../types/media/photo.js";
|
|
7
8
|
async function setMyProfilePhoto(client, params) {
|
|
8
9
|
const { type, previewSec } = params;
|
|
9
10
|
let { media } = params;
|
|
10
|
-
if (tdFileId.isFileIdLike(media) || typeof media === "object" &&
|
|
11
|
+
if (tdFileId.isFileIdLike(media) || typeof media === "object" && isAnyInputPhoto(media)) {
|
|
11
12
|
if (typeof media === "string" && media.match(/^https?:\/\//)) {
|
|
12
13
|
throw new MtArgumentError("Profile photo can't be set from URL.");
|
|
13
14
|
}
|
|
@@ -19,6 +20,7 @@ async function setMyProfilePhoto(client, params) {
|
|
|
19
20
|
_: "photos.updateProfilePhoto",
|
|
20
21
|
id: media
|
|
21
22
|
});
|
|
23
|
+
assertTypeIs("photos.updateProfilePhoto", res2.photo, "photo");
|
|
22
24
|
return new Photo$2(res2.photo);
|
|
23
25
|
}
|
|
24
26
|
}
|
|
@@ -27,6 +29,7 @@ async function setMyProfilePhoto(client, params) {
|
|
|
27
29
|
[type === "photo" ? "file" : "video"]: await _normalizeInputFile(client, media, {}),
|
|
28
30
|
videoStartTs: previewSec
|
|
29
31
|
});
|
|
32
|
+
assertTypeIs("photos.updateProfilePhoto", res.photo, "photo");
|
|
30
33
|
return new Photo$2(res.photo);
|
|
31
34
|
}
|
|
32
35
|
export {
|
|
@@ -15,14 +15,18 @@ const TIMER_ID = "online";
|
|
|
15
15
|
const TIMER_INTERVAL = 24e4;
|
|
16
16
|
async function setOnline(client, online = true) {
|
|
17
17
|
if (online) {
|
|
18
|
-
client.timers.
|
|
19
|
-
|
|
18
|
+
await client.timers.upsert({
|
|
19
|
+
kind: "rpc",
|
|
20
|
+
key: TIMER_ID,
|
|
21
|
+
interval: TIMER_INTERVAL,
|
|
22
|
+
startNow: true,
|
|
23
|
+
request: {
|
|
20
24
|
_: "account.updateStatus",
|
|
21
25
|
offline: false
|
|
22
|
-
}
|
|
23
|
-
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
24
28
|
} else {
|
|
25
|
-
client.timers.cancel(TIMER_ID);
|
|
29
|
+
await client.timers.cancel(TIMER_ID);
|
|
26
30
|
await client.call({
|
|
27
31
|
_: "account.updateStatus",
|
|
28
32
|
offline: true
|
|
@@ -8,14 +8,18 @@ const TIMER_ID = "online";
|
|
|
8
8
|
const TIMER_INTERVAL = 24e4;
|
|
9
9
|
async function setOnline(client, online = true) {
|
|
10
10
|
if (online) {
|
|
11
|
-
client.timers.
|
|
12
|
-
|
|
11
|
+
await client.timers.upsert({
|
|
12
|
+
kind: "rpc",
|
|
13
|
+
key: TIMER_ID,
|
|
14
|
+
interval: TIMER_INTERVAL,
|
|
15
|
+
startNow: true,
|
|
16
|
+
request: {
|
|
13
17
|
_: "account.updateStatus",
|
|
14
18
|
offline: false
|
|
15
|
-
}
|
|
16
|
-
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
17
21
|
} else {
|
|
18
|
-
client.timers.cancel(TIMER_ID);
|
|
22
|
+
await client.timers.cancel(TIMER_ID);
|
|
19
23
|
await client.call({
|
|
20
24
|
_: "account.updateStatus",
|
|
21
25
|
offline: true
|
package/highlevel/methods.d.cts
CHANGED
|
@@ -56,7 +56,6 @@ export { getCreatorAfterLeave } from './methods/chats/get-creator-after-leave.js
|
|
|
56
56
|
export { getFullChat } from './methods/chats/get-full-chat.js';
|
|
57
57
|
export { getFullUser } from './methods/chats/get-full-user.js';
|
|
58
58
|
export { getMessageAuthor } from './methods/chats/get-message-author.js';
|
|
59
|
-
export { getNearbyChats } from './methods/chats/get-nearby-chats.js';
|
|
60
59
|
export { getPeer } from './methods/chats/get-peer.js';
|
|
61
60
|
export { getPeers } from './methods/chats/get-peers.js';
|
|
62
61
|
export { getSimilarChannels } from './methods/chats/get-similar-channels.js';
|
package/highlevel/methods.d.ts
CHANGED
|
@@ -56,7 +56,6 @@ export { getCreatorAfterLeave } from './methods/chats/get-creator-after-leave.js
|
|
|
56
56
|
export { getFullChat } from './methods/chats/get-full-chat.js';
|
|
57
57
|
export { getFullUser } from './methods/chats/get-full-user.js';
|
|
58
58
|
export { getMessageAuthor } from './methods/chats/get-message-author.js';
|
|
59
|
-
export { getNearbyChats } from './methods/chats/get-nearby-chats.js';
|
|
60
59
|
export { getPeer } from './methods/chats/get-peer.js';
|
|
61
60
|
export { getPeers } from './methods/chats/get-peers.js';
|
|
62
61
|
export { getSimilarChannels } from './methods/chats/get-similar-channels.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { tl } from '@mtcute/tl';
|
|
2
1
|
import { IKeyValueRepository } from '../../../storage/repository/key-value.js';
|
|
3
2
|
import { ServiceOptions, BaseService } from '../../../storage/service/base.js';
|
|
3
|
+
import { tl } from '../../../tl/index.js';
|
|
4
4
|
export interface CurrentUserInfo {
|
|
5
5
|
userId: number;
|
|
6
6
|
isBot: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { tl } from '@mtcute/tl';
|
|
2
1
|
import { IKeyValueRepository } from '../../../storage/repository/key-value.js';
|
|
3
2
|
import { ServiceOptions, BaseService } from '../../../storage/service/base.js';
|
|
3
|
+
import { tl } from '../../../tl/index.js';
|
|
4
4
|
export interface CurrentUserInfo {
|
|
5
5
|
userId: number;
|
|
6
6
|
isBot: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { tl } from '@mtcute/tl';
|
|
2
1
|
import { ServiceOptions, BaseService } from '../../../storage/service/base.js';
|
|
2
|
+
import { tl } from '../../../tl/index.js';
|
|
3
3
|
import { IPeersRepository } from '../repository/peers.js';
|
|
4
4
|
import { RefMessagesService } from './ref-messages.js';
|
|
5
5
|
export interface PeersServiceOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { tl } from '@mtcute/tl';
|
|
2
1
|
import { ServiceOptions, BaseService } from '../../../storage/service/base.js';
|
|
2
|
+
import { tl } from '../../../tl/index.js';
|
|
3
3
|
import { IPeersRepository } from '../repository/peers.js';
|
|
4
4
|
import { RefMessagesService } from './ref-messages.js';
|
|
5
5
|
export interface PeersServiceOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tl } from '
|
|
1
|
+
import { tl } from '../../../../tl/index.js';
|
|
2
2
|
import { ITelegramClient } from '../../../client.types.js';
|
|
3
3
|
import { InputText } from '../../../types/misc/entities.js';
|
|
4
4
|
import { InputInlineMessage, InputInlineMessageContact, InputInlineMessageGame, InputInlineMessageGeo, InputInlineMessageGeoLive, InputInlineMessageMedia, InputInlineMessageText, InputInlineMessageVenue, InputInlineMessageWebpage } from './types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tl } from '
|
|
1
|
+
import { tl } from '../../../../tl/index.js';
|
|
2
2
|
import { ITelegramClient } from '../../../client.types.js';
|
|
3
3
|
import { InputText } from '../../../types/misc/entities.js';
|
|
4
4
|
import { InputInlineMessage, InputInlineMessageContact, InputInlineMessageGame, InputInlineMessageGeo, InputInlineMessageGeoLive, InputInlineMessageMedia, InputInlineMessageText, InputInlineMessageVenue, InputInlineMessageWebpage } from './types.js';
|