@mtcute/core 0.7.2 → 0.8.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/README.md +26 -3
- package/cjs/highlevel/base.d.ts +3 -1
- package/cjs/highlevel/base.js +18 -0
- package/cjs/highlevel/base.js.map +1 -1
- package/cjs/highlevel/client.d.ts +23 -10
- package/cjs/highlevel/client.js +26 -19
- package/cjs/highlevel/client.js.map +1 -1
- package/cjs/highlevel/client.types.d.ts +14 -0
- package/cjs/highlevel/client.types.js.map +1 -1
- package/cjs/highlevel/index.d.ts +0 -2
- package/cjs/highlevel/index.js +0 -2
- package/cjs/highlevel/index.js.map +1 -1
- package/cjs/highlevel/methods/_imports.js.map +1 -1
- package/cjs/highlevel/methods/_init.js +4 -29
- package/cjs/highlevel/methods/_init.js.map +1 -1
- package/cjs/highlevel/methods/bots/get-callback-answer.js +2 -2
- package/cjs/highlevel/methods/bots/get-callback-answer.js.map +1 -1
- package/cjs/highlevel/methods/dialogs/create-folder.js +1 -1
- package/cjs/highlevel/methods/dialogs/create-folder.js.map +1 -1
- package/cjs/highlevel/methods/dialogs/edit-folder.js +1 -1
- package/cjs/highlevel/methods/dialogs/edit-folder.js.map +1 -1
- package/cjs/highlevel/methods/dialogs/find-folder.js +1 -1
- package/cjs/highlevel/methods/dialogs/find-folder.js.map +1 -1
- package/cjs/highlevel/methods/dialogs/get-folders.d.ts +1 -1
- package/cjs/highlevel/methods/dialogs/get-folders.js +1 -1
- package/cjs/highlevel/methods/dialogs/get-folders.js.map +1 -1
- package/cjs/highlevel/methods/files/download-file.d.ts +1 -10
- package/cjs/highlevel/methods/files/download-file.js +1 -32
- package/cjs/highlevel/methods/files/download-file.js.map +1 -1
- package/cjs/highlevel/methods/files/download-iterable.js +2 -1
- package/cjs/highlevel/methods/files/download-iterable.js.map +1 -1
- package/cjs/highlevel/methods/files/download-node-stream.js +4 -0
- package/cjs/highlevel/methods/files/download-node-stream.js.map +1 -0
- package/cjs/highlevel/methods/files/normalize-input-media.d.ts +1 -1
- package/cjs/highlevel/methods/files/normalize-input-media.js +2 -1
- package/cjs/highlevel/methods/files/normalize-input-media.js.map +1 -1
- package/cjs/highlevel/methods/files/upload-file.d.ts +0 -3
- package/cjs/highlevel/methods/files/upload-file.js +17 -13
- package/cjs/highlevel/methods/files/upload-file.js.map +1 -1
- package/cjs/highlevel/methods/messages/find-in-update.js +23 -8
- package/cjs/highlevel/methods/messages/find-in-update.js.map +1 -1
- package/cjs/highlevel/methods/messages/send-media-group.d.ts +1 -1
- package/cjs/highlevel/methods/messages/send-media-group.js.map +1 -1
- package/cjs/highlevel/methods/messages/send-media.d.ts +2 -2
- package/cjs/highlevel/methods/messages/send-media.js +5 -4
- package/cjs/highlevel/methods/messages/send-media.js.map +1 -1
- package/cjs/highlevel/methods/messages/send-text.d.ts +1 -1
- package/cjs/highlevel/methods/messages/send-text.js +7 -6
- package/cjs/highlevel/methods/messages/send-text.js.map +1 -1
- package/cjs/highlevel/methods/misc/with-params.d.ts +10 -0
- package/cjs/highlevel/methods/misc/with-params.js +32 -0
- package/cjs/highlevel/methods/misc/with-params.js.map +1 -0
- package/cjs/highlevel/methods.d.ts +13 -1
- package/cjs/highlevel/methods.js +4 -6
- package/cjs/highlevel/methods.js.map +1 -1
- package/cjs/highlevel/types/bots/command-scope/index.d.ts +10 -0
- package/cjs/highlevel/types/bots/command-scope/index.js +29 -0
- package/cjs/highlevel/types/bots/command-scope/index.js.map +1 -0
- package/cjs/highlevel/types/bots/command-scope/inner.d.ts +54 -0
- package/cjs/highlevel/types/bots/command-scope/inner.js +76 -0
- package/cjs/highlevel/types/bots/command-scope/inner.js.map +1 -0
- package/cjs/highlevel/types/bots/index.d.ts +4 -4
- package/cjs/highlevel/types/bots/index.js +4 -4
- package/cjs/highlevel/types/bots/index.js.map +1 -1
- package/cjs/highlevel/types/bots/inline-message/factories.d.ts +43 -0
- package/cjs/highlevel/types/bots/inline-message/factories.js +175 -0
- package/cjs/highlevel/types/bots/inline-message/factories.js.map +1 -0
- package/cjs/highlevel/types/bots/inline-message/index.d.ts +3 -0
- package/cjs/highlevel/types/bots/inline-message/index.js +33 -0
- package/cjs/highlevel/types/bots/inline-message/index.js.map +1 -0
- package/{esm/highlevel/types/bots/input/input-inline-message.d.ts → cjs/highlevel/types/bots/inline-message/types.d.ts} +2 -45
- package/cjs/highlevel/types/bots/inline-message/types.js +3 -0
- package/cjs/highlevel/types/bots/inline-message/types.js.map +1 -0
- package/cjs/highlevel/types/bots/inline-result/factories.d.ts +94 -0
- package/cjs/highlevel/types/bots/inline-result/factories.js +486 -0
- package/cjs/highlevel/types/bots/inline-result/factories.js.map +1 -0
- package/cjs/highlevel/types/bots/inline-result/index.d.ts +3 -0
- package/cjs/highlevel/types/bots/inline-result/index.js +33 -0
- package/cjs/highlevel/types/bots/inline-result/index.js.map +1 -0
- package/{esm/highlevel/types/bots/input/input-inline-result.d.ts → cjs/highlevel/types/bots/inline-result/types.d.ts} +1 -95
- package/cjs/highlevel/types/bots/inline-result/types.js +3 -0
- package/cjs/highlevel/types/bots/inline-result/types.js.map +1 -0
- package/cjs/highlevel/types/bots/{keyboard-builder.d.ts → keyboards/builder.d.ts} +1 -1
- package/cjs/highlevel/types/bots/{keyboard-builder.js → keyboards/builder.js} +1 -1
- package/cjs/highlevel/types/bots/keyboards/builder.js.map +1 -0
- package/cjs/highlevel/types/bots/keyboards/factories.d.ts +195 -0
- package/cjs/highlevel/types/bots/keyboards/factories.js +366 -0
- package/cjs/highlevel/types/bots/keyboards/factories.js.map +1 -0
- package/cjs/highlevel/types/bots/keyboards/index.d.ts +14 -0
- package/cjs/highlevel/types/bots/keyboards/index.js +33 -0
- package/cjs/highlevel/types/bots/keyboards/index.js.map +1 -0
- package/cjs/highlevel/types/bots/keyboards/types.d.ts +34 -0
- package/cjs/highlevel/types/bots/keyboards/types.js +3 -0
- package/cjs/highlevel/types/bots/keyboards/types.js.map +1 -0
- package/cjs/highlevel/types/media/document.js +3 -2
- package/cjs/highlevel/types/media/document.js.map +1 -1
- package/cjs/highlevel/types/media/index.d.ts +1 -1
- package/cjs/highlevel/types/media/index.js +1 -1
- package/cjs/highlevel/types/media/index.js.map +1 -1
- package/cjs/highlevel/types/media/input-media/factories.d.ts +141 -0
- package/cjs/highlevel/types/media/input-media/factories.js +250 -0
- package/cjs/highlevel/types/media/input-media/factories.js.map +1 -0
- package/cjs/highlevel/types/media/input-media/index.d.ts +3 -0
- package/cjs/highlevel/types/media/input-media/index.js +33 -0
- package/cjs/highlevel/types/media/input-media/index.js.map +1 -0
- package/cjs/highlevel/types/media/{input-media.d.ts → input-media/types.d.ts} +5 -145
- package/cjs/highlevel/types/media/input-media/types.js +3 -0
- package/cjs/highlevel/types/media/input-media/types.js.map +1 -0
- package/cjs/highlevel/types/media/thumbnail.js +5 -4
- package/cjs/highlevel/types/media/thumbnail.js.map +1 -1
- package/cjs/highlevel/types/messages/message.d.ts +1 -1
- package/cjs/highlevel/types/messages/message.js +3 -3
- package/cjs/highlevel/types/messages/message.js.map +1 -1
- package/cjs/highlevel/types/misc/index.d.ts +1 -1
- package/cjs/highlevel/types/misc/index.js +1 -1
- package/cjs/highlevel/types/misc/index.js.map +1 -1
- package/cjs/highlevel/types/misc/input-privacy-rule/allow.d.ts +22 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/allow.js +36 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/allow.js.map +1 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/bundle.d.ts +3 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/bundle.js +31 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/bundle.js.map +1 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/disallow.d.ts +20 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/disallow.js +32 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/disallow.js.map +1 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/index.d.ts +3 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/index.js +33 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/index.js.map +1 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/types.d.ts +11 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/types.js +3 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/types.js.map +1 -0
- package/cjs/highlevel/types/peers/chat-photo.js +3 -2
- package/cjs/highlevel/types/peers/chat-photo.js.map +1 -1
- package/cjs/highlevel/types/updates/callback-query.js +2 -2
- package/cjs/highlevel/types/updates/callback-query.js.map +1 -1
- package/cjs/highlevel/types/updates/user-status-update.js +1 -1
- package/cjs/highlevel/types/updates/user-status-update.js.map +1 -1
- package/cjs/highlevel/updates/manager.d.ts +5 -3
- package/cjs/highlevel/updates/manager.js +81 -67
- package/cjs/highlevel/updates/manager.js.map +1 -1
- package/cjs/highlevel/utils/convert-file-id.js +7 -6
- package/cjs/highlevel/utils/convert-file-id.js.map +1 -1
- package/cjs/highlevel/utils/file-utils.js +8 -4
- package/cjs/highlevel/utils/file-utils.js.map +1 -1
- package/cjs/highlevel/utils/inline-utils.js +3 -2
- package/cjs/highlevel/utils/inline-utils.js.map +1 -1
- package/cjs/highlevel/utils/inspectable.d.ts +1 -1
- package/cjs/highlevel/utils/inspectable.js +3 -2
- package/cjs/highlevel/utils/inspectable.js.map +1 -1
- package/cjs/highlevel/utils/memoize.d.ts +1 -1
- package/cjs/highlevel/utils/memoize.js +1 -0
- package/cjs/highlevel/utils/memoize.js.map +1 -1
- package/cjs/highlevel/utils/stream-utils.d.ts +0 -2
- package/cjs/highlevel/utils/stream-utils.js +1 -28
- package/cjs/highlevel/utils/stream-utils.js.map +1 -1
- package/cjs/highlevel/utils/string-session.js +3 -2
- package/cjs/highlevel/utils/string-session.js.map +1 -1
- package/cjs/highlevel/worker/index.d.ts +3 -0
- package/cjs/highlevel/{types/bots/input → worker}/index.js +3 -2
- package/cjs/highlevel/worker/index.js.map +1 -0
- package/cjs/highlevel/worker/port.d.ts +6 -3
- package/cjs/highlevel/worker/port.js +8 -2
- package/cjs/highlevel/worker/port.js.map +1 -1
- package/cjs/highlevel/worker/protocol.d.ts +5 -1
- package/cjs/highlevel/worker/protocol.js.map +1 -1
- package/cjs/highlevel/worker/worker.d.ts +11 -4
- package/cjs/highlevel/worker/worker.js +53 -49
- package/cjs/highlevel/worker/worker.js.map +1 -1
- package/cjs/network/authorization.js +1 -0
- package/cjs/network/authorization.js.map +1 -1
- package/cjs/network/client.d.ts +4 -4
- package/cjs/network/client.js +3 -1
- package/cjs/network/client.js.map +1 -1
- package/cjs/network/mtproto-session.d.ts +1 -0
- package/cjs/network/mtproto-session.js +7 -1
- package/cjs/network/mtproto-session.js.map +1 -1
- package/cjs/network/multi-session-connection.d.ts +1 -0
- package/cjs/network/multi-session-connection.js +6 -0
- package/cjs/network/multi-session-connection.js.map +1 -1
- package/cjs/network/network-manager.d.ts +5 -1
- package/cjs/network/network-manager.js +24 -15
- package/cjs/network/network-manager.js.map +1 -1
- package/cjs/network/persistent-connection.d.ts +3 -0
- package/cjs/network/persistent-connection.js +23 -1
- package/cjs/network/persistent-connection.js.map +1 -1
- package/cjs/network/session-connection.d.ts +2 -0
- package/cjs/network/session-connection.js +21 -7
- package/cjs/network/session-connection.js.map +1 -1
- package/cjs/network/transports/index.d.ts +0 -3
- package/cjs/network/transports/index.js +0 -4
- package/cjs/network/transports/index.js.map +1 -1
- package/cjs/platform.d.ts +18 -0
- package/cjs/platform.js +36 -0
- package/cjs/platform.js.map +1 -0
- package/cjs/storage/index.d.ts +1 -2
- package/cjs/storage/index.js +1 -2
- package/cjs/storage/index.js.map +1 -1
- package/{esm/storage/providers → cjs/storage}/memory/driver.d.ts +1 -1
- package/cjs/storage/memory/driver.js.map +1 -0
- package/{esm/storage/providers → cjs/storage}/memory/index.d.ts +2 -2
- package/cjs/storage/memory/index.js.map +1 -0
- package/cjs/storage/{providers/memory → memory}/repository/auth-keys.d.ts +1 -1
- package/cjs/storage/memory/repository/auth-keys.js.map +1 -0
- package/{esm/storage/providers → cjs/storage}/memory/repository/kv.d.ts +1 -1
- package/cjs/storage/memory/repository/kv.js.map +1 -0
- package/{esm/storage/providers → cjs/storage}/memory/repository/peers.d.ts +1 -1
- package/cjs/storage/memory/repository/peers.js.map +1 -0
- package/{esm/storage/providers → cjs/storage}/memory/repository/ref-messages.d.ts +1 -1
- package/cjs/storage/memory/repository/ref-messages.js.map +1 -0
- package/cjs/storage/storage.js +2 -1
- package/cjs/storage/storage.js.map +1 -1
- package/cjs/utils/binary/asn1-parser.js +3 -3
- package/cjs/utils/binary/asn1-parser.js.map +1 -1
- package/cjs/utils/crypto/abstract.d.ts +0 -1
- package/cjs/utils/crypto/abstract.js.map +1 -1
- package/cjs/utils/crypto/index.d.ts +0 -2
- package/cjs/utils/crypto/index.js +0 -3
- package/cjs/utils/crypto/index.js.map +1 -1
- package/cjs/utils/crypto/keys.js +5 -3
- package/cjs/utils/crypto/keys.js.map +1 -1
- package/cjs/utils/crypto/password.js +3 -3
- package/cjs/utils/crypto/password.js.map +1 -1
- package/cjs/utils/dcs.d.ts +4 -0
- package/cjs/utils/dcs.js +0 -4
- package/cjs/utils/dcs.js.map +1 -1
- package/cjs/utils/{platform/error-reporting.d.ts → error-reporting.d.ts} +1 -1
- package/cjs/utils/error-reporting.js.map +1 -0
- package/cjs/utils/index.d.ts +4 -1
- package/cjs/utils/index.js +6 -1
- package/cjs/utils/index.js.map +1 -1
- package/cjs/utils/links/common.js +1 -1
- package/cjs/utils/links/common.js.map +1 -1
- package/cjs/utils/logger.d.ts +1 -0
- package/cjs/utils/logger.js +9 -22
- package/cjs/utils/logger.js.map +1 -1
- package/esm/highlevel/base.d.ts +3 -1
- package/esm/highlevel/base.js +18 -0
- package/esm/highlevel/base.js.map +1 -1
- package/esm/highlevel/client.d.ts +23 -10
- package/esm/highlevel/client.js +12 -19
- package/esm/highlevel/client.js.map +1 -1
- package/esm/highlevel/client.types.d.ts +14 -0
- package/esm/highlevel/client.types.js.map +1 -1
- package/esm/highlevel/index.d.ts +0 -2
- package/esm/highlevel/index.js +0 -2
- package/esm/highlevel/index.js.map +1 -1
- package/esm/highlevel/methods/_imports.js.map +1 -1
- package/esm/highlevel/methods/_init.js +4 -29
- package/esm/highlevel/methods/_init.js.map +1 -1
- package/esm/highlevel/methods/bots/get-callback-answer.js +2 -2
- package/esm/highlevel/methods/bots/get-callback-answer.js.map +1 -1
- package/esm/highlevel/methods/dialogs/create-folder.js +1 -1
- package/esm/highlevel/methods/dialogs/create-folder.js.map +1 -1
- package/esm/highlevel/methods/dialogs/edit-folder.js +1 -1
- package/esm/highlevel/methods/dialogs/edit-folder.js.map +1 -1
- package/esm/highlevel/methods/dialogs/find-folder.js +1 -1
- package/esm/highlevel/methods/dialogs/find-folder.js.map +1 -1
- package/esm/highlevel/methods/dialogs/get-folders.d.ts +1 -1
- package/esm/highlevel/methods/dialogs/get-folders.js +1 -1
- package/esm/highlevel/methods/dialogs/get-folders.js.map +1 -1
- package/esm/highlevel/methods/files/download-file.d.ts +1 -10
- package/esm/highlevel/methods/files/download-file.js +2 -30
- package/esm/highlevel/methods/files/download-file.js.map +1 -1
- package/esm/highlevel/methods/files/download-iterable.js +2 -1
- package/esm/highlevel/methods/files/download-iterable.js.map +1 -1
- package/esm/highlevel/methods/files/download-node-stream.js +3 -0
- package/esm/highlevel/methods/files/download-node-stream.js.map +1 -0
- package/esm/highlevel/methods/files/normalize-input-media.d.ts +1 -1
- package/esm/highlevel/methods/files/normalize-input-media.js +2 -1
- package/esm/highlevel/methods/files/normalize-input-media.js.map +1 -1
- package/esm/highlevel/methods/files/upload-file.d.ts +0 -3
- package/esm/highlevel/methods/files/upload-file.js +17 -13
- package/esm/highlevel/methods/files/upload-file.js.map +1 -1
- package/esm/highlevel/methods/messages/find-in-update.js +23 -8
- package/esm/highlevel/methods/messages/find-in-update.js.map +1 -1
- package/esm/highlevel/methods/messages/send-media-group.d.ts +1 -1
- package/esm/highlevel/methods/messages/send-media-group.js.map +1 -1
- package/esm/highlevel/methods/messages/send-media.d.ts +2 -2
- package/esm/highlevel/methods/messages/send-media.js +4 -3
- package/esm/highlevel/methods/messages/send-media.js.map +1 -1
- package/esm/highlevel/methods/messages/send-text.d.ts +1 -1
- package/esm/highlevel/methods/messages/send-text.js +4 -3
- package/esm/highlevel/methods/messages/send-text.js.map +1 -1
- package/esm/highlevel/methods/misc/with-params.d.ts +10 -0
- package/esm/highlevel/methods/misc/with-params.js +28 -0
- package/esm/highlevel/methods/misc/with-params.js.map +1 -0
- package/esm/highlevel/methods.d.ts +13 -1
- package/esm/highlevel/methods.js +0 -1
- package/esm/highlevel/methods.js.map +1 -1
- package/esm/highlevel/types/auth/sent-code.js +4 -3
- package/esm/highlevel/types/bots/command-scope/index.d.ts +10 -0
- package/esm/highlevel/types/bots/command-scope/index.js +11 -0
- package/esm/highlevel/types/bots/command-scope/index.js.map +1 -0
- package/esm/highlevel/types/bots/command-scope/inner.d.ts +54 -0
- package/esm/highlevel/types/bots/command-scope/inner.js +69 -0
- package/esm/highlevel/types/bots/command-scope/inner.js.map +1 -0
- package/esm/highlevel/types/bots/game-high-score.js +5 -4
- package/esm/highlevel/types/bots/index.d.ts +4 -4
- package/esm/highlevel/types/bots/index.js +4 -4
- package/esm/highlevel/types/bots/index.js.map +1 -1
- package/esm/highlevel/types/bots/inline-message/factories.d.ts +43 -0
- package/esm/highlevel/types/bots/inline-message/factories.js +163 -0
- package/esm/highlevel/types/bots/inline-message/factories.js.map +1 -0
- package/esm/highlevel/types/bots/inline-message/index.d.ts +3 -0
- package/esm/highlevel/types/bots/inline-message/index.js +4 -0
- package/esm/highlevel/types/bots/inline-message/index.js.map +1 -0
- package/{cjs/highlevel/types/bots/input/input-inline-message.d.ts → esm/highlevel/types/bots/inline-message/types.d.ts} +2 -45
- package/esm/highlevel/types/bots/inline-message/types.js +2 -0
- package/esm/highlevel/types/bots/inline-message/types.js.map +1 -0
- package/esm/highlevel/types/bots/inline-result/factories.d.ts +94 -0
- package/esm/highlevel/types/bots/inline-result/factories.js +470 -0
- package/esm/highlevel/types/bots/inline-result/factories.js.map +1 -0
- package/esm/highlevel/types/bots/inline-result/index.d.ts +3 -0
- package/esm/highlevel/types/bots/inline-result/index.js +4 -0
- package/esm/highlevel/types/bots/inline-result/index.js.map +1 -0
- package/{cjs/highlevel/types/bots/input/input-inline-result.d.ts → esm/highlevel/types/bots/inline-result/types.d.ts} +1 -95
- package/esm/highlevel/types/bots/inline-result/types.js +2 -0
- package/esm/highlevel/types/bots/inline-result/types.js.map +1 -0
- package/esm/highlevel/types/bots/{keyboard-builder.d.ts → keyboards/builder.d.ts} +1 -1
- package/esm/highlevel/types/bots/{keyboard-builder.js → keyboards/builder.js} +1 -1
- package/esm/highlevel/types/bots/keyboards/builder.js.map +1 -0
- package/esm/highlevel/types/bots/keyboards/factories.d.ts +195 -0
- package/esm/highlevel/types/bots/keyboards/factories.js +341 -0
- package/esm/highlevel/types/bots/keyboards/factories.js.map +1 -0
- package/esm/highlevel/types/bots/keyboards/index.d.ts +14 -0
- package/esm/highlevel/types/bots/keyboards/index.js +15 -0
- package/esm/highlevel/types/bots/keyboards/index.js.map +1 -0
- package/esm/highlevel/types/bots/keyboards/types.d.ts +34 -0
- package/esm/highlevel/types/bots/keyboards/types.js +2 -0
- package/esm/highlevel/types/bots/keyboards/types.js.map +1 -0
- package/esm/highlevel/types/files/file-location.js +4 -3
- package/esm/highlevel/types/files/web-document.js +4 -3
- package/esm/highlevel/types/media/audio.js +5 -4
- package/esm/highlevel/types/media/contact.js +4 -3
- package/esm/highlevel/types/media/dice.js +4 -3
- package/esm/highlevel/types/media/document.js +8 -6
- package/esm/highlevel/types/media/document.js.map +1 -1
- package/esm/highlevel/types/media/game.js +5 -4
- package/esm/highlevel/types/media/index.d.ts +1 -1
- package/esm/highlevel/types/media/index.js +1 -1
- package/esm/highlevel/types/media/index.js.map +1 -1
- package/esm/highlevel/types/media/input-media/factories.d.ts +141 -0
- package/esm/highlevel/types/media/input-media/factories.js +228 -0
- package/esm/highlevel/types/media/input-media/factories.js.map +1 -0
- package/esm/highlevel/types/media/input-media/index.d.ts +3 -0
- package/esm/highlevel/types/media/input-media/index.js +4 -0
- package/esm/highlevel/types/media/input-media/index.js.map +1 -0
- package/esm/highlevel/types/media/{input-media.d.ts → input-media/types.d.ts} +5 -145
- package/esm/highlevel/types/media/input-media/types.js +2 -0
- package/esm/highlevel/types/media/input-media/types.js.map +1 -0
- package/esm/highlevel/types/media/invoice.js +9 -7
- package/esm/highlevel/types/media/location.js +7 -5
- package/esm/highlevel/types/media/photo.js +5 -4
- package/esm/highlevel/types/media/poll.js +5 -4
- package/esm/highlevel/types/media/sticker.js +5 -4
- package/esm/highlevel/types/media/story.js +4 -3
- package/esm/highlevel/types/media/thumbnail.js +10 -8
- package/esm/highlevel/types/media/thumbnail.js.map +1 -1
- package/esm/highlevel/types/media/venue.js +5 -4
- package/esm/highlevel/types/media/video.js +5 -4
- package/esm/highlevel/types/media/voice.js +5 -4
- package/esm/highlevel/types/media/web-page.js +5 -4
- package/esm/highlevel/types/messages/dialog.js +5 -4
- package/esm/highlevel/types/messages/draft-message.js +5 -4
- package/esm/highlevel/types/messages/message-entity.js +5 -4
- package/esm/highlevel/types/messages/message-forward.js +5 -4
- package/esm/highlevel/types/messages/message-reactions.js +5 -4
- package/esm/highlevel/types/messages/message-replies.js +5 -4
- package/esm/highlevel/types/messages/message.d.ts +1 -1
- package/esm/highlevel/types/messages/message.js +6 -5
- package/esm/highlevel/types/messages/message.js.map +1 -1
- package/esm/highlevel/types/messages/replied-message.js +5 -4
- package/esm/highlevel/types/misc/index.d.ts +1 -1
- package/esm/highlevel/types/misc/index.js +1 -1
- package/esm/highlevel/types/misc/index.js.map +1 -1
- package/esm/highlevel/types/misc/input-privacy-rule/allow.d.ts +22 -0
- package/esm/highlevel/types/misc/input-privacy-rule/allow.js +31 -0
- package/esm/highlevel/types/misc/input-privacy-rule/allow.js.map +1 -0
- package/esm/highlevel/types/misc/input-privacy-rule/bundle.d.ts +3 -0
- package/esm/highlevel/types/misc/input-privacy-rule/bundle.js +4 -0
- package/esm/highlevel/types/misc/input-privacy-rule/bundle.js.map +1 -0
- package/esm/highlevel/types/misc/input-privacy-rule/disallow.d.ts +20 -0
- package/esm/highlevel/types/misc/input-privacy-rule/disallow.js +27 -0
- package/esm/highlevel/types/misc/input-privacy-rule/disallow.js.map +1 -0
- package/esm/highlevel/types/misc/input-privacy-rule/index.d.ts +3 -0
- package/esm/highlevel/types/misc/input-privacy-rule/index.js +4 -0
- package/esm/highlevel/types/misc/input-privacy-rule/index.js.map +1 -0
- package/esm/highlevel/types/misc/input-privacy-rule/types.d.ts +11 -0
- package/esm/highlevel/types/misc/input-privacy-rule/types.js +2 -0
- package/esm/highlevel/types/misc/input-privacy-rule/types.js.map +1 -0
- package/esm/highlevel/types/misc/sticker-set.js +5 -4
- package/esm/highlevel/types/misc/takeout-session.js +4 -3
- package/esm/highlevel/types/peers/chat-colors.js +4 -3
- package/esm/highlevel/types/peers/chat-event/index.js +5 -4
- package/esm/highlevel/types/peers/chat-invite-link-member.js +5 -4
- package/esm/highlevel/types/peers/chat-invite-link.js +5 -4
- package/esm/highlevel/types/peers/chat-location.js +5 -4
- package/esm/highlevel/types/peers/chat-member.js +5 -4
- package/esm/highlevel/types/peers/chat-permissions.js +4 -3
- package/esm/highlevel/types/peers/chat-photo.js +12 -9
- package/esm/highlevel/types/peers/chat-photo.js.map +1 -1
- package/esm/highlevel/types/peers/chat-preview.js +5 -4
- package/esm/highlevel/types/peers/chat.js +5 -4
- package/esm/highlevel/types/peers/forum-topic.js +5 -4
- package/esm/highlevel/types/peers/user.js +5 -4
- package/esm/highlevel/types/premium/boost-slot.js +5 -4
- package/esm/highlevel/types/premium/boost-stats.js +4 -3
- package/esm/highlevel/types/premium/boost.js +5 -4
- package/esm/highlevel/types/reactions/emoji-status.js +4 -3
- package/esm/highlevel/types/reactions/peer-reaction.js +5 -4
- package/esm/highlevel/types/reactions/reaction-count.js +4 -3
- package/esm/highlevel/types/stories/all-stories.js +5 -4
- package/esm/highlevel/types/stories/interactive/channel-post.js +5 -4
- package/esm/highlevel/types/stories/interactive/location.js +5 -4
- package/esm/highlevel/types/stories/interactive/reaction.js +4 -3
- package/esm/highlevel/types/stories/interactive/venue.js +5 -4
- package/esm/highlevel/types/stories/peer-stories.js +5 -4
- package/esm/highlevel/types/stories/stealth-mode.js +4 -3
- package/esm/highlevel/types/stories/story-interactions.js +5 -4
- package/esm/highlevel/types/stories/story-viewer.js +9 -7
- package/esm/highlevel/types/stories/story.js +5 -4
- package/esm/highlevel/types/updates/bot-chat-join-request.js +5 -4
- package/esm/highlevel/types/updates/bot-reaction.js +9 -7
- package/esm/highlevel/types/updates/bot-stopped.js +5 -4
- package/esm/highlevel/types/updates/callback-query.js +11 -9
- package/esm/highlevel/types/updates/callback-query.js.map +1 -1
- package/esm/highlevel/types/updates/chat-join-request.js +5 -4
- package/esm/highlevel/types/updates/chat-member-update.js +5 -4
- package/esm/highlevel/types/updates/chosen-inline-result.js +5 -4
- package/esm/highlevel/types/updates/delete-message-update.js +4 -3
- package/esm/highlevel/types/updates/delete-story-update.js +5 -4
- package/esm/highlevel/types/updates/history-read-update.js +4 -3
- package/esm/highlevel/types/updates/inline-query.js +5 -4
- package/esm/highlevel/types/updates/poll-update.js +5 -4
- package/esm/highlevel/types/updates/poll-vote.js +5 -4
- package/esm/highlevel/types/updates/pre-checkout-query.js +5 -4
- package/esm/highlevel/types/updates/story-update.js +5 -4
- package/esm/highlevel/types/updates/user-status-update.js +5 -4
- package/esm/highlevel/types/updates/user-status-update.js.map +1 -1
- package/esm/highlevel/types/updates/user-typing-update.js +4 -3
- package/esm/highlevel/updates/manager.d.ts +5 -3
- package/esm/highlevel/updates/manager.js +81 -67
- package/esm/highlevel/updates/manager.js.map +1 -1
- package/esm/highlevel/utils/convert-file-id.js +7 -6
- package/esm/highlevel/utils/convert-file-id.js.map +1 -1
- package/esm/highlevel/utils/file-utils.js +8 -4
- package/esm/highlevel/utils/file-utils.js.map +1 -1
- package/esm/highlevel/utils/inline-utils.js +4 -3
- package/esm/highlevel/utils/inline-utils.js.map +1 -1
- package/esm/highlevel/utils/inspectable.d.ts +1 -1
- package/esm/highlevel/utils/inspectable.js +3 -2
- package/esm/highlevel/utils/inspectable.js.map +1 -1
- package/esm/highlevel/utils/memoize.d.ts +1 -1
- package/esm/highlevel/utils/memoize.js +1 -0
- package/esm/highlevel/utils/memoize.js.map +1 -1
- package/esm/highlevel/utils/stream-utils.d.ts +0 -2
- package/esm/highlevel/utils/stream-utils.js +0 -26
- package/esm/highlevel/utils/stream-utils.js.map +1 -1
- package/esm/highlevel/utils/string-session.js +4 -3
- package/esm/highlevel/utils/string-session.js.map +1 -1
- package/esm/highlevel/worker/index.d.ts +3 -0
- package/esm/highlevel/worker/index.js +4 -0
- package/esm/highlevel/worker/index.js.map +1 -0
- package/esm/highlevel/worker/port.d.ts +6 -3
- package/esm/highlevel/worker/port.js +8 -2
- package/esm/highlevel/worker/port.js.map +1 -1
- package/esm/highlevel/worker/protocol.d.ts +5 -1
- package/esm/highlevel/worker/protocol.js.map +1 -1
- package/esm/highlevel/worker/worker.d.ts +11 -4
- package/esm/highlevel/worker/worker.js +51 -47
- package/esm/highlevel/worker/worker.js.map +1 -1
- package/esm/network/authorization.js +1 -0
- package/esm/network/authorization.js.map +1 -1
- package/esm/network/client.d.ts +4 -4
- package/esm/network/client.js +4 -2
- package/esm/network/client.js.map +1 -1
- package/esm/network/mtproto-session.d.ts +1 -0
- package/esm/network/mtproto-session.js +7 -1
- package/esm/network/mtproto-session.js.map +1 -1
- package/esm/network/multi-session-connection.d.ts +1 -0
- package/esm/network/multi-session-connection.js +6 -0
- package/esm/network/multi-session-connection.js.map +1 -1
- package/esm/network/network-manager.d.ts +5 -1
- package/esm/network/network-manager.js +24 -15
- package/esm/network/network-manager.js.map +1 -1
- package/esm/network/persistent-connection.d.ts +3 -0
- package/esm/network/persistent-connection.js +23 -1
- package/esm/network/persistent-connection.js.map +1 -1
- package/esm/network/session-connection.d.ts +2 -0
- package/esm/network/session-connection.js +21 -7
- package/esm/network/session-connection.js.map +1 -1
- package/esm/network/transports/index.d.ts +0 -3
- package/esm/network/transports/index.js +0 -3
- package/esm/network/transports/index.js.map +1 -1
- package/esm/platform.d.ts +18 -0
- package/esm/platform.js +31 -0
- package/esm/platform.js.map +1 -0
- package/esm/storage/index.d.ts +1 -2
- package/esm/storage/index.js +1 -2
- package/esm/storage/index.js.map +1 -1
- package/{cjs/storage/providers → esm/storage}/memory/driver.d.ts +1 -1
- package/esm/storage/memory/driver.js.map +1 -0
- package/{cjs/storage/providers → esm/storage}/memory/index.d.ts +2 -2
- package/esm/storage/memory/index.js.map +1 -0
- package/esm/storage/{providers/memory → memory}/repository/auth-keys.d.ts +1 -1
- package/esm/storage/memory/repository/auth-keys.js.map +1 -0
- package/{cjs/storage/providers → esm/storage}/memory/repository/kv.d.ts +1 -1
- package/esm/storage/memory/repository/kv.js.map +1 -0
- package/{cjs/storage/providers → esm/storage}/memory/repository/peers.d.ts +1 -1
- package/esm/storage/memory/repository/peers.js.map +1 -0
- package/{cjs/storage/providers → esm/storage}/memory/repository/ref-messages.d.ts +1 -1
- package/esm/storage/memory/repository/ref-messages.js.map +1 -0
- package/esm/storage/storage.js +3 -2
- package/esm/storage/storage.js.map +1 -1
- package/esm/utils/binary/asn1-parser.js +3 -3
- package/esm/utils/binary/asn1-parser.js.map +1 -1
- package/esm/utils/crypto/abstract.d.ts +0 -1
- package/esm/utils/crypto/abstract.js.map +1 -1
- package/esm/utils/crypto/index.d.ts +0 -2
- package/esm/utils/crypto/index.js +0 -2
- package/esm/utils/crypto/index.js.map +1 -1
- package/esm/utils/crypto/keys.js +6 -4
- package/esm/utils/crypto/keys.js.map +1 -1
- package/esm/utils/crypto/password.js +3 -3
- package/esm/utils/crypto/password.js.map +1 -1
- package/esm/utils/dcs.d.ts +4 -0
- package/esm/utils/dcs.js +0 -4
- package/esm/utils/dcs.js.map +1 -1
- package/esm/utils/{platform/error-reporting.d.ts → error-reporting.d.ts} +1 -1
- package/esm/utils/error-reporting.js.map +1 -0
- package/esm/utils/index.d.ts +4 -1
- package/esm/utils/index.js +6 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/links/common.js +1 -1
- package/esm/utils/links/common.js.map +1 -1
- package/esm/utils/logger.d.ts +1 -0
- package/esm/utils/logger.js +9 -22
- package/esm/utils/logger.js.map +1 -1
- package/package.json +24 -52
- package/cjs/highlevel/base.test.js +0 -14
- package/cjs/highlevel/base.test.js.map +0 -1
- package/cjs/highlevel/methods/files/_platform.js +0 -33
- package/cjs/highlevel/methods/files/_platform.js.map +0 -1
- package/cjs/highlevel/methods/files/_platform.web.d.ts +0 -1
- package/cjs/highlevel/methods/files/_platform.web.js +0 -26
- package/cjs/highlevel/methods/files/_platform.web.js.map +0 -1
- package/cjs/highlevel/methods/files/download-file.web.d.ts +0 -1
- package/cjs/highlevel/methods/files/download-file.web.js +0 -9
- package/cjs/highlevel/methods/files/download-file.web.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-text.test.d.ts +0 -1
- package/cjs/highlevel/methods/messages/send-text.test.js +0 -140
- package/cjs/highlevel/methods/messages/send-text.test.js.map +0 -1
- package/cjs/highlevel/methods/users/get-users.test.d.ts +0 -1
- package/cjs/highlevel/methods/users/get-users.test.js +0 -33
- package/cjs/highlevel/methods/users/get-users.test.js.map +0 -1
- package/cjs/highlevel/methods/users/resolve-peer.test.d.ts +0 -1
- package/cjs/highlevel/methods/users/resolve-peer.test.js +0 -307
- package/cjs/highlevel/methods/users/resolve-peer.test.js.map +0 -1
- package/cjs/highlevel/types/bots/command-scope.d.ts +0 -63
- package/cjs/highlevel/types/bots/command-scope.js +0 -87
- package/cjs/highlevel/types/bots/command-scope.js.map +0 -1
- package/cjs/highlevel/types/bots/input/index.d.ts +0 -2
- package/cjs/highlevel/types/bots/input/index.js.map +0 -1
- package/cjs/highlevel/types/bots/input/input-inline-message.js +0 -179
- package/cjs/highlevel/types/bots/input/input-inline-message.js.map +0 -1
- package/cjs/highlevel/types/bots/input/input-inline-result.js +0 -490
- package/cjs/highlevel/types/bots/input/input-inline-result.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboard-builder.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboard-builder.test.d.ts +0 -1
- package/cjs/highlevel/types/bots/keyboard-builder.test.js +0 -162
- package/cjs/highlevel/types/bots/keyboard-builder.test.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboards.d.ts +0 -239
- package/cjs/highlevel/types/bots/keyboards.js +0 -380
- package/cjs/highlevel/types/bots/keyboards.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboards.test.d.ts +0 -1
- package/cjs/highlevel/types/bots/keyboards.test.js +0 -146
- package/cjs/highlevel/types/bots/keyboards.test.js.map +0 -1
- package/cjs/highlevel/types/media/input-media.js +0 -254
- package/cjs/highlevel/types/media/input-media.js.map +0 -1
- package/cjs/highlevel/types/misc/input-privacy-rule.d.ts +0 -63
- package/cjs/highlevel/types/misc/input-privacy-rule.js +0 -85
- package/cjs/highlevel/types/misc/input-privacy-rule.js.map +0 -1
- package/cjs/highlevel/types/peers/peers-index.test.d.ts +0 -1
- package/cjs/highlevel/types/peers/peers-index.test.js +0 -71
- package/cjs/highlevel/types/peers/peers-index.test.js.map +0 -1
- package/cjs/highlevel/types/peers/user.test.d.ts +0 -1
- package/cjs/highlevel/types/peers/user.test.js +0 -176
- package/cjs/highlevel/types/peers/user.test.js.map +0 -1
- package/cjs/highlevel/utils/file-type.test.d.ts +0 -1
- package/cjs/highlevel/utils/file-type.test.js +0 -64
- package/cjs/highlevel/utils/file-type.test.js.map +0 -1
- package/cjs/highlevel/utils/file-utils.test.d.ts +0 -1
- package/cjs/highlevel/utils/file-utils.test.js +0 -126
- package/cjs/highlevel/utils/file-utils.test.js.map +0 -1
- package/cjs/highlevel/utils/inline-utils.test.d.ts +0 -1
- package/cjs/highlevel/utils/inline-utils.test.js +0 -47
- package/cjs/highlevel/utils/inline-utils.test.js.map +0 -1
- package/cjs/highlevel/utils/inspectable.test.d.ts +0 -1
- package/cjs/highlevel/utils/inspectable.test.js +0 -97
- package/cjs/highlevel/utils/inspectable.test.js.map +0 -1
- package/cjs/highlevel/utils/memoize.test.d.ts +0 -1
- package/cjs/highlevel/utils/memoize.test.js +0 -60
- package/cjs/highlevel/utils/memoize.test.js.map +0 -1
- package/cjs/highlevel/utils/peer-utils.test.d.ts +0 -1
- package/cjs/highlevel/utils/peer-utils.test.js +0 -109
- package/cjs/highlevel/utils/peer-utils.test.js.map +0 -1
- package/cjs/highlevel/utils/platform/storage.d.ts +0 -1
- package/cjs/highlevel/utils/platform/storage.js +0 -10
- package/cjs/highlevel/utils/platform/storage.js.map +0 -1
- package/cjs/highlevel/utils/platform/storage.web.d.ts +0 -1
- package/cjs/highlevel/utils/platform/storage.web.js +0 -14
- package/cjs/highlevel/utils/platform/storage.web.js.map +0 -1
- package/cjs/highlevel/utils/query-batcher.test.d.ts +0 -1
- package/cjs/highlevel/utils/query-batcher.test.js +0 -502
- package/cjs/highlevel/utils/query-batcher.test.js.map +0 -1
- package/cjs/highlevel/utils/stream-utils.test.d.ts +0 -1
- package/cjs/highlevel/utils/stream-utils.test.js +0 -98
- package/cjs/highlevel/utils/stream-utils.test.js.map +0 -1
- package/cjs/highlevel/utils/string-session.test.d.ts +0 -1
- package/cjs/highlevel/utils/string-session.test.js +0 -198
- package/cjs/highlevel/utils/string-session.test.js.map +0 -1
- package/cjs/highlevel/utils/voice-utils.test.d.ts +0 -1
- package/cjs/highlevel/utils/voice-utils.test.js +0 -28
- package/cjs/highlevel/utils/voice-utils.test.js.map +0 -1
- package/cjs/highlevel/worker/platform/connect.d.ts +0 -2
- package/cjs/highlevel/worker/platform/connect.js +0 -19
- package/cjs/highlevel/worker/platform/connect.js.map +0 -1
- package/cjs/highlevel/worker/platform/connect.web.d.ts +0 -2
- package/cjs/highlevel/worker/platform/connect.web.js +0 -51
- package/cjs/highlevel/worker/platform/connect.web.js.map +0 -1
- package/cjs/highlevel/worker/platform/register.d.ts +0 -2
- package/cjs/highlevel/worker/platform/register.js +0 -20
- package/cjs/highlevel/worker/platform/register.js.map +0 -1
- package/cjs/highlevel/worker/platform/register.web.d.ts +0 -2
- package/cjs/highlevel/worker/platform/register.web.js +0 -64
- package/cjs/highlevel/worker/platform/register.web.js.map +0 -1
- package/cjs/network/auth-key.test.d.ts +0 -1
- package/cjs/network/auth-key.test.js +0 -111
- package/cjs/network/auth-key.test.js.map +0 -1
- package/cjs/network/config-manager.test.d.ts +0 -1
- package/cjs/network/config-manager.test.js +0 -174
- package/cjs/network/config-manager.test.js.map +0 -1
- package/cjs/network/persistent-connection.test.d.ts +0 -1
- package/cjs/network/persistent-connection.test.js +0 -157
- package/cjs/network/persistent-connection.test.js.map +0 -1
- package/cjs/network/transports/intermediate.test.d.ts +0 -1
- package/cjs/network/transports/intermediate.test.js +0 -84
- package/cjs/network/transports/intermediate.test.js.map +0 -1
- package/cjs/network/transports/obfuscated.test.d.ts +0 -1
- package/cjs/network/transports/obfuscated.test.js +0 -131
- package/cjs/network/transports/obfuscated.test.js.map +0 -1
- package/cjs/network/transports/tcp.d.ts +0 -32
- package/cjs/network/transports/tcp.js +0 -130
- package/cjs/network/transports/tcp.js.map +0 -1
- package/cjs/network/transports/tcp.test.d.ts +0 -1
- package/cjs/network/transports/tcp.test.js +0 -103
- package/cjs/network/transports/tcp.test.js.map +0 -1
- package/cjs/network/transports/websocket.d.ts +0 -46
- package/cjs/network/transports/websocket.js +0 -124
- package/cjs/network/transports/websocket.js.map +0 -1
- package/cjs/network/transports/websocket.test.d.ts +0 -1
- package/cjs/network/transports/websocket.test.js +0 -91
- package/cjs/network/transports/websocket.test.js.map +0 -1
- package/cjs/storage/providers/idb/driver.d.ts +0 -18
- package/cjs/storage/providers/idb/driver.js +0 -138
- package/cjs/storage/providers/idb/driver.js.map +0 -1
- package/cjs/storage/providers/idb/idb.test.d.ts +0 -1
- package/cjs/storage/providers/idb/idb.test.js +0 -29
- package/cjs/storage/providers/idb/idb.test.js.map +0 -1
- package/cjs/storage/providers/idb/index.d.ts +0 -22
- package/cjs/storage/providers/idb/index.js +0 -28
- package/cjs/storage/providers/idb/index.js.map +0 -1
- package/cjs/storage/providers/idb/repository/auth-keys.d.ts +0 -14
- package/cjs/storage/providers/idb/repository/auth-keys.js +0 -70
- package/cjs/storage/providers/idb/repository/auth-keys.js.map +0 -1
- package/cjs/storage/providers/idb/repository/kv.d.ts +0 -11
- package/cjs/storage/providers/idb/repository/kv.js +0 -34
- package/cjs/storage/providers/idb/repository/kv.js.map +0 -1
- package/cjs/storage/providers/idb/repository/peers.d.ts +0 -12
- package/cjs/storage/providers/idb/repository/peers.js +0 -38
- package/cjs/storage/providers/idb/repository/peers.js.map +0 -1
- package/cjs/storage/providers/idb/repository/ref-messages.d.ts +0 -12
- package/cjs/storage/providers/idb/repository/ref-messages.js +0 -57
- package/cjs/storage/providers/idb/repository/ref-messages.js.map +0 -1
- package/cjs/storage/providers/idb/utils.d.ts +0 -3
- package/cjs/storage/providers/idb/utils.js +0 -27
- package/cjs/storage/providers/idb/utils.js.map +0 -1
- package/cjs/storage/providers/memory/driver.js.map +0 -1
- package/cjs/storage/providers/memory/index.js.map +0 -1
- package/cjs/storage/providers/memory/memory.test.d.ts +0 -1
- package/cjs/storage/providers/memory/memory.test.js +0 -13
- package/cjs/storage/providers/memory/memory.test.js.map +0 -1
- package/cjs/storage/providers/memory/repository/auth-keys.js.map +0 -1
- package/cjs/storage/providers/memory/repository/kv.js.map +0 -1
- package/cjs/storage/providers/memory/repository/peers.js.map +0 -1
- package/cjs/storage/providers/memory/repository/ref-messages.js.map +0 -1
- package/cjs/storage/service/auth-keys.test.d.ts +0 -1
- package/cjs/storage/service/auth-keys.test.js +0 -22
- package/cjs/storage/service/auth-keys.test.js.map +0 -1
- package/cjs/storage/service/updates.test.d.ts +0 -1
- package/cjs/storage/service/updates.test.js +0 -60
- package/cjs/storage/service/updates.test.js.map +0 -1
- package/cjs/storage/service/utils.test-utils.d.ts +0 -2
- package/cjs/storage/service/utils.test-utils.js +0 -19
- package/cjs/storage/service/utils.test-utils.js.map +0 -1
- package/cjs/utils/async-lock.test.d.ts +0 -1
- package/cjs/utils/async-lock.test.js +0 -25
- package/cjs/utils/async-lock.test.js.map +0 -1
- package/cjs/utils/bigint-utils.test.d.ts +0 -1
- package/cjs/utils/bigint-utils.test.js +0 -150
- package/cjs/utils/bigint-utils.test.js.map +0 -1
- package/cjs/utils/buffer-utils.test.d.ts +0 -1
- package/cjs/utils/buffer-utils.test.js +0 -69
- package/cjs/utils/buffer-utils.test.js.map +0 -1
- package/cjs/utils/condition-variable.test.d.ts +0 -1
- package/cjs/utils/condition-variable.test.js +0 -27
- package/cjs/utils/condition-variable.test.js.map +0 -1
- package/cjs/utils/controllable-promise.test.d.ts +0 -1
- package/cjs/utils/controllable-promise.test.js +0 -17
- package/cjs/utils/controllable-promise.test.js.map +0 -1
- package/cjs/utils/crypto/factorization.test.d.ts +0 -1
- package/cjs/utils/crypto/factorization.test.js +0 -19
- package/cjs/utils/crypto/factorization.test.js.map +0 -1
- package/cjs/utils/crypto/keys.test.d.ts +0 -1
- package/cjs/utils/crypto/keys.test.js +0 -40
- package/cjs/utils/crypto/keys.test.js.map +0 -1
- package/cjs/utils/crypto/miller-rabin.test.d.ts +0 -1
- package/cjs/utils/crypto/miller-rabin.test.js +0 -60
- package/cjs/utils/crypto/miller-rabin.test.js.map +0 -1
- package/cjs/utils/crypto/mtproto.test.d.ts +0 -1
- package/cjs/utils/crypto/mtproto.test.js +0 -50
- package/cjs/utils/crypto/mtproto.test.js.map +0 -1
- package/cjs/utils/crypto/node.d.ts +0 -21
- package/cjs/utils/crypto/node.js +0 -74
- package/cjs/utils/crypto/node.js.map +0 -1
- package/cjs/utils/crypto/node.test.d.ts +0 -1
- package/cjs/utils/crypto/node.test.js +0 -14
- package/cjs/utils/crypto/node.test.js.map +0 -1
- package/cjs/utils/crypto/password.test.d.ts +0 -1
- package/cjs/utils/crypto/password.test.js +0 -95
- package/cjs/utils/crypto/password.test.js.map +0 -1
- package/cjs/utils/crypto/utils.test.d.ts +0 -1
- package/cjs/utils/crypto/utils.test.js +0 -49
- package/cjs/utils/crypto/utils.test.js.map +0 -1
- package/cjs/utils/crypto/wasm.d.ts +0 -22
- package/cjs/utils/crypto/wasm.js +0 -41
- package/cjs/utils/crypto/wasm.js.map +0 -1
- package/cjs/utils/crypto/web.d.ts +0 -11
- package/cjs/utils/crypto/web.js +0 -40
- package/cjs/utils/crypto/web.js.map +0 -1
- package/cjs/utils/crypto/web.test.d.ts +0 -1
- package/cjs/utils/crypto/web.test.js +0 -17
- package/cjs/utils/crypto/web.test.js.map +0 -1
- package/cjs/utils/deque.test.d.ts +0 -1
- package/cjs/utils/deque.test.js +0 -128
- package/cjs/utils/deque.test.js.map +0 -1
- package/cjs/utils/function-utils.test.d.ts +0 -1
- package/cjs/utils/function-utils.test.js +0 -23
- package/cjs/utils/function-utils.test.js.map +0 -1
- package/cjs/utils/linked-list.test.d.ts +0 -1
- package/cjs/utils/linked-list.test.js +0 -36
- package/cjs/utils/linked-list.test.js.map +0 -1
- package/cjs/utils/links/bots.test.d.ts +0 -1
- package/cjs/utils/links/bots.test.js +0 -152
- package/cjs/utils/links/bots.test.js.map +0 -1
- package/cjs/utils/links/chat.test.d.ts +0 -1
- package/cjs/utils/links/chat.test.js +0 -84
- package/cjs/utils/links/chat.test.js.map +0 -1
- package/cjs/utils/links/misc.test.d.ts +0 -1
- package/cjs/utils/links/misc.test.js +0 -153
- package/cjs/utils/links/misc.test.js.map +0 -1
- package/cjs/utils/links/proxy.test.d.ts +0 -1
- package/cjs/utils/links/proxy.test.js +0 -74
- package/cjs/utils/links/proxy.test.js.map +0 -1
- package/cjs/utils/links/user.test.d.ts +0 -1
- package/cjs/utils/links/user.test.js +0 -63
- package/cjs/utils/links/user.test.js.map +0 -1
- package/cjs/utils/logger.test.d.ts +0 -1
- package/cjs/utils/logger.test.js +0 -139
- package/cjs/utils/logger.test.js.map +0 -1
- package/cjs/utils/long-utils.test.d.ts +0 -1
- package/cjs/utils/long-utils.test.js +0 -158
- package/cjs/utils/long-utils.test.js.map +0 -1
- package/cjs/utils/lru-map.test.d.ts +0 -1
- package/cjs/utils/lru-map.test.js +0 -96
- package/cjs/utils/lru-map.test.js.map +0 -1
- package/cjs/utils/lru-set.test.d.ts +0 -1
- package/cjs/utils/lru-set.test.js +0 -77
- package/cjs/utils/lru-set.test.js.map +0 -1
- package/cjs/utils/peer-utils.test.d.ts +0 -1
- package/cjs/utils/peer-utils.test.js +0 -110
- package/cjs/utils/peer-utils.test.js.map +0 -1
- package/cjs/utils/platform/crypto.d.ts +0 -1
- package/cjs/utils/platform/crypto.js +0 -8
- package/cjs/utils/platform/crypto.js.map +0 -1
- package/cjs/utils/platform/crypto.web.d.ts +0 -1
- package/cjs/utils/platform/crypto.web.js +0 -14
- package/cjs/utils/platform/crypto.web.js.map +0 -1
- package/cjs/utils/platform/error-reporting.js.map +0 -1
- package/cjs/utils/platform/exit-hook.d.ts +0 -1
- package/cjs/utils/platform/exit-hook.js +0 -45
- package/cjs/utils/platform/exit-hook.js.map +0 -1
- package/cjs/utils/platform/exit-hook.web.d.ts +0 -1
- package/cjs/utils/platform/exit-hook.web.js +0 -21
- package/cjs/utils/platform/exit-hook.web.js.map +0 -1
- package/cjs/utils/platform/logging.d.ts +0 -1
- package/cjs/utils/platform/logging.js +0 -34
- package/cjs/utils/platform/logging.js.map +0 -1
- package/cjs/utils/platform/logging.web.d.ts +0 -1
- package/cjs/utils/platform/logging.web.js +0 -35
- package/cjs/utils/platform/logging.web.js.map +0 -1
- package/cjs/utils/platform/transport.d.ts +0 -1
- package/cjs/utils/platform/transport.js +0 -8
- package/cjs/utils/platform/transport.js.map +0 -1
- package/cjs/utils/platform/transport.web.d.ts +0 -1
- package/cjs/utils/platform/transport.web.js +0 -15
- package/cjs/utils/platform/transport.web.js.map +0 -1
- package/cjs/utils/sorted-array.test.d.ts +0 -1
- package/cjs/utils/sorted-array.test.js +0 -66
- package/cjs/utils/sorted-array.test.js.map +0 -1
- package/cjs/utils/tl-json.test.d.ts +0 -1
- package/cjs/utils/tl-json.test.js +0 -83
- package/cjs/utils/tl-json.test.js.map +0 -1
- package/cjs/utils/type-assertions.test.d.ts +0 -1
- package/cjs/utils/type-assertions.test.js +0 -67
- package/cjs/utils/type-assertions.test.js.map +0 -1
- package/esm/highlevel/base.test.d.ts +0 -1
- package/esm/highlevel/base.test.js +0 -12
- package/esm/highlevel/base.test.js.map +0 -1
- package/esm/highlevel/methods/files/_platform.d.ts +0 -1
- package/esm/highlevel/methods/files/_platform.js +0 -26
- package/esm/highlevel/methods/files/_platform.js.map +0 -1
- package/esm/highlevel/methods/files/_platform.web.d.ts +0 -1
- package/esm/highlevel/methods/files/_platform.web.js +0 -19
- package/esm/highlevel/methods/files/_platform.web.js.map +0 -1
- package/esm/highlevel/methods/files/download-file.web.d.ts +0 -1
- package/esm/highlevel/methods/files/download-file.web.js +0 -5
- package/esm/highlevel/methods/files/download-file.web.js.map +0 -1
- package/esm/highlevel/methods/messages/send-text.test.d.ts +0 -1
- package/esm/highlevel/methods/messages/send-text.test.js +0 -135
- package/esm/highlevel/methods/messages/send-text.test.js.map +0 -1
- package/esm/highlevel/methods/users/get-users.test.d.ts +0 -1
- package/esm/highlevel/methods/users/get-users.test.js +0 -28
- package/esm/highlevel/methods/users/get-users.test.js.map +0 -1
- package/esm/highlevel/methods/users/resolve-peer.test.d.ts +0 -1
- package/esm/highlevel/methods/users/resolve-peer.test.js +0 -302
- package/esm/highlevel/methods/users/resolve-peer.test.js.map +0 -1
- package/esm/highlevel/types/bots/command-scope.d.ts +0 -63
- package/esm/highlevel/types/bots/command-scope.js +0 -84
- package/esm/highlevel/types/bots/command-scope.js.map +0 -1
- package/esm/highlevel/types/bots/input/index.d.ts +0 -2
- package/esm/highlevel/types/bots/input/index.js +0 -3
- package/esm/highlevel/types/bots/input/index.js.map +0 -1
- package/esm/highlevel/types/bots/input/input-inline-message.js +0 -176
- package/esm/highlevel/types/bots/input/input-inline-message.js.map +0 -1
- package/esm/highlevel/types/bots/input/input-inline-result.js +0 -487
- package/esm/highlevel/types/bots/input/input-inline-result.js.map +0 -1
- package/esm/highlevel/types/bots/keyboard-builder.js.map +0 -1
- package/esm/highlevel/types/bots/keyboard-builder.test.d.ts +0 -1
- package/esm/highlevel/types/bots/keyboard-builder.test.js +0 -160
- package/esm/highlevel/types/bots/keyboard-builder.test.js.map +0 -1
- package/esm/highlevel/types/bots/keyboards.d.ts +0 -239
- package/esm/highlevel/types/bots/keyboards.js +0 -377
- package/esm/highlevel/types/bots/keyboards.js.map +0 -1
- package/esm/highlevel/types/bots/keyboards.test.d.ts +0 -1
- package/esm/highlevel/types/bots/keyboards.test.js +0 -144
- package/esm/highlevel/types/bots/keyboards.test.js.map +0 -1
- package/esm/highlevel/types/media/input-media.js +0 -251
- package/esm/highlevel/types/media/input-media.js.map +0 -1
- package/esm/highlevel/types/misc/input-privacy-rule.d.ts +0 -63
- package/esm/highlevel/types/misc/input-privacy-rule.js +0 -82
- package/esm/highlevel/types/misc/input-privacy-rule.js.map +0 -1
- package/esm/highlevel/types/peers/peers-index.test.d.ts +0 -1
- package/esm/highlevel/types/peers/peers-index.test.js +0 -69
- package/esm/highlevel/types/peers/peers-index.test.js.map +0 -1
- package/esm/highlevel/types/peers/user.test.d.ts +0 -1
- package/esm/highlevel/types/peers/user.test.js +0 -171
- package/esm/highlevel/types/peers/user.test.js.map +0 -1
- package/esm/highlevel/utils/file-type.test.d.ts +0 -1
- package/esm/highlevel/utils/file-type.test.js +0 -62
- package/esm/highlevel/utils/file-type.test.js.map +0 -1
- package/esm/highlevel/utils/file-utils.test.d.ts +0 -1
- package/esm/highlevel/utils/file-utils.test.js +0 -124
- package/esm/highlevel/utils/file-utils.test.js.map +0 -1
- package/esm/highlevel/utils/inline-utils.test.d.ts +0 -1
- package/esm/highlevel/utils/inline-utils.test.js +0 -42
- package/esm/highlevel/utils/inline-utils.test.js.map +0 -1
- package/esm/highlevel/utils/inspectable.test.d.ts +0 -1
- package/esm/highlevel/utils/inspectable.test.js +0 -95
- package/esm/highlevel/utils/inspectable.test.js.map +0 -1
- package/esm/highlevel/utils/memoize.test.d.ts +0 -1
- package/esm/highlevel/utils/memoize.test.js +0 -58
- package/esm/highlevel/utils/memoize.test.js.map +0 -1
- package/esm/highlevel/utils/peer-utils.test.d.ts +0 -1
- package/esm/highlevel/utils/peer-utils.test.js +0 -107
- package/esm/highlevel/utils/peer-utils.test.js.map +0 -1
- package/esm/highlevel/utils/platform/storage.d.ts +0 -1
- package/esm/highlevel/utils/platform/storage.js +0 -6
- package/esm/highlevel/utils/platform/storage.js.map +0 -1
- package/esm/highlevel/utils/platform/storage.web.d.ts +0 -1
- package/esm/highlevel/utils/platform/storage.web.js +0 -10
- package/esm/highlevel/utils/platform/storage.web.js.map +0 -1
- package/esm/highlevel/utils/query-batcher.test.d.ts +0 -1
- package/esm/highlevel/utils/query-batcher.test.js +0 -500
- package/esm/highlevel/utils/query-batcher.test.js.map +0 -1
- package/esm/highlevel/utils/stream-utils.test.d.ts +0 -1
- package/esm/highlevel/utils/stream-utils.test.js +0 -96
- package/esm/highlevel/utils/stream-utils.test.js.map +0 -1
- package/esm/highlevel/utils/string-session.test.d.ts +0 -1
- package/esm/highlevel/utils/string-session.test.js +0 -196
- package/esm/highlevel/utils/string-session.test.js.map +0 -1
- package/esm/highlevel/utils/voice-utils.test.d.ts +0 -1
- package/esm/highlevel/utils/voice-utils.test.js +0 -26
- package/esm/highlevel/utils/voice-utils.test.js.map +0 -1
- package/esm/highlevel/worker/platform/connect.d.ts +0 -2
- package/esm/highlevel/worker/platform/connect.js +0 -15
- package/esm/highlevel/worker/platform/connect.js.map +0 -1
- package/esm/highlevel/worker/platform/connect.web.d.ts +0 -2
- package/esm/highlevel/worker/platform/connect.web.js +0 -47
- package/esm/highlevel/worker/platform/connect.web.js.map +0 -1
- package/esm/highlevel/worker/platform/register.d.ts +0 -2
- package/esm/highlevel/worker/platform/register.js +0 -16
- package/esm/highlevel/worker/platform/register.js.map +0 -1
- package/esm/highlevel/worker/platform/register.web.d.ts +0 -2
- package/esm/highlevel/worker/platform/register.web.js +0 -60
- package/esm/highlevel/worker/platform/register.web.js.map +0 -1
- package/esm/network/auth-key.test.d.ts +0 -1
- package/esm/network/auth-key.test.js +0 -106
- package/esm/network/auth-key.test.js.map +0 -1
- package/esm/network/config-manager.test.d.ts +0 -1
- package/esm/network/config-manager.test.js +0 -172
- package/esm/network/config-manager.test.js.map +0 -1
- package/esm/network/persistent-connection.test.d.ts +0 -1
- package/esm/network/persistent-connection.test.js +0 -155
- package/esm/network/persistent-connection.test.js.map +0 -1
- package/esm/network/transports/intermediate.test.d.ts +0 -1
- package/esm/network/transports/intermediate.test.js +0 -82
- package/esm/network/transports/intermediate.test.js.map +0 -1
- package/esm/network/transports/obfuscated.test.d.ts +0 -1
- package/esm/network/transports/obfuscated.test.js +0 -129
- package/esm/network/transports/obfuscated.test.js.map +0 -1
- package/esm/network/transports/tcp.d.ts +0 -32
- package/esm/network/transports/tcp.js +0 -122
- package/esm/network/transports/tcp.js.map +0 -1
- package/esm/network/transports/tcp.test.d.ts +0 -1
- package/esm/network/transports/tcp.test.js +0 -101
- package/esm/network/transports/tcp.test.js.map +0 -1
- package/esm/network/transports/websocket.d.ts +0 -46
- package/esm/network/transports/websocket.js +0 -116
- package/esm/network/transports/websocket.js.map +0 -1
- package/esm/network/transports/websocket.test.d.ts +0 -1
- package/esm/network/transports/websocket.test.js +0 -89
- package/esm/network/transports/websocket.test.js.map +0 -1
- package/esm/storage/providers/idb/driver.d.ts +0 -18
- package/esm/storage/providers/idb/driver.js +0 -134
- package/esm/storage/providers/idb/driver.js.map +0 -1
- package/esm/storage/providers/idb/idb.test.d.ts +0 -1
- package/esm/storage/providers/idb/idb.test.js +0 -27
- package/esm/storage/providers/idb/idb.test.js.map +0 -1
- package/esm/storage/providers/idb/index.d.ts +0 -22
- package/esm/storage/providers/idb/index.js +0 -23
- package/esm/storage/providers/idb/index.js.map +0 -1
- package/esm/storage/providers/idb/repository/auth-keys.d.ts +0 -14
- package/esm/storage/providers/idb/repository/auth-keys.js +0 -66
- package/esm/storage/providers/idb/repository/auth-keys.js.map +0 -1
- package/esm/storage/providers/idb/repository/kv.d.ts +0 -11
- package/esm/storage/providers/idb/repository/kv.js +0 -30
- package/esm/storage/providers/idb/repository/kv.js.map +0 -1
- package/esm/storage/providers/idb/repository/peers.d.ts +0 -12
- package/esm/storage/providers/idb/repository/peers.js +0 -34
- package/esm/storage/providers/idb/repository/peers.js.map +0 -1
- package/esm/storage/providers/idb/repository/ref-messages.d.ts +0 -12
- package/esm/storage/providers/idb/repository/ref-messages.js +0 -53
- package/esm/storage/providers/idb/repository/ref-messages.js.map +0 -1
- package/esm/storage/providers/idb/utils.d.ts +0 -3
- package/esm/storage/providers/idb/utils.js +0 -21
- package/esm/storage/providers/idb/utils.js.map +0 -1
- package/esm/storage/providers/memory/driver.js.map +0 -1
- package/esm/storage/providers/memory/index.js.map +0 -1
- package/esm/storage/providers/memory/memory.test.d.ts +0 -1
- package/esm/storage/providers/memory/memory.test.js +0 -11
- package/esm/storage/providers/memory/memory.test.js.map +0 -1
- package/esm/storage/providers/memory/repository/auth-keys.js.map +0 -1
- package/esm/storage/providers/memory/repository/kv.js.map +0 -1
- package/esm/storage/providers/memory/repository/peers.js.map +0 -1
- package/esm/storage/providers/memory/repository/ref-messages.js.map +0 -1
- package/esm/storage/service/auth-keys.test.d.ts +0 -1
- package/esm/storage/service/auth-keys.test.js +0 -20
- package/esm/storage/service/auth-keys.test.js.map +0 -1
- package/esm/storage/service/updates.test.d.ts +0 -1
- package/esm/storage/service/updates.test.js +0 -58
- package/esm/storage/service/updates.test.js.map +0 -1
- package/esm/storage/service/utils.test-utils.d.ts +0 -2
- package/esm/storage/service/utils.test-utils.js +0 -15
- package/esm/storage/service/utils.test-utils.js.map +0 -1
- package/esm/utils/async-lock.test.d.ts +0 -1
- package/esm/utils/async-lock.test.js +0 -23
- package/esm/utils/async-lock.test.js.map +0 -1
- package/esm/utils/bigint-utils.test.d.ts +0 -1
- package/esm/utils/bigint-utils.test.js +0 -148
- package/esm/utils/bigint-utils.test.js.map +0 -1
- package/esm/utils/buffer-utils.test.d.ts +0 -1
- package/esm/utils/buffer-utils.test.js +0 -67
- package/esm/utils/buffer-utils.test.js.map +0 -1
- package/esm/utils/condition-variable.test.d.ts +0 -1
- package/esm/utils/condition-variable.test.js +0 -25
- package/esm/utils/condition-variable.test.js.map +0 -1
- package/esm/utils/controllable-promise.test.d.ts +0 -1
- package/esm/utils/controllable-promise.test.js +0 -15
- package/esm/utils/controllable-promise.test.js.map +0 -1
- package/esm/utils/crypto/factorization.test.d.ts +0 -1
- package/esm/utils/crypto/factorization.test.js +0 -17
- package/esm/utils/crypto/factorization.test.js.map +0 -1
- package/esm/utils/crypto/keys.test.d.ts +0 -1
- package/esm/utils/crypto/keys.test.js +0 -38
- package/esm/utils/crypto/keys.test.js.map +0 -1
- package/esm/utils/crypto/miller-rabin.test.d.ts +0 -1
- package/esm/utils/crypto/miller-rabin.test.js +0 -58
- package/esm/utils/crypto/miller-rabin.test.js.map +0 -1
- package/esm/utils/crypto/mtproto.test.d.ts +0 -1
- package/esm/utils/crypto/mtproto.test.js +0 -48
- package/esm/utils/crypto/mtproto.test.js.map +0 -1
- package/esm/utils/crypto/node.d.ts +0 -21
- package/esm/utils/crypto/node.js +0 -69
- package/esm/utils/crypto/node.js.map +0 -1
- package/esm/utils/crypto/node.test.d.ts +0 -1
- package/esm/utils/crypto/node.test.js +0 -12
- package/esm/utils/crypto/node.test.js.map +0 -1
- package/esm/utils/crypto/password.test.d.ts +0 -1
- package/esm/utils/crypto/password.test.js +0 -90
- package/esm/utils/crypto/password.test.js.map +0 -1
- package/esm/utils/crypto/utils.test.d.ts +0 -1
- package/esm/utils/crypto/utils.test.js +0 -47
- package/esm/utils/crypto/utils.test.js.map +0 -1
- package/esm/utils/crypto/wasm.d.ts +0 -22
- package/esm/utils/crypto/wasm.js +0 -37
- package/esm/utils/crypto/wasm.js.map +0 -1
- package/esm/utils/crypto/web.d.ts +0 -11
- package/esm/utils/crypto/web.js +0 -36
- package/esm/utils/crypto/web.js.map +0 -1
- package/esm/utils/crypto/web.test.d.ts +0 -1
- package/esm/utils/crypto/web.test.js +0 -15
- package/esm/utils/crypto/web.test.js.map +0 -1
- package/esm/utils/deque.test.d.ts +0 -1
- package/esm/utils/deque.test.js +0 -126
- package/esm/utils/deque.test.js.map +0 -1
- package/esm/utils/function-utils.test.d.ts +0 -1
- package/esm/utils/function-utils.test.js +0 -21
- package/esm/utils/function-utils.test.js.map +0 -1
- package/esm/utils/linked-list.test.d.ts +0 -1
- package/esm/utils/linked-list.test.js +0 -34
- package/esm/utils/linked-list.test.js.map +0 -1
- package/esm/utils/links/bots.test.d.ts +0 -1
- package/esm/utils/links/bots.test.js +0 -150
- package/esm/utils/links/bots.test.js.map +0 -1
- package/esm/utils/links/chat.test.d.ts +0 -1
- package/esm/utils/links/chat.test.js +0 -82
- package/esm/utils/links/chat.test.js.map +0 -1
- package/esm/utils/links/misc.test.d.ts +0 -1
- package/esm/utils/links/misc.test.js +0 -151
- package/esm/utils/links/misc.test.js.map +0 -1
- package/esm/utils/links/proxy.test.d.ts +0 -1
- package/esm/utils/links/proxy.test.js +0 -72
- package/esm/utils/links/proxy.test.js.map +0 -1
- package/esm/utils/links/user.test.d.ts +0 -1
- package/esm/utils/links/user.test.js +0 -61
- package/esm/utils/links/user.test.js.map +0 -1
- package/esm/utils/logger.test.d.ts +0 -1
- package/esm/utils/logger.test.js +0 -134
- package/esm/utils/logger.test.js.map +0 -1
- package/esm/utils/long-utils.test.d.ts +0 -1
- package/esm/utils/long-utils.test.js +0 -153
- package/esm/utils/long-utils.test.js.map +0 -1
- package/esm/utils/lru-map.test.d.ts +0 -1
- package/esm/utils/lru-map.test.js +0 -94
- package/esm/utils/lru-map.test.js.map +0 -1
- package/esm/utils/lru-set.test.d.ts +0 -1
- package/esm/utils/lru-set.test.js +0 -72
- package/esm/utils/lru-set.test.js.map +0 -1
- package/esm/utils/peer-utils.test.d.ts +0 -1
- package/esm/utils/peer-utils.test.js +0 -105
- package/esm/utils/peer-utils.test.js.map +0 -1
- package/esm/utils/platform/crypto.d.ts +0 -1
- package/esm/utils/platform/crypto.js +0 -4
- package/esm/utils/platform/crypto.js.map +0 -1
- package/esm/utils/platform/crypto.web.d.ts +0 -1
- package/esm/utils/platform/crypto.web.js +0 -10
- package/esm/utils/platform/crypto.web.js.map +0 -1
- package/esm/utils/platform/error-reporting.js.map +0 -1
- package/esm/utils/platform/exit-hook.d.ts +0 -1
- package/esm/utils/platform/exit-hook.js +0 -41
- package/esm/utils/platform/exit-hook.js.map +0 -1
- package/esm/utils/platform/exit-hook.web.d.ts +0 -1
- package/esm/utils/platform/exit-hook.web.js +0 -17
- package/esm/utils/platform/exit-hook.web.js.map +0 -1
- package/esm/utils/platform/logging.d.ts +0 -1
- package/esm/utils/platform/logging.js +0 -31
- package/esm/utils/platform/logging.js.map +0 -1
- package/esm/utils/platform/logging.web.d.ts +0 -1
- package/esm/utils/platform/logging.web.js +0 -31
- package/esm/utils/platform/logging.web.js.map +0 -1
- package/esm/utils/platform/transport.d.ts +0 -1
- package/esm/utils/platform/transport.js +0 -4
- package/esm/utils/platform/transport.js.map +0 -1
- package/esm/utils/platform/transport.web.d.ts +0 -1
- package/esm/utils/platform/transport.web.js +0 -12
- package/esm/utils/platform/transport.web.js.map +0 -1
- package/esm/utils/sorted-array.test.d.ts +0 -1
- package/esm/utils/sorted-array.test.js +0 -64
- package/esm/utils/sorted-array.test.js.map +0 -1
- package/esm/utils/tl-json.test.d.ts +0 -1
- package/esm/utils/tl-json.test.js +0 -81
- package/esm/utils/tl-json.test.js.map +0 -1
- package/esm/utils/type-assertions.test.d.ts +0 -1
- package/esm/utils/type-assertions.test.js +0 -65
- package/esm/utils/type-assertions.test.js.map +0 -1
- /package/cjs/highlevel/{base.test.d.ts → methods/files/download-node-stream.d.ts} +0 -0
- /package/cjs/storage/{providers/memory → memory}/driver.js +0 -0
- /package/cjs/storage/{providers/memory → memory}/index.js +0 -0
- /package/cjs/storage/{providers/memory → memory}/repository/auth-keys.js +0 -0
- /package/cjs/storage/{providers/memory → memory}/repository/kv.js +0 -0
- /package/cjs/storage/{providers/memory → memory}/repository/peers.js +0 -0
- /package/cjs/storage/{providers/memory → memory}/repository/ref-messages.js +0 -0
- /package/cjs/utils/{platform/error-reporting.js → error-reporting.js} +0 -0
- /package/{cjs/highlevel/methods/files/_platform.d.ts → esm/highlevel/methods/files/download-node-stream.d.ts} +0 -0
- /package/esm/storage/{providers/memory → memory}/driver.js +0 -0
- /package/esm/storage/{providers/memory → memory}/index.js +0 -0
- /package/esm/storage/{providers/memory → memory}/repository/auth-keys.js +0 -0
- /package/esm/storage/{providers/memory → memory}/repository/kv.js +0 -0
- /package/esm/storage/{providers/memory → memory}/repository/peers.js +0 -0
- /package/esm/storage/{providers/memory → memory}/repository/ref-messages.js +0 -0
- /package/esm/utils/{platform/error-reporting.js → error-reporting.js} +0 -0
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
import { MtArgumentError } from '../../../../types/errors.js';
|
|
2
|
+
import { fileIdToInputDocument, fileIdToInputPhoto } from '../../../utils/convert-file-id.js';
|
|
3
|
+
import { extractFileName } from '../../../utils/file-utils.js';
|
|
4
|
+
import { BotInlineMessage } from '../inline-message/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Create an inline result containing an article
|
|
7
|
+
*
|
|
8
|
+
* @param id Inline result ID
|
|
9
|
+
* @param params Article
|
|
10
|
+
*/
|
|
11
|
+
export function article(id, params) {
|
|
12
|
+
const ret = params;
|
|
13
|
+
ret.id = id;
|
|
14
|
+
ret.type = 'article';
|
|
15
|
+
return ret;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create an inline result containing a GIF
|
|
19
|
+
*
|
|
20
|
+
* @param id Inline result ID
|
|
21
|
+
* @param media GIF animation
|
|
22
|
+
* @param params Additional parameters
|
|
23
|
+
*/
|
|
24
|
+
export function gif(id, media, params = {}) {
|
|
25
|
+
const ret = params;
|
|
26
|
+
ret.id = id;
|
|
27
|
+
ret.type = 'gif';
|
|
28
|
+
ret.media = media;
|
|
29
|
+
return ret;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Create an inline result containing a video
|
|
33
|
+
*
|
|
34
|
+
* @param id Inline result ID
|
|
35
|
+
* @param media Video
|
|
36
|
+
* @param params Additional parameters
|
|
37
|
+
*/
|
|
38
|
+
export function video(id, media, params) {
|
|
39
|
+
const ret = params;
|
|
40
|
+
ret.id = id;
|
|
41
|
+
ret.type = 'video';
|
|
42
|
+
ret.media = media;
|
|
43
|
+
return ret;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create an inline result containing an audio file
|
|
47
|
+
*
|
|
48
|
+
* @param id Inline result ID
|
|
49
|
+
* @param media Audio file
|
|
50
|
+
* @param params Additional parameters
|
|
51
|
+
*/
|
|
52
|
+
export function audio(id, media, params) {
|
|
53
|
+
const ret = params;
|
|
54
|
+
ret.id = id;
|
|
55
|
+
ret.type = 'audio';
|
|
56
|
+
ret.media = media;
|
|
57
|
+
return ret;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create an inline result containing a voice note
|
|
61
|
+
*
|
|
62
|
+
* @param id Inline result ID
|
|
63
|
+
* @param media Voice note
|
|
64
|
+
* @param params Additional parameters
|
|
65
|
+
*/
|
|
66
|
+
export function voice(id, media, params) {
|
|
67
|
+
const ret = params;
|
|
68
|
+
ret.id = id;
|
|
69
|
+
ret.type = 'voice';
|
|
70
|
+
ret.media = media;
|
|
71
|
+
return ret;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create an inline result containing a photo
|
|
75
|
+
*
|
|
76
|
+
* @param id Inline result ID
|
|
77
|
+
* @param media Photo
|
|
78
|
+
* @param params Additional parameters
|
|
79
|
+
*/
|
|
80
|
+
export function photo(id, media, params = {}) {
|
|
81
|
+
const ret = params;
|
|
82
|
+
ret.id = id;
|
|
83
|
+
ret.type = 'photo';
|
|
84
|
+
ret.media = media;
|
|
85
|
+
return ret;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Create an inline result containing a sticker
|
|
89
|
+
*
|
|
90
|
+
* @param id Inline result ID
|
|
91
|
+
* @param media Sticker
|
|
92
|
+
*/
|
|
93
|
+
export function sticker(id, media) {
|
|
94
|
+
return {
|
|
95
|
+
id,
|
|
96
|
+
type: 'sticker',
|
|
97
|
+
media,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Create an inline result containing a document
|
|
102
|
+
* (only PDF and ZIP are supported when using URL)
|
|
103
|
+
*
|
|
104
|
+
* @param id Inline result ID
|
|
105
|
+
* @param media Document
|
|
106
|
+
* @param params Additional parameters
|
|
107
|
+
*/
|
|
108
|
+
export function file(id, media, params) {
|
|
109
|
+
const ret = params;
|
|
110
|
+
ret.id = id;
|
|
111
|
+
ret.type = 'file';
|
|
112
|
+
ret.media = media;
|
|
113
|
+
return ret;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Create an inline result containing a geolocation
|
|
117
|
+
*
|
|
118
|
+
* @param id Inline result ID
|
|
119
|
+
* @param params Additional parameters
|
|
120
|
+
*/
|
|
121
|
+
export function geo(id, params) {
|
|
122
|
+
const ret = params;
|
|
123
|
+
ret.id = id;
|
|
124
|
+
ret.type = 'geo';
|
|
125
|
+
return ret;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Create an inline result containing a venue
|
|
129
|
+
*
|
|
130
|
+
* @param id Inline result ID
|
|
131
|
+
* @param params Venue parameters
|
|
132
|
+
*/
|
|
133
|
+
export function venue(id, params) {
|
|
134
|
+
const ret = params;
|
|
135
|
+
ret.id = id;
|
|
136
|
+
ret.type = 'venue';
|
|
137
|
+
return ret;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Create an inline result containing a contact
|
|
141
|
+
*
|
|
142
|
+
* @param id Inline result ID
|
|
143
|
+
* @param params Contact parameters
|
|
144
|
+
*/
|
|
145
|
+
export function contact(id, params) {
|
|
146
|
+
const ret = params;
|
|
147
|
+
ret.id = id;
|
|
148
|
+
ret.type = 'contact';
|
|
149
|
+
return ret;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Create an inline result containing a game
|
|
153
|
+
*
|
|
154
|
+
* @param id Inline result ID
|
|
155
|
+
* @param shortName Short name of the game
|
|
156
|
+
* @param params Additional parameters
|
|
157
|
+
*/
|
|
158
|
+
export function game(id, shortName, params = {}) {
|
|
159
|
+
const ret = params;
|
|
160
|
+
ret.id = id;
|
|
161
|
+
ret.type = 'game';
|
|
162
|
+
ret.shortName = shortName;
|
|
163
|
+
return ret;
|
|
164
|
+
}
|
|
165
|
+
/** @internal */
|
|
166
|
+
export async function _convertToTl(client, results) {
|
|
167
|
+
const normalizeThumb = (obj, fallback) => {
|
|
168
|
+
if (obj.type !== 'voice' && obj.type !== 'audio' && obj.type !== 'sticker' && obj.type !== 'game') {
|
|
169
|
+
if (!obj.thumb || typeof obj.thumb === 'string') {
|
|
170
|
+
if (!obj.thumb && !fallback) {
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
_: 'inputWebDocument',
|
|
175
|
+
size: 0,
|
|
176
|
+
url: obj.thumb || fallback,
|
|
177
|
+
mimeType: obj.type === 'gif' ? obj.thumbMime ?? obj.mime ?? 'video/mp4' : 'image/jpeg',
|
|
178
|
+
attributes: [],
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
return obj.thumb;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
const items = [];
|
|
185
|
+
let isGallery = false;
|
|
186
|
+
let forceVertical = false;
|
|
187
|
+
for (const obj of results) {
|
|
188
|
+
switch (obj.type) {
|
|
189
|
+
case 'article': {
|
|
190
|
+
forceVertical = true;
|
|
191
|
+
let sendMessage;
|
|
192
|
+
if (obj.message) {
|
|
193
|
+
sendMessage = await BotInlineMessage._convertToTl(client, obj.message);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
let message = obj.title;
|
|
197
|
+
const entities = [
|
|
198
|
+
{
|
|
199
|
+
_: 'messageEntityBold',
|
|
200
|
+
offset: 0,
|
|
201
|
+
length: message.length,
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
if (obj.url) {
|
|
205
|
+
entities.push({
|
|
206
|
+
_: 'messageEntityTextUrl',
|
|
207
|
+
url: obj.url,
|
|
208
|
+
offset: 0,
|
|
209
|
+
length: message.length,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
if (obj.description) {
|
|
213
|
+
message += '\n' + obj.description;
|
|
214
|
+
}
|
|
215
|
+
sendMessage = {
|
|
216
|
+
_: 'inputBotInlineMessageText',
|
|
217
|
+
message,
|
|
218
|
+
entities,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
items.push({
|
|
222
|
+
_: 'inputBotInlineResult',
|
|
223
|
+
id: obj.id,
|
|
224
|
+
type: obj.type,
|
|
225
|
+
title: obj.title,
|
|
226
|
+
description: obj.description,
|
|
227
|
+
url: obj.hideUrl ? undefined : obj.url,
|
|
228
|
+
content: obj.url && obj.hideUrl ?
|
|
229
|
+
{
|
|
230
|
+
_: 'inputWebDocument',
|
|
231
|
+
url: obj.url,
|
|
232
|
+
mimeType: 'text/html',
|
|
233
|
+
size: 0,
|
|
234
|
+
attributes: [],
|
|
235
|
+
} :
|
|
236
|
+
undefined,
|
|
237
|
+
thumb: typeof obj.thumb === 'string' ? normalizeThumb(obj) : obj.thumb,
|
|
238
|
+
sendMessage,
|
|
239
|
+
});
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
case 'game': {
|
|
243
|
+
let sendMessage;
|
|
244
|
+
if (obj.message) {
|
|
245
|
+
sendMessage = await BotInlineMessage._convertToTl(client, obj.message);
|
|
246
|
+
if (sendMessage._ !== 'inputBotInlineMessageGame') {
|
|
247
|
+
throw new MtArgumentError('game inline result must contain a game inline message');
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
sendMessage = {
|
|
252
|
+
_: 'inputBotInlineMessageGame',
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
items.push({
|
|
256
|
+
_: 'inputBotInlineResultGame',
|
|
257
|
+
id: obj.id,
|
|
258
|
+
shortName: obj.shortName,
|
|
259
|
+
sendMessage,
|
|
260
|
+
});
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
case 'gif':
|
|
264
|
+
case 'photo':
|
|
265
|
+
case 'sticker':
|
|
266
|
+
isGallery = true;
|
|
267
|
+
break;
|
|
268
|
+
case 'audio':
|
|
269
|
+
case 'contact':
|
|
270
|
+
case 'voice':
|
|
271
|
+
forceVertical = true;
|
|
272
|
+
}
|
|
273
|
+
let sendMessage;
|
|
274
|
+
if (obj.message) {
|
|
275
|
+
sendMessage = await BotInlineMessage._convertToTl(client, obj.message);
|
|
276
|
+
}
|
|
277
|
+
else if (obj.type === 'venue') {
|
|
278
|
+
if (obj.latitude && obj.longitude) {
|
|
279
|
+
sendMessage = {
|
|
280
|
+
_: 'inputBotInlineMessageMediaVenue',
|
|
281
|
+
title: obj.title,
|
|
282
|
+
address: obj.address,
|
|
283
|
+
geoPoint: {
|
|
284
|
+
_: 'inputGeoPoint',
|
|
285
|
+
lat: obj.latitude,
|
|
286
|
+
long: obj.longitude,
|
|
287
|
+
},
|
|
288
|
+
provider: '',
|
|
289
|
+
venueId: '',
|
|
290
|
+
venueType: '',
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
throw new MtArgumentError('message or location (lat&lon) bust be supplied for venue inline result');
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
else if (obj.type === 'video' && obj.isEmbed && typeof obj.media === 'string') {
|
|
298
|
+
sendMessage = {
|
|
299
|
+
_: 'inputBotInlineMessageText',
|
|
300
|
+
message: obj.media,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
else if (obj.type === 'geo') {
|
|
304
|
+
sendMessage = {
|
|
305
|
+
_: 'inputBotInlineMessageMediaGeo',
|
|
306
|
+
geoPoint: {
|
|
307
|
+
_: 'inputGeoPoint',
|
|
308
|
+
lat: obj.latitude,
|
|
309
|
+
long: obj.longitude,
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
else if (obj.type === 'contact') {
|
|
314
|
+
sendMessage = {
|
|
315
|
+
_: 'inputBotInlineMessageMediaContact',
|
|
316
|
+
phoneNumber: obj.phone,
|
|
317
|
+
firstName: obj.firstName,
|
|
318
|
+
lastName: obj.lastName ?? '',
|
|
319
|
+
vcard: '',
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
sendMessage = {
|
|
324
|
+
_: 'inputBotInlineMessageMediaAuto',
|
|
325
|
+
message: '',
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
let media = undefined;
|
|
329
|
+
if (obj.type !== 'geo' && obj.type !== 'venue' && obj.type !== 'contact') {
|
|
330
|
+
if (typeof obj.media === 'string') {
|
|
331
|
+
// file id or url
|
|
332
|
+
if (obj.media.match(/^https?:\/\//)) {
|
|
333
|
+
if (obj.type === 'sticker') {
|
|
334
|
+
throw new MtArgumentError('sticker inline result cannot contain a URL');
|
|
335
|
+
}
|
|
336
|
+
let mime;
|
|
337
|
+
if (obj.type === 'video')
|
|
338
|
+
mime = 'video/mp4';
|
|
339
|
+
else if (obj.type === 'audio') {
|
|
340
|
+
mime = obj.mime ?? 'audio/mpeg';
|
|
341
|
+
}
|
|
342
|
+
else if (obj.type === 'gif') {
|
|
343
|
+
mime = obj.mime ?? 'video/mp4';
|
|
344
|
+
}
|
|
345
|
+
else if (obj.type === 'voice')
|
|
346
|
+
mime = 'audio/ogg';
|
|
347
|
+
else if (obj.type === 'file') {
|
|
348
|
+
if (!obj.mime) {
|
|
349
|
+
throw new MtArgumentError('MIME type must be specified for file inline result');
|
|
350
|
+
}
|
|
351
|
+
mime = obj.mime;
|
|
352
|
+
}
|
|
353
|
+
else
|
|
354
|
+
mime = 'image/jpeg';
|
|
355
|
+
const attributes = [];
|
|
356
|
+
if ((obj.type === 'video' || obj.type === 'gif' || obj.type === 'photo') &&
|
|
357
|
+
obj.width &&
|
|
358
|
+
obj.height) {
|
|
359
|
+
if (obj.type !== 'photo' && obj.duration) {
|
|
360
|
+
attributes.push({
|
|
361
|
+
_: 'documentAttributeVideo',
|
|
362
|
+
w: obj.width,
|
|
363
|
+
h: obj.height,
|
|
364
|
+
duration: obj.duration,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
attributes.push({
|
|
369
|
+
_: 'documentAttributeImageSize',
|
|
370
|
+
w: obj.width,
|
|
371
|
+
h: obj.height,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
else if (obj.type === 'audio' || obj.type === 'voice') {
|
|
376
|
+
attributes.push({
|
|
377
|
+
_: 'documentAttributeAudio',
|
|
378
|
+
voice: obj.type === 'voice',
|
|
379
|
+
duration: obj.duration ?? 0,
|
|
380
|
+
title: obj.type === 'audio' ? obj.title : '',
|
|
381
|
+
performer: obj.type === 'audio' ? obj.performer : '',
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
attributes.push({
|
|
385
|
+
_: 'documentAttributeFilename',
|
|
386
|
+
fileName: extractFileName(obj.media),
|
|
387
|
+
});
|
|
388
|
+
media = {
|
|
389
|
+
_: 'inputWebDocument',
|
|
390
|
+
url: obj.media,
|
|
391
|
+
mimeType: mime,
|
|
392
|
+
size: 0,
|
|
393
|
+
attributes,
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
else if (obj.type === 'photo') {
|
|
397
|
+
media = fileIdToInputPhoto(obj.media);
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
media = fileIdToInputDocument(obj.media);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
media = obj.media;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
let title = undefined;
|
|
408
|
+
let description = undefined;
|
|
409
|
+
// incredible hacks by durov team.
|
|
410
|
+
// i honestly don't understand why didn't they just
|
|
411
|
+
// make a bunch of types, as they normally do,
|
|
412
|
+
// but whatever.
|
|
413
|
+
// ref: https://github.com/tdlib/td/blob/master/td/telegram/InlineQueriesManager.cpp
|
|
414
|
+
if (obj.type === 'contact') {
|
|
415
|
+
title = obj.lastName?.length ? `${obj.firstName} ${obj.lastName}` : obj.firstName;
|
|
416
|
+
}
|
|
417
|
+
else if (obj.type !== 'sticker') {
|
|
418
|
+
title = obj.title;
|
|
419
|
+
}
|
|
420
|
+
if (obj.type === 'audio') {
|
|
421
|
+
description = obj.performer;
|
|
422
|
+
}
|
|
423
|
+
else if (obj.type === 'geo') {
|
|
424
|
+
description = `${obj.latitude} ${obj.longitude}`;
|
|
425
|
+
}
|
|
426
|
+
else if (obj.type === 'venue') {
|
|
427
|
+
description = obj.address;
|
|
428
|
+
}
|
|
429
|
+
else if (obj.type === 'contact') {
|
|
430
|
+
description = obj.phone;
|
|
431
|
+
}
|
|
432
|
+
else if (obj.type !== 'voice' && obj.type !== 'sticker') {
|
|
433
|
+
description = obj.description;
|
|
434
|
+
}
|
|
435
|
+
if (!media || media._ === 'inputWebDocument') {
|
|
436
|
+
items.push({
|
|
437
|
+
_: 'inputBotInlineResult',
|
|
438
|
+
id: obj.id,
|
|
439
|
+
type: obj.type,
|
|
440
|
+
title,
|
|
441
|
+
description,
|
|
442
|
+
content: media,
|
|
443
|
+
thumb: normalizeThumb(obj, media?.url),
|
|
444
|
+
sendMessage,
|
|
445
|
+
});
|
|
446
|
+
continue;
|
|
447
|
+
}
|
|
448
|
+
if (media._ === 'inputPhoto') {
|
|
449
|
+
items.push({
|
|
450
|
+
_: 'inputBotInlineResultPhoto',
|
|
451
|
+
id: obj.id,
|
|
452
|
+
type: obj.type,
|
|
453
|
+
photo: media,
|
|
454
|
+
sendMessage,
|
|
455
|
+
});
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
items.push({
|
|
459
|
+
_: 'inputBotInlineResultDocument',
|
|
460
|
+
id: obj.id,
|
|
461
|
+
type: obj.type,
|
|
462
|
+
title,
|
|
463
|
+
description,
|
|
464
|
+
document: media,
|
|
465
|
+
sendMessage,
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
return [isGallery && !forceVertical, items];
|
|
469
|
+
}
|
|
470
|
+
//# sourceMappingURL=factories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factories.js","sourceRoot":"","sources":["../../../../../../src/highlevel/types/bots/inline-result/factories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAE7D,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAiB7D;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,EAAU,EAAE,MAAqD;IACrF,MAAM,GAAG,GAAG,MAA8C,CAAA;IAC1D,GAAG,CAAC,EAAE,GAAG,EAAE,CAAA;IACX,GAAG,CAAC,IAAI,GAAG,SAAS,CAAA;IAEpB,OAAO,GAAG,CAAA;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CACf,EAAU,EACV,KAA4D,EAC5D,SAA8D,EAAE;IAEhE,MAAM,GAAG,GAAG,MAA0C,CAAA;IACtD,GAAG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K,SAAS,EAAE;YAC/B,WAAW,GAAG,GAAG,CAAC,KAAK,CAAA;SAC1B;aAAM,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,EAAE;YACvD,WAAW,GAAG,GAAG,CAAC,WAAW,CAAA;SAChC;QAED,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,kBAAkB,EAAE;YAC1C,KAAK,CAAC,IAAI,CAAC;gBACP,CAAC,EAAE,sBAAsB;gBACzB,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,KAAK;gBACL,WAAW;gBACX,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC;gBACtC,WAAW;aACd,CAAC,CAAA;YACF,SAAQ;SACX;QAED,IAAI,KAAK,CAAC,CAAC,KAAK,YAAY,EAAE;YAC1B,KAAK,CAAC,IAAI,CAAC;gBACP,CAAC,EAAE,2BAA2B;gBAC9B,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,KAAK,EAAE,KAAK;gBACZ,WAAW;aACd,CAAC,CAAA;YACF,SAAQ;SACX;QAED,KAAK,CAAC,IAAI,CAAC;YACP,CAAC,EAAE,8BAA8B;YACjC,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,KAAK;YACL,WAAW;YACX,QAAQ,EAAE,KAAK;YACf,WAAW;SACd,CAAC,CAAA;KACL;IAED,OAAO,CAAC,SAAS,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;AAC/C,CAAC","sourcesContent":["import { tl } from '@mtcute/tl'\n\nimport { MtArgumentError } from '../../../../types/errors.js'\nimport { ITelegramClient } from '../../../client.types.js'\nimport { fileIdToInputDocument, fileIdToInputPhoto } from '../../../utils/convert-file-id.js'\nimport { extractFileName } from '../../../utils/file-utils.js'\nimport { BotInlineMessage } from '../inline-message/index.js'\nimport {\n InputInlineResult,\n InputInlineResultArticle,\n InputInlineResultAudio,\n InputInlineResultContact,\n InputInlineResultFile,\n InputInlineResultGame,\n InputInlineResultGeo,\n InputInlineResultGif,\n InputInlineResultPhoto,\n InputInlineResultSticker,\n InputInlineResultVenue,\n InputInlineResultVideo,\n InputInlineResultVoice,\n} from './types.js'\n\n/**\n * Create an inline result containing an article\n *\n * @param id Inline result ID\n * @param params Article\n */\nexport function article(id: string, params: Omit<InputInlineResultArticle, 'type' | 'id'>): InputInlineResultArticle {\n const ret = params as tl.Mutable<InputInlineResultArticle>\n ret.id = id\n ret.type = 'article'\n\n return ret\n}\n\n/**\n * Create an inline result containing a GIF\n *\n * @param id Inline result ID\n * @param media GIF animation\n * @param params Additional parameters\n */\nexport function gif(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultGif, 'type' | 'id' | 'media'> = {},\n): InputInlineResultGif {\n const ret = params as tl.Mutable<InputInlineResultGif>\n ret.id = id\n ret.type = 'gif'\n ret.media = media\n\n return ret\n}\n\n/**\n * Create an inline result containing a video\n *\n * @param id Inline result ID\n * @param media Video\n * @param params Additional parameters\n */\nexport function video(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultVideo, 'type' | 'id' | 'media'>,\n): InputInlineResultVideo {\n const ret = params as tl.Mutable<InputInlineResultVideo>\n ret.id = id\n ret.type = 'video'\n ret.media = media\n\n return ret\n}\n\n/**\n * Create an inline result containing an audio file\n *\n * @param id Inline result ID\n * @param media Audio file\n * @param params Additional parameters\n */\nexport function audio(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultAudio, 'type' | 'id' | 'media'>,\n): InputInlineResultAudio {\n const ret = params as tl.Mutable<InputInlineResultAudio>\n ret.id = id\n ret.type = 'audio'\n ret.media = media\n\n return ret\n}\n\n/**\n * Create an inline result containing a voice note\n *\n * @param id Inline result ID\n * @param media Voice note\n * @param params Additional parameters\n */\nexport function voice(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultVoice, 'type' | 'id' | 'media'>,\n): InputInlineResultVoice {\n const ret = params as tl.Mutable<InputInlineResultVoice>\n ret.id = id\n ret.type = 'voice'\n ret.media = media\n\n return ret\n}\n\n/**\n * Create an inline result containing a photo\n *\n * @param id Inline result ID\n * @param media Photo\n * @param params Additional parameters\n */\nexport function photo(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputPhoto,\n params: Omit<InputInlineResultPhoto, 'type' | 'id' | 'media'> = {},\n): InputInlineResultPhoto {\n const ret = params as tl.Mutable<InputInlineResultPhoto>\n ret.id = id\n ret.type = 'photo'\n ret.media = media\n\n return ret\n}\n\n/**\n * Create an inline result containing a sticker\n *\n * @param id Inline result ID\n * @param media Sticker\n */\nexport function sticker(id: string, media: string | tl.RawInputDocument): InputInlineResultSticker {\n return {\n id,\n type: 'sticker',\n media,\n }\n}\n\n/**\n * Create an inline result containing a document\n * (only PDF and ZIP are supported when using URL)\n *\n * @param id Inline result ID\n * @param media Document\n * @param params Additional parameters\n */\nexport function file(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultFile, 'type' | 'id' | 'media'>,\n): InputInlineResultFile {\n const ret = params as tl.Mutable<InputInlineResultFile>\n ret.id = id\n ret.type = 'file'\n ret.media = media\n\n return ret\n}\n\n/**\n * Create an inline result containing a geolocation\n *\n * @param id Inline result ID\n * @param params Additional parameters\n */\nexport function geo(id: string, params: Omit<InputInlineResultGeo, 'type' | 'id'>): InputInlineResultGeo {\n const ret = params as tl.Mutable<InputInlineResultGeo>\n ret.id = id\n ret.type = 'geo'\n\n return ret\n}\n\n/**\n * Create an inline result containing a venue\n *\n * @param id Inline result ID\n * @param params Venue parameters\n */\nexport function venue(id: string, params: Omit<InputInlineResultVenue, 'type' | 'id'>): InputInlineResultVenue {\n const ret = params as tl.Mutable<InputInlineResultVenue>\n ret.id = id\n ret.type = 'venue'\n\n return ret\n}\n\n/**\n * Create an inline result containing a contact\n *\n * @param id Inline result ID\n * @param params Contact parameters\n */\nexport function contact(id: string, params: Omit<InputInlineResultContact, 'type' | 'id'>): InputInlineResultContact {\n const ret = params as tl.Mutable<InputInlineResultContact>\n ret.id = id\n ret.type = 'contact'\n\n return ret\n}\n\n/**\n * Create an inline result containing a game\n *\n * @param id Inline result ID\n * @param shortName Short name of the game\n * @param params Additional parameters\n */\nexport function game(\n id: string,\n shortName: string,\n params: Omit<InputInlineResultGame, 'type' | 'id' | 'shortName'> = {},\n): InputInlineResultGame {\n const ret = params as tl.Mutable<InputInlineResultGame>\n ret.id = id\n ret.type = 'game'\n ret.shortName = shortName\n\n return ret\n}\n\n/** @internal */\nexport async function _convertToTl(\n client: ITelegramClient,\n results: InputInlineResult[],\n): Promise<[boolean, tl.TypeInputBotInlineResult[]]> {\n const normalizeThumb = (obj: InputInlineResult, fallback?: string): tl.RawInputWebDocument | undefined => {\n if (obj.type !== 'voice' && obj.type !== 'audio' && obj.type !== 'sticker' && obj.type !== 'game') {\n if (!obj.thumb || typeof obj.thumb === 'string') {\n if (!obj.thumb && !fallback) {\n return undefined\n }\n\n return {\n _: 'inputWebDocument',\n size: 0,\n url: obj.thumb || fallback!,\n mimeType: obj.type === 'gif' ? obj.thumbMime ?? obj.mime ?? 'video/mp4' : 'image/jpeg',\n attributes: [],\n }\n }\n\n return obj.thumb\n }\n }\n\n const items: tl.TypeInputBotInlineResult[] = []\n\n let isGallery = false\n let forceVertical = false\n\n for (const obj of results) {\n switch (obj.type) {\n case 'article': {\n forceVertical = true\n\n let sendMessage: tl.TypeInputBotInlineMessage\n\n if (obj.message) {\n sendMessage = await BotInlineMessage._convertToTl(client, obj.message)\n } else {\n let message = obj.title\n const entities: tl.TypeMessageEntity[] = [\n {\n _: 'messageEntityBold',\n offset: 0,\n length: message.length,\n },\n ]\n\n if (obj.url) {\n entities.push({\n _: 'messageEntityTextUrl',\n url: obj.url,\n offset: 0,\n length: message.length,\n })\n }\n\n if (obj.description) {\n message += '\\n' + obj.description\n }\n\n sendMessage = {\n _: 'inputBotInlineMessageText',\n message,\n entities,\n }\n }\n\n items.push({\n _: 'inputBotInlineResult',\n id: obj.id,\n type: obj.type,\n title: obj.title,\n description: obj.description,\n url: obj.hideUrl ? undefined : obj.url,\n content:\n obj.url && obj.hideUrl ?\n {\n _: 'inputWebDocument',\n url: obj.url,\n mimeType: 'text/html',\n size: 0,\n attributes: [],\n } :\n undefined,\n thumb: typeof obj.thumb === 'string' ? normalizeThumb(obj) : obj.thumb,\n sendMessage,\n })\n continue\n }\n case 'game': {\n let sendMessage: tl.TypeInputBotInlineMessage\n\n if (obj.message) {\n sendMessage = await BotInlineMessage._convertToTl(client, obj.message)\n\n if (sendMessage._ !== 'inputBotInlineMessageGame') {\n throw new MtArgumentError('game inline result must contain a game inline message')\n }\n } else {\n sendMessage = {\n _: 'inputBotInlineMessageGame',\n }\n }\n\n items.push({\n _: 'inputBotInlineResultGame',\n id: obj.id,\n shortName: obj.shortName,\n sendMessage,\n })\n continue\n }\n case 'gif':\n case 'photo':\n case 'sticker':\n isGallery = true\n break\n case 'audio':\n case 'contact':\n case 'voice':\n forceVertical = true\n }\n\n let sendMessage: tl.TypeInputBotInlineMessage\n\n if (obj.message) {\n sendMessage = await BotInlineMessage._convertToTl(client, obj.message)\n } else if (obj.type === 'venue') {\n if (obj.latitude && obj.longitude) {\n sendMessage = {\n _: 'inputBotInlineMessageMediaVenue',\n title: obj.title,\n address: obj.address,\n geoPoint: {\n _: 'inputGeoPoint',\n lat: obj.latitude,\n long: obj.longitude,\n },\n provider: '',\n venueId: '',\n venueType: '',\n }\n } else {\n throw new MtArgumentError('message or location (lat&lon) bust be supplied for venue inline result')\n }\n } else if (obj.type === 'video' && obj.isEmbed && typeof obj.media === 'string') {\n sendMessage = {\n _: 'inputBotInlineMessageText',\n message: obj.media,\n }\n } else if (obj.type === 'geo') {\n sendMessage = {\n _: 'inputBotInlineMessageMediaGeo',\n geoPoint: {\n _: 'inputGeoPoint',\n lat: obj.latitude,\n long: obj.longitude,\n },\n }\n } else if (obj.type === 'contact') {\n sendMessage = {\n _: 'inputBotInlineMessageMediaContact',\n phoneNumber: obj.phone,\n firstName: obj.firstName,\n lastName: obj.lastName ?? '',\n vcard: '',\n }\n } else {\n sendMessage = {\n _: 'inputBotInlineMessageMediaAuto',\n message: '',\n }\n }\n\n let media: tl.TypeInputWebDocument | tl.TypeInputDocument | tl.TypeInputPhoto | undefined = undefined\n\n if (obj.type !== 'geo' && obj.type !== 'venue' && obj.type !== 'contact') {\n if (typeof obj.media === 'string') {\n // file id or url\n if (obj.media.match(/^https?:\\/\\//)) {\n if (obj.type === 'sticker') {\n throw new MtArgumentError('sticker inline result cannot contain a URL')\n }\n\n let mime: string\n if (obj.type === 'video') mime = 'video/mp4'\n else if (obj.type === 'audio') {\n mime = obj.mime ?? 'audio/mpeg'\n } else if (obj.type === 'gif') {\n mime = obj.mime ?? 'video/mp4'\n } else if (obj.type === 'voice') mime = 'audio/ogg'\n else if (obj.type === 'file') {\n if (!obj.mime) {\n throw new MtArgumentError('MIME type must be specified for file inline result')\n }\n\n mime = obj.mime\n } else mime = 'image/jpeg'\n\n const attributes: tl.TypeDocumentAttribute[] = []\n\n if (\n (obj.type === 'video' || obj.type === 'gif' || obj.type === 'photo') &&\n obj.width &&\n obj.height\n ) {\n if (obj.type !== 'photo' && obj.duration) {\n attributes.push({\n _: 'documentAttributeVideo',\n w: obj.width,\n h: obj.height,\n duration: obj.duration,\n })\n } else {\n attributes.push({\n _: 'documentAttributeImageSize',\n w: obj.width,\n h: obj.height,\n })\n }\n } else if (obj.type === 'audio' || obj.type === 'voice') {\n attributes.push({\n _: 'documentAttributeAudio',\n voice: obj.type === 'voice',\n duration: obj.duration ?? 0,\n title: obj.type === 'audio' ? obj.title : '',\n performer: obj.type === 'audio' ? obj.performer : '',\n })\n }\n\n attributes.push({\n _: 'documentAttributeFilename',\n fileName: extractFileName(obj.media),\n })\n\n media = {\n _: 'inputWebDocument',\n url: obj.media,\n mimeType: mime,\n size: 0,\n attributes,\n }\n } else if (obj.type === 'photo') {\n media = fileIdToInputPhoto(obj.media)\n } else {\n media = fileIdToInputDocument(obj.media)\n }\n } else {\n media = obj.media\n }\n }\n\n let title: string | undefined = undefined\n let description: string | undefined = undefined\n\n // incredible hacks by durov team.\n // i honestly don't understand why didn't they just\n // make a bunch of types, as they normally do,\n // but whatever.\n // ref: https://github.com/tdlib/td/blob/master/td/telegram/InlineQueriesManager.cpp\n if (obj.type === 'contact') {\n title = obj.lastName?.length ? `${obj.firstName} ${obj.lastName}` : obj.firstName\n } else if (obj.type !== 'sticker') {\n title = obj.title\n }\n\n if (obj.type === 'audio') {\n description = obj.performer\n } else if (obj.type === 'geo') {\n description = `${obj.latitude} ${obj.longitude}`\n } else if (obj.type === 'venue') {\n description = obj.address\n } else if (obj.type === 'contact') {\n description = obj.phone\n } else if (obj.type !== 'voice' && obj.type !== 'sticker') {\n description = obj.description\n }\n\n if (!media || media._ === 'inputWebDocument') {\n items.push({\n _: 'inputBotInlineResult',\n id: obj.id,\n type: obj.type,\n title,\n description,\n content: media,\n thumb: normalizeThumb(obj, media?.url),\n sendMessage,\n })\n continue\n }\n\n if (media._ === 'inputPhoto') {\n items.push({\n _: 'inputBotInlineResultPhoto',\n id: obj.id,\n type: obj.type,\n photo: media,\n sendMessage,\n })\n continue\n }\n\n items.push({\n _: 'inputBotInlineResultDocument',\n id: obj.id,\n type: obj.type,\n title,\n description,\n document: media,\n sendMessage,\n })\n }\n\n return [isGallery && !forceVertical, items]\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/highlevel/types/bots/inline-result/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,SAAS,EAAE,CAAA","sourcesContent":["import * as BotInline from './factories.js'\n\nexport * from './types.js'\nexport { BotInline }\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tl } from '@mtcute/tl';
|
|
2
|
-
import { InputInlineMessage } from '
|
|
2
|
+
import { InputInlineMessage } from '../inline-message/types.js';
|
|
3
3
|
export interface BaseInputInlineResult {
|
|
4
4
|
/**
|
|
5
5
|
* Unique ID of the result
|
|
@@ -415,97 +415,3 @@ export interface InputInlineResultContact extends BaseInputInlineResult {
|
|
|
415
415
|
thumb?: string | tl.RawInputWebDocument;
|
|
416
416
|
}
|
|
417
417
|
export type InputInlineResult = InputInlineResultArticle | InputInlineResultGif | InputInlineResultVideo | InputInlineResultAudio | InputInlineResultVoice | InputInlineResultPhoto | InputInlineResultSticker | InputInlineResultFile | InputInlineResultGeo | InputInlineResultVenue | InputInlineResultGame | InputInlineResultContact;
|
|
418
|
-
export declare namespace BotInline {
|
|
419
|
-
/**
|
|
420
|
-
* Create an inline result containing an article
|
|
421
|
-
*
|
|
422
|
-
* @param id Inline result ID
|
|
423
|
-
* @param params Article
|
|
424
|
-
*/
|
|
425
|
-
function article(id: string, params: Omit<InputInlineResultArticle, 'type' | 'id'>): InputInlineResultArticle;
|
|
426
|
-
/**
|
|
427
|
-
* Create an inline result containing a GIF
|
|
428
|
-
*
|
|
429
|
-
* @param id Inline result ID
|
|
430
|
-
* @param media GIF animation
|
|
431
|
-
* @param params Additional parameters
|
|
432
|
-
*/
|
|
433
|
-
function gif(id: string, media: string | tl.RawInputWebDocument | tl.RawInputDocument, params?: Omit<InputInlineResultGif, 'type' | 'id' | 'media'>): InputInlineResultGif;
|
|
434
|
-
/**
|
|
435
|
-
* Create an inline result containing a video
|
|
436
|
-
*
|
|
437
|
-
* @param id Inline result ID
|
|
438
|
-
* @param media Video
|
|
439
|
-
* @param params Additional parameters
|
|
440
|
-
*/
|
|
441
|
-
function video(id: string, media: string | tl.RawInputWebDocument | tl.RawInputDocument, params: Omit<InputInlineResultVideo, 'type' | 'id' | 'media'>): InputInlineResultVideo;
|
|
442
|
-
/**
|
|
443
|
-
* Create an inline result containing an audio file
|
|
444
|
-
*
|
|
445
|
-
* @param id Inline result ID
|
|
446
|
-
* @param media Audio file
|
|
447
|
-
* @param params Additional parameters
|
|
448
|
-
*/
|
|
449
|
-
function audio(id: string, media: string | tl.RawInputWebDocument | tl.RawInputDocument, params: Omit<InputInlineResultAudio, 'type' | 'id' | 'media'>): InputInlineResultAudio;
|
|
450
|
-
/**
|
|
451
|
-
* Create an inline result containing a voice note
|
|
452
|
-
*
|
|
453
|
-
* @param id Inline result ID
|
|
454
|
-
* @param media Voice note
|
|
455
|
-
* @param params Additional parameters
|
|
456
|
-
*/
|
|
457
|
-
function voice(id: string, media: string | tl.RawInputWebDocument | tl.RawInputDocument, params: Omit<InputInlineResultVoice, 'type' | 'id' | 'media'>): InputInlineResultVoice;
|
|
458
|
-
/**
|
|
459
|
-
* Create an inline result containing a photo
|
|
460
|
-
*
|
|
461
|
-
* @param id Inline result ID
|
|
462
|
-
* @param media Photo
|
|
463
|
-
* @param params Additional parameters
|
|
464
|
-
*/
|
|
465
|
-
function photo(id: string, media: string | tl.RawInputWebDocument | tl.RawInputPhoto, params?: Omit<InputInlineResultPhoto, 'type' | 'id' | 'media'>): InputInlineResultPhoto;
|
|
466
|
-
/**
|
|
467
|
-
* Create an inline result containing a sticker
|
|
468
|
-
*
|
|
469
|
-
* @param id Inline result ID
|
|
470
|
-
* @param media Sticker
|
|
471
|
-
*/
|
|
472
|
-
function sticker(id: string, media: string | tl.RawInputDocument): InputInlineResultSticker;
|
|
473
|
-
/**
|
|
474
|
-
* Create an inline result containing a document
|
|
475
|
-
* (only PDF and ZIP are supported when using URL)
|
|
476
|
-
*
|
|
477
|
-
* @param id Inline result ID
|
|
478
|
-
* @param media Document
|
|
479
|
-
* @param params Additional parameters
|
|
480
|
-
*/
|
|
481
|
-
function file(id: string, media: string | tl.RawInputWebDocument | tl.RawInputDocument, params: Omit<InputInlineResultFile, 'type' | 'id' | 'media'>): InputInlineResultFile;
|
|
482
|
-
/**
|
|
483
|
-
* Create an inline result containing a geolocation
|
|
484
|
-
*
|
|
485
|
-
* @param id Inline result ID
|
|
486
|
-
* @param params Additional parameters
|
|
487
|
-
*/
|
|
488
|
-
function geo(id: string, params: Omit<InputInlineResultGeo, 'type' | 'id'>): InputInlineResultGeo;
|
|
489
|
-
/**
|
|
490
|
-
* Create an inline result containing a venue
|
|
491
|
-
*
|
|
492
|
-
* @param id Inline result ID
|
|
493
|
-
* @param params Venue parameters
|
|
494
|
-
*/
|
|
495
|
-
function venue(id: string, params: Omit<InputInlineResultVenue, 'type' | 'id'>): InputInlineResultVenue;
|
|
496
|
-
/**
|
|
497
|
-
* Create an inline result containing a contact
|
|
498
|
-
*
|
|
499
|
-
* @param id Inline result ID
|
|
500
|
-
* @param params Contact parameters
|
|
501
|
-
*/
|
|
502
|
-
function contact(id: string, params: Omit<InputInlineResultContact, 'type' | 'id'>): InputInlineResultContact;
|
|
503
|
-
/**
|
|
504
|
-
* Create an inline result containing a game
|
|
505
|
-
*
|
|
506
|
-
* @param id Inline result ID
|
|
507
|
-
* @param shortName Short name of the game
|
|
508
|
-
* @param params Additional parameters
|
|
509
|
-
*/
|
|
510
|
-
function game(id: string, shortName: string, params?: Omit<InputInlineResultGame, 'type' | 'id' | 'shortName'>): InputInlineResultGame;
|
|
511
|
-
}
|