From c746588a36315b3c84f7a63dd7b466f5c708f088 Mon Sep 17 00:00:00 2001 From: ehsan Date: Sun, 14 Nov 2021 18:50:52 +0330 Subject: [PATCH] adds documentation to generated types --- .../tl/types-generator/.vscode/settings.json | 6 + gramjs/tl/types-generator/api.d.ts | 29389 ++++++++++++++++ gramjs/tl/types-generator/deno.lock | 43 + .../docs/Parsers/ConstructPageParser.ts | 27 + .../docs/Parsers/MethodPageParser.ts | 51 + .../docs/Parsers/PageParser.ts | 62 + gramjs/tl/types-generator/docs/crawl.ts | 116 + gramjs/tl/types-generator/docs/types.ts | 30 + gramjs/tl/types-generator/docs/utils.ts | 7 + gramjs/tl/types-generator/generate.js | 98 - gramjs/tl/types-generator/import_map.json | 7 + gramjs/tl/types-generator/main.ts | 23 + gramjs/tl/types-generator/template.js | 323 - .../tl-parser/parseRow.test.ts | 69 + .../tl/types-generator/tl-parser/parseRow.ts | 91 + .../tl/types-generator/tl-parser/tl-parser.ts | 46 + gramjs/tl/types-generator/tl-parser/types.ts | 26 + gramjs/tl/types-generator/tl-parser/utils.ts | 43 + .../type-generator/SchemaPreparer.test.ts | 148 + .../type-generator/SchemaPreparer.ts | 165 + .../type-generator/type-gen.ts | 311 + package.json | 1 + 22 files changed, 30661 insertions(+), 421 deletions(-) create mode 100644 gramjs/tl/types-generator/.vscode/settings.json create mode 100644 gramjs/tl/types-generator/api.d.ts create mode 100644 gramjs/tl/types-generator/deno.lock create mode 100644 gramjs/tl/types-generator/docs/Parsers/ConstructPageParser.ts create mode 100644 gramjs/tl/types-generator/docs/Parsers/MethodPageParser.ts create mode 100644 gramjs/tl/types-generator/docs/Parsers/PageParser.ts create mode 100644 gramjs/tl/types-generator/docs/crawl.ts create mode 100644 gramjs/tl/types-generator/docs/types.ts create mode 100644 gramjs/tl/types-generator/docs/utils.ts delete mode 100644 gramjs/tl/types-generator/generate.js create mode 100644 gramjs/tl/types-generator/import_map.json create mode 100644 gramjs/tl/types-generator/main.ts delete mode 100644 gramjs/tl/types-generator/template.js create mode 100644 gramjs/tl/types-generator/tl-parser/parseRow.test.ts create mode 100644 gramjs/tl/types-generator/tl-parser/parseRow.ts create mode 100644 gramjs/tl/types-generator/tl-parser/tl-parser.ts create mode 100644 gramjs/tl/types-generator/tl-parser/types.ts create mode 100644 gramjs/tl/types-generator/tl-parser/utils.ts create mode 100644 gramjs/tl/types-generator/type-generator/SchemaPreparer.test.ts create mode 100644 gramjs/tl/types-generator/type-generator/SchemaPreparer.ts create mode 100644 gramjs/tl/types-generator/type-generator/type-gen.ts diff --git a/gramjs/tl/types-generator/.vscode/settings.json b/gramjs/tl/types-generator/.vscode/settings.json new file mode 100644 index 00000000..c8405f5e --- /dev/null +++ b/gramjs/tl/types-generator/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "deno.enable": true, + "deno.lint": true, + "deno.unstable": true, + "deno.importMap": "./import_map.json" +} diff --git a/gramjs/tl/types-generator/api.d.ts b/gramjs/tl/types-generator/api.d.ts new file mode 100644 index 00000000..1f69e616 --- /dev/null +++ b/gramjs/tl/types-generator/api.d.ts @@ -0,0 +1,29389 @@ +import { BigInteger } from "big-integer"; +import { EntityLike, MessageIDLike } from "../define"; +import { CustomMessage } from "./custom/message"; + +export namespace Api { + type AnyLiteral = Record | void; + type Reader = any; + type Client = any; + type Utils = any; + type X = unknown; + type Type = unknown; + type Bool = boolean; + type int = number; + type double = number; + type float = number; + type int128 = BigInteger; + type int256 = BigInteger; + type long = BigInteger; + type bytes = Buffer; + + abstract class VirtualClass { + static CONSTRUCTOR_ID: number; + static SUBCLASS_OF_ID: number; + static className: string; + static classType: "constructor"|"request"; + CONSTRUCTOR_ID: number; + SUBCLASS_OF_ID: number; + className: string; + classType: "constructor"|"request"; + originalArgs: Args; + constructor(args: Args); + static serializeBytes(data: Buffer|string): Buffer; + static serializeDate(date: Date|number): Buffer; + getBytes(): Buffer; + toJSON(): Args; + } + + abstract class Request extends VirtualClass> { + __response: Response; + static readResult(reader: Reader): Buffer; + resolve(client: Client, utils: Utils): Promise; + } + /** An empty constructor, no user or chat is defined.
*/ + export class InputPeerEmpty extends VirtualClass { + CONSTRUCTOR_id: 2134579434; + SUBCLASS_OF_ID: 3374092470; + classType: "constructor"; + className: "InputPeerEmpty"; + fromReader(reader: Reader): InputPeerEmpty; + } + + /** Defines the current user.
*/ + export class InputPeerSelf extends VirtualClass { + CONSTRUCTOR_id: 2107670217; + SUBCLASS_OF_ID: 3374092470; + classType: "constructor"; + className: "InputPeerSelf"; + fromReader(reader: Reader): InputPeerSelf; + } + + export interface InputPeerChatArgs { + /** Chat idientifier */ + chatId: int; + } + + /** Defines a chat for further interaction.
*/ + export class InputPeerChat extends VirtualClass implements InputPeerChatArgs { + CONSTRUCTOR_id: 396093539; + SUBCLASS_OF_ID: 3374092470; + classType: "constructor"; + className: "InputPeerChat"; + chatId: int; + fromReader(reader: Reader): InputPeerChat; + } + + export interface InputPeerUserArgs { + /** User identifier */ + userId: int; + /** access_hash value from the user constructor */ + accessHash: long; + } + + /** + * Defines a user for further interaction.
+ * @link https://corefork.telegram.org/constructor/user + */ + export class InputPeerUser extends VirtualClass implements InputPeerUserArgs { + CONSTRUCTOR_id: 2072935910; + SUBCLASS_OF_ID: 3374092470; + classType: "constructor"; + className: "InputPeerUser"; + userId: int; + accessHash: long; + fromReader(reader: Reader): InputPeerUser; + } + + export interface InputPeerChannelArgs { + /** Channel identifier */ + channelId: int; + /** access_hash value from the channel constructor */ + accessHash: long; + } + + /** + * Defines a channel for further interaction.
+ * @link https://corefork.telegram.org/constructor/channel + */ + export class InputPeerChannel extends VirtualClass implements InputPeerChannelArgs { + CONSTRUCTOR_id: 548253432; + SUBCLASS_OF_ID: 3374092470; + classType: "constructor"; + className: "InputPeerChannel"; + channelId: int; + accessHash: long; + fromReader(reader: Reader): InputPeerChannel; + } + + export interface InputPeerUserFromMessageArgs { + /** The chat where the user was seen */ + peer: TypeInputPeer; + /** The message ID */ + msgId: MessageIDLike; + /** The identifier of the user that was seen */ + userId: int; + } + + /** + * Defines a min user that was seen in a certain message of a certain chat.
+ * @link https://corefork.telegram.org/api/min + */ + export class InputPeerUserFromMessage extends VirtualClass implements InputPeerUserFromMessageArgs { + CONSTRUCTOR_id: 398123750; + SUBCLASS_OF_ID: 3374092470; + classType: "constructor"; + className: "InputPeerUserFromMessage"; + peer: TypeInputPeer; + msgId: MessageIDLike; + userId: int; + fromReader(reader: Reader): InputPeerUserFromMessage; + } + + export interface InputPeerChannelFromMessageArgs { + /** The chat where the channel's message was seen */ + peer: TypeInputPeer; + /** The message ID */ + msgId: MessageIDLike; + /** The identifier of the channel that was seen */ + channelId: int; + } + + /** + * Defines a min channel that was seen in a certain message of a certain chat.
+ * @link https://corefork.telegram.org/api/min + */ + export class InputPeerChannelFromMessage extends VirtualClass implements InputPeerChannelFromMessageArgs { + CONSTRUCTOR_id: -1667893317; + SUBCLASS_OF_ID: 3374092470; + classType: "constructor"; + className: "InputPeerChannelFromMessage"; + peer: TypeInputPeer; + msgId: MessageIDLike; + channelId: int; + fromReader(reader: Reader): InputPeerChannelFromMessage; + } + + /** Empty constructor, does not define a user.
*/ + export class InputUserEmpty extends VirtualClass { + CONSTRUCTOR_id: -1182234929; + SUBCLASS_OF_ID: 3865689926; + classType: "constructor"; + className: "InputUserEmpty"; + fromReader(reader: Reader): InputUserEmpty; + } + + /** Defines the current user.
*/ + export class InputUserSelf extends VirtualClass { + CONSTRUCTOR_id: -138301121; + SUBCLASS_OF_ID: 3865689926; + classType: "constructor"; + className: "InputUserSelf"; + fromReader(reader: Reader): InputUserSelf; + } + + export interface InputUserArgs { + /** User identifier */ + userId: int; + /** access_hash value from the user constructor */ + accessHash: long; + } + + /** + * Defines a user for further interaction.
+ * @link https://corefork.telegram.org/constructor/user + */ + export class InputUser extends VirtualClass implements InputUserArgs { + CONSTRUCTOR_id: -668391402; + SUBCLASS_OF_ID: 3865689926; + classType: "constructor"; + className: "InputUser"; + userId: int; + accessHash: long; + fromReader(reader: Reader): InputUser; + } + + export interface InputUserFromMessageArgs { + /** The chat where the user was seen */ + peer: TypeInputPeer; + /** The message ID */ + msgId: MessageIDLike; + /** The identifier of the user that was seen */ + userId: int; + } + + /** + * Defines a min user that was seen in a certain message of a certain chat.
+ * @link https://corefork.telegram.org/api/min + */ + export class InputUserFromMessage extends VirtualClass implements InputUserFromMessageArgs { + CONSTRUCTOR_id: 756118935; + SUBCLASS_OF_ID: 3865689926; + classType: "constructor"; + className: "InputUserFromMessage"; + peer: TypeInputPeer; + msgId: MessageIDLike; + userId: int; + fromReader(reader: Reader): InputUserFromMessage; + } + + export interface InputPhoneContactArgs { + /** User identifier on the client */ + clientId: long; + /** Phone number */ + phone: string; + /** Contact's first name */ + firstName: string; + /** Contact's last name */ + lastName: string; + } + + /** + * Phone contact. The client_id is just an arbitrary contact ID: it should be set, for example, to an incremental number when using contacts.importContacts, in order to retry importing only the contacts that weren't imported successfully.
+ * @link https://corefork.telegram.org/method/contacts.importContacts + * @link https://corefork.telegram.org/method/contacts.addContact + */ + export class InputPhoneContact extends VirtualClass implements InputPhoneContactArgs { + CONSTRUCTOR_id: -208488460; + SUBCLASS_OF_ID: 2926144130; + classType: "constructor"; + className: "InputPhoneContact"; + clientId: long; + phone: string; + firstName: string; + lastName: string; + fromReader(reader: Reader): InputPhoneContact; + } + + export interface InputFileArgs { + /** Random file identifier created by the client */ + id: long; + /** Number of parts saved */ + parts: int; + /** Full name of the file */ + name: string; + /** In case the file's md5-hash was passed, contents of the file will be checked prior to use */ + md5Checksum: string; + } + + /** + * Defines a file saved in parts using the method upload.saveFilePart.
+ * @link https://corefork.telegram.org/method/upload.saveFilePart + */ + export class InputFile extends VirtualClass implements InputFileArgs { + CONSTRUCTOR_id: -181407105; + SUBCLASS_OF_ID: 3882180383; + classType: "constructor"; + className: "InputFile"; + id: long; + parts: int; + name: string; + md5Checksum: string; + fromReader(reader: Reader): InputFile; + } + + export interface InputFileBigArgs { + /** Random file id, created by the client */ + id: long; + /** Number of parts saved */ + parts: int; + /** Full file name */ + name: string; + } + + /** + * Assigns a big file (over 10Mb in size), saved in part using the method upload.saveBigFilePart.
+ * @link https://corefork.telegram.org/method/upload.saveBigFilePart + */ + export class InputFileBig extends VirtualClass implements InputFileBigArgs { + CONSTRUCTOR_id: -95482955; + SUBCLASS_OF_ID: 3882180383; + classType: "constructor"; + className: "InputFileBig"; + id: long; + parts: int; + name: string; + fromReader(reader: Reader): InputFileBig; + } + + /** Empty media content of a message.
*/ + export class InputMediaEmpty extends VirtualClass { + CONSTRUCTOR_id: -1771768449; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaEmpty"; + fromReader(reader: Reader): InputMediaEmpty; + } + + export interface InputMediaUploadedPhotoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The uploaded file */ + file: TypeInputFile; + /** Attached mask stickers */ + stickers?: TypeInputDocument[]; + /** Time to live in seconds of self-destructing photo */ + ttlSeconds?: int; + } + + /** + * Photo
+ * @link https://corefork.telegram.org/api/files + */ + export class InputMediaUploadedPhoto extends VirtualClass implements InputMediaUploadedPhotoArgs { + CONSTRUCTOR_id: 505969924; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaUploadedPhoto"; + flags: number; + file: TypeInputFile; + stickers?: TypeInputDocument[]; + ttlSeconds?: int; + fromReader(reader: Reader): InputMediaUploadedPhoto; + } + + export interface InputMediaPhotoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Photo to be forwarded */ + id: TypeInputPhoto; + /** Time to live in seconds of self-destructing photo */ + ttlSeconds?: int; + } + + /** Forwarded photo
*/ + export class InputMediaPhoto extends VirtualClass implements InputMediaPhotoArgs { + CONSTRUCTOR_id: -1279654347; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaPhoto"; + flags: number; + id: TypeInputPhoto; + ttlSeconds?: int; + fromReader(reader: Reader): InputMediaPhoto; + } + + export interface InputMediaGeoPointArgs { + /** GeoPoint */ + geoPoint: TypeInputGeoPoint; + } + + /** Map.
*/ + export class InputMediaGeoPoint extends VirtualClass implements InputMediaGeoPointArgs { + CONSTRUCTOR_id: -104578748; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaGeoPoint"; + geoPoint: TypeInputGeoPoint; + fromReader(reader: Reader): InputMediaGeoPoint; + } + + export interface InputMediaContactArgs { + /** Phone number */ + phoneNumber: string; + /** Contact's first name */ + firstName: string; + /** Contact's last name */ + lastName: string; + /** Contact vcard */ + vcard: string; + } + + /** Phonebook contact
*/ + export class InputMediaContact extends VirtualClass implements InputMediaContactArgs { + CONSTRUCTOR_id: -122978821; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaContact"; + phoneNumber: string; + firstName: string; + lastName: string; + vcard: string; + fromReader(reader: Reader): InputMediaContact; + } + + export interface InputMediaUploadedDocumentArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the specified document is a video file with no audio tracks (a GIF animation (even as MPEG4), for example) */ + nosoundVideo?: true; + /** Force the media file to be uploaded as document */ + forceFile?: true; + /** The uploaded file */ + file: TypeInputFile; + /** Thumbnail of the document, uploaded as for the file */ + thumb?: TypeInputFile; + /** MIME type of document */ + mimeType: string; + /** Attributes that specify the type of the document (video, audio, voice, sticker, etc.) */ + attributes: TypeDocumentAttribute[]; + /** Attached stickers */ + stickers?: TypeInputDocument[]; + /** Time to live in seconds of self-destructing document */ + ttlSeconds?: int; + } + + /** + * New document
+ * @link https://corefork.telegram.org/api/files + */ + export class InputMediaUploadedDocument extends VirtualClass implements InputMediaUploadedDocumentArgs { + CONSTRUCTOR_id: 1530447553; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaUploadedDocument"; + flags: number; + nosoundVideo?: true; + forceFile?: true; + file: TypeInputFile; + thumb?: TypeInputFile; + mimeType: string; + attributes: TypeDocumentAttribute[]; + stickers?: TypeInputDocument[]; + ttlSeconds?: int; + fromReader(reader: Reader): InputMediaUploadedDocument; + } + + export interface InputMediaDocumentArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The document to be forwarded. */ + id: TypeInputDocument; + /** Time to live of self-destructing document */ + ttlSeconds?: int; + /** Text query or emoji that was used by the user to find this sticker or GIF: used to improve search result relevance. */ + query?: string; + } + + /** Forwarded document
*/ + export class InputMediaDocument extends VirtualClass implements InputMediaDocumentArgs { + CONSTRUCTOR_id: 860303448; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaDocument"; + flags: number; + id: TypeInputDocument; + ttlSeconds?: int; + query?: string; + fromReader(reader: Reader): InputMediaDocument; + } + + export interface InputMediaVenueArgs { + /** Geolocation */ + geoPoint: TypeInputGeoPoint; + /** Venue name */ + title: string; + /** Physical address of the venue */ + address: string; + /** Venue provider: currently only "foursquare" needs to be supported */ + provider: string; + /** Venue ID in the provider's database */ + venueId: string; + /** Venue type in the provider's database */ + venueType: string; + } + + /** Can be used to send a venue geolocation.
*/ + export class InputMediaVenue extends VirtualClass implements InputMediaVenueArgs { + CONSTRUCTOR_id: -1052959727; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaVenue"; + geoPoint: TypeInputGeoPoint; + title: string; + address: string; + provider: string; + venueId: string; + venueType: string; + fromReader(reader: Reader): InputMediaVenue; + } + + export interface InputMediaPhotoExternalArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** URL of the photo */ + url: string; + /** Self-destruct time to live of photo */ + ttlSeconds?: int; + } + + /** New photo that will be uploaded by the server using the specified URL
*/ + export class InputMediaPhotoExternal extends VirtualClass implements InputMediaPhotoExternalArgs { + CONSTRUCTOR_id: -440664550; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaPhotoExternal"; + flags: number; + url: string; + ttlSeconds?: int; + fromReader(reader: Reader): InputMediaPhotoExternal; + } + + export interface InputMediaDocumentExternalArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** URL of the document */ + url: string; + /** Self-destruct time to live of document */ + ttlSeconds?: int; + } + + /** Document that will be downloaded by the telegram servers
*/ + export class InputMediaDocumentExternal extends VirtualClass implements InputMediaDocumentExternalArgs { + CONSTRUCTOR_id: -78455655; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaDocumentExternal"; + flags: number; + url: string; + ttlSeconds?: int; + fromReader(reader: Reader): InputMediaDocumentExternal; + } + + export interface InputMediaGameArgs { + /** The game to forward */ + id: TypeInputGame; + } + + /** A game
*/ + export class InputMediaGame extends VirtualClass implements InputMediaGameArgs { + CONSTRUCTOR_id: -750828557; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaGame"; + id: TypeInputGame; + fromReader(reader: Reader): InputMediaGame; + } + + export interface InputMediaInvoiceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Product name, 1-32 characters */ + title: string; + /** Product description, 1-255 characters */ + description: string; + /** URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. */ + photo?: TypeInputWebDocument; + /** The actual invoice */ + invoice: TypeInvoice; + /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */ + payload: bytes; + /** Payments provider token, obtained via Botfather */ + provider: string; + /** JSON-encoded data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. */ + providerData: TypeDataJSON; + /** Start parameter */ + startParam?: string; + } + + /** + * Generated invoice of a bot payment
+ * @link https://corefork.telegram.org/bots/payments + */ + export class InputMediaInvoice extends VirtualClass implements InputMediaInvoiceArgs { + CONSTRUCTOR_id: -646342540; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaInvoice"; + flags: number; + title: string; + description: string; + photo?: TypeInputWebDocument; + invoice: TypeInvoice; + payload: bytes; + provider: string; + providerData: TypeDataJSON; + startParam?: string; + fromReader(reader: Reader): InputMediaInvoice; + } + + export interface InputMediaGeoLiveArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether sending of the geolocation was stopped */ + stopped?: true; + /** Current geolocation */ + geoPoint: TypeInputGeoPoint; + /** For live locations, a direction in which the location moves, in degrees; 1-360. */ + heading?: int; + /** Validity period of the current location */ + period?: int; + /** For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000) */ + proximityNotificationRadius?: int; + } + + /** + * Live geolocation
+ * @link https://corefork.telegram.org/api/live-location + */ + export class InputMediaGeoLive extends VirtualClass implements InputMediaGeoLiveArgs { + CONSTRUCTOR_id: -1759532989; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaGeoLive"; + flags: number; + stopped?: true; + geoPoint: TypeInputGeoPoint; + heading?: int; + period?: int; + proximityNotificationRadius?: int; + fromReader(reader: Reader): InputMediaGeoLive; + } + + export interface InputMediaPollArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The poll to send */ + poll: TypePoll; + /** Correct answer IDs (for quiz polls) */ + correctAnswers?: bytes[]; + /** Explanation of quiz solution */ + solution?: string; + /** Message entities for styled text */ + solutionEntities?: TypeMessageEntity[]; + } + + /** + * A poll
+ * @link https://corefork.telegram.org/api/entities + */ + export class InputMediaPoll extends VirtualClass implements InputMediaPollArgs { + CONSTRUCTOR_id: 261416433; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaPoll"; + flags: number; + poll: TypePoll; + correctAnswers?: bytes[]; + solution?: string; + solutionEntities?: TypeMessageEntity[]; + fromReader(reader: Reader): InputMediaPoll; + } + + export interface InputMediaDiceArgs { + /** The emoji, for now 🏀, 🎲 and 🎯 are supported */ + emoticon: string; + } + + /** + * Send a dice-based animated sticker
+ * @link https://corefork.telegram.org/api/dice + */ + export class InputMediaDice extends VirtualClass implements InputMediaDiceArgs { + CONSTRUCTOR_id: -428884101; + SUBCLASS_OF_ID: 4210575092; + classType: "constructor"; + className: "InputMediaDice"; + emoticon: string; + fromReader(reader: Reader): InputMediaDice; + } + + /** Empty constructor, remove group photo.
*/ + export class InputChatPhotoEmpty extends VirtualClass { + CONSTRUCTOR_id: 480546647; + SUBCLASS_OF_ID: 3572182388; + classType: "constructor"; + className: "InputChatPhotoEmpty"; + fromReader(reader: Reader): InputChatPhotoEmpty; + } + + export interface InputChatUploadedPhotoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** File saved in parts using the method upload.saveFilePart */ + file?: TypeInputFile; + /** Square video for animated profile picture */ + video?: TypeInputFile; + /** Timestamp that should be shown as static preview to the user (seconds) */ + videoStartTs?: double; + } + + /** + * New photo to be set as group profile photo.
+ * @link https://corefork.telegram.org/method/upload.saveFilePart + */ + export class InputChatUploadedPhoto extends VirtualClass implements InputChatUploadedPhotoArgs { + CONSTRUCTOR_id: -968723890; + SUBCLASS_OF_ID: 3572182388; + classType: "constructor"; + className: "InputChatUploadedPhoto"; + flags: number; + file?: TypeInputFile; + video?: TypeInputFile; + videoStartTs?: double; + fromReader(reader: Reader): InputChatUploadedPhoto; + } + + export interface InputChatPhotoArgs { + /** Existing photo */ + id: TypeInputPhoto; + } + + /** Existing photo to be set as a chat profile photo.
*/ + export class InputChatPhoto extends VirtualClass implements InputChatPhotoArgs { + CONSTRUCTOR_id: -1991004873; + SUBCLASS_OF_ID: 3572182388; + classType: "constructor"; + className: "InputChatPhoto"; + id: TypeInputPhoto; + fromReader(reader: Reader): InputChatPhoto; + } + + /** Empty GeoPoint constructor.
*/ + export class InputGeoPointEmpty extends VirtualClass { + CONSTRUCTOR_id: -457104426; + SUBCLASS_OF_ID: 70308389; + classType: "constructor"; + className: "InputGeoPointEmpty"; + fromReader(reader: Reader): InputGeoPointEmpty; + } + + export interface InputGeoPointArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Latitide */ + lat: double; + /** Longtitude */ + long: double; + /** The estimated horizontal accuracy of the location, in meters; as defined by the sender. */ + accuracyRadius?: int; + } + + /** Defines a GeoPoint by its coordinates.
*/ + export class InputGeoPoint extends VirtualClass implements InputGeoPointArgs { + CONSTRUCTOR_id: 1210199983; + SUBCLASS_OF_ID: 70308389; + classType: "constructor"; + className: "InputGeoPoint"; + flags: number; + lat: double; + long: double; + accuracyRadius?: int; + fromReader(reader: Reader): InputGeoPoint; + } + + /** Empty constructor.
*/ + export class InputPhotoEmpty extends VirtualClass { + CONSTRUCTOR_id: 483901197; + SUBCLASS_OF_ID: 2221106144; + classType: "constructor"; + className: "InputPhotoEmpty"; + fromReader(reader: Reader): InputPhotoEmpty; + } + + export interface InputPhotoArgs { + /** Photo identifier */ + id: long; + /** access_hash value from the photo constructor */ + accessHash: long; + /** File reference */ + fileReference: bytes; + } + + /** + * Defines a photo for further interaction.
+ * @link https://corefork.telegram.org/constructor/photo + * @link https://corefork.telegram.org/api/file_reference + */ + export class InputPhoto extends VirtualClass implements InputPhotoArgs { + CONSTRUCTOR_id: 1001634122; + SUBCLASS_OF_ID: 2221106144; + classType: "constructor"; + className: "InputPhoto"; + id: long; + accessHash: long; + fileReference: bytes; + fromReader(reader: Reader): InputPhoto; + } + + export interface InputFileLocationArgs { + /** Server volume */ + volumeId: long; + /** File identifier */ + localId: int; + /** Check sum to access the file */ + secret: long; + /** File reference */ + fileReference: bytes; + } + + /** + * DEPRECATED location of a photo
+ * @link https://corefork.telegram.org/api/file_reference + */ + export class InputFileLocation extends VirtualClass implements InputFileLocationArgs { + CONSTRUCTOR_id: -539317279; + SUBCLASS_OF_ID: 354669666; + classType: "constructor"; + className: "InputFileLocation"; + volumeId: long; + localId: int; + secret: long; + fileReference: bytes; + fromReader(reader: Reader): InputFileLocation; + } + + export interface InputEncryptedFileLocationArgs { + /** File ID, id parameter value from encryptedFile */ + id: long; + /** Checksum, access_hash parameter value from encryptedFile */ + accessHash: long; + } + + /** + * Location of encrypted secret chat file.
+ * @link https://corefork.telegram.org/constructor/encryptedFile + */ + export class InputEncryptedFileLocation extends VirtualClass implements InputEncryptedFileLocationArgs { + CONSTRUCTOR_id: -182231723; + SUBCLASS_OF_ID: 354669666; + classType: "constructor"; + className: "InputEncryptedFileLocation"; + id: long; + accessHash: long; + fromReader(reader: Reader): InputEncryptedFileLocation; + } + + export interface InputDocumentFileLocationArgs { + /** Document ID */ + id: long; + /** access_hash parameter from the document constructor */ + accessHash: long; + /** File reference */ + fileReference: bytes; + /** Thumbnail size to download the thumbnail */ + thumbSize: string; + } + + /** + * Document location (video, voice, audio, basically every type except photo)
+ * @link https://corefork.telegram.org/constructor/document + * @link https://corefork.telegram.org/api/file_reference + */ + export class InputDocumentFileLocation extends VirtualClass implements InputDocumentFileLocationArgs { + CONSTRUCTOR_id: -1160743548; + SUBCLASS_OF_ID: 354669666; + classType: "constructor"; + className: "InputDocumentFileLocation"; + id: long; + accessHash: long; + fileReference: bytes; + thumbSize: string; + fromReader(reader: Reader): InputDocumentFileLocation; + } + + export interface InputSecureFileLocationArgs { + /** File ID, id parameter value from secureFile */ + id: long; + /** Checksum, access_hash parameter value from secureFile */ + accessHash: long; + } + + /** + * Location of encrypted telegram passport file.
+ * @link https://corefork.telegram.org/constructor/secureFile + * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport + */ + export class InputSecureFileLocation extends VirtualClass implements InputSecureFileLocationArgs { + CONSTRUCTOR_id: -876089816; + SUBCLASS_OF_ID: 354669666; + classType: "constructor"; + className: "InputSecureFileLocation"; + id: long; + accessHash: long; + fromReader(reader: Reader): InputSecureFileLocation; + } + + /** Empty constructor for takeout
*/ + export class InputTakeoutFileLocation extends VirtualClass { + CONSTRUCTOR_id: 700340377; + SUBCLASS_OF_ID: 354669666; + classType: "constructor"; + className: "InputTakeoutFileLocation"; + fromReader(reader: Reader): InputTakeoutFileLocation; + } + + export interface InputPhotoFileLocationArgs { + /** Photo ID, obtained from the photo object */ + id: long; + /** Photo's access hash, obtained from the photo object */ + accessHash: long; + /** File reference */ + fileReference: bytes; + /** The PhotoSize to download: must be set to the type field of the desired PhotoSize object of the photo */ + thumbSize: string; + } + + /** + * Use this object to download a photo with upload.getFile method
+ * @link https://corefork.telegram.org/constructor/photo + * @link https://corefork.telegram.org/api/file_reference + * @link https://corefork.telegram.org/type/PhotoSize + * @link https://corefork.telegram.org/method/upload.getFile + */ + export class InputPhotoFileLocation extends VirtualClass implements InputPhotoFileLocationArgs { + CONSTRUCTOR_id: 1075322878; + SUBCLASS_OF_ID: 354669666; + classType: "constructor"; + className: "InputPhotoFileLocation"; + id: long; + accessHash: long; + fileReference: bytes; + thumbSize: string; + fromReader(reader: Reader): InputPhotoFileLocation; + } + + export interface InputPhotoLegacyFileLocationArgs { + /** Photo ID */ + id: long; + /** Access hash */ + accessHash: long; + /** File reference */ + fileReference: bytes; + /** Volume ID */ + volumeId: long; + /** Local ID */ + localId: int; + /** Secret */ + secret: long; + } + + /** DEPRECATED legacy photo file location
*/ + export class InputPhotoLegacyFileLocation extends VirtualClass implements InputPhotoLegacyFileLocationArgs { + CONSTRUCTOR_id: -667654413; + SUBCLASS_OF_ID: 354669666; + classType: "constructor"; + className: "InputPhotoLegacyFileLocation"; + id: long; + accessHash: long; + fileReference: bytes; + volumeId: long; + localId: int; + secret: long; + fromReader(reader: Reader): InputPhotoLegacyFileLocation; + } + + export interface InputPeerPhotoFileLocationArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to download the high-quality version of the picture */ + big?: true; + /** The peer whose profile picture should be downloaded */ + peer: TypeInputPeer; + /** Photo ID */ + photoId: long; + } + + /** Location of profile photo of channel/group/supergroup/user
*/ + export class InputPeerPhotoFileLocation extends VirtualClass implements InputPeerPhotoFileLocationArgs { + CONSTRUCTOR_id: 925204121; + SUBCLASS_OF_ID: 354669666; + classType: "constructor"; + className: "InputPeerPhotoFileLocation"; + flags: number; + big?: true; + peer: TypeInputPeer; + photoId: long; + fromReader(reader: Reader): InputPeerPhotoFileLocation; + } + + export interface InputStickerSetThumbArgs { + /** Sticker set */ + stickerset: TypeInputStickerSet; + /** Thumbnail version */ + thumbVersion: int; + } + + /** + * Location of stickerset thumbnail (see files)
+ * @link https://corefork.telegram.org/api/files + */ + export class InputStickerSetThumb extends VirtualClass implements InputStickerSetThumbArgs { + CONSTRUCTOR_id: -1652231205; + SUBCLASS_OF_ID: 354669666; + classType: "constructor"; + className: "InputStickerSetThumb"; + stickerset: TypeInputStickerSet; + thumbVersion: int; + fromReader(reader: Reader): InputStickerSetThumb; + } + + export interface InputGroupCallStreamArgs { + /** Flags, see TL conditional fields */ + call: TypeInputGroupCall; + /** Livestream info */ + timeMs: long; + /** Timestamp in milliseconds */ + scale: int; + } + + /** Chunk of a livestream
*/ + export class InputGroupCallStream extends VirtualClass implements InputGroupCallStreamArgs { + CONSTRUCTOR_id: -1146808775; + SUBCLASS_OF_ID: 354669666; + classType: "constructor"; + className: "InputGroupCallStream"; + call: TypeInputGroupCall; + timeMs: long; + scale: int; + fromReader(reader: Reader): InputGroupCallStream; + } + + export interface PeerUserArgs { + /** User identifier */ + userId: int; + } + + /** Chat partner
*/ + export class PeerUser extends VirtualClass implements PeerUserArgs { + CONSTRUCTOR_id: -1649296275; + SUBCLASS_OF_ID: 47470215; + classType: "constructor"; + className: "PeerUser"; + userId: int; + fromReader(reader: Reader): PeerUser; + } + + export interface PeerChatArgs { + /** Group identifier */ + chatId: int; + } + + /** Group.
*/ + export class PeerChat extends VirtualClass implements PeerChatArgs { + CONSTRUCTOR_id: -1160714821; + SUBCLASS_OF_ID: 47470215; + classType: "constructor"; + className: "PeerChat"; + chatId: int; + fromReader(reader: Reader): PeerChat; + } + + export interface PeerChannelArgs { + /** Channel ID */ + channelId: int; + } + + /** Channel/supergroup
*/ + export class PeerChannel extends VirtualClass implements PeerChannelArgs { + CONSTRUCTOR_id: -1109531342; + SUBCLASS_OF_ID: 47470215; + classType: "constructor"; + className: "PeerChannel"; + channelId: int; + fromReader(reader: Reader): PeerChannel; + } + + export interface UserEmptyArgs { + /** User identifier or 0 */ + id: int; + } + + /** Empty constructor, non-existent user.
*/ + export class UserEmpty extends VirtualClass implements UserEmptyArgs { + CONSTRUCTOR_id: 537022650; + SUBCLASS_OF_ID: 765557111; + classType: "constructor"; + className: "UserEmpty"; + id: int; + fromReader(reader: Reader): UserEmpty; + } + + export interface UserArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this user indicates the currently logged in user */ + self?: true; + /** Whether this user is a contact */ + contact?: true; + /** Whether this user is a mutual contact */ + mutualContact?: true; + /** Whether the account of this user was deleted */ + deleted?: true; + /** Is this user a bot? */ + bot?: true; + /** Can the bot see all messages in groups? */ + botChatHistory?: true; + /** Can the bot be added to groups? */ + botNochats?: true; + /** Whether this user is verified */ + verified?: true; + /** Access to this user must be restricted for the reason specified in restriction_reason */ + restricted?: true; + /** See min */ + min?: true; + /** Whether the bot can request our geolocation in inline mode */ + botInlineGeo?: true; + /** Whether this is an official support user */ + support?: true; + /** This may be a scam user */ + scam?: true; + /** If set, the profile picture for this user should be refetched */ + applyMinPhoto?: true; + /** If set, this user was reported by many users as a fake or scam user: be careful when interacting with them. */ + fake?: true; + /** ID of the user */ + id: int; + /** Access hash of the user */ + accessHash?: long; + /** First name */ + firstName?: string; + /** Last name */ + lastName?: string; + /** Username */ + username?: string; + /** Phone number */ + phone?: string; + /** Profile picture of user */ + photo?: TypeUserProfilePhoto; + /** Online status of user */ + status?: TypeUserStatus; + /** Version of the bot_info field in userFull, incremented every time it changes */ + botInfoVersion?: int; + /** Contains the reason why access to this user must be restricted. */ + restrictionReason?: TypeRestrictionReason[]; + /** Inline placeholder for this inline bot */ + botInlinePlaceholder?: string; + /** Language code of the user */ + langCode?: string; + } + + /** + * Indicates info about a certain user
+ * @link https://corefork.telegram.org/api/min + * @link https://corefork.telegram.org/constructor/userFull + */ + export class User extends VirtualClass implements UserArgs { + CONSTRUCTOR_id: -1820043071; + SUBCLASS_OF_ID: 765557111; + classType: "constructor"; + className: "User"; + flags: number; + self?: true; + contact?: true; + mutualContact?: true; + deleted?: true; + bot?: true; + botChatHistory?: true; + botNochats?: true; + verified?: true; + restricted?: true; + min?: true; + botInlineGeo?: true; + support?: true; + scam?: true; + applyMinPhoto?: true; + fake?: true; + id: int; + accessHash?: long; + firstName?: string; + lastName?: string; + username?: string; + phone?: string; + photo?: TypeUserProfilePhoto; + status?: TypeUserStatus; + botInfoVersion?: int; + restrictionReason?: TypeRestrictionReason[]; + botInlinePlaceholder?: string; + langCode?: string; + fromReader(reader: Reader): User; + } + + /** Profile photo has not been set, or was hidden.
*/ + export class UserProfilePhotoEmpty extends VirtualClass { + CONSTRUCTOR_id: 1326562017; + SUBCLASS_OF_ID: 3325267837; + classType: "constructor"; + className: "UserProfilePhotoEmpty"; + fromReader(reader: Reader): UserProfilePhotoEmpty; + } + + export interface UserProfilePhotoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether an animated profile picture is available for this user */ + hasVideo?: true; + /** Identifier of the respective photo
Parameter added in Layer 2 */ + photoId: long; + /** Stripped thumbnail */ + strippedThumb?: bytes; + /** DC ID where the photo is stored */ + dcId: int; + } + + /** + * User profile photo.
+ * @link https://corefork.telegram.org/api/files + * @link https://corefork.telegram.org/api/layers + */ + export class UserProfilePhoto extends VirtualClass implements UserProfilePhotoArgs { + CONSTRUCTOR_id: -2100168954; + SUBCLASS_OF_ID: 3325267837; + classType: "constructor"; + className: "UserProfilePhoto"; + flags: number; + hasVideo?: true; + photoId: long; + strippedThumb?: bytes; + dcId: int; + fromReader(reader: Reader): UserProfilePhoto; + } + + /** User status has not been set yet.
*/ + export class UserStatusEmpty extends VirtualClass { + CONSTRUCTOR_id: 164646985; + SUBCLASS_OF_ID: 1527477310; + classType: "constructor"; + className: "UserStatusEmpty"; + fromReader(reader: Reader): UserStatusEmpty; + } + + export interface UserStatusOnlineArgs { + /** Time to expiration of the current online status */ + expires: int; + } + + /** Online status of the user.
*/ + export class UserStatusOnline extends VirtualClass implements UserStatusOnlineArgs { + CONSTRUCTOR_id: -306628279; + SUBCLASS_OF_ID: 1527477310; + classType: "constructor"; + className: "UserStatusOnline"; + expires: int; + fromReader(reader: Reader): UserStatusOnline; + } + + export interface UserStatusOfflineArgs { + /** Time the user was last seen online */ + wasOnline: int; + } + + /** The user's offline status.
*/ + export class UserStatusOffline extends VirtualClass implements UserStatusOfflineArgs { + CONSTRUCTOR_id: -7573441; + SUBCLASS_OF_ID: 1527477310; + classType: "constructor"; + className: "UserStatusOffline"; + wasOnline: int; + fromReader(reader: Reader): UserStatusOffline; + } + + /** Online status: last seen recently
*/ + export class UserStatusRecently extends VirtualClass { + CONSTRUCTOR_id: -496024847; + SUBCLASS_OF_ID: 1527477310; + classType: "constructor"; + className: "UserStatusRecently"; + fromReader(reader: Reader): UserStatusRecently; + } + + /** Online status: last seen last week
*/ + export class UserStatusLastWeek extends VirtualClass { + CONSTRUCTOR_id: 129960444; + SUBCLASS_OF_ID: 1527477310; + classType: "constructor"; + className: "UserStatusLastWeek"; + fromReader(reader: Reader): UserStatusLastWeek; + } + + /** Online status: last seen last month
*/ + export class UserStatusLastMonth extends VirtualClass { + CONSTRUCTOR_id: 2011940674; + SUBCLASS_OF_ID: 1527477310; + classType: "constructor"; + className: "UserStatusLastMonth"; + fromReader(reader: Reader): UserStatusLastMonth; + } + + export interface ChatEmptyArgs { + /** Group identifier */ + id: int; + } + + /** Empty constructor, group doesn't exist
*/ + export class ChatEmpty extends VirtualClass implements ChatEmptyArgs { + CONSTRUCTOR_id: -1683826688; + SUBCLASS_OF_ID: 3316604308; + classType: "constructor"; + className: "ChatEmpty"; + id: int; + fromReader(reader: Reader): ChatEmpty; + } + + export interface ChatArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the current user is the creator of the group */ + creator?: true; + /** Whether the current user was kicked from the group */ + kicked?: true; + /** Whether the current user has left the group */ + left?: true; + /** Whether the group was migrated */ + deactivated?: true; + /** Whether a group call is currently active */ + callActive?: true; + /** Whether there's anyone in the group call */ + callNotEmpty?: true; + /** ID of the group */ + id: int; + /** Title */ + title: string; + /** Chat photo */ + photo: TypeChatPhoto; + /** Participant count */ + participantsCount: int; + /** Date of creation of the group */ + date: int; + /** Used in basic groups to reorder updates and make sure that all of them were received. */ + version: int; + /** Means this chat was upgraded to a supergroup */ + migratedTo?: TypeInputChannel; + /** Admin rights of the user in the group */ + adminRights?: TypeChatAdminRights; + /** Default banned rights of all users in the group */ + defaultBannedRights?: TypeChatBannedRights; + } + + /** + * Info about a group
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/rights + */ + export class Chat extends VirtualClass implements ChatArgs { + CONSTRUCTOR_id: 1004149726; + SUBCLASS_OF_ID: 3316604308; + classType: "constructor"; + className: "Chat"; + flags: number; + creator?: true; + kicked?: true; + left?: true; + deactivated?: true; + callActive?: true; + callNotEmpty?: true; + id: int; + title: string; + photo: TypeChatPhoto; + participantsCount: int; + date: int; + version: int; + migratedTo?: TypeInputChannel; + adminRights?: TypeChatAdminRights; + defaultBannedRights?: TypeChatBannedRights; + fromReader(reader: Reader): Chat; + } + + export interface ChatForbiddenArgs { + /** User identifier */ + id: int; + /** Group name */ + title: string; + } + + /** A group to which the user has no access. E.g., because the user was kicked from the group.
*/ + export class ChatForbidden extends VirtualClass implements ChatForbiddenArgs { + CONSTRUCTOR_id: 120753115; + SUBCLASS_OF_ID: 3316604308; + classType: "constructor"; + className: "ChatForbidden"; + id: int; + title: string; + fromReader(reader: Reader): ChatForbidden; + } + + export interface ChannelArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the current user is the creator of this channel */ + creator?: true; + /** Whether the current user has left this channel */ + left?: true; + /** Is this a channel? */ + broadcast?: true; + /** Is this channel verified by telegram? */ + verified?: true; + /** Is this a supergroup? */ + megagroup?: true; + /** Whether viewing/writing in this channel for a reason (see restriction_reason */ + restricted?: true; + /** Whether signatures are enabled (channels) */ + signatures?: true; + /** See min */ + min?: true; + /** This channel/supergroup is probably a scam */ + scam?: true; + /** Whether this channel has a private join link */ + hasLink?: true; + /** Whether this chanel has a geoposition */ + hasGeo?: true; + /** Whether slow mode is enabled for groups to prevent flood in chat */ + slowmodeEnabled?: true; + /** Whether a group call or livestream is currently active */ + callActive?: true; + /** Whether there's anyone in the group call or livestream */ + callNotEmpty?: true; + /** If set, this supergroup/channel was reported by many users as a fake or scam: be careful when interacting with it. */ + fake?: true; + /** Whether this supergroup is a gigagroup */ + gigagroup?: true; + /** ID of the channel */ + id: int; + /** Access hash */ + accessHash?: long; + /** Title */ + title: string; + /** Username */ + username?: string; + /** Profile photo */ + photo: TypeChatPhoto; + /** Date when the user joined the supergroup/channel, or if the user isn't a member, its creation date */ + date: int; + /** Contains the reason why access to this channel must be restricted. */ + version: int; + /** Admin rights of the user in this channel (see rights) */ + restrictionReason?: TypeRestrictionReason[]; + /** Banned rights of the user in this channel (see rights) */ + adminRights?: TypeChatAdminRights; + /** Default chat rights (see rights) */ + bannedRights?: TypeChatBannedRights; + /** Participant count */ + defaultBannedRights?: TypeChatBannedRights; + /** */ + participantsCount?: int; + } + + /** + * Channel/supergroup info
+ * @link https://corefork.telegram.org/api/min + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/rights + */ + export class Channel extends VirtualClass implements ChannelArgs { + CONSTRUCTOR_id: -753232354; + SUBCLASS_OF_ID: 3316604308; + classType: "constructor"; + className: "Channel"; + flags: number; + creator?: true; + left?: true; + broadcast?: true; + verified?: true; + megagroup?: true; + restricted?: true; + signatures?: true; + min?: true; + scam?: true; + hasLink?: true; + hasGeo?: true; + slowmodeEnabled?: true; + callActive?: true; + callNotEmpty?: true; + fake?: true; + gigagroup?: true; + id: int; + accessHash?: long; + title: string; + username?: string; + photo: TypeChatPhoto; + date: int; + version: int; + restrictionReason?: TypeRestrictionReason[]; + adminRights?: TypeChatAdminRights; + bannedRights?: TypeChatBannedRights; + defaultBannedRights?: TypeChatBannedRights; + participantsCount?: int; + fromReader(reader: Reader): Channel; + } + + export interface ChannelForbiddenArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Is this a channel */ + broadcast?: true; + /** Is this a supergroup */ + megagroup?: true; + /** Channel ID */ + id: int; + /** Access hash */ + accessHash: long; + /** Title */ + title: string; + /** The ban is valid until the specified date */ + untilDate?: int; + } + + /** Indicates a channel/supergroup we can't access because we were banned, or for some other reason.
*/ + export class ChannelForbidden extends VirtualClass implements ChannelForbiddenArgs { + CONSTRUCTOR_id: 681420594; + SUBCLASS_OF_ID: 3316604308; + classType: "constructor"; + className: "ChannelForbidden"; + flags: number; + broadcast?: true; + megagroup?: true; + id: int; + accessHash: long; + title: string; + untilDate?: int; + fromReader(reader: Reader): ChannelForbidden; + } + + export interface ChatFullArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Can we change the username of this chat */ + canSetUsername?: true; + /** Whether scheduled messages are available */ + hasScheduled?: true; + /** ID of the chat */ + id: int; + /** About string for this chat */ + about: string; + /** Participant list */ + participants: TypeChatParticipants; + /** Chat photo */ + chatPhoto?: TypePhoto; + /** Notification settings */ + notifySettings: TypePeerNotifySettings; + /** Chat invite */ + exportedInvite?: TypeExportedChatInvite; + /** Info about bots that are in this chat */ + botInfo?: TypeBotInfo[]; + /** Message ID of the last pinned message */ + pinnedMsgId?: MessageIDLike; + /** Peer folder ID, for more info click here */ + folderId?: int; + /** Group call information */ + call?: TypeInputGroupCall; + /** Time-To-Live of messages sent by the current user to this chat */ + ttlPeriod?: int; + /** When using phone.getGroupCallJoinAs to get a list of peers that can be used to join a group call, this field indicates the peer that should be selected by default. */ + groupcallDefaultJoinAs?: TypePeer; + } + + /** + * Detailed chat info
+ * @link https://corefork.telegram.org/api/scheduled-messages + * @link https://corefork.telegram.org/api/pin + * @link https://corefork.telegram.org/api/folders + * @link https://corefork.telegram.org/method/phone.getGroupCallJoinAs + */ + export class ChatFull extends VirtualClass implements ChatFullArgs { + CONSTRUCTOR_id: -1977734781; + SUBCLASS_OF_ID: 3566872215; + classType: "constructor"; + className: "ChatFull"; + flags: number; + canSetUsername?: true; + hasScheduled?: true; + id: int; + about: string; + participants: TypeChatParticipants; + chatPhoto?: TypePhoto; + notifySettings: TypePeerNotifySettings; + exportedInvite?: TypeExportedChatInvite; + botInfo?: TypeBotInfo[]; + pinnedMsgId?: MessageIDLike; + folderId?: int; + call?: TypeInputGroupCall; + ttlPeriod?: int; + groupcallDefaultJoinAs?: TypePeer; + fromReader(reader: Reader): ChatFull; + } + + export interface ChannelFullArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Can we vew the participant list? */ + canViewParticipants?: true; + /** Can we set the channel's username? */ + canSetUsername?: true; + /** Can we associate a stickerpack to the supergroup? */ + canSetStickers?: true; + /** Is the history before we joined hidden to us? */ + hiddenPrehistory?: true; + /** Can we set the geolocation of this group (for geogroups) */ + canSetLocation?: true; + /** Whether scheduled messages are available */ + hasScheduled?: true; + /** Can the user view channel/supergroup statistics */ + canViewStats?: true; + /** Whether any anonymous admin of this supergroup was blocked: if set, you won't receive messages from anonymous group admins in discussion replies via @replies */ + blocked?: true; + /** ID of the channel */ + id: int; + /** Info about the channel */ + about: string; + /** Number of participants of the channel */ + participantsCount?: int; + /** Number of channel admins */ + adminsCount?: int; + /** Number of users kicked from the channel */ + kickedCount?: int; + /** Number of users banned from the channel */ + bannedCount?: int; + /** Number of users currently online */ + onlineCount?: int; + /** Position up to which all incoming messages are read. */ + readInboxMaxId: int; + /** Position up to which all outgoing messages are read. */ + readOutboxMaxId: int; + /** Count of unread messages */ + unreadCount: int; + /** Channel picture */ + chatPhoto: TypePhoto; + /** Notification settings */ + notifySettings: TypePeerNotifySettings; + /** Invite link */ + exportedInvite?: TypeExportedChatInvite; + /** Info about bots in the channel/supergrup */ + botInfo: TypeBotInfo[]; + /** The chat ID from which this group was migrated */ + migratedFromChatId?: int; + /** The message ID in the original chat at which this group was migrated */ + migratedFromMaxId?: int; + /** Message ID of the last pinned message */ + pinnedMsgId?: MessageIDLike; + /** Associated stickerset */ + stickerset?: TypeStickerSet; + /** Identifier of a maximum unavailable message in a channel due to hidden history. */ + availableMinId?: int; + /** Peer folder ID, for more info click here */ + folderId?: int; + /** ID of the linked discussion chat for channels */ + linkedChatId?: int; + /** Location of the geogroup */ + location?: TypeChannelLocation; + /** If specified, users in supergroups will only be able to send one message every slowmode_seconds seconds */ + slowmodeSeconds?: int; + /** Indicates when the user will be allowed to send another message in the supergroup (unixdate) */ + slowmodeNextSendDate?: int; + /** If set, specifies the DC to use for fetching channel statistics */ + statsDc?: int; + /** Latest PTS for this channel */ + pts: int; + /** Livestream or group call information */ + call?: TypeInputGroupCall; + /** Time-To-Live of messages in this channel or supergroup */ + ttlPeriod?: int; + /** A list of suggested actions for the supergroup admin, see here for more info ». */ + pendingSuggestions?: string[]; + /** When using phone.getGroupCallJoinAs to get a list of peers that can be used to join a group call, this field indicates the peer that should be selected by default. */ + groupcallDefaultJoinAs?: TypePeer; + } + + /** + * Full info about a channel/supergroup
+ * @link https://corefork.telegram.org/method/channels.setStickers + * @link https://corefork.telegram.org/api/stats + * @link https://corefork.telegram.org/api/discussion + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://telegram.org/blog/privacy-discussions-web-bots + * @link https://corefork.telegram.org/api/rights + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/pin + * @link https://corefork.telegram.org/api/folders + * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/config + * @link https://corefork.telegram.org/method/phone.getGroupCallJoinAs + */ + export class ChannelFull extends VirtualClass implements ChannelFullArgs { + CONSTRUCTOR_id: 1418477459; + SUBCLASS_OF_ID: 3566872215; + classType: "constructor"; + className: "ChannelFull"; + flags: number; + canViewParticipants?: true; + canSetUsername?: true; + canSetStickers?: true; + hiddenPrehistory?: true; + canSetLocation?: true; + hasScheduled?: true; + canViewStats?: true; + blocked?: true; + id: int; + about: string; + participantsCount?: int; + adminsCount?: int; + kickedCount?: int; + bannedCount?: int; + onlineCount?: int; + readInboxMaxId: int; + readOutboxMaxId: int; + unreadCount: int; + chatPhoto: TypePhoto; + notifySettings: TypePeerNotifySettings; + exportedInvite?: TypeExportedChatInvite; + botInfo: TypeBotInfo[]; + migratedFromChatId?: int; + migratedFromMaxId?: int; + pinnedMsgId?: MessageIDLike; + stickerset?: TypeStickerSet; + availableMinId?: int; + folderId?: int; + linkedChatId?: int; + location?: TypeChannelLocation; + slowmodeSeconds?: int; + slowmodeNextSendDate?: int; + statsDc?: int; + pts: int; + call?: TypeInputGroupCall; + ttlPeriod?: int; + pendingSuggestions?: string[]; + groupcallDefaultJoinAs?: TypePeer; + fromReader(reader: Reader): ChannelFull; + } + + export interface ChatParticipantArgs { + /** Member user ID */ + userId: int; + /** ID of the user that added the member to the group */ + inviterId: int; + /** Date added to the group */ + date: int; + } + + /** Group member.
*/ + export class ChatParticipant extends VirtualClass implements ChatParticipantArgs { + CONSTRUCTOR_id: -925415106; + SUBCLASS_OF_ID: 2105307014; + classType: "constructor"; + className: "ChatParticipant"; + userId: int; + inviterId: int; + date: int; + fromReader(reader: Reader): ChatParticipant; + } + + export interface ChatParticipantCreatorArgs { + /** ID of the user that created the group */ + userId: int; + } + + /** Represents the creator of the group
*/ + export class ChatParticipantCreator extends VirtualClass implements ChatParticipantCreatorArgs { + CONSTRUCTOR_id: -636267638; + SUBCLASS_OF_ID: 2105307014; + classType: "constructor"; + className: "ChatParticipantCreator"; + userId: int; + fromReader(reader: Reader): ChatParticipantCreator; + } + + export interface ChatParticipantAdminArgs { + /** ID of a group member that is admin */ + userId: int; + /** ID of the user that added the member to the group */ + inviterId: int; + /** Date when the user was added */ + date: int; + } + + /** Chat admin
*/ + export class ChatParticipantAdmin extends VirtualClass implements ChatParticipantAdminArgs { + CONSTRUCTOR_id: -489233354; + SUBCLASS_OF_ID: 2105307014; + classType: "constructor"; + className: "ChatParticipantAdmin"; + userId: int; + inviterId: int; + date: int; + fromReader(reader: Reader): ChatParticipantAdmin; + } + + export interface ChatParticipantsForbiddenArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Group ID */ + chatId: int; + /** Info about the group membership of the current user */ + selfParticipant?: TypeChatParticipant; + } + + /** Info on members is unavailable
*/ + export class ChatParticipantsForbidden extends VirtualClass implements ChatParticipantsForbiddenArgs { + CONSTRUCTOR_id: -57668565; + SUBCLASS_OF_ID: 531142001; + classType: "constructor"; + className: "ChatParticipantsForbidden"; + flags: number; + chatId: int; + selfParticipant?: TypeChatParticipant; + fromReader(reader: Reader): ChatParticipantsForbidden; + } + + export interface ChatParticipantsArgs { + /** Group identifier */ + chatId: int; + /** List of group members */ + participants: TypeChatParticipant[]; + /** Group version number */ + version: int; + } + + /** Group members.
*/ + export class ChatParticipants extends VirtualClass implements ChatParticipantsArgs { + CONSTRUCTOR_id: 1061556205; + SUBCLASS_OF_ID: 531142001; + classType: "constructor"; + className: "ChatParticipants"; + chatId: int; + participants: TypeChatParticipant[]; + version: int; + fromReader(reader: Reader): ChatParticipants; + } + + /** Group photo is not set.
*/ + export class ChatPhotoEmpty extends VirtualClass { + CONSTRUCTOR_id: 935395612; + SUBCLASS_OF_ID: 2889794789; + classType: "constructor"; + className: "ChatPhotoEmpty"; + fromReader(reader: Reader): ChatPhotoEmpty; + } + + export interface ChatPhotoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the user has an animated profile picture */ + hasVideo?: true; + /** Photo ID */ + photoId: long; + /** Stripped thumbnail */ + strippedThumb?: bytes; + /** DC where this photo is stored */ + dcId: int; + } + + /** + * Group profile photo.
+ * @link https://corefork.telegram.org/api/files + */ + export class ChatPhoto extends VirtualClass implements ChatPhotoArgs { + CONSTRUCTOR_id: 476978193; + SUBCLASS_OF_ID: 2889794789; + classType: "constructor"; + className: "ChatPhoto"; + flags: number; + hasVideo?: true; + photoId: long; + strippedThumb?: bytes; + dcId: int; + fromReader(reader: Reader): ChatPhoto; + } + + export interface MessageEmptyArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Message identifier */ + id: int; + /** Peer ID, the chat where this message was sent */ + peerId?: TypePeer; + } + + /** Empty constructor, non-existent message.
*/ + export class MessageEmpty extends VirtualClass implements MessageEmptyArgs { + CONSTRUCTOR_id: -1868117372; + SUBCLASS_OF_ID: 2030045667; + classType: "constructor"; + className: "MessageEmpty"; + flags: number; + id: int; + peerId?: TypePeer; + fromReader(reader: Reader): MessageEmpty; + } + + export interface MessageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Is this an outgoing message */ + out?: true; + /** Whether we were mentioned in this message */ + mentioned?: true; + /** Whether there are unread media attachments in this message */ + mediaUnread?: true; + /** Whether this is a silent message (no notification triggered) */ + silent?: true; + /** Whether this is a channel post */ + post?: true; + /** Whether this is a scheduled message */ + fromScheduled?: true; + /** This is a legacy message: it has to be refetched with the new layer */ + legacy?: true; + /** Whether the message should be shown as not modified to the user, even if an edit date is present */ + editHide?: true; + /** Whether this message is pinned */ + pinned?: true; + /** ID of the message */ + id: int; + /** ID of the sender of the message */ + fromId?: TypePeer; + /** Peer ID, the chat where this message was sent */ + peerId: TypePeer; + /** Info about forwarded messages */ + fwdFrom?: TypeMessageFwdHeader; + /** ID of the inline bot that generated the message */ + viaBotId?: int; + /** Reply information */ + replyTo?: TypeMessageReplyHeader; + /** Date of the message */ + date: int; + /** The message */ + message: string; + /** Media attachment */ + media?: TypeMessageMedia; + /** Reply markup (bot/inline keyboards) */ + replyMarkup?: TypeReplyMarkup; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + /** View count for channel posts */ + views?: int; + /** Forward counter */ + forwards?: int; + /** Info about post comments (for channels) or message replies (for groups) */ + replies?: TypeMessageReplies; + /** Last edit date of this message */ + editDate?: int; + /** Name of the author of this message for channel posts (with signatures enabled) */ + postAuthor?: string; + /** Multiple media messages sent using messages.sendMultiMedia with the same grouped ID indicate an album or media group */ + groupedId?: long; + /** Contains the reason why access to this message must be restricted. */ + restrictionReason?: TypeRestrictionReason[]; + /** Time To Live of the message, once message.date+message.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. */ + ttlPeriod?: int; + } + + /** + * A message
+ * @link https://corefork.telegram.org/api/mentions + * @link https://corefork.telegram.org/api/scheduled-messages + * @link https://corefork.telegram.org/api/pin + * @link https://corefork.telegram.org/api/entities + * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/method/messages.sendMultiMedia + * @link https://corefork.telegram.org/api/files + */ + export class Message extends VirtualClass implements MessageArgs { + CONSTRUCTOR_id: -1125940270; + SUBCLASS_OF_ID: 2030045667; + classType: "constructor"; + className: "Message"; + flags: number; + out?: true; + mentioned?: true; + mediaUnread?: true; + silent?: true; + post?: true; + fromScheduled?: true; + legacy?: true; + editHide?: true; + pinned?: true; + id: int; + fromId?: TypePeer; + peerId: TypePeer; + fwdFrom?: TypeMessageFwdHeader; + viaBotId?: int; + replyTo?: TypeMessageReplyHeader; + date: int; + message: string; + media?: TypeMessageMedia; + replyMarkup?: TypeReplyMarkup; + entities?: TypeMessageEntity[]; + views?: int; + forwards?: int; + replies?: TypeMessageReplies; + editDate?: int; + postAuthor?: string; + groupedId?: long; + restrictionReason?: TypeRestrictionReason[]; + ttlPeriod?: int; + fromReader(reader: Reader): Message; + } + + export interface MessageServiceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the message is outgoing */ + out?: true; + /** Whether we were mentioned in the message */ + mentioned?: true; + /** Whether the message contains unread media */ + mediaUnread?: true; + /** Whether the message is silent */ + silent?: true; + /** Whether it's a channel post */ + post?: true; + /** This is a legacy message: it has to be refetched with the new layer */ + legacy?: true; + /** Message ID */ + id: int; + /** ID of the sender of this message */ + fromId?: TypePeer; + /** Sender of service message */ + peerId: TypePeer; + /** Reply (thread) information */ + replyTo?: TypeMessageReplyHeader; + /** Message date */ + date: int; + /** Event connected with the service message */ + action: TypeMessageAction; + /** Time To Live of the message, once message.date+message.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. */ + ttlPeriod?: int; + } + + /** Indicates a service message
*/ + export class MessageService extends VirtualClass implements MessageServiceArgs { + CONSTRUCTOR_id: 721967202; + SUBCLASS_OF_ID: 2030045667; + classType: "constructor"; + className: "MessageService"; + flags: number; + out?: true; + mentioned?: true; + mediaUnread?: true; + silent?: true; + post?: true; + legacy?: true; + id: int; + fromId?: TypePeer; + peerId: TypePeer; + replyTo?: TypeMessageReplyHeader; + date: int; + action: TypeMessageAction; + ttlPeriod?: int; + fromReader(reader: Reader): MessageService; + } + + /** Empty constructor.
*/ + export class MessageMediaEmpty extends VirtualClass { + CONSTRUCTOR_id: 1038967584; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaEmpty"; + fromReader(reader: Reader): MessageMediaEmpty; + } + + export interface MessageMediaPhotoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Photo */ + photo?: TypePhoto; + /** Time to live in seconds of self-destructing photo */ + ttlSeconds?: int; + } + + /** Attached photo.
*/ + export class MessageMediaPhoto extends VirtualClass implements MessageMediaPhotoArgs { + CONSTRUCTOR_id: 1766936791; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaPhoto"; + flags: number; + photo?: TypePhoto; + ttlSeconds?: int; + fromReader(reader: Reader): MessageMediaPhoto; + } + + export interface MessageMediaGeoArgs { + /** GeoPoint */ + geo: TypeGeoPoint; + } + + /** Attached map.
*/ + export class MessageMediaGeo extends VirtualClass implements MessageMediaGeoArgs { + CONSTRUCTOR_id: 1457575028; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaGeo"; + geo: TypeGeoPoint; + fromReader(reader: Reader): MessageMediaGeo; + } + + export interface MessageMediaContactArgs { + /** Phone number */ + phoneNumber: string; + /** Contact's first name */ + firstName: string; + /** Contact's last name */ + lastName: string; + /** VCARD of contact */ + vcard: string; + /** User identifier or 0, if the user with the given phone number is not registered */ + userId: int; + } + + /** Attached contact.
*/ + export class MessageMediaContact extends VirtualClass implements MessageMediaContactArgs { + CONSTRUCTOR_id: -873313984; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaContact"; + phoneNumber: string; + firstName: string; + lastName: string; + vcard: string; + userId: int; + fromReader(reader: Reader): MessageMediaContact; + } + + /** Current version of the client does not support this media type.
*/ + export class MessageMediaUnsupported extends VirtualClass { + CONSTRUCTOR_id: -1618676578; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaUnsupported"; + fromReader(reader: Reader): MessageMediaUnsupported; + } + + export interface MessageMediaDocumentArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Attached document */ + document?: TypeDocument; + /** Time to live of self-destructing document */ + ttlSeconds?: int; + } + + /** Document (video, audio, voice, sticker, any media type except photo)
*/ + export class MessageMediaDocument extends VirtualClass implements MessageMediaDocumentArgs { + CONSTRUCTOR_id: -1666158377; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaDocument"; + flags: number; + document?: TypeDocument; + ttlSeconds?: int; + fromReader(reader: Reader): MessageMediaDocument; + } + + export interface MessageMediaWebPageArgs { + /** Webpage preview */ + webpage: TypeWebPage; + } + + /** Preview of webpage
*/ + export class MessageMediaWebPage extends VirtualClass implements MessageMediaWebPageArgs { + CONSTRUCTOR_id: -1557277184; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaWebPage"; + webpage: TypeWebPage; + fromReader(reader: Reader): MessageMediaWebPage; + } + + export interface MessageMediaVenueArgs { + /** Geolocation of venue */ + geo: TypeGeoPoint; + /** Venue name */ + title: string; + /** Address */ + address: string; + /** Venue provider: currently only "foursquare" needs to be supported */ + provider: string; + /** Venue ID in the provider's database */ + venueId: string; + /** Venue type in the provider's database */ + venueType: string; + } + + /** Venue
*/ + export class MessageMediaVenue extends VirtualClass implements MessageMediaVenueArgs { + CONSTRUCTOR_id: 784356159; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaVenue"; + geo: TypeGeoPoint; + title: string; + address: string; + provider: string; + venueId: string; + venueType: string; + fromReader(reader: Reader): MessageMediaVenue; + } + + export interface MessageMediaGameArgs { + /** Game */ + game: TypeGame; + } + + /** Telegram game
*/ + export class MessageMediaGame extends VirtualClass implements MessageMediaGameArgs { + CONSTRUCTOR_id: -38694904; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaGame"; + game: TypeGame; + fromReader(reader: Reader): MessageMediaGame; + } + + export interface MessageMediaInvoiceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the shipping address was requested */ + shippingAddressRequested?: true; + /** Whether this is an example invoice */ + test?: true; + /** Product name, 1-32 characters */ + title: string; + /** Product description, 1-255 characters */ + description: string; + /** URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. */ + photo?: TypeWebDocument; + /** Message ID of receipt: if set, clients should change the text of the first keyboardButtonBuy button always attached to the message to a localized version of the word Receipt */ + receiptMsgId?: MessageIDLike; + /** Three-letter ISO 4217 currency code */ + currency: string; + /** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ + totalAmount: long; + /** Unique bot deep-linking parameter that can be used to generate this invoice */ + startParam: string; + } + + /** + * Invoice
+ * @link https://corefork.telegram.org/constructor/keyboardButtonBuy + * @link https://corefork.telegram.org/constructor/message + * @link https://corefork.telegram.org/bots/payments + */ + export class MessageMediaInvoice extends VirtualClass implements MessageMediaInvoiceArgs { + CONSTRUCTOR_id: -2074799289; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaInvoice"; + flags: number; + shippingAddressRequested?: true; + test?: true; + title: string; + description: string; + photo?: TypeWebDocument; + receiptMsgId?: MessageIDLike; + currency: string; + totalAmount: long; + startParam: string; + fromReader(reader: Reader): MessageMediaInvoice; + } + + export interface MessageMediaGeoLiveArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Geolocation */ + geo: TypeGeoPoint; + /** For live locations, a direction in which the location moves, in degrees; 1-360 */ + heading?: int; + /** Validity period of provided geolocation */ + period: int; + /** For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). */ + proximityNotificationRadius?: int; + } + + /** + * Indicates a live geolocation
+ * @link https://corefork.telegram.org/api/live-location + */ + export class MessageMediaGeoLive extends VirtualClass implements MessageMediaGeoLiveArgs { + CONSTRUCTOR_id: -1186937242; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaGeoLive"; + flags: number; + geo: TypeGeoPoint; + heading?: int; + period: int; + proximityNotificationRadius?: int; + fromReader(reader: Reader): MessageMediaGeoLive; + } + + export interface MessageMediaPollArgs { + /** The poll */ + poll: TypePoll; + /** The results of the poll */ + results: TypePollResults; + } + + /** Poll
*/ + export class MessageMediaPoll extends VirtualClass implements MessageMediaPollArgs { + CONSTRUCTOR_id: 1272375192; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaPoll"; + poll: TypePoll; + results: TypePollResults; + fromReader(reader: Reader): MessageMediaPoll; + } + + export interface MessageMediaDiceArgs { + /** Dice value */ + value: int; + /** The emoji, for now 🏀, 🎲 and 🎯 are supported */ + emoticon: string; + } + + /** + * Dice-based animated sticker
+ * @link https://corefork.telegram.org/api/dice + */ + export class MessageMediaDice extends VirtualClass implements MessageMediaDiceArgs { + CONSTRUCTOR_id: 1065280907; + SUBCLASS_OF_ID: 1198308914; + classType: "constructor"; + className: "MessageMediaDice"; + value: int; + emoticon: string; + fromReader(reader: Reader): MessageMediaDice; + } + + /** Empty constructor.
*/ + export class MessageActionEmpty extends VirtualClass { + CONSTRUCTOR_id: -1230047312; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionEmpty"; + fromReader(reader: Reader): MessageActionEmpty; + } + + export interface MessageActionChatCreateArgs { + /** Group name */ + title: string; + /** List of group members */ + users: int[]; + } + + /** Group created
*/ + export class MessageActionChatCreate extends VirtualClass implements MessageActionChatCreateArgs { + CONSTRUCTOR_id: -1503425638; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionChatCreate"; + title: string; + users: int[]; + fromReader(reader: Reader): MessageActionChatCreate; + } + + export interface MessageActionChatEditTitleArgs { + /** New group name */ + title: string; + } + + /** Group name changed.
*/ + export class MessageActionChatEditTitle extends VirtualClass implements MessageActionChatEditTitleArgs { + CONSTRUCTOR_id: -1247687078; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionChatEditTitle"; + title: string; + fromReader(reader: Reader): MessageActionChatEditTitle; + } + + export interface MessageActionChatEditPhotoArgs { + /** New group pofile photo */ + photo: TypePhoto; + } + + /** Group profile changed
*/ + export class MessageActionChatEditPhoto extends VirtualClass implements MessageActionChatEditPhotoArgs { + CONSTRUCTOR_id: 2144015272; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionChatEditPhoto"; + photo: TypePhoto; + fromReader(reader: Reader): MessageActionChatEditPhoto; + } + + /** Group profile photo removed.
*/ + export class MessageActionChatDeletePhoto extends VirtualClass { + CONSTRUCTOR_id: -1780220945; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionChatDeletePhoto"; + fromReader(reader: Reader): MessageActionChatDeletePhoto; + } + + export interface MessageActionChatAddUserArgs { + /** Users that were invited to the chat */ + users: int[]; + } + + /** New member in the group
*/ + export class MessageActionChatAddUser extends VirtualClass implements MessageActionChatAddUserArgs { + CONSTRUCTOR_id: 1217033015; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionChatAddUser"; + users: int[]; + fromReader(reader: Reader): MessageActionChatAddUser; + } + + export interface MessageActionChatDeleteUserArgs { + /** Leaving user ID */ + userId: int; + } + + /** User left the group.
*/ + export class MessageActionChatDeleteUser extends VirtualClass implements MessageActionChatDeleteUserArgs { + CONSTRUCTOR_id: -1297179892; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionChatDeleteUser"; + userId: int; + fromReader(reader: Reader): MessageActionChatDeleteUser; + } + + export interface MessageActionChatJoinedByLinkArgs { + /** ID of the user that created the invite link */ + inviterId: int; + } + + /** A user joined the chat via an invite link
*/ + export class MessageActionChatJoinedByLink extends VirtualClass implements MessageActionChatJoinedByLinkArgs { + CONSTRUCTOR_id: -123931160; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionChatJoinedByLink"; + inviterId: int; + fromReader(reader: Reader): MessageActionChatJoinedByLink; + } + + export interface MessageActionChannelCreateArgs { + /** Original channel/supergroup title */ + title: string; + } + + /** The channel was created
*/ + export class MessageActionChannelCreate extends VirtualClass implements MessageActionChannelCreateArgs { + CONSTRUCTOR_id: -1781355374; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionChannelCreate"; + title: string; + fromReader(reader: Reader): MessageActionChannelCreate; + } + + export interface MessageActionChatMigrateToArgs { + /** The supergroup it was migrated to */ + channelId: int; + } + + /** + * Indicates the chat was migrated to the specified supergroup
+ * @link https://corefork.telegram.org/api/channel + */ + export class MessageActionChatMigrateTo extends VirtualClass implements MessageActionChatMigrateToArgs { + CONSTRUCTOR_id: 1371385889; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionChatMigrateTo"; + channelId: int; + fromReader(reader: Reader): MessageActionChatMigrateTo; + } + + export interface MessageActionChannelMigrateFromArgs { + /** The old chat tite */ + title: string; + /** The old chat ID */ + chatId: int; + } + + /** + * Indicates the channel was migrated from the specified chat
+ * @link https://corefork.telegram.org/api/channel + */ + export class MessageActionChannelMigrateFrom extends VirtualClass implements MessageActionChannelMigrateFromArgs { + CONSTRUCTOR_id: -1336546578; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionChannelMigrateFrom"; + title: string; + chatId: int; + fromReader(reader: Reader): MessageActionChannelMigrateFrom; + } + + /** A message was pinned
*/ + export class MessageActionPinMessage extends VirtualClass { + CONSTRUCTOR_id: -1799538451; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionPinMessage"; + fromReader(reader: Reader): MessageActionPinMessage; + } + + /** Chat history was cleared
*/ + export class MessageActionHistoryClear extends VirtualClass { + CONSTRUCTOR_id: -1615153660; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionHistoryClear"; + fromReader(reader: Reader): MessageActionHistoryClear; + } + + export interface MessageActionGameScoreArgs { + /** Game ID */ + gameId: long; + /** Score */ + score: int; + } + + /** Someone scored in a game
*/ + export class MessageActionGameScore extends VirtualClass implements MessageActionGameScoreArgs { + CONSTRUCTOR_id: -1834538890; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionGameScore"; + gameId: long; + score: int; + fromReader(reader: Reader): MessageActionGameScore; + } + + export interface MessageActionPaymentSentMeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Three-letter ISO 4217 currency code */ + currency: string; + /** Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ + totalAmount: long; + /** Bot specified invoice payload */ + payload: bytes; + /** Order info provided by the user */ + info?: TypePaymentRequestedInfo; + /** Identifier of the shipping option chosen by the user */ + shippingOptionId?: string; + /** Provider payment identifier */ + charge: TypePaymentCharge; + } + + /** + * A user just sent a payment to me (a bot)
+ * @link https://corefork.telegram.org/bots/payments + */ + export class MessageActionPaymentSentMe extends VirtualClass implements MessageActionPaymentSentMeArgs { + CONSTRUCTOR_id: -1892568281; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionPaymentSentMe"; + flags: number; + currency: string; + totalAmount: long; + payload: bytes; + info?: TypePaymentRequestedInfo; + shippingOptionId?: string; + charge: TypePaymentCharge; + fromReader(reader: Reader): MessageActionPaymentSentMe; + } + + export interface MessageActionPaymentSentArgs { + /** Three-letter ISO 4217 currency code */ + currency: string; + /** Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ + totalAmount: long; + } + + /** + * A payment was sent
+ * @link https://corefork.telegram.org/bots/payments + */ + export class MessageActionPaymentSent extends VirtualClass implements MessageActionPaymentSentArgs { + CONSTRUCTOR_id: 1080663248; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionPaymentSent"; + currency: string; + totalAmount: long; + fromReader(reader: Reader): MessageActionPaymentSent; + } + + export interface MessageActionPhoneCallArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Is this a video call? */ + video?: true; + /** Call ID */ + callId: long; + /** If the call has ended, the reason why it ended */ + reason?: TypePhoneCallDiscardReason; + /** Duration of the call in seconds */ + duration?: int; + } + + /** A phone call
*/ + export class MessageActionPhoneCall extends VirtualClass implements MessageActionPhoneCallArgs { + CONSTRUCTOR_id: -2132731265; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionPhoneCall"; + flags: number; + video?: true; + callId: long; + reason?: TypePhoneCallDiscardReason; + duration?: int; + fromReader(reader: Reader): MessageActionPhoneCall; + } + + /** A screenshot of the chat was taken
*/ + export class MessageActionScreenshotTaken extends VirtualClass { + CONSTRUCTOR_id: 1200788123; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionScreenshotTaken"; + fromReader(reader: Reader): MessageActionScreenshotTaken; + } + + export interface MessageActionCustomActionArgs { + /** Action message */ + message: string; + } + + /** Custom action (most likely not supported by the current layer, an upgrade might be needed)
*/ + export class MessageActionCustomAction extends VirtualClass implements MessageActionCustomActionArgs { + CONSTRUCTOR_id: -85549226; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionCustomAction"; + message: string; + fromReader(reader: Reader): MessageActionCustomAction; + } + + export interface MessageActionBotAllowedArgs { + /** The domain name of the website on which the user has logged in. */ + domain: string; + } + + /** + * The domain name of the website on which the user has logged in. More about Telegram Login »
+ * @link https://corefork.telegram.org/widgets/login + */ + export class MessageActionBotAllowed extends VirtualClass implements MessageActionBotAllowedArgs { + CONSTRUCTOR_id: -1410748418; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionBotAllowed"; + domain: string; + fromReader(reader: Reader): MessageActionBotAllowed; + } + + export interface MessageActionSecureValuesSentMeArgs { + /** Vector with information about documents and other Telegram Passport elements that were shared with the bot */ + values: TypeSecureValue[]; + /** Encrypted credentials required to decrypt the data */ + credentials: TypeSecureCredentialsEncrypted; + } + + /** + * Secure telegram passport values were received
+ * @link https://corefork.telegram.org/passport + */ + export class MessageActionSecureValuesSentMe extends VirtualClass implements MessageActionSecureValuesSentMeArgs { + CONSTRUCTOR_id: 455635795; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionSecureValuesSentMe"; + values: TypeSecureValue[]; + credentials: TypeSecureCredentialsEncrypted; + fromReader(reader: Reader): MessageActionSecureValuesSentMe; + } + + export interface MessageActionSecureValuesSentArgs { + /** Secure value types */ + types: TypeSecureValueType[]; + } + + /** + * Request for secure telegram passport values was sent
+ * @link https://corefork.telegram.org/passport + */ + export class MessageActionSecureValuesSent extends VirtualClass implements MessageActionSecureValuesSentArgs { + CONSTRUCTOR_id: -648257196; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionSecureValuesSent"; + types: TypeSecureValueType[]; + fromReader(reader: Reader): MessageActionSecureValuesSent; + } + + /** A contact just signed up to telegram
*/ + export class MessageActionContactSignUp extends VirtualClass { + CONSTRUCTOR_id: -202219658; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionContactSignUp"; + fromReader(reader: Reader): MessageActionContactSignUp; + } + + export interface MessageActionGeoProximityReachedArgs { + /** The user or chat that is now in proximity of to_id */ + fromId: TypePeer; + /** The user or chat that subscribed to live geolocation proximity alerts */ + toId: TypePeer; + /** Distance, in meters (0-100000) */ + distance: int; + } + + /** + * A user of the chat is now in proximity of another user
+ * @link https://corefork.telegram.org/api/live-location + */ + export class MessageActionGeoProximityReached extends VirtualClass implements MessageActionGeoProximityReachedArgs { + CONSTRUCTOR_id: -1730095465; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionGeoProximityReached"; + fromId: TypePeer; + toId: TypePeer; + distance: int; + fromReader(reader: Reader): MessageActionGeoProximityReached; + } + + export interface MessageActionGroupCallArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Group call */ + call: TypeInputGroupCall; + /** Group call duration */ + duration?: int; + } + + /** The group call has ended
*/ + export class MessageActionGroupCall extends VirtualClass implements MessageActionGroupCallArgs { + CONSTRUCTOR_id: 2047704898; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionGroupCall"; + flags: number; + call: TypeInputGroupCall; + duration?: int; + fromReader(reader: Reader): MessageActionGroupCall; + } + + export interface MessageActionInviteToGroupCallArgs { + /** The group call */ + call: TypeInputGroupCall; + /** The invited users */ + users: int[]; + } + + /** A set of users was invited to the group call
*/ + export class MessageActionInviteToGroupCall extends VirtualClass implements MessageActionInviteToGroupCallArgs { + CONSTRUCTOR_id: 1991897370; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionInviteToGroupCall"; + call: TypeInputGroupCall; + users: int[]; + fromReader(reader: Reader): MessageActionInviteToGroupCall; + } + + export interface MessageActionSetMessagesTTLArgs { + /** New Time-To-Live */ + period: int; + } + + /** The Time-To-Live of messages in this chat was changed.
*/ + export class MessageActionSetMessagesTTL extends VirtualClass implements MessageActionSetMessagesTTLArgs { + CONSTRUCTOR_id: -1441072131; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionSetMessagesTTL"; + period: int; + fromReader(reader: Reader): MessageActionSetMessagesTTL; + } + + export interface MessageActionGroupCallScheduledArgs { + /** The group call */ + call: TypeInputGroupCall; + /** When is this group call scheduled to start */ + scheduleDate: int; + } + + /** A group call was scheduled
*/ + export class MessageActionGroupCallScheduled extends VirtualClass implements MessageActionGroupCallScheduledArgs { + CONSTRUCTOR_id: -1281329567; + SUBCLASS_OF_ID: 2256589094; + classType: "constructor"; + className: "MessageActionGroupCallScheduled"; + call: TypeInputGroupCall; + scheduleDate: int; + fromReader(reader: Reader): MessageActionGroupCallScheduled; + } + + export interface DialogArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Is the dialog pinned */ + pinned?: true; + /** Whether the chat was manually marked as unread */ + unreadMark?: true; + /** The chat */ + peer: TypePeer; + /** The latest message ID */ + topMessage: int; + /** Position up to which all incoming messages are read. */ + readInboxMaxId: int; + /** Position up to which all outgoing messages are read. */ + readOutboxMaxId: int; + /** Number of unread messages */ + unreadCount: int; + /** Number of unread mentions */ + unreadMentionsCount: int; + /** Notification settings */ + notifySettings: TypePeerNotifySettings; + /** PTS */ + pts?: int; + /** Message draft */ + draft?: TypeDraftMessage; + /** Peer folder ID, for more info click here */ + folderId?: int; + } + + /** + * Chat
+ * @link https://corefork.telegram.org/api/mentions + * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/folders + */ + export class Dialog extends VirtualClass implements DialogArgs { + CONSTRUCTOR_id: 739712882; + SUBCLASS_OF_ID: 1120787796; + classType: "constructor"; + className: "Dialog"; + flags: number; + pinned?: true; + unreadMark?: true; + peer: TypePeer; + topMessage: int; + readInboxMaxId: int; + readOutboxMaxId: int; + unreadCount: int; + unreadMentionsCount: int; + notifySettings: TypePeerNotifySettings; + pts?: int; + draft?: TypeDraftMessage; + folderId?: int; + fromReader(reader: Reader): Dialog; + } + + export interface DialogFolderArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Is this folder pinned */ + pinned?: true; + /** The folder */ + folder: TypeFolder; + /** Peer in folder */ + peer: TypePeer; + /** Latest message ID of dialog */ + topMessage: int; + /** Number of unread muted peers in folder */ + unreadMutedPeersCount: int; + /** Number of unread unmuted peers in folder */ + unreadUnmutedPeersCount: int; + /** Number of unread messages from muted peers in folder */ + unreadMutedMessagesCount: int; + /** Number of unread messages from unmuted peers in folder */ + unreadUnmutedMessagesCount: int; + } + + /** Dialog in folder
*/ + export class DialogFolder extends VirtualClass implements DialogFolderArgs { + CONSTRUCTOR_id: 1908216652; + SUBCLASS_OF_ID: 1120787796; + classType: "constructor"; + className: "DialogFolder"; + flags: number; + pinned?: true; + folder: TypeFolder; + peer: TypePeer; + topMessage: int; + unreadMutedPeersCount: int; + unreadUnmutedPeersCount: int; + unreadMutedMessagesCount: int; + unreadUnmutedMessagesCount: int; + fromReader(reader: Reader): DialogFolder; + } + + export interface PhotoEmptyArgs { + /** Photo identifier */ + id: long; + } + + /** Empty constructor, non-existent photo
*/ + export class PhotoEmpty extends VirtualClass implements PhotoEmptyArgs { + CONSTRUCTOR_id: 590459437; + SUBCLASS_OF_ID: 3581324060; + classType: "constructor"; + className: "PhotoEmpty"; + id: long; + fromReader(reader: Reader): PhotoEmpty; + } + + export interface PhotoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the photo has mask stickers attached to it */ + hasStickers?: true; + /** ID */ + id: long; + /** Access hash */ + accessHash: long; + /** file reference */ + fileReference: bytes; + /** Date of upload */ + date: int; + /** Available sizes for download */ + sizes: TypePhotoSize[]; + /** For animated profiles, the MPEG4 videos */ + videoSizes?: TypeVideoSize[]; + /** DC ID to use for download */ + dcId: int; + } + + /** + * Photo
+ * @link https://corefork.telegram.org/api/file_reference + * @link https://corefork.telegram.org/api/files + */ + export class Photo extends VirtualClass implements PhotoArgs { + CONSTRUCTOR_id: -82216347; + SUBCLASS_OF_ID: 3581324060; + classType: "constructor"; + className: "Photo"; + flags: number; + hasStickers?: true; + id: long; + accessHash: long; + fileReference: bytes; + date: int; + sizes: TypePhotoSize[]; + videoSizes?: TypeVideoSize[]; + dcId: int; + fromReader(reader: Reader): Photo; + } + + export interface PhotoSizeEmptyArgs { + /** Thumbnail type (see. photoSize) */ + type: string; + } + + /** + * Empty constructor. Image with this thumbnail is unavailable.
+ * @link https://corefork.telegram.org/constructor/photoSize + */ + export class PhotoSizeEmpty extends VirtualClass implements PhotoSizeEmptyArgs { + CONSTRUCTOR_id: 236446268; + SUBCLASS_OF_ID: 399256025; + classType: "constructor"; + className: "PhotoSizeEmpty"; + type: string; + fromReader(reader: Reader): PhotoSizeEmpty; + } + + export interface PhotoSizeArgs { + /** Thumbnail type */ + type: string; + /** Image width */ + w: int; + /** Image height */ + h: int; + /** File size */ + size: int; + } + + /** + * Image description.
+ * @link https://corefork.telegram.org/api/files + */ + export class PhotoSize extends VirtualClass implements PhotoSizeArgs { + CONSTRUCTOR_id: 1976012384; + SUBCLASS_OF_ID: 399256025; + classType: "constructor"; + className: "PhotoSize"; + type: string; + w: int; + h: int; + size: int; + fromReader(reader: Reader): PhotoSize; + } + + export interface PhotoCachedSizeArgs { + /** Thumbnail type */ + type: string; + /** Image width */ + w: int; + /** Image height */ + h: int; + /** Binary data, file content */ + bytes: bytes; + } + + /** + * Description of an image and its content.
+ * @link https://corefork.telegram.org/api/files + */ + export class PhotoCachedSize extends VirtualClass implements PhotoCachedSizeArgs { + CONSTRUCTOR_id: 35527382; + SUBCLASS_OF_ID: 399256025; + classType: "constructor"; + className: "PhotoCachedSize"; + type: string; + w: int; + h: int; + bytes: bytes; + fromReader(reader: Reader): PhotoCachedSize; + } + + export interface PhotoStrippedSizeArgs { + /** Thumbnail type */ + type: string; + /** Thumbnail data, see here for more info on decompression » */ + bytes: bytes; + } + + /** + * A low-resolution compressed JPG payload
+ * @link https://corefork.telegram.org/api/files + * @link https://corefork.telegram.org/constructor/photoSize + */ + export class PhotoStrippedSize extends VirtualClass implements PhotoStrippedSizeArgs { + CONSTRUCTOR_id: -525288402; + SUBCLASS_OF_ID: 399256025; + classType: "constructor"; + className: "PhotoStrippedSize"; + type: string; + bytes: bytes; + fromReader(reader: Reader): PhotoStrippedSize; + } + + export interface PhotoSizeProgressiveArgs { + /** Photosize type */ + type: string; + /** Photo width */ + w: int; + /** Photo height */ + h: int; + /** Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image. */ + sizes: int[]; + } + + /** + * Progressively encoded photosize
+ * @link https://corefork.telegram.org/api/files + */ + export class PhotoSizeProgressive extends VirtualClass implements PhotoSizeProgressiveArgs { + CONSTRUCTOR_id: -96535659; + SUBCLASS_OF_ID: 399256025; + classType: "constructor"; + className: "PhotoSizeProgressive"; + type: string; + w: int; + h: int; + sizes: int[]; + fromReader(reader: Reader): PhotoSizeProgressive; + } + + export interface PhotoPathSizeArgs { + /** Always j */ + type: string; + /** Compressed SVG path payload, see here for decompression instructions */ + bytes: bytes; + } + + /** + * Messages with animated stickers can have a compressed svg (< 300 bytes) to show the outline of the sticker before fetching the actual lottie animation.
+ * @link https://corefork.telegram.org/api/files + */ + export class PhotoPathSize extends VirtualClass implements PhotoPathSizeArgs { + CONSTRUCTOR_id: -668906175; + SUBCLASS_OF_ID: 399256025; + classType: "constructor"; + className: "PhotoPathSize"; + type: string; + bytes: bytes; + fromReader(reader: Reader): PhotoPathSize; + } + + /** Empty constructor.
*/ + export class GeoPointEmpty extends VirtualClass { + CONSTRUCTOR_id: 286776671; + SUBCLASS_OF_ID: 3591430509; + classType: "constructor"; + className: "GeoPointEmpty"; + fromReader(reader: Reader): GeoPointEmpty; + } + + export interface GeoPointArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Longtitude */ + long: double; + /** Latitude */ + lat: double; + /** Access hash */ + accessHash: long; + /** The estimated horizontal accuracy of the location, in meters; as defined by the sender. */ + accuracyRadius?: int; + } + + /** GeoPoint.
*/ + export class GeoPoint extends VirtualClass implements GeoPointArgs { + CONSTRUCTOR_id: -1297942941; + SUBCLASS_OF_ID: 3591430509; + classType: "constructor"; + className: "GeoPoint"; + flags: number; + long: double; + lat: double; + accessHash: long; + accuracyRadius?: int; + fromReader(reader: Reader): GeoPoint; + } + + export interface InputNotifyPeerArgs { + /** User or group */ + peer: TypeInputPeer; + } + + /** Notifications generated by a certain user or group.
*/ + export class InputNotifyPeer extends VirtualClass implements InputNotifyPeerArgs { + CONSTRUCTOR_id: -1195615476; + SUBCLASS_OF_ID: 1486362133; + classType: "constructor"; + className: "InputNotifyPeer"; + peer: TypeInputPeer; + fromReader(reader: Reader): InputNotifyPeer; + } + + /** Notifications generated by all users.
*/ + export class InputNotifyUsers extends VirtualClass { + CONSTRUCTOR_id: 423314455; + SUBCLASS_OF_ID: 1486362133; + classType: "constructor"; + className: "InputNotifyUsers"; + fromReader(reader: Reader): InputNotifyUsers; + } + + /** Notifications generated by all groups.
*/ + export class InputNotifyChats extends VirtualClass { + CONSTRUCTOR_id: 1251338318; + SUBCLASS_OF_ID: 1486362133; + classType: "constructor"; + className: "InputNotifyChats"; + fromReader(reader: Reader): InputNotifyChats; + } + + /** + * All channels
+ * @link https://corefork.telegram.org/api/channel + */ + export class InputNotifyBroadcasts extends VirtualClass { + CONSTRUCTOR_id: -1311015810; + SUBCLASS_OF_ID: 1486362133; + classType: "constructor"; + className: "InputNotifyBroadcasts"; + fromReader(reader: Reader): InputNotifyBroadcasts; + } + + export interface InputPeerNotifySettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If the text of the message shall be displayed in notification */ + showPreviews?: Bool; + /** Peer was muted? */ + silent?: Bool; + /** Date until which all notifications shall be switched off */ + muteUntil?: int; + /** Name of an audio file for notification */ + sound?: string; + } + + /** Notification settings.
*/ + export class InputPeerNotifySettings extends VirtualClass implements InputPeerNotifySettingsArgs { + CONSTRUCTOR_id: -1673717362; + SUBCLASS_OF_ID: 2430274317; + classType: "constructor"; + className: "InputPeerNotifySettings"; + flags: number; + showPreviews?: Bool; + silent?: Bool; + muteUntil?: int; + sound?: string; + fromReader(reader: Reader): InputPeerNotifySettings; + } + + export interface PeerNotifySettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Display text in notifications */ + showPreviews?: Bool; + /** Mute peer? */ + silent?: Bool; + /** Mute all notifications until this date */ + muteUntil?: int; + /** Audio file name for notifications */ + sound?: string; + } + + /** Notification settings.
*/ + export class PeerNotifySettings extends VirtualClass implements PeerNotifySettingsArgs { + CONSTRUCTOR_id: -1353671392; + SUBCLASS_OF_ID: 3475030132; + classType: "constructor"; + className: "PeerNotifySettings"; + flags: number; + showPreviews?: Bool; + silent?: Bool; + muteUntil?: int; + sound?: string; + fromReader(reader: Reader): PeerNotifySettings; + } + + export interface PeerSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether we can still report the user for spam */ + reportSpam?: true; + /** Whether we can add the user as contact */ + addContact?: true; + /** Whether we can block the user */ + blockContact?: true; + /** Whether we can share the user's contact */ + shareContact?: true; + /** Whether a special exception for contacts is needed */ + needContactsException?: true; + /** Whether we can report a geogroup is irrelevant for this location */ + reportGeo?: true; + /** Whether this peer was automatically archived according to privacy settings */ + autoarchived?: true; + /** Whether we can invite members to a group or channel */ + inviteMembers?: true; + /** Distance in meters between us and this peer */ + geoDistance?: int; + } + + /** + * Peer settings
+ * @link https://corefork.telegram.org/constructor/globalPrivacySettings + * @link https://corefork.telegram.org/api/channel + */ + export class PeerSettings extends VirtualClass implements PeerSettingsArgs { + CONSTRUCTOR_id: 1933519201; + SUBCLASS_OF_ID: 4138180484; + classType: "constructor"; + className: "PeerSettings"; + flags: number; + reportSpam?: true; + addContact?: true; + blockContact?: true; + shareContact?: true; + needContactsException?: true; + reportGeo?: true; + autoarchived?: true; + inviteMembers?: true; + geoDistance?: int; + fromReader(reader: Reader): PeerSettings; + } + + export interface WallPaperArgs { + /** Identifier */ + id: long; + /** Flags, see TL conditional fields */ + flags: number; + /** Creator of the wallpaper */ + creator?: true; + /** Whether this is the default wallpaper */ + default?: true; + /** Pattern */ + pattern?: true; + /** Dark mode */ + dark?: true; + /** Access hash */ + accessHash: long; + /** Unique wallpaper ID */ + slug: string; + /** The actual wallpaper */ + document: TypeDocument; + /** Wallpaper settings */ + settings?: TypeWallPaperSettings; + } + + /** Wallpaper settings.
*/ + export class WallPaper extends VirtualClass implements WallPaperArgs { + CONSTRUCTOR_id: -1539849235; + SUBCLASS_OF_ID: 2527250827; + classType: "constructor"; + className: "WallPaper"; + id: long; + flags: number; + creator?: true; + default?: true; + pattern?: true; + dark?: true; + accessHash: long; + slug: string; + document: TypeDocument; + settings?: TypeWallPaperSettings; + fromReader(reader: Reader): WallPaper; + } + + export interface WallPaperNoFileArgs { + /** Wallpaper ID */ + id: long; + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is the default wallpaper */ + default?: true; + /** Dark mode */ + dark?: true; + /** Wallpaper settings */ + settings?: TypeWallPaperSettings; + } + + /** + * Wallpaper with no file access hash, used for example when deleting (unsave=true) wallpapers using account.saveWallPaper, specifying just the wallpaper ID.
+ * Also used for some default wallpapers which contain only colours.
+ * @link https://corefork.telegram.org/method/account.saveWallPaper + */ + export class WallPaperNoFile extends VirtualClass implements WallPaperNoFileArgs { + CONSTRUCTOR_id: -528465642; + SUBCLASS_OF_ID: 2527250827; + classType: "constructor"; + className: "WallPaperNoFile"; + id: long; + flags: number; + default?: true; + dark?: true; + settings?: TypeWallPaperSettings; + fromReader(reader: Reader): WallPaperNoFile; + } + + /** Report for spam
*/ + export class InputReportReasonSpam extends VirtualClass { + CONSTRUCTOR_id: 1490799288; + SUBCLASS_OF_ID: 2214706471; + classType: "constructor"; + className: "InputReportReasonSpam"; + fromReader(reader: Reader): InputReportReasonSpam; + } + + /** Report for violence
*/ + export class InputReportReasonViolence extends VirtualClass { + CONSTRUCTOR_id: 505595789; + SUBCLASS_OF_ID: 2214706471; + classType: "constructor"; + className: "InputReportReasonViolence"; + fromReader(reader: Reader): InputReportReasonViolence; + } + + /** Report for pornography
*/ + export class InputReportReasonPornography extends VirtualClass { + CONSTRUCTOR_id: 777640226; + SUBCLASS_OF_ID: 2214706471; + classType: "constructor"; + className: "InputReportReasonPornography"; + fromReader(reader: Reader): InputReportReasonPornography; + } + + /** Report for child abuse
*/ + export class InputReportReasonChildAbuse extends VirtualClass { + CONSTRUCTOR_id: -1376497949; + SUBCLASS_OF_ID: 2214706471; + classType: "constructor"; + className: "InputReportReasonChildAbuse"; + fromReader(reader: Reader): InputReportReasonChildAbuse; + } + + /** Other
*/ + export class InputReportReasonOther extends VirtualClass { + CONSTRUCTOR_id: -1041980751; + SUBCLASS_OF_ID: 2214706471; + classType: "constructor"; + className: "InputReportReasonOther"; + fromReader(reader: Reader): InputReportReasonOther; + } + + /** Report for copyrighted content
*/ + export class InputReportReasonCopyright extends VirtualClass { + CONSTRUCTOR_id: -1685456582; + SUBCLASS_OF_ID: 2214706471; + classType: "constructor"; + className: "InputReportReasonCopyright"; + fromReader(reader: Reader): InputReportReasonCopyright; + } + + /** Report an irrelevant geogroup
*/ + export class InputReportReasonGeoIrrelevant extends VirtualClass { + CONSTRUCTOR_id: -606798099; + SUBCLASS_OF_ID: 2214706471; + classType: "constructor"; + className: "InputReportReasonGeoIrrelevant"; + fromReader(reader: Reader): InputReportReasonGeoIrrelevant; + } + + /** Report for impersonation
*/ + export class InputReportReasonFake extends VirtualClass { + CONSTRUCTOR_id: -170010905; + SUBCLASS_OF_ID: 2214706471; + classType: "constructor"; + className: "InputReportReasonFake"; + fromReader(reader: Reader): InputReportReasonFake; + } + + export interface UserFullArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether you have blocked this user */ + blocked?: true; + /** Whether this user can make VoIP calls */ + phoneCallsAvailable?: true; + /** Whether this user's privacy settings allow you to call him */ + phoneCallsPrivate?: true; + /** Whether you can pin messages in the chat with this user, you can do this only for a chat with yourself */ + canPinMessage?: true; + /** Whether scheduled messages are available */ + hasScheduled?: true; + /** Whether the user can receive video calls */ + videoCallsAvailable?: true; + /** Remaining user info */ + user: TypeUser; + /** Bio of the user */ + about?: string; + /** Peer settings */ + settings: TypePeerSettings; + /** Profile photo */ + profilePhoto?: TypePhoto; + /** Notification settings */ + notifySettings: TypePeerNotifySettings; + /** For bots, info about the bot (bot commands, etc) */ + botInfo?: TypeBotInfo; + /** Message ID of the last pinned message */ + pinnedMsgId?: MessageIDLike; + /** Chats in common with this user */ + commonChatsCount: int; + /** Peer folder ID, for more info click here */ + folderId?: int; + /** Time To Live of all messages in this chat; once a message is this many seconds old, it must be deleted. */ + ttlPeriod?: int; + } + + /** + * Extended user info
+ * @link https://corefork.telegram.org/api/scheduled-messages + * @link https://corefork.telegram.org/api/pin + * @link https://corefork.telegram.org/api/folders + */ + export class UserFull extends VirtualClass implements UserFullArgs { + CONSTRUCTOR_id: 328899191; + SUBCLASS_OF_ID: 524706233; + classType: "constructor"; + className: "UserFull"; + flags: number; + blocked?: true; + phoneCallsAvailable?: true; + phoneCallsPrivate?: true; + canPinMessage?: true; + hasScheduled?: true; + videoCallsAvailable?: true; + user: TypeUser; + about?: string; + settings: TypePeerSettings; + profilePhoto?: TypePhoto; + notifySettings: TypePeerNotifySettings; + botInfo?: TypeBotInfo; + pinnedMsgId?: MessageIDLike; + commonChatsCount: int; + folderId?: int; + ttlPeriod?: int; + fromReader(reader: Reader): UserFull; + } + + export interface ContactArgs { + /** User identifier */ + userId: int; + /** Current user is in the user's contact list */ + mutual: Bool; + } + + /** A contact of the current user that is registered in the system.
*/ + export class Contact extends VirtualClass implements ContactArgs { + CONSTRUCTOR_id: -116274796; + SUBCLASS_OF_ID: 2212487076; + classType: "constructor"; + className: "Contact"; + userId: int; + mutual: Bool; + fromReader(reader: Reader): Contact; + } + + export interface ImportedContactArgs { + /** User identifier */ + userId: int; + /** The contact's client identifier (passed to one of the InputContact constructors) */ + clientId: long; + } + + /** + * Successfully imported contact.
+ * @link https://corefork.telegram.org/type/InputContact + */ + export class ImportedContact extends VirtualClass implements ImportedContactArgs { + CONSTRUCTOR_id: -805141448; + SUBCLASS_OF_ID: 3041246170; + classType: "constructor"; + className: "ImportedContact"; + userId: int; + clientId: long; + fromReader(reader: Reader): ImportedContact; + } + + export interface ContactStatusArgs { + /** User identifier */ + userId: int; + /** Online status */ + status: TypeUserStatus; + } + + /** Contact status: online / offline.
*/ + export class ContactStatus extends VirtualClass implements ContactStatusArgs { + CONSTRUCTOR_id: -748155807; + SUBCLASS_OF_ID: 1757468492; + classType: "constructor"; + className: "ContactStatus"; + userId: int; + status: TypeUserStatus; + fromReader(reader: Reader): ContactStatus; + } + + /** Filter is absent.
*/ + export class InputMessagesFilterEmpty extends VirtualClass { + CONSTRUCTOR_id: 1474492012; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterEmpty"; + fromReader(reader: Reader): InputMessagesFilterEmpty; + } + + /** Filter for messages containing photos.
*/ + export class InputMessagesFilterPhotos extends VirtualClass { + CONSTRUCTOR_id: -1777752804; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterPhotos"; + fromReader(reader: Reader): InputMessagesFilterPhotos; + } + + /** Filter for messages containing videos.
*/ + export class InputMessagesFilterVideo extends VirtualClass { + CONSTRUCTOR_id: -1614803355; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterVideo"; + fromReader(reader: Reader): InputMessagesFilterVideo; + } + + /** Filter for messages containing photos or videos.
*/ + export class InputMessagesFilterPhotoVideo extends VirtualClass { + CONSTRUCTOR_id: 1458172132; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterPhotoVideo"; + fromReader(reader: Reader): InputMessagesFilterPhotoVideo; + } + + /** Filter for messages containing documents.
*/ + export class InputMessagesFilterDocument extends VirtualClass { + CONSTRUCTOR_id: -1629621880; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterDocument"; + fromReader(reader: Reader): InputMessagesFilterDocument; + } + + /** Return only messages containing URLs
*/ + export class InputMessagesFilterUrl extends VirtualClass { + CONSTRUCTOR_id: 2129714567; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterUrl"; + fromReader(reader: Reader): InputMessagesFilterUrl; + } + + /** Return only messages containing gifs
*/ + export class InputMessagesFilterGif extends VirtualClass { + CONSTRUCTOR_id: -3644025; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterGif"; + fromReader(reader: Reader): InputMessagesFilterGif; + } + + /** Return only messages containing voice notes
*/ + export class InputMessagesFilterVoice extends VirtualClass { + CONSTRUCTOR_id: 1358283666; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterVoice"; + fromReader(reader: Reader): InputMessagesFilterVoice; + } + + /** Return only messages containing audio files
*/ + export class InputMessagesFilterMusic extends VirtualClass { + CONSTRUCTOR_id: 928101534; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterMusic"; + fromReader(reader: Reader): InputMessagesFilterMusic; + } + + /** Return only chat photo changes
*/ + export class InputMessagesFilterChatPhotos extends VirtualClass { + CONSTRUCTOR_id: 975236280; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterChatPhotos"; + fromReader(reader: Reader): InputMessagesFilterChatPhotos; + } + + export interface InputMessagesFilterPhoneCallsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Return only missed phone calls */ + missed?: true; + } + + /** Return only phone calls
*/ + export class InputMessagesFilterPhoneCalls extends VirtualClass implements InputMessagesFilterPhoneCallsArgs { + CONSTRUCTOR_id: -2134272152; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterPhoneCalls"; + flags: number; + missed?: true; + fromReader(reader: Reader): InputMessagesFilterPhoneCalls; + } + + /** Return only round videos and voice notes
*/ + export class InputMessagesFilterRoundVoice extends VirtualClass { + CONSTRUCTOR_id: 2054952868; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterRoundVoice"; + fromReader(reader: Reader): InputMessagesFilterRoundVoice; + } + + /** Return only round videos
*/ + export class InputMessagesFilterRoundVideo extends VirtualClass { + CONSTRUCTOR_id: -1253451181; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterRoundVideo"; + fromReader(reader: Reader): InputMessagesFilterRoundVideo; + } + + /** + * Return only messages where the current user was mentioned.
+ * @link https://corefork.telegram.org/api/mentions + */ + export class InputMessagesFilterMyMentions extends VirtualClass { + CONSTRUCTOR_id: -1040652646; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterMyMentions"; + fromReader(reader: Reader): InputMessagesFilterMyMentions; + } + + /** Return only messages containing geolocations
*/ + export class InputMessagesFilterGeo extends VirtualClass { + CONSTRUCTOR_id: -419271411; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterGeo"; + fromReader(reader: Reader): InputMessagesFilterGeo; + } + + /** Return only messages containing contacts
*/ + export class InputMessagesFilterContacts extends VirtualClass { + CONSTRUCTOR_id: -530392189; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterContacts"; + fromReader(reader: Reader): InputMessagesFilterContacts; + } + + /** Fetch only pinned messages
*/ + export class InputMessagesFilterPinned extends VirtualClass { + CONSTRUCTOR_id: 464520273; + SUBCLASS_OF_ID: 2318855188; + classType: "constructor"; + className: "InputMessagesFilterPinned"; + fromReader(reader: Reader): InputMessagesFilterPinned; + } + + export interface UpdateNewMessageArgs { + /** Message */ + message: TypeMessage; + /** New quantity of actions in a message box */ + pts: int; + /** Number of generated events */ + ptsCount: int; + } + + /** New message in a private chat or in a legacy group.
*/ + export class UpdateNewMessage extends VirtualClass implements UpdateNewMessageArgs { + CONSTRUCTOR_id: 522914557; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateNewMessage"; + message: TypeMessage; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateNewMessage; + } + + export interface UpdateMessageIDArgs { + /** id identifier of a respective Message */ + id: int; + /** Previuosly transferred client random_id identifier */ + randomId: long; + } + + /** + * Sent message with random_id client identifier was assigned an identifier.
+ * @link https://corefork.telegram.org/type/Message + */ + export class UpdateMessageID extends VirtualClass implements UpdateMessageIDArgs { + CONSTRUCTOR_id: 1318109142; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateMessageID"; + id: int; + randomId: long; + fromReader(reader: Reader): UpdateMessageID; + } + + export interface UpdateDeleteMessagesArgs { + /** List of identifiers of deleted messages */ + messages: int[]; + /** New quality of actions in a message box */ + pts: int; + /** Number of generated events */ + ptsCount: int; + } + + /** + * Messages were deleted.
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdateDeleteMessages extends VirtualClass implements UpdateDeleteMessagesArgs { + CONSTRUCTOR_id: -1576161051; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateDeleteMessages"; + messages: int[]; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateDeleteMessages; + } + + export interface UpdateUserTypingArgs { + /** User id */ + userId: int; + /** Action type
Param added in Layer 17. */ + action: TypeSendMessageAction; + } + + /** + * The user is preparing a message; typing, recording, uploading, etc. This update is valid for 6 seconds. If no repeated update received after 6 seconds, it should be considered that the user stopped doing whatever he's been doing.
+ * @link https://corefork.telegram.org/api/layers + */ + export class UpdateUserTyping extends VirtualClass implements UpdateUserTypingArgs { + CONSTRUCTOR_id: 1548249383; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateUserTyping"; + userId: int; + action: TypeSendMessageAction; + fromReader(reader: Reader): UpdateUserTyping; + } + + export interface UpdateChatUserTypingArgs { + /** Group id */ + chatId: int; + /** Peer that started typing (can be the chat itself, in case of anonymous admins). */ + fromId: TypePeer; + /** Type of action
Parameter added in Layer 17. */ + action: TypeSendMessageAction; + } + + /** + * The user is preparing a message in a group; typing, recording, uploading, etc. This update is valid for 6 seconds. If no repeated update received after 6 seconds, it should be considered that the user stopped doing whatever he's been doing.
+ * @link https://corefork.telegram.org/api/layers + */ + export class UpdateChatUserTyping extends VirtualClass implements UpdateChatUserTypingArgs { + CONSTRUCTOR_id: -2033525908; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChatUserTyping"; + chatId: int; + fromId: TypePeer; + action: TypeSendMessageAction; + fromReader(reader: Reader): UpdateChatUserTyping; + } + + export interface UpdateChatParticipantsArgs { + /** Updated chat participants */ + participants: TypeChatParticipants; + } + + /** Composition of chat participants changed.
*/ + export class UpdateChatParticipants extends VirtualClass implements UpdateChatParticipantsArgs { + CONSTRUCTOR_id: 125178264; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChatParticipants"; + participants: TypeChatParticipants; + fromReader(reader: Reader): UpdateChatParticipants; + } + + export interface UpdateUserStatusArgs { + /** User identifier */ + userId: int; + /** New status */ + status: TypeUserStatus; + } + + /** Contact status update.
*/ + export class UpdateUserStatus extends VirtualClass implements UpdateUserStatusArgs { + CONSTRUCTOR_id: 469489699; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateUserStatus"; + userId: int; + status: TypeUserStatus; + fromReader(reader: Reader): UpdateUserStatus; + } + + export interface UpdateUserNameArgs { + /** User identifier */ + userId: int; + /** New first name. Corresponds to the new value of real_first_name field of the userFull constructor. */ + firstName: string; + /** New last name. Corresponds to the new value of real_last_name field of the userFull constructor. */ + lastName: string; + /** New username.
Parameter added in Layer 18. */ + username: string; + } + + /** + * Changes the user's first name, last name and username.
+ * @link https://corefork.telegram.org/constructor/userFull + * @link https://corefork.telegram.org/api/layers + */ + export class UpdateUserName extends VirtualClass implements UpdateUserNameArgs { + CONSTRUCTOR_id: -1489818765; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateUserName"; + userId: int; + firstName: string; + lastName: string; + username: string; + fromReader(reader: Reader): UpdateUserName; + } + + export interface UpdateUserPhotoArgs { + /** User identifier */ + userId: int; + /** Date of photo update. */ + date: int; + /** New profile photo */ + photo: TypeUserProfilePhoto; + /** (boolTrue), if one of the previously used photos is set a profile photo. */ + previous: Bool; + } + + /** + * Change of contact's profile photo.
+ * @link https://corefork.telegram.org/constructor/boolTrue + */ + export class UpdateUserPhoto extends VirtualClass implements UpdateUserPhotoArgs { + CONSTRUCTOR_id: -1791935732; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateUserPhoto"; + userId: int; + date: int; + photo: TypeUserProfilePhoto; + previous: Bool; + fromReader(reader: Reader): UpdateUserPhoto; + } + + export interface UpdateNewEncryptedMessageArgs { + /** Message */ + message: TypeEncryptedMessage; + /** New qts value, see updates » for more info. */ + qts: int; + } + + /** + * New encrypted message.
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdateNewEncryptedMessage extends VirtualClass implements UpdateNewEncryptedMessageArgs { + CONSTRUCTOR_id: 314359194; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateNewEncryptedMessage"; + message: TypeEncryptedMessage; + qts: int; + fromReader(reader: Reader): UpdateNewEncryptedMessage; + } + + export interface UpdateEncryptedChatTypingArgs { + /** Chat ID */ + chatId: int; + } + + /** Interlocutor is typing a message in an encrypted chat. Update period is 6 second. If upon this time there is no repeated update, it shall be considered that the interlocutor stopped typing.
*/ + export class UpdateEncryptedChatTyping extends VirtualClass implements UpdateEncryptedChatTypingArgs { + CONSTRUCTOR_id: 386986326; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateEncryptedChatTyping"; + chatId: int; + fromReader(reader: Reader): UpdateEncryptedChatTyping; + } + + export interface UpdateEncryptionArgs { + /** Encrypted chat */ + chat: TypeEncryptedChat; + /** Date of change */ + date: int; + } + + /** Change of state in an encrypted chat.
*/ + export class UpdateEncryption extends VirtualClass implements UpdateEncryptionArgs { + CONSTRUCTOR_id: -1264392051; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateEncryption"; + chat: TypeEncryptedChat; + date: int; + fromReader(reader: Reader): UpdateEncryption; + } + + export interface UpdateEncryptedMessagesReadArgs { + /** Chat ID */ + chatId: int; + /** Maximum value of data for read messages */ + maxDate: int; + /** Time when messages were read */ + date: int; + } + + /** Communication history in an encrypted chat was marked as read.
*/ + export class UpdateEncryptedMessagesRead extends VirtualClass implements UpdateEncryptedMessagesReadArgs { + CONSTRUCTOR_id: 956179895; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateEncryptedMessagesRead"; + chatId: int; + maxDate: int; + date: int; + fromReader(reader: Reader): UpdateEncryptedMessagesRead; + } + + export interface UpdateChatParticipantAddArgs { + /** Group ID */ + chatId: int; + /** ID of the new member */ + userId: int; + /** ID of the user, who added member to the group */ + inviterId: int; + /** When was the participant added */ + date: int; + /** Chat version number */ + version: int; + } + + /** New group member.
*/ + export class UpdateChatParticipantAdd extends VirtualClass implements UpdateChatParticipantAddArgs { + CONSTRUCTOR_id: -364179876; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChatParticipantAdd"; + chatId: int; + userId: int; + inviterId: int; + date: int; + version: int; + fromReader(reader: Reader): UpdateChatParticipantAdd; + } + + export interface UpdateChatParticipantDeleteArgs { + /** Group ID */ + chatId: int; + /** ID of the user */ + userId: int; + /** Used in basic groups to reorder updates and make sure that all of them was received. */ + version: int; + } + + /** A member has left the group.
*/ + export class UpdateChatParticipantDelete extends VirtualClass implements UpdateChatParticipantDeleteArgs { + CONSTRUCTOR_id: 1851755554; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChatParticipantDelete"; + chatId: int; + userId: int; + version: int; + fromReader(reader: Reader): UpdateChatParticipantDelete; + } + + export interface UpdateDcOptionsArgs { + /** New connection options */ + dcOptions: TypeDcOption[]; + } + + /** Changes in the data center configuration options.
*/ + export class UpdateDcOptions extends VirtualClass implements UpdateDcOptionsArgs { + CONSTRUCTOR_id: -1906403213; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateDcOptions"; + dcOptions: TypeDcOption[]; + fromReader(reader: Reader): UpdateDcOptions; + } + + export interface UpdateNotifySettingsArgs { + /** Nofication source */ + peer: TypeNotifyPeer; + /** New notification settings */ + notifySettings: TypePeerNotifySettings; + } + + /** Changes in notification settings.
*/ + export class UpdateNotifySettings extends VirtualClass implements UpdateNotifySettingsArgs { + CONSTRUCTOR_id: -1094555409; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateNotifySettings"; + peer: TypeNotifyPeer; + notifySettings: TypePeerNotifySettings; + fromReader(reader: Reader): UpdateNotifySettings; + } + + export interface UpdateServiceNotificationArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** (boolTrue) if the message must be displayed in a popup. */ + popup?: true; + /** When was the notification received
The message must also be stored locally as part of the message history with the user id 777000 (Telegram Notifications). */ + inboxDate?: int; + /** String, identical in format and contents to the type field in API errors. Describes type of service message. It is acceptable to ignore repeated messages of the same type within a short period of time (15 minutes). */ + type: string; + /** Message text */ + message: string; + /** Media content (optional) */ + media: TypeMessageMedia; + /** Message entities for styled text */ + entities: TypeMessageEntity[]; + } + + /** + * A service message for the user.
The app must show the message to the user upon receiving this update. In case the popup parameter was passed, the text message must be displayed in a popup alert immediately upon receipt. It is recommended to handle the text as you would an ordinary message in terms of highlighting links, etc. The message must also be stored locally as part of the message history with the user id 777000 (Telegram Notifications).
+ * @link https://corefork.telegram.org/api/errors + * @link https://corefork.telegram.org/api/entities + */ + export class UpdateServiceNotification extends VirtualClass implements UpdateServiceNotificationArgs { + CONSTRUCTOR_id: -337352679; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateServiceNotification"; + flags: number; + popup?: true; + inboxDate?: int; + type: string; + message: string; + media: TypeMessageMedia; + entities: TypeMessageEntity[]; + fromReader(reader: Reader): UpdateServiceNotification; + } + + export interface UpdatePrivacyArgs { + /** Peers to which the privacy rules apply */ + key: TypePrivacyKey; + /** New privacy rules */ + rules: TypePrivacyRule[]; + } + + /** Privacy rules were changed
*/ + export class UpdatePrivacy extends VirtualClass implements UpdatePrivacyArgs { + CONSTRUCTOR_id: -298113238; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePrivacy"; + key: TypePrivacyKey; + rules: TypePrivacyRule[]; + fromReader(reader: Reader): UpdatePrivacy; + } + + export interface UpdateUserPhoneArgs { + /** User ID */ + userId: int; + /** New phone number */ + phone: string; + } + + /** A user's phone number was changed
*/ + export class UpdateUserPhone extends VirtualClass implements UpdateUserPhoneArgs { + CONSTRUCTOR_id: 314130811; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateUserPhone"; + userId: int; + phone: string; + fromReader(reader: Reader): UpdateUserPhone; + } + + export interface UpdateReadHistoryInboxArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Peer folder ID, for more info click here */ + folderId?: int; + /** Peer */ + peer: TypePeer; + /** Maximum ID of messages read */ + maxId: int; + /** Number of messages that are still unread */ + stillUnreadCount: int; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * Incoming messages were read
+ * @link https://corefork.telegram.org/api/folders + * @link https://corefork.telegram.org/api/updates + */ + export class UpdateReadHistoryInbox extends VirtualClass implements UpdateReadHistoryInboxArgs { + CONSTRUCTOR_id: -1667805217; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateReadHistoryInbox"; + flags: number; + folderId?: int; + peer: TypePeer; + maxId: int; + stillUnreadCount: int; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateReadHistoryInbox; + } + + export interface UpdateReadHistoryOutboxArgs { + /** Peer */ + peer: TypePeer; + /** Maximum ID of read outgoing messages */ + maxId: int; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * Outgoing messages were read
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdateReadHistoryOutbox extends VirtualClass implements UpdateReadHistoryOutboxArgs { + CONSTRUCTOR_id: 791617983; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateReadHistoryOutbox"; + peer: TypePeer; + maxId: int; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateReadHistoryOutbox; + } + + export interface UpdateWebPageArgs { + /** Webpage preview */ + webpage: TypeWebPage; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * An instant view webpage preview was generated
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdateWebPage extends VirtualClass implements UpdateWebPageArgs { + CONSTRUCTOR_id: 2139689491; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateWebPage"; + webpage: TypeWebPage; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateWebPage; + } + + export interface UpdateReadMessagesContentsArgs { + /** IDs of read messages */ + messages: int[]; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * Contents of messages in the common message box were read
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdateReadMessagesContents extends VirtualClass implements UpdateReadMessagesContentsArgs { + CONSTRUCTOR_id: 1757493555; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateReadMessagesContents"; + messages: int[]; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateReadMessagesContents; + } + + export interface UpdateChannelTooLongArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The channel */ + channelId: int; + /** The PTS. */ + pts?: int; + } + + /** + * There are new updates in the specified channel, the client must fetch them.
+ * If the difference is too long or if the channel isn't currently in the states, start fetching from the specified pts.
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdateChannelTooLong extends VirtualClass implements UpdateChannelTooLongArgs { + CONSTRUCTOR_id: -352032773; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChannelTooLong"; + flags: number; + channelId: int; + pts?: int; + fromReader(reader: Reader): UpdateChannelTooLong; + } + + export interface UpdateChannelArgs { + /** Channel ID */ + channelId: int; + } + + /** A new channel is available
*/ + export class UpdateChannel extends VirtualClass implements UpdateChannelArgs { + CONSTRUCTOR_id: -1227598250; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChannel"; + channelId: int; + fromReader(reader: Reader): UpdateChannel; + } + + export interface UpdateNewChannelMessageArgs { + /** New message */ + message: TypeMessage; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * A new message was sent in a channel/supergroup
+ * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/channel + */ + export class UpdateNewChannelMessage extends VirtualClass implements UpdateNewChannelMessageArgs { + CONSTRUCTOR_id: 1656358105; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateNewChannelMessage"; + message: TypeMessage; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateNewChannelMessage; + } + + export interface UpdateReadChannelInboxArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Peer folder ID, for more info click here */ + folderId?: int; + /** Channel/supergroup ID */ + channelId: int; + /** Position up to which all incoming messages are read. */ + maxId: int; + /** Count of messages weren't read yet */ + stillUnreadCount: int; + /** Event count after generation */ + pts: int; + } + + /** + * Incoming messages in a channel/supergroup were read
+ * @link https://corefork.telegram.org/api/folders + * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/channel + */ + export class UpdateReadChannelInbox extends VirtualClass implements UpdateReadChannelInboxArgs { + CONSTRUCTOR_id: 856380452; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateReadChannelInbox"; + flags: number; + folderId?: int; + channelId: int; + maxId: int; + stillUnreadCount: int; + pts: int; + fromReader(reader: Reader): UpdateReadChannelInbox; + } + + export interface UpdateDeleteChannelMessagesArgs { + /** Channel ID */ + channelId: int; + /** IDs of messages that were deleted */ + messages: int[]; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * Some messages in a supergroup/channel were deleted
+ * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/channel + */ + export class UpdateDeleteChannelMessages extends VirtualClass implements UpdateDeleteChannelMessagesArgs { + CONSTRUCTOR_id: -1015733815; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateDeleteChannelMessages"; + channelId: int; + messages: int[]; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateDeleteChannelMessages; + } + + export interface UpdateChannelMessageViewsArgs { + /** Channel ID */ + channelId: int; + /** ID of the message */ + id: int; + /** New view counter */ + views: int; + } + + /** The view counter of a message in a channel has changed
*/ + export class UpdateChannelMessageViews extends VirtualClass implements UpdateChannelMessageViewsArgs { + CONSTRUCTOR_id: -1734268085; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChannelMessageViews"; + channelId: int; + id: int; + views: int; + fromReader(reader: Reader): UpdateChannelMessageViews; + } + + export interface UpdateChatParticipantAdminArgs { + /** Chat ID */ + chatId: int; + /** ID of the (de)admined user */ + userId: int; + /** Whether the user was rendered admin */ + isAdmin: Bool; + /** Used in basic groups to reorder updates and make sure that all of them was received. */ + version: int; + } + + /** + * Admin permissions of a user in a legacy group were changed
+ * @link https://corefork.telegram.org/api/channel + */ + export class UpdateChatParticipantAdmin extends VirtualClass implements UpdateChatParticipantAdminArgs { + CONSTRUCTOR_id: -1232070311; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChatParticipantAdmin"; + chatId: int; + userId: int; + isAdmin: Bool; + version: int; + fromReader(reader: Reader): UpdateChatParticipantAdmin; + } + + export interface UpdateNewStickerSetArgs { + /** The installed stickerset */ + stickerset: messages.TypeStickerSet; + } + + /** A new stickerset was installed
*/ + export class UpdateNewStickerSet extends VirtualClass implements UpdateNewStickerSetArgs { + CONSTRUCTOR_id: 1753886890; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateNewStickerSet"; + stickerset: messages.TypeStickerSet; + fromReader(reader: Reader): UpdateNewStickerSet; + } + + export interface UpdateStickerSetsOrderArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the updated stickers are mask stickers */ + masks?: true; + /** New sticker order by sticker ID */ + order: long[]; + } + + /** The order of stickersets was changed
*/ + export class UpdateStickerSetsOrder extends VirtualClass implements UpdateStickerSetsOrderArgs { + CONSTRUCTOR_id: 196268545; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateStickerSetsOrder"; + flags: number; + masks?: true; + order: long[]; + fromReader(reader: Reader): UpdateStickerSetsOrder; + } + + /** Installed stickersets have changed, the client should refetch them using messages.getAllStickers
*/ + export class UpdateStickerSets extends VirtualClass { + CONSTRUCTOR_id: 1135492588; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateStickerSets"; + fromReader(reader: Reader): UpdateStickerSets; + } + + /** The saved gif list has changed, the client should refetch it using messages.getSavedGifs
*/ + export class UpdateSavedGifs extends VirtualClass { + CONSTRUCTOR_id: -1821035490; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateSavedGifs"; + fromReader(reader: Reader): UpdateSavedGifs; + } + + export interface UpdateBotInlineQueryArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Query ID */ + queryId: long; + /** User that sent the query */ + userId: int; + /** Text of query */ + query: string; + /** Attached geolocation */ + geo?: TypeGeoPoint; + /** Type of the chat from which the inline query was sent. */ + peerType?: TypeInlineQueryPeerType; + /** Offset to navigate through results */ + offset: string; + } + + /** An incoming inline query
*/ + export class UpdateBotInlineQuery extends VirtualClass implements UpdateBotInlineQueryArgs { + CONSTRUCTOR_id: 1059076315; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateBotInlineQuery"; + flags: number; + queryId: long; + userId: int; + query: string; + geo?: TypeGeoPoint; + peerType?: TypeInlineQueryPeerType; + offset: string; + fromReader(reader: Reader): UpdateBotInlineQuery; + } + + export interface UpdateBotInlineSendArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The user that chose the result */ + userId: int; + /** The query that was used to obtain the result */ + query: string; + /** Optional. Sender location, only for bots that require user location */ + geo?: TypeGeoPoint; + /** The unique identifier for the result that was chosen */ + id: string; + /** Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. */ + msgId?: TypeInputBotInlineMessageID; + } + + /** The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
*/ + export class UpdateBotInlineSend extends VirtualClass implements UpdateBotInlineSendArgs { + CONSTRUCTOR_id: 239663460; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateBotInlineSend"; + flags: number; + userId: int; + query: string; + geo?: TypeGeoPoint; + id: string; + msgId?: TypeInputBotInlineMessageID; + fromReader(reader: Reader): UpdateBotInlineSend; + } + + export interface UpdateEditChannelMessageArgs { + /** The new message */ + message: TypeMessage; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * A message was edited in a channel/supergroup
+ * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/channel + */ + export class UpdateEditChannelMessage extends VirtualClass implements UpdateEditChannelMessageArgs { + CONSTRUCTOR_id: 457133559; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateEditChannelMessage"; + message: TypeMessage; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateEditChannelMessage; + } + + export interface UpdateBotCallbackQueryArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Query ID */ + queryId: long; + /** ID of the user that pressed the button */ + userId: int; + /** Chat where the inline keyboard was sent */ + peer: TypePeer; + /** Message ID */ + msgId: MessageIDLike; + /** Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. */ + chatInstance: long; + /** Callback data */ + data?: bytes; + /** Short name of a Game to be returned, serves as the unique identifier for the game */ + gameShortName?: string; + } + + /** A callback button was pressed, and the button data was sent to the bot that created the button
*/ + export class UpdateBotCallbackQuery extends VirtualClass implements UpdateBotCallbackQueryArgs { + CONSTRUCTOR_id: -415938591; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateBotCallbackQuery"; + flags: number; + queryId: long; + userId: int; + peer: TypePeer; + msgId: MessageIDLike; + chatInstance: long; + data?: bytes; + gameShortName?: string; + fromReader(reader: Reader): UpdateBotCallbackQuery; + } + + export interface UpdateEditMessageArgs { + /** The new edited message */ + message: TypeMessage; + /** PTS */ + pts: int; + /** PTS count */ + ptsCount: int; + } + + /** + * A message was edited
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdateEditMessage extends VirtualClass implements UpdateEditMessageArgs { + CONSTRUCTOR_id: -469536605; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateEditMessage"; + message: TypeMessage; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateEditMessage; + } + + export interface UpdateInlineBotCallbackQueryArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Query ID */ + queryId: long; + /** ID of the user that pressed the button */ + userId: int; + /** ID of the inline message with the button */ + msgId: TypeInputBotInlineMessageID; + /** Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. */ + chatInstance: long; + /** Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field. */ + data?: bytes; + /** Short name of a Game to be returned, serves as the unique identifier for the game */ + gameShortName?: string; + } + + /** This notification is received by bots when a button is pressed
*/ + export class UpdateInlineBotCallbackQuery extends VirtualClass implements UpdateInlineBotCallbackQueryArgs { + CONSTRUCTOR_id: -103646630; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateInlineBotCallbackQuery"; + flags: number; + queryId: long; + userId: int; + msgId: TypeInputBotInlineMessageID; + chatInstance: long; + data?: bytes; + gameShortName?: string; + fromReader(reader: Reader): UpdateInlineBotCallbackQuery; + } + + export interface UpdateReadChannelOutboxArgs { + /** Channel/supergroup ID */ + channelId: int; + /** Position up to which all outgoing messages are read. */ + maxId: int; + } + + /** + * Outgoing messages in a channel/supergroup were read
+ * @link https://corefork.telegram.org/api/channel + */ + export class UpdateReadChannelOutbox extends VirtualClass implements UpdateReadChannelOutboxArgs { + CONSTRUCTOR_id: 634833351; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateReadChannelOutbox"; + channelId: int; + maxId: int; + fromReader(reader: Reader): UpdateReadChannelOutbox; + } + + export interface UpdateDraftMessageArgs { + /** The peer to which the draft is associated */ + peer: TypePeer; + /** The draft */ + draft: TypeDraftMessage; + } + + /** + * Notifies a change of a message draft.
+ * @link https://corefork.telegram.org/api/drafts + */ + export class UpdateDraftMessage extends VirtualClass implements UpdateDraftMessageArgs { + CONSTRUCTOR_id: -299124375; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateDraftMessage"; + peer: TypePeer; + draft: TypeDraftMessage; + fromReader(reader: Reader): UpdateDraftMessage; + } + + /** Some featured stickers were marked as read
*/ + export class UpdateReadFeaturedStickers extends VirtualClass { + CONSTRUCTOR_id: 1461528386; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateReadFeaturedStickers"; + fromReader(reader: Reader): UpdateReadFeaturedStickers; + } + + /** The recent sticker list was updated
*/ + export class UpdateRecentStickers extends VirtualClass { + CONSTRUCTOR_id: -1706939360; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateRecentStickers"; + fromReader(reader: Reader): UpdateRecentStickers; + } + + /** + * The server-side configuration has changed; the client should re-fetch the config using help.getConfig
+ * @link https://corefork.telegram.org/method/help.getConfig + */ + export class UpdateConfig extends VirtualClass { + CONSTRUCTOR_id: -1574314746; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateConfig"; + fromReader(reader: Reader): UpdateConfig; + } + + /** + * Common message box sequence PTS has changed, state has to be refetched using updates.getState
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdatePtsChanged extends VirtualClass { + CONSTRUCTOR_id: 861169551; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePtsChanged"; + fromReader(reader: Reader): UpdatePtsChanged; + } + + export interface UpdateChannelWebPageArgs { + /** Channel/supergroup ID */ + channelId: int; + /** Generated webpage preview */ + webpage: TypeWebPage; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * A webpage preview of a link in a channel/supergroup message was generated
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/updates + */ + export class UpdateChannelWebPage extends VirtualClass implements UpdateChannelWebPageArgs { + CONSTRUCTOR_id: 1081547008; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChannelWebPage"; + channelId: int; + webpage: TypeWebPage; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateChannelWebPage; + } + + export interface UpdateDialogPinnedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the dialog was pinned */ + pinned?: true; + /** Peer folder ID, for more info click here */ + folderId?: int; + /** The dialog */ + peer: TypeDialogPeer; + } + + /** + * A dialog was pinned/unpinned
+ * @link https://corefork.telegram.org/api/folders + */ + export class UpdateDialogPinned extends VirtualClass implements UpdateDialogPinnedArgs { + CONSTRUCTOR_id: 1852826908; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateDialogPinned"; + flags: number; + pinned?: true; + folderId?: int; + peer: TypeDialogPeer; + fromReader(reader: Reader): UpdateDialogPinned; + } + + export interface UpdatePinnedDialogsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Peer folder ID, for more info click here */ + folderId?: int; + /** New order of pinned dialogs */ + order?: TypeDialogPeer[]; + } + + /** + * Pinned dialogs were updated
+ * @link https://corefork.telegram.org/api/folders + */ + export class UpdatePinnedDialogs extends VirtualClass implements UpdatePinnedDialogsArgs { + CONSTRUCTOR_id: -99664734; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePinnedDialogs"; + flags: number; + folderId?: int; + order?: TypeDialogPeer[]; + fromReader(reader: Reader): UpdatePinnedDialogs; + } + + export interface UpdateBotWebhookJSONArgs { + /** The event */ + data: TypeDataJSON; + } + + /** A new incoming event; for bots only
*/ + export class UpdateBotWebhookJSON extends VirtualClass implements UpdateBotWebhookJSONArgs { + CONSTRUCTOR_id: -2095595325; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateBotWebhookJSON"; + data: TypeDataJSON; + fromReader(reader: Reader): UpdateBotWebhookJSON; + } + + export interface UpdateBotWebhookJSONQueryArgs { + /** Query identifier */ + queryId: long; + /** Query data */ + data: TypeDataJSON; + /** Query timeout */ + timeout: int; + } + + /** A new incoming query; for bots only
*/ + export class UpdateBotWebhookJSONQuery extends VirtualClass implements UpdateBotWebhookJSONQueryArgs { + CONSTRUCTOR_id: -1684914010; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateBotWebhookJSONQuery"; + queryId: long; + data: TypeDataJSON; + timeout: int; + fromReader(reader: Reader): UpdateBotWebhookJSONQuery; + } + + export interface UpdateBotShippingQueryArgs { + /** Unique query identifier */ + queryId: long; + /** User who sent the query */ + userId: int; + /** Bot specified invoice payload */ + payload: bytes; + /** User specified shipping address */ + shippingAddress: TypePostAddress; + } + + /** This object contains information about an incoming shipping query.
*/ + export class UpdateBotShippingQuery extends VirtualClass implements UpdateBotShippingQueryArgs { + CONSTRUCTOR_id: -523384512; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateBotShippingQuery"; + queryId: long; + userId: int; + payload: bytes; + shippingAddress: TypePostAddress; + fromReader(reader: Reader): UpdateBotShippingQuery; + } + + export interface UpdateBotPrecheckoutQueryArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Unique query identifier */ + queryId: long; + /** User who sent the query */ + userId: int; + /** Bot specified invoice payload */ + payload: bytes; + /** Order info provided by the user */ + info?: TypePaymentRequestedInfo; + /** Identifier of the shipping option chosen by the user */ + shippingOptionId?: string; + /** Three-letter ISO 4217 currency code */ + currency: string; + /** Total amount in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ + totalAmount: long; + } + + /** + * This object contains information about an incoming pre-checkout query.
+ * @link https://corefork.telegram.org/bots/payments + */ + export class UpdateBotPrecheckoutQuery extends VirtualClass implements UpdateBotPrecheckoutQueryArgs { + CONSTRUCTOR_id: 1563376297; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateBotPrecheckoutQuery"; + flags: number; + queryId: long; + userId: int; + payload: bytes; + info?: TypePaymentRequestedInfo; + shippingOptionId?: string; + currency: string; + totalAmount: long; + fromReader(reader: Reader): UpdateBotPrecheckoutQuery; + } + + export interface UpdatePhoneCallArgs { + /** Phone call */ + phoneCall: TypePhoneCall; + } + + /** An incoming phone call
*/ + export class UpdatePhoneCall extends VirtualClass implements UpdatePhoneCallArgs { + CONSTRUCTOR_id: -1425052898; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePhoneCall"; + phoneCall: TypePhoneCall; + fromReader(reader: Reader): UpdatePhoneCall; + } + + export interface UpdateLangPackTooLongArgs { + /** Language code */ + langCode: string; + } + + /** + * A language pack has changed, the client should manually fetch the changed strings using langpack.getDifference
+ * @link https://corefork.telegram.org/method/langpack.getDifference + */ + export class UpdateLangPackTooLong extends VirtualClass implements UpdateLangPackTooLongArgs { + CONSTRUCTOR_id: 1180041828; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateLangPackTooLong"; + langCode: string; + fromReader(reader: Reader): UpdateLangPackTooLong; + } + + export interface UpdateLangPackArgs { + /** Changed strings */ + difference: TypeLangPackDifference; + } + + /** Language pack updated
*/ + export class UpdateLangPack extends VirtualClass implements UpdateLangPackArgs { + CONSTRUCTOR_id: 1442983757; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateLangPack"; + difference: TypeLangPackDifference; + fromReader(reader: Reader): UpdateLangPack; + } + + /** + * The list of favorited stickers was changed, the client should call messages.getFavedStickers to refetch the new list
+ * @link https://corefork.telegram.org/method/messages.getFavedStickers + */ + export class UpdateFavedStickers extends VirtualClass { + CONSTRUCTOR_id: -451831443; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateFavedStickers"; + fromReader(reader: Reader): UpdateFavedStickers; + } + + export interface UpdateChannelReadMessagesContentsArgs { + /** Channel/supergroup ID */ + channelId: int; + /** IDs of messages that were read */ + messages: int[]; + } + + /** + * The specified channel/supergroup messages were read
+ * @link https://corefork.telegram.org/api/channel + */ + export class UpdateChannelReadMessagesContents extends VirtualClass implements UpdateChannelReadMessagesContentsArgs { + CONSTRUCTOR_id: -1987495099; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChannelReadMessagesContents"; + channelId: int; + messages: int[]; + fromReader(reader: Reader): UpdateChannelReadMessagesContents; + } + + /** All contacts were deleted
*/ + export class UpdateContactsReset extends VirtualClass { + CONSTRUCTOR_id: 1887741886; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateContactsReset"; + fromReader(reader: Reader): UpdateContactsReset; + } + + export interface UpdateChannelAvailableMessagesArgs { + /** Channel/supergroup ID */ + channelId: int; + /** Identifier of a maximum unavailable message in a channel due to hidden history. */ + availableMinId: int; + } + + /** + * The history of a channel/supergroup was hidden.
+ * @link https://corefork.telegram.org/api/channel + */ + export class UpdateChannelAvailableMessages extends VirtualClass implements UpdateChannelAvailableMessagesArgs { + CONSTRUCTOR_id: 1893427255; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChannelAvailableMessages"; + channelId: int; + availableMinId: int; + fromReader(reader: Reader): UpdateChannelAvailableMessages; + } + + export interface UpdateDialogUnreadMarkArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Was the chat marked or unmarked as read */ + unread?: true; + /** The dialog */ + peer: TypeDialogPeer; + } + + /** The manual unread mark of a chat was changed
*/ + export class UpdateDialogUnreadMark extends VirtualClass implements UpdateDialogUnreadMarkArgs { + CONSTRUCTOR_id: -513517117; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateDialogUnreadMark"; + flags: number; + unread?: true; + peer: TypeDialogPeer; + fromReader(reader: Reader): UpdateDialogUnreadMark; + } + + export interface UpdateMessagePollArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Poll ID */ + pollId: long; + /** If the server knows the client hasn't cached this poll yet, the poll itself */ + poll?: TypePoll; + /** New poll results */ + results: TypePollResults; + } + + /** The results of a poll have changed
*/ + export class UpdateMessagePoll extends VirtualClass implements UpdateMessagePollArgs { + CONSTRUCTOR_id: -1398708869; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateMessagePoll"; + flags: number; + pollId: long; + poll?: TypePoll; + results: TypePollResults; + fromReader(reader: Reader): UpdateMessagePoll; + } + + export interface UpdateChatDefaultBannedRightsArgs { + /** The chat */ + peer: TypePeer; + /** New default banned rights */ + defaultBannedRights: TypeChatBannedRights; + /** Version */ + version: int; + } + + /** + * Default banned rights in a normal chat were updated
+ * @link https://corefork.telegram.org/api/channel + */ + export class UpdateChatDefaultBannedRights extends VirtualClass implements UpdateChatDefaultBannedRightsArgs { + CONSTRUCTOR_id: 1421875280; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChatDefaultBannedRights"; + peer: TypePeer; + defaultBannedRights: TypeChatBannedRights; + version: int; + fromReader(reader: Reader): UpdateChatDefaultBannedRights; + } + + export interface UpdateFolderPeersArgs { + /** New peer list */ + folderPeers: TypeFolderPeer[]; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * The peer list of a peer folder was updated
+ * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/folders + */ + export class UpdateFolderPeers extends VirtualClass implements UpdateFolderPeersArgs { + CONSTRUCTOR_id: 422972864; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateFolderPeers"; + folderPeers: TypeFolderPeer[]; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdateFolderPeers; + } + + export interface UpdatePeerSettingsArgs { + /** The peer */ + peer: TypePeer; + /** Associated peer settings */ + settings: TypePeerSettings; + } + + /** Settings of a certain peer have changed
*/ + export class UpdatePeerSettings extends VirtualClass implements UpdatePeerSettingsArgs { + CONSTRUCTOR_id: 1786671974; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePeerSettings"; + peer: TypePeer; + settings: TypePeerSettings; + fromReader(reader: Reader): UpdatePeerSettings; + } + + export interface UpdatePeerLocatedArgs { + /** Geolocated peer list update */ + peers: TypePeerLocated[]; + } + + /** List of peers near you was updated
*/ + export class UpdatePeerLocated extends VirtualClass implements UpdatePeerLocatedArgs { + CONSTRUCTOR_id: -1263546448; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePeerLocated"; + peers: TypePeerLocated[]; + fromReader(reader: Reader): UpdatePeerLocated; + } + + export interface UpdateNewScheduledMessageArgs { + /** Message */ + message: TypeMessage; + } + + /** + * A message was added to the schedule queue of a chat
+ * @link https://corefork.telegram.org/api/scheduled-messages + */ + export class UpdateNewScheduledMessage extends VirtualClass implements UpdateNewScheduledMessageArgs { + CONSTRUCTOR_id: 967122427; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateNewScheduledMessage"; + message: TypeMessage; + fromReader(reader: Reader): UpdateNewScheduledMessage; + } + + export interface UpdateDeleteScheduledMessagesArgs { + /** Peer */ + peer: TypePeer; + /** Deleted scheduled messages */ + messages: int[]; + } + + /** + * Some scheduled messages were deleted from the schedule queue of a chat
+ * @link https://corefork.telegram.org/api/scheduled-messages + */ + export class UpdateDeleteScheduledMessages extends VirtualClass implements UpdateDeleteScheduledMessagesArgs { + CONSTRUCTOR_id: -1870238482; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateDeleteScheduledMessages"; + peer: TypePeer; + messages: int[]; + fromReader(reader: Reader): UpdateDeleteScheduledMessages; + } + + export interface UpdateThemeArgs { + /** Theme */ + theme: TypeTheme; + } + + /** A cloud theme was updated
*/ + export class UpdateTheme extends VirtualClass implements UpdateThemeArgs { + CONSTRUCTOR_id: -2112423005; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateTheme"; + theme: TypeTheme; + fromReader(reader: Reader): UpdateTheme; + } + + export interface UpdateGeoLiveViewedArgs { + /** The user that viewed the live geoposition */ + peer: TypePeer; + /** Message ID of geoposition message */ + msgId: MessageIDLike; + } + + /** Live geoposition message was viewed
*/ + export class UpdateGeoLiveViewed extends VirtualClass implements UpdateGeoLiveViewedArgs { + CONSTRUCTOR_id: -2027964103; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateGeoLiveViewed"; + peer: TypePeer; + msgId: MessageIDLike; + fromReader(reader: Reader): UpdateGeoLiveViewed; + } + + /** A login token (for login via QR code) was accepted.
*/ + export class UpdateLoginToken extends VirtualClass { + CONSTRUCTOR_id: 1448076945; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateLoginToken"; + fromReader(reader: Reader): UpdateLoginToken; + } + + export interface UpdateMessagePollVoteArgs { + /** Poll ID */ + pollId: long; + /** User ID */ + userId: int; + /** Chosen option(s) */ + options: bytes[]; + /** New qts value, see updates » for more info. */ + qts: int; + } + + /** + * A specific user has voted in a poll
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdateMessagePollVote extends VirtualClass implements UpdateMessagePollVoteArgs { + CONSTRUCTOR_id: 938909451; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateMessagePollVote"; + pollId: long; + userId: int; + options: bytes[]; + qts: int; + fromReader(reader: Reader): UpdateMessagePollVote; + } + + export interface UpdateDialogFilterArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Folder ID */ + id: int; + /** Folder info */ + filter?: TypeDialogFilter; + } + + /** + * A new folder was added
+ * @link https://corefork.telegram.org/api/folders + */ + export class UpdateDialogFilter extends VirtualClass implements UpdateDialogFilterArgs { + CONSTRUCTOR_id: 654302845; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateDialogFilter"; + flags: number; + id: int; + filter?: TypeDialogFilter; + fromReader(reader: Reader): UpdateDialogFilter; + } + + export interface UpdateDialogFilterOrderArgs { + /** Ordered folder IDs */ + order: int[]; + } + + /** + * New folder order
+ * @link https://corefork.telegram.org/api/folders + */ + export class UpdateDialogFilterOrder extends VirtualClass implements UpdateDialogFilterOrderArgs { + CONSTRUCTOR_id: -1512627963; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateDialogFilterOrder"; + order: int[]; + fromReader(reader: Reader): UpdateDialogFilterOrder; + } + + /** + * Clients should update folder info
+ * @link https://corefork.telegram.org/api/folders + */ + export class UpdateDialogFilters extends VirtualClass { + CONSTRUCTOR_id: 889491791; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateDialogFilters"; + fromReader(reader: Reader): UpdateDialogFilters; + } + + export interface UpdatePhoneCallSignalingDataArgs { + /** Phone call ID */ + phoneCallId: long; + /** Signaling payload */ + data: bytes; + } + + /** Incoming phone call signaling payload
*/ + export class UpdatePhoneCallSignalingData extends VirtualClass implements UpdatePhoneCallSignalingDataArgs { + CONSTRUCTOR_id: 643940105; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePhoneCallSignalingData"; + phoneCallId: long; + data: bytes; + fromReader(reader: Reader): UpdatePhoneCallSignalingData; + } + + export interface UpdateChannelMessageForwardsArgs { + /** Channel ID */ + channelId: int; + /** ID of the message */ + id: int; + /** New forward counter */ + forwards: int; + } + + /** The forward counter of a message in a channel has changed
*/ + export class UpdateChannelMessageForwards extends VirtualClass implements UpdateChannelMessageForwardsArgs { + CONSTRUCTOR_id: 1854571743; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChannelMessageForwards"; + channelId: int; + id: int; + forwards: int; + fromReader(reader: Reader): UpdateChannelMessageForwards; + } + + export interface UpdateReadChannelDiscussionInboxArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Discussion group ID */ + channelId: int; + /** ID of the group message that started the thread (message in linked discussion group) */ + topMsgId: MessageIDLike; + /** Message ID of latest read incoming message for this thread */ + readMaxId: int; + /** If set, contains the ID of the channel that contains the post that started the comment thread in the discussion group (channel_id) */ + broadcastId?: int; + /** If set, contains the ID of the channel post that started the the comment thread */ + broadcastPost?: int; + } + + /** + * Incoming comments in a discussion thread were marked as read
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + */ + export class UpdateReadChannelDiscussionInbox extends VirtualClass implements UpdateReadChannelDiscussionInboxArgs { + CONSTRUCTOR_id: 482860628; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateReadChannelDiscussionInbox"; + flags: number; + channelId: int; + topMsgId: MessageIDLike; + readMaxId: int; + broadcastId?: int; + broadcastPost?: int; + fromReader(reader: Reader): UpdateReadChannelDiscussionInbox; + } + + export interface UpdateReadChannelDiscussionOutboxArgs { + /** Supergroup ID */ + channelId: int; + /** ID of the group message that started the thread */ + topMsgId: MessageIDLike; + /** Message ID of latest read outgoing message for this thread */ + readMaxId: int; + } + + /** + * Outgoing comments in a discussion thread were marked as read
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + */ + export class UpdateReadChannelDiscussionOutbox extends VirtualClass implements UpdateReadChannelDiscussionOutboxArgs { + CONSTRUCTOR_id: 1178116716; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateReadChannelDiscussionOutbox"; + channelId: int; + topMsgId: MessageIDLike; + readMaxId: int; + fromReader(reader: Reader): UpdateReadChannelDiscussionOutbox; + } + + export interface UpdatePeerBlockedArgs { + /** The blocked peer */ + peerId: TypePeer; + /** Whether the peer was blocked or unblocked */ + blocked: Bool; + } + + /** A peer was blocked
*/ + export class UpdatePeerBlocked extends VirtualClass implements UpdatePeerBlockedArgs { + CONSTRUCTOR_id: 610945826; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePeerBlocked"; + peerId: TypePeer; + blocked: Bool; + fromReader(reader: Reader): UpdatePeerBlocked; + } + + export interface UpdateChannelUserTypingArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Channel ID */ + channelId: int; + /** Thread ID */ + topMsgId?: MessageIDLike; + /** The peer that is typing */ + fromId: TypePeer; + /** Whether the user is typing, sending a media or doing something else */ + action: TypeSendMessageAction; + } + + /** + * A user is typing in a supergroup, channel or message thread
+ * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + */ + export class UpdateChannelUserTyping extends VirtualClass implements UpdateChannelUserTypingArgs { + CONSTRUCTOR_id: 1796675352; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChannelUserTyping"; + flags: number; + channelId: int; + topMsgId?: MessageIDLike; + fromId: TypePeer; + action: TypeSendMessageAction; + fromReader(reader: Reader): UpdateChannelUserTyping; + } + + export interface UpdatePinnedMessagesArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the messages were pinned or unpinned */ + pinned?: true; + /** Peer */ + peer: TypePeer; + /** Message IDs */ + messages: int[]; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * Some messages were pinned in a chat
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdatePinnedMessages extends VirtualClass implements UpdatePinnedMessagesArgs { + CONSTRUCTOR_id: -309990731; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePinnedMessages"; + flags: number; + pinned?: true; + peer: TypePeer; + messages: int[]; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdatePinnedMessages; + } + + export interface UpdatePinnedChannelMessagesArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the messages were pinned or unpinned */ + pinned?: true; + /** Channel ID */ + channelId: int; + /** Messages */ + messages: int[]; + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * Messages were pinned/unpinned in a channel/supergroup
+ * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/channel + */ + export class UpdatePinnedChannelMessages extends VirtualClass implements UpdatePinnedChannelMessagesArgs { + CONSTRUCTOR_id: -2054649973; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePinnedChannelMessages"; + flags: number; + pinned?: true; + channelId: int; + messages: int[]; + pts: int; + ptsCount: int; + fromReader(reader: Reader): UpdatePinnedChannelMessages; + } + + export interface UpdateChatArgs { + /** Chat ID */ + chatId: int; + } + + /** A new chat is available
*/ + export class UpdateChat extends VirtualClass implements UpdateChatArgs { + CONSTRUCTOR_id: 321954198; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChat"; + chatId: int; + fromReader(reader: Reader): UpdateChat; + } + + export interface UpdateGroupCallParticipantsArgs { + /** Group call */ + call: TypeInputGroupCall; + /** New participant list */ + participants: TypeGroupCallParticipant[]; + /** Version */ + version: int; + } + + /** The participant list of a certain group call has changed
*/ + export class UpdateGroupCallParticipants extends VirtualClass implements UpdateGroupCallParticipantsArgs { + CONSTRUCTOR_id: -219423922; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateGroupCallParticipants"; + call: TypeInputGroupCall; + participants: TypeGroupCallParticipant[]; + version: int; + fromReader(reader: Reader): UpdateGroupCallParticipants; + } + + export interface UpdateGroupCallArgs { + /** The channel/supergroup where this group call or livestream takes place */ + chatId: int; + /** Info about the group call or livestream */ + call: TypeGroupCall; + } + + /** + * A new groupcall was started
+ * @link https://corefork.telegram.org/api/channel + */ + export class UpdateGroupCall extends VirtualClass implements UpdateGroupCallArgs { + CONSTRUCTOR_id: -1537295973; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateGroupCall"; + chatId: int; + call: TypeGroupCall; + fromReader(reader: Reader): UpdateGroupCall; + } + + export interface UpdatePeerHistoryTTLArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The chat */ + peer: TypePeer; + /** The new Time-To-Live */ + ttlPeriod?: int; + } + + /** The Time-To-Live for messages sent by the current user in a specific chat has changed
*/ + export class UpdatePeerHistoryTTL extends VirtualClass implements UpdatePeerHistoryTTLArgs { + CONSTRUCTOR_id: -1147422299; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdatePeerHistoryTTL"; + flags: number; + peer: TypePeer; + ttlPeriod?: int; + fromReader(reader: Reader): UpdatePeerHistoryTTL; + } + + export interface UpdateChatParticipantArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Chat ID */ + chatId: int; + /** When did this event occur */ + date: int; + /** User that triggered the change (inviter, admin that kicked the user, or the even the user_id itself) */ + actorId: int; + /** User that was affected by the change */ + userId: int; + /** Previous participant info (empty if this participant just joined) */ + prevParticipant?: TypeChatParticipant; + /** New participant info (empty if this participant just left) */ + newParticipant?: TypeChatParticipant; + /** The invite that was used to join the group */ + invite?: TypeExportedChatInvite; + /** New qts value, see updates » for more info. */ + qts: int; + } + + /** + * A user has joined or left a specific chat
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/updates + */ + export class UpdateChatParticipant extends VirtualClass implements UpdateChatParticipantArgs { + CONSTRUCTOR_id: -206342113; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChatParticipant"; + flags: number; + chatId: int; + date: int; + actorId: int; + userId: int; + prevParticipant?: TypeChatParticipant; + newParticipant?: TypeChatParticipant; + invite?: TypeExportedChatInvite; + qts: int; + fromReader(reader: Reader): UpdateChatParticipant; + } + + export interface UpdateChannelParticipantArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Channel ID */ + channelId: int; + /** Date of the event */ + date: int; + /** User that triggered the change (inviter, admin that kicked the user, or the even the user_id itself) */ + actorId: int; + /** User that was affected by the change */ + userId: int; + /** Previous participant status */ + prevParticipant?: TypeChannelParticipant; + /** New participant status */ + newParticipant?: TypeChannelParticipant; + /** Chat invite used to join the channel/supergroup */ + invite?: TypeExportedChatInvite; + /** New qts value, see updates » for more info. */ + qts: int; + } + + /** + * A participant has left, joined, was banned or admined in a channel or supergroup.
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/updates + */ + export class UpdateChannelParticipant extends VirtualClass implements UpdateChannelParticipantArgs { + CONSTRUCTOR_id: 2146218476; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateChannelParticipant"; + flags: number; + channelId: int; + date: int; + actorId: int; + userId: int; + prevParticipant?: TypeChannelParticipant; + newParticipant?: TypeChannelParticipant; + invite?: TypeExportedChatInvite; + qts: int; + fromReader(reader: Reader): UpdateChannelParticipant; + } + + export interface UpdateBotStoppedArgs { + /** The bot ID */ + userId: int; + /** When did this action occur */ + date: int; + /** Whether the bot was stopped or started */ + stopped: Bool; + /** New qts value, see updates » for more info. */ + qts: int; + } + + /** + * A bot was stopped or re-started.
+ * @link https://corefork.telegram.org/api/updates + */ + export class UpdateBotStopped extends VirtualClass implements UpdateBotStoppedArgs { + CONSTRUCTOR_id: 133777546; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateBotStopped"; + userId: int; + date: int; + stopped: Bool; + qts: int; + fromReader(reader: Reader): UpdateBotStopped; + } + + export interface UpdateGroupCallConnectionArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Are these parameters related to the screen capture session currently in progress? */ + presentation?: true; + /** WebRTC parameters */ + params: TypeDataJSON; + } + + /** New WebRTC parameters
*/ + export class UpdateGroupCallConnection extends VirtualClass implements UpdateGroupCallConnectionArgs { + CONSTRUCTOR_id: 192428418; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateGroupCallConnection"; + flags: number; + presentation?: true; + params: TypeDataJSON; + fromReader(reader: Reader): UpdateGroupCallConnection; + } + + export interface UpdateBotCommandsArgs { + /** The affected chat */ + peer: TypePeer; + /** ID of the bot that changed its command set */ + botId: int; + /** New bot commands */ + commands: TypeBotCommand[]; + } + + /** + * The command set of a certain bot in a certain chat has changed.
+ * @link https://corefork.telegram.org/bots/api + */ + export class UpdateBotCommands extends VirtualClass implements UpdateBotCommandsArgs { + CONSTRUCTOR_id: -813823885; + SUBCLASS_OF_ID: 2676568142; + classType: "constructor"; + className: "UpdateBotCommands"; + peer: TypePeer; + botId: int; + commands: TypeBotCommand[]; + fromReader(reader: Reader): UpdateBotCommands; + } + + /** + * Too many updates, it is necessary to execute updates.getDifference.
+ * @link https://corefork.telegram.org/method/updates.getDifference + * @link https://corefork.telegram.org/api/updates + */ + export class UpdatesTooLong extends VirtualClass { + CONSTRUCTOR_id: -484987010; + SUBCLASS_OF_ID: 2331323052; + classType: "constructor"; + className: "UpdatesTooLong"; + fromReader(reader: Reader): UpdatesTooLong; + } + + export interface UpdateShortMessageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the message is outgoing */ + out?: true; + /** Whether we were mentioned in the message */ + mentioned?: true; + /** Whether there are some unread mentions in this message */ + mediaUnread?: true; + /** If true, the message is a silent message, no notifications should be triggered */ + silent?: true; + /** The message ID */ + id: int; + /** The ID of the sender (if outgoing will be the ID of the destination) of the message */ + userId: int; + /** The message */ + message: string; + /** PTS */ + pts: int; + /** PTS count */ + ptsCount: int; + /** date */ + date: int; + /** Info about a forwarded message */ + fwdFrom?: TypeMessageFwdHeader; + /** Info about the inline bot used to generate this message */ + viaBotId?: int; + /** Reply and thread information */ + replyTo?: TypeMessageReplyHeader; + /** Entities for styled text */ + entities?: TypeMessageEntity[]; + /** Time To Live of the message, once message.date+message.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. */ + ttlPeriod?: int; + } + + /** + * Info about a message sent to (received from) another user
+ * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/entities + */ + export class UpdateShortMessage extends VirtualClass implements UpdateShortMessageArgs { + CONSTRUCTOR_id: -84936653; + SUBCLASS_OF_ID: 2331323052; + classType: "constructor"; + className: "UpdateShortMessage"; + flags: number; + out?: true; + mentioned?: true; + mediaUnread?: true; + silent?: true; + id: int; + userId: int; + message: string; + pts: int; + ptsCount: int; + date: int; + fwdFrom?: TypeMessageFwdHeader; + viaBotId?: int; + replyTo?: TypeMessageReplyHeader; + entities?: TypeMessageEntity[]; + ttlPeriod?: int; + fromReader(reader: Reader): UpdateShortMessage; + } + + export interface UpdateShortChatMessageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the message is outgoing */ + out?: true; + /** Whether we were mentioned in this message */ + mentioned?: true; + /** Whether the message contains some unread mentions */ + mediaUnread?: true; + /** If true, the message is a silent message, no notifications should be triggered */ + silent?: true; + /** ID of the message */ + id: int; + /** ID of the sender of the message */ + fromId: int; + /** ID of the chat where the message was sent */ + chatId: int; + /** Message */ + message: string; + /** PTS */ + pts: int; + /** PTS count */ + ptsCount: int; + /** date */ + date: int; + /** Info about a forwarded message */ + fwdFrom?: TypeMessageFwdHeader; + /** Info about the inline bot used to generate this message */ + viaBotId?: int; + /** Reply (thread) information */ + replyTo?: TypeMessageReplyHeader; + /** Entities for styled text */ + entities?: TypeMessageEntity[]; + /** Time To Live of the message, once updateShortChatMessage.date+updateShortChatMessage.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. */ + ttlPeriod?: int; + } + + /** + * Shortened constructor containing info on one new incoming text message from a chat
+ * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/entities + */ + export class UpdateShortChatMessage extends VirtualClass implements UpdateShortChatMessageArgs { + CONSTRUCTOR_id: 290961496; + SUBCLASS_OF_ID: 2331323052; + classType: "constructor"; + className: "UpdateShortChatMessage"; + flags: number; + out?: true; + mentioned?: true; + mediaUnread?: true; + silent?: true; + id: int; + fromId: int; + chatId: int; + message: string; + pts: int; + ptsCount: int; + date: int; + fwdFrom?: TypeMessageFwdHeader; + viaBotId?: int; + replyTo?: TypeMessageReplyHeader; + entities?: TypeMessageEntity[]; + ttlPeriod?: int; + fromReader(reader: Reader): UpdateShortChatMessage; + } + + export interface UpdateShortArgs { + /** Update */ + update: TypeUpdate; + /** Date of event */ + date: int; + } + + /** Shortened constructor containing info on one update not requiring auxiliary data
*/ + export class UpdateShort extends VirtualClass implements UpdateShortArgs { + CONSTRUCTOR_id: 2027216577; + SUBCLASS_OF_ID: 2331323052; + classType: "constructor"; + className: "UpdateShort"; + update: TypeUpdate; + date: int; + fromReader(reader: Reader): UpdateShort; + } + + export interface UpdatesCombinedArgs { + /** List of updates */ + updates: TypeUpdate[]; + /** List of users mentioned in updates */ + users: TypeUser[]; + /** List of chats mentioned in updates */ + chats: TypeChat[]; + /** Current date */ + date: int; + /** Value seq for the earliest update in a group */ + seqStart: int; + /** Value seq for the latest update in a group */ + seq: int; + } + + /** Constructor for a group of updates.
*/ + export class UpdatesCombined extends VirtualClass implements UpdatesCombinedArgs { + CONSTRUCTOR_id: 1918567619; + SUBCLASS_OF_ID: 2331323052; + classType: "constructor"; + className: "UpdatesCombined"; + updates: TypeUpdate[]; + users: TypeUser[]; + chats: TypeChat[]; + date: int; + seqStart: int; + seq: int; + fromReader(reader: Reader): UpdatesCombined; + } + + export interface UpdatesArgs { + /** List of updates */ + updates: TypeUpdate[]; + /** List of users mentioned in updates */ + users: TypeUser[]; + /** List of chats mentioned in updates */ + chats: TypeChat[]; + /** Current date */ + date: int; + /** Total number of sent updates */ + seq: int; + } + + /** Full constructor of updates
*/ + export class Updates extends VirtualClass implements UpdatesArgs { + CONSTRUCTOR_id: 1957577280; + SUBCLASS_OF_ID: 2331323052; + classType: "constructor"; + className: "Updates"; + updates: TypeUpdate[]; + users: TypeUser[]; + chats: TypeChat[]; + date: int; + seq: int; + fromReader(reader: Reader): Updates; + } + + export interface UpdateShortSentMessageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the message is outgoing */ + out?: true; + /** ID of the sent message */ + id: int; + /** PTS */ + pts: int; + /** PTS count */ + ptsCount: int; + /** date */ + date: int; + /** Attached media */ + media?: TypeMessageMedia; + /** Entities for styled text */ + entities?: TypeMessageEntity[]; + /** Time To Live of the message, once message.date+message.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. */ + ttlPeriod?: int; + } + + /** + * Shortened constructor containing info on one outgoing message to a contact (the destination chat has to be extracted from the method call that returned this object).
+ * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/entities + */ + export class UpdateShortSentMessage extends VirtualClass implements UpdateShortSentMessageArgs { + CONSTRUCTOR_id: -1877614335; + SUBCLASS_OF_ID: 2331323052; + classType: "constructor"; + className: "UpdateShortSentMessage"; + flags: number; + out?: true; + id: int; + pts: int; + ptsCount: int; + date: int; + media?: TypeMessageMedia; + entities?: TypeMessageEntity[]; + ttlPeriod?: int; + fromReader(reader: Reader): UpdateShortSentMessage; + } + + export interface DcOptionArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the specified IP is an IPv6 address */ + ipv6?: true; + /** Whether this DC should only be used to download or upload files */ + mediaOnly?: true; + /** Whether this DC only supports connection with transport obfuscation */ + tcpoOnly?: true; + /** Whether this is a CDN DC. */ + cdn?: true; + /** If set, this IP should be used when connecting through a proxy */ + static?: true; + /** DC ID */ + id: int; + /** IP address of DC */ + ipAddress: string; + /** Port */ + port: int; + /** If the tcpo_only flag is set, specifies the secret to use when connecting using transport obfuscation */ + secret?: bytes; + } + + /** + * Data centre
+ * @link https://corefork.telegram.org/api/files + * @link https://corefork.telegram.org/mtproto/mtproto-transports + * @link https://corefork.telegram.org/cdn + */ + export class DcOption extends VirtualClass implements DcOptionArgs { + CONSTRUCTOR_id: 414687501; + SUBCLASS_OF_ID: 2655248675; + classType: "constructor"; + className: "DcOption"; + flags: number; + ipv6?: true; + mediaOnly?: true; + tcpoOnly?: true; + cdn?: true; + static?: true; + id: int; + ipAddress: string; + port: int; + secret?: bytes; + fromReader(reader: Reader): DcOption; + } + + export interface ConfigArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether phone calls can be used */ + phonecallsEnabled?: true; + /** Whether the client should use P2P by default for phone calls with contacts */ + defaultP2pContacts?: true; + /** Whether the client should preload featured stickers */ + preloadFeaturedStickers?: true; + /** Whether the client should ignore phone entities */ + ignorePhoneEntities?: true; + /** Whether incoming private messages can be deleted for both participants */ + revokePmInbox?: true; + /** Indicates that telegram is probably censored by governments/ISPs in the current region */ + blockedMode?: true; + /** Whether pfs was used */ + pfsEnabled?: true; + /** Current date at the server */ + date: int; + /** Expiration date of this config: when it expires it'll have to be refetched using help.getConfig */ + expires: int; + /** Whether we're connected to the test DCs */ + testMode: Bool; + /** ID of the DC that returned the reply */ + thisDc: int; + /** DC IP list */ + dcOptions: TypeDcOption[]; + /** Domain name for fetching encrypted DC list from DNS TXT record */ + dcTxtDomainName: string; + /** Maximum member count for normal groups */ + chatSizeMax: int; + /** Maximum member count for supergroups */ + megagroupSizeMax: int; + /** Maximum number of messages that can be forwarded at once using messages.forwardMessages. */ + forwardedCountMax: int; + /** The client should update its online status every N milliseconds */ + onlineUpdatePeriodMs: int; + /** Delay before offline status needs to be sent to the server */ + offlineBlurTimeoutMs: int; + /** Time without any user activity after which it should be treated offline */ + offlineIdleTimeoutMs: int; + /** If we are offline, but were online from some other client in last online_cloud_timeout_ms milliseconds after we had gone offline, then delay offline notification for notify_cloud_delay_ms milliseconds. */ + onlineCloudTimeoutMs: int; + /** If we are offline, but online from some other client then delay sending the offline notification for notify_cloud_delay_ms milliseconds. */ + notifyCloudDelayMs: int; + /** If some other client is online, then delay notification for notification_default_delay_ms milliseconds */ + notifyDefaultDelayMs: int; + /** Not for client use */ + pushChatPeriodMs: int; + /** Not for client use */ + pushChatLimit: int; + /** Maximum count of saved gifs */ + savedGifsLimit: int; + /** Only messages with age smaller than the one specified can be edited */ + editTimeLimit: int; + /** Only channel/supergroup messages with age smaller than the specified can be deleted */ + revokeTimeLimit: int; + /** Only private messages with age smaller than the specified can be deleted */ + revokePmTimeLimit: int; + /** Exponential decay rate for computing top peer rating */ + ratingEDecay: int; + /** Maximum number of recent stickers */ + stickersRecentLimit: int; + /** Maximum number of faved stickers */ + stickersFavedLimit: int; + /** Indicates that round videos (video notes) and voice messages sent in channels and older than the specified period must be marked as read */ + channelsReadMediaPeriod: int; + /** Temporary passport sessions */ + tmpSessions?: int; + /** Maximum count of pinned dialogs */ + pinnedDialogsCountMax: int; + /** Maximum count of dialogs per folder */ + pinnedInfolderCountMax: int; + /** Maximum allowed outgoing ring time in VoIP calls: if the user we're calling doesn't reply within the specified time (in milliseconds), we should hang up the call */ + callReceiveTimeoutMs: int; + /** Maximum allowed incoming ring time in VoIP calls: if the current user doesn't reply within the specified time (in milliseconds), the call will be automatically refused */ + callRingTimeoutMs: int; + /** VoIP connection timeout: if the instance of libtgvoip on the other side of the call doesn't connect to our instance of libtgvoip within the specified time (in milliseconds), the call must be aborted */ + callConnectTimeoutMs: int; + /** If during a VoIP call a packet isn't received for the specified period of time, the call must be aborted */ + callPacketTimeoutMs: int; + /** The domain to use to parse in-app links.
For example t.me indicates that t.me/username links should parsed to @username, t.me/addsticker/name should be parsed to the appropriate stickerset and so on... */ + meUrlPrefix: string; + /** URL to use to auto-update the current app */ + autoupdateUrlPrefix?: string; + /** Username of the bot to use to search for GIFs */ + gifSearchUsername?: string; + /** Username of the bot to use to search for venues */ + venueSearchUsername?: string; + /** Username of the bot to use for image search */ + imgSearchUsername?: string; + /** ID of the map provider to use for venues */ + staticMapsProvider?: string; + /** Maximum length of caption (length in utf8 codepoints) */ + captionLengthMax: int; + /** Maximum length of messages (length in utf8 codepoints) */ + messageLengthMax: int; + /** DC ID to use to download webfiles */ + webfileDcId: int; + /** Suggested language code */ + suggestedLangCode?: string; + /** Language pack version */ + langPackVersion?: int; + /** Basic language pack version */ + baseLangPackVersion?: int; + } + + /** + * Current configuration
+ * @link https://corefork.telegram.org/api/entities + * @link https://corefork.telegram.org/api/pfs + * @link https://corefork.telegram.org/method/help.getConfig + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/method/messages.forwardMessages + * @link https://corefork.telegram.org/method/account.updateStatus + * @link https://corefork.telegram.org/api/top-rating + * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/api/files + */ + export class Config extends VirtualClass implements ConfigArgs { + CONSTRUCTOR_id: 856375399; + SUBCLASS_OF_ID: 3542493770; + classType: "constructor"; + className: "Config"; + flags: number; + phonecallsEnabled?: true; + defaultP2pContacts?: true; + preloadFeaturedStickers?: true; + ignorePhoneEntities?: true; + revokePmInbox?: true; + blockedMode?: true; + pfsEnabled?: true; + date: int; + expires: int; + testMode: Bool; + thisDc: int; + dcOptions: TypeDcOption[]; + dcTxtDomainName: string; + chatSizeMax: int; + megagroupSizeMax: int; + forwardedCountMax: int; + onlineUpdatePeriodMs: int; + offlineBlurTimeoutMs: int; + offlineIdleTimeoutMs: int; + onlineCloudTimeoutMs: int; + notifyCloudDelayMs: int; + notifyDefaultDelayMs: int; + pushChatPeriodMs: int; + pushChatLimit: int; + savedGifsLimit: int; + editTimeLimit: int; + revokeTimeLimit: int; + revokePmTimeLimit: int; + ratingEDecay: int; + stickersRecentLimit: int; + stickersFavedLimit: int; + channelsReadMediaPeriod: int; + tmpSessions?: int; + pinnedDialogsCountMax: int; + pinnedInfolderCountMax: int; + callReceiveTimeoutMs: int; + callRingTimeoutMs: int; + callConnectTimeoutMs: int; + callPacketTimeoutMs: int; + meUrlPrefix: string; + autoupdateUrlPrefix?: string; + gifSearchUsername?: string; + venueSearchUsername?: string; + imgSearchUsername?: string; + staticMapsProvider?: string; + captionLengthMax: int; + messageLengthMax: int; + webfileDcId: int; + suggestedLangCode?: string; + langPackVersion?: int; + baseLangPackVersion?: int; + fromReader(reader: Reader): Config; + } + + export interface NearestDcArgs { + /** Country code determined by geo-ip */ + country: string; + /** Number of current data centre */ + thisDc: int; + /** Number of nearest data centre */ + nearestDc: int; + } + + /** Nearest data centre, according to geo-ip.
*/ + export class NearestDc extends VirtualClass implements NearestDcArgs { + CONSTRUCTOR_id: -1910892683; + SUBCLASS_OF_ID: 947323999; + classType: "constructor"; + className: "NearestDc"; + country: string; + thisDc: int; + nearestDc: int; + fromReader(reader: Reader): NearestDc; + } + + export interface EncryptedChatEmptyArgs { + /** Chat ID */ + id: int; + } + + /** Empty constructor.
*/ + export class EncryptedChatEmpty extends VirtualClass implements EncryptedChatEmptyArgs { + CONSTRUCTOR_id: -1417756512; + SUBCLASS_OF_ID: 1831379834; + classType: "constructor"; + className: "EncryptedChatEmpty"; + id: int; + fromReader(reader: Reader): EncryptedChatEmpty; + } + + export interface EncryptedChatWaitingArgs { + /** Chat ID */ + id: int; + /** Checking sum depending on user ID */ + accessHash: long; + /** Date of chat creation */ + date: int; + /** Chat creator ID */ + adminId: int; + /** ID of second chat participant */ + participantId: int; + } + + /** Chat waiting for approval of second participant.
*/ + export class EncryptedChatWaiting extends VirtualClass implements EncryptedChatWaitingArgs { + CONSTRUCTOR_id: 1006044124; + SUBCLASS_OF_ID: 1831379834; + classType: "constructor"; + className: "EncryptedChatWaiting"; + id: int; + accessHash: long; + date: int; + adminId: int; + participantId: int; + fromReader(reader: Reader): EncryptedChatWaiting; + } + + export interface EncryptedChatRequestedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Peer folder ID, for more info click here */ + folderId?: int; + /** Chat ID */ + id: int; + /** Check sum depending on user ID */ + accessHash: long; + /** Chat creation date */ + date: int; + /** Chat creator ID */ + adminId: int; + /** ID of second chat participant */ + participantId: int; + /** A = g ^ a mod p, see Wikipedia */ + gA: bytes; + } + + /** + * Request to create an encrypted chat.
+ * @link https://corefork.telegram.org/api/folders + */ + export class EncryptedChatRequested extends VirtualClass implements EncryptedChatRequestedArgs { + CONSTRUCTOR_id: 1651608194; + SUBCLASS_OF_ID: 1831379834; + classType: "constructor"; + className: "EncryptedChatRequested"; + flags: number; + folderId?: int; + id: int; + accessHash: long; + date: int; + adminId: int; + participantId: int; + gA: bytes; + fromReader(reader: Reader): EncryptedChatRequested; + } + + export interface EncryptedChatArgs { + /** Chat ID */ + id: int; + /** Check sum dependant on the user ID */ + accessHash: long; + /** Date chat was created */ + date: int; + /** Chat creator ID */ + adminId: int; + /** ID of the second chat participant */ + participantId: int; + /** B = g ^ b mod p, if the currently authorized user is the chat's creator,
or A = g ^ a mod p otherwise
See Wikipedia for more info */ + gAOrB: bytes; + /** 64-bit fingerprint of received key */ + keyFingerprint: long; + } + + /** Encrypted chat
*/ + export class EncryptedChat extends VirtualClass implements EncryptedChatArgs { + CONSTRUCTOR_id: -94974410; + SUBCLASS_OF_ID: 1831379834; + classType: "constructor"; + className: "EncryptedChat"; + id: int; + accessHash: long; + date: int; + adminId: int; + participantId: int; + gAOrB: bytes; + keyFingerprint: long; + fromReader(reader: Reader): EncryptedChat; + } + + export interface EncryptedChatDiscardedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether both users of this secret chat should also remove all of its messages */ + historyDeleted?: true; + /** Chat ID */ + id: int; + } + + /** Discarded or deleted chat.
*/ + export class EncryptedChatDiscarded extends VirtualClass implements EncryptedChatDiscardedArgs { + CONSTRUCTOR_id: 505183301; + SUBCLASS_OF_ID: 1831379834; + classType: "constructor"; + className: "EncryptedChatDiscarded"; + flags: number; + historyDeleted?: true; + id: int; + fromReader(reader: Reader): EncryptedChatDiscarded; + } + + export interface InputEncryptedChatArgs { + /** Chat ID */ + chatId: int; + /** Checking sum from constructor encryptedChat, encryptedChatWaiting or encryptedChatRequested */ + accessHash: long; + } + + /** + * Creates an encrypted chat.
+ * @link https://corefork.telegram.org/constructor/encryptedChat + * @link https://corefork.telegram.org/constructor/encryptedChatWaiting + * @link https://corefork.telegram.org/constructor/encryptedChatRequested + */ + export class InputEncryptedChat extends VirtualClass implements InputEncryptedChatArgs { + CONSTRUCTOR_id: -247351839; + SUBCLASS_OF_ID: 1819674304; + classType: "constructor"; + className: "InputEncryptedChat"; + chatId: int; + accessHash: long; + fromReader(reader: Reader): InputEncryptedChat; + } + + /** Empty constructor, unexisitng file.
*/ + export class EncryptedFileEmpty extends VirtualClass { + CONSTRUCTOR_id: -1038136962; + SUBCLASS_OF_ID: 2217371584; + classType: "constructor"; + className: "EncryptedFileEmpty"; + fromReader(reader: Reader): EncryptedFileEmpty; + } + + export interface EncryptedFileArgs { + /** File ID */ + id: long; + /** Checking sum depending on user ID */ + accessHash: long; + /** File size in bytes */ + size: int; + /** Number of data centre */ + dcId: int; + /** 32-bit fingerprint of key used for file encryption */ + keyFingerprint: int; + } + + /** Encrypted file.
*/ + export class EncryptedFile extends VirtualClass implements EncryptedFileArgs { + CONSTRUCTOR_id: 1248893260; + SUBCLASS_OF_ID: 2217371584; + classType: "constructor"; + className: "EncryptedFile"; + id: long; + accessHash: long; + size: int; + dcId: int; + keyFingerprint: int; + fromReader(reader: Reader): EncryptedFile; + } + + /** Empty constructor.
*/ + export class InputEncryptedFileEmpty extends VirtualClass { + CONSTRUCTOR_id: 406307684; + SUBCLASS_OF_ID: 2239021690; + classType: "constructor"; + className: "InputEncryptedFileEmpty"; + fromReader(reader: Reader): InputEncryptedFileEmpty; + } + + export interface InputEncryptedFileUploadedArgs { + /** Random file ID created by clien */ + id: long; + /** Number of saved parts */ + parts: int; + /** In case md5-HASH of the (already encrypted) file was transmitted, file content will be checked prior to use */ + md5Checksum: string; + /** 32-bit fingerprint of the key used to encrypt a file */ + keyFingerprint: int; + } + + /** Sets new encrypted file saved by parts using upload.saveFilePart method.
*/ + export class InputEncryptedFileUploaded extends VirtualClass implements InputEncryptedFileUploadedArgs { + CONSTRUCTOR_id: 1690108678; + SUBCLASS_OF_ID: 2239021690; + classType: "constructor"; + className: "InputEncryptedFileUploaded"; + id: long; + parts: int; + md5Checksum: string; + keyFingerprint: int; + fromReader(reader: Reader): InputEncryptedFileUploaded; + } + + export interface InputEncryptedFileArgs { + /** File ID, value of id parameter from encryptedFile */ + id: long; + /** Checking sum, value of access_hash parameter from encryptedFile */ + accessHash: long; + } + + /** + * Sets forwarded encrypted file for attachment.
+ * @link https://corefork.telegram.org/constructor/encryptedFile + */ + export class InputEncryptedFile extends VirtualClass implements InputEncryptedFileArgs { + CONSTRUCTOR_id: 1511503333; + SUBCLASS_OF_ID: 2239021690; + classType: "constructor"; + className: "InputEncryptedFile"; + id: long; + accessHash: long; + fromReader(reader: Reader): InputEncryptedFile; + } + + export interface InputEncryptedFileBigUploadedArgs { + /** Random file id, created by the client */ + id: long; + /** Number of saved parts */ + parts: int; + /** 32-bit imprint of the key used to encrypt the file */ + keyFingerprint: int; + } + + /** + * Assigns a new big encrypted file (over 10Mb in size), saved in parts using the method upload.saveBigFilePart.
+ * @link https://corefork.telegram.org/method/upload.saveBigFilePart + */ + export class InputEncryptedFileBigUploaded extends VirtualClass implements InputEncryptedFileBigUploadedArgs { + CONSTRUCTOR_id: 767652808; + SUBCLASS_OF_ID: 2239021690; + classType: "constructor"; + className: "InputEncryptedFileBigUploaded"; + id: long; + parts: int; + keyFingerprint: int; + fromReader(reader: Reader): InputEncryptedFileBigUploaded; + } + + export interface EncryptedMessageArgs { + /** Random message ID, assigned by the author of message */ + randomId: long; + /** ID of encrypted chat */ + chatId: int; + /** Date of sending */ + date: int; + /** TL-serialising of DecryptedMessage type, encrypted with the key creatied at stage of chat initialization */ + bytes: bytes; + /** Attached encrypted file */ + file: TypeEncryptedFile; + } + + /** + * Encrypted message.
+ * @link https://corefork.telegram.org/type/DecryptedMessage + */ + export class EncryptedMessage extends VirtualClass implements EncryptedMessageArgs { + CONSTRUCTOR_id: -317144808; + SUBCLASS_OF_ID: 597634641; + classType: "constructor"; + className: "EncryptedMessage"; + randomId: long; + chatId: int; + date: int; + bytes: bytes; + file: TypeEncryptedFile; + fromReader(reader: Reader): EncryptedMessage; + } + + export interface EncryptedMessageServiceArgs { + /** Random message ID, assigned by the author of message */ + randomId: long; + /** ID of encrypted chat */ + chatId: int; + /** Date of sending */ + date: int; + /** TL-serialising of DecryptedMessage type, encrypted with the key creatied at stage of chat initialization */ + bytes: bytes; + } + + /** + * Encrypted service message
+ * @link https://corefork.telegram.org/type/DecryptedMessage + */ + export class EncryptedMessageService extends VirtualClass implements EncryptedMessageServiceArgs { + CONSTRUCTOR_id: 594758406; + SUBCLASS_OF_ID: 597634641; + classType: "constructor"; + className: "EncryptedMessageService"; + randomId: long; + chatId: int; + date: int; + bytes: bytes; + fromReader(reader: Reader): EncryptedMessageService; + } + + /** Empty constructor.
*/ + export class InputDocumentEmpty extends VirtualClass { + CONSTRUCTOR_id: 1928391342; + SUBCLASS_OF_ID: 4081048424; + classType: "constructor"; + className: "InputDocumentEmpty"; + fromReader(reader: Reader): InputDocumentEmpty; + } + + export interface InputDocumentArgs { + /** Document ID */ + id: long; + /** access_hash parameter from the document constructor */ + accessHash: long; + /** File reference */ + fileReference: bytes; + } + + /** + * Defines a video for subsequent interaction.
+ * @link https://corefork.telegram.org/constructor/document + * @link https://corefork.telegram.org/api/file_reference + */ + export class InputDocument extends VirtualClass implements InputDocumentArgs { + CONSTRUCTOR_id: 448771445; + SUBCLASS_OF_ID: 4081048424; + classType: "constructor"; + className: "InputDocument"; + id: long; + accessHash: long; + fileReference: bytes; + fromReader(reader: Reader): InputDocument; + } + + export interface DocumentEmptyArgs { + /** Document ID or 0 */ + id: long; + } + + /** Empty constructor, document doesn't exist.
*/ + export class DocumentEmpty extends VirtualClass implements DocumentEmptyArgs { + CONSTRUCTOR_id: 922273905; + SUBCLASS_OF_ID: 555739168; + classType: "constructor"; + className: "DocumentEmpty"; + id: long; + fromReader(reader: Reader): DocumentEmpty; + } + + export interface DocumentArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Document ID */ + id: long; + /** Check sum, dependant on document ID */ + accessHash: long; + /** File reference */ + fileReference: bytes; + /** Creation date */ + date: int; + /** MIME type */ + mimeType: string; + /** Size */ + size: int; + /** Thumbnails */ + thumbs?: TypePhotoSize[]; + /** Video thumbnails */ + videoThumbs?: TypeVideoSize[]; + /** DC ID */ + dcId: int; + /** Attributes */ + attributes: TypeDocumentAttribute[]; + } + + /** + * Document
+ * @link https://corefork.telegram.org/api/file_reference + */ + export class Document extends VirtualClass implements DocumentArgs { + CONSTRUCTOR_id: 512177195; + SUBCLASS_OF_ID: 555739168; + classType: "constructor"; + className: "Document"; + flags: number; + id: long; + accessHash: long; + fileReference: bytes; + date: int; + mimeType: string; + size: int; + thumbs?: TypePhotoSize[]; + videoThumbs?: TypeVideoSize[]; + dcId: int; + attributes: TypeDocumentAttribute[]; + fromReader(reader: Reader): Document; + } + + export interface NotifyPeerArgs { + /** user or group */ + peer: TypePeer; + } + + /** Notifications generated by a certain user or group.
*/ + export class NotifyPeer extends VirtualClass implements NotifyPeerArgs { + CONSTRUCTOR_id: -1613493288; + SUBCLASS_OF_ID: 3756548142; + classType: "constructor"; + className: "NotifyPeer"; + peer: TypePeer; + fromReader(reader: Reader): NotifyPeer; + } + + /** Notifications generated by all users.
*/ + export class NotifyUsers extends VirtualClass { + CONSTRUCTOR_id: -1261946036; + SUBCLASS_OF_ID: 3756548142; + classType: "constructor"; + className: "NotifyUsers"; + fromReader(reader: Reader): NotifyUsers; + } + + /** Notifications generated by all groups.
*/ + export class NotifyChats extends VirtualClass { + CONSTRUCTOR_id: -1073230141; + SUBCLASS_OF_ID: 3756548142; + classType: "constructor"; + className: "NotifyChats"; + fromReader(reader: Reader): NotifyChats; + } + + /** Channel notification settings
*/ + export class NotifyBroadcasts extends VirtualClass { + CONSTRUCTOR_id: -703403793; + SUBCLASS_OF_ID: 3756548142; + classType: "constructor"; + className: "NotifyBroadcasts"; + fromReader(reader: Reader): NotifyBroadcasts; + } + + /** User is typing.
*/ + export class SendMessageTypingAction extends VirtualClass { + CONSTRUCTOR_id: 381645902; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageTypingAction"; + fromReader(reader: Reader): SendMessageTypingAction; + } + + /** Invalidate all previous action updates. E.g. when user deletes entered text or aborts a video upload.
*/ + export class SendMessageCancelAction extends VirtualClass { + CONSTRUCTOR_id: -44119819; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageCancelAction"; + fromReader(reader: Reader): SendMessageCancelAction; + } + + /** User is recording a video.
*/ + export class SendMessageRecordVideoAction extends VirtualClass { + CONSTRUCTOR_id: -1584933265; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageRecordVideoAction"; + fromReader(reader: Reader): SendMessageRecordVideoAction; + } + + export interface SendMessageUploadVideoActionArgs { + /** Progress percentage */ + progress: int; + } + + /** User is uploading a video.
*/ + export class SendMessageUploadVideoAction extends VirtualClass implements SendMessageUploadVideoActionArgs { + CONSTRUCTOR_id: -378127636; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageUploadVideoAction"; + progress: int; + fromReader(reader: Reader): SendMessageUploadVideoAction; + } + + /** User is recording a voice message.
*/ + export class SendMessageRecordAudioAction extends VirtualClass { + CONSTRUCTOR_id: -718310409; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageRecordAudioAction"; + fromReader(reader: Reader): SendMessageRecordAudioAction; + } + + export interface SendMessageUploadAudioActionArgs { + /** Progress percentage */ + progress: int; + } + + /** User is uploading a voice message.
*/ + export class SendMessageUploadAudioAction extends VirtualClass implements SendMessageUploadAudioActionArgs { + CONSTRUCTOR_id: -212740181; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageUploadAudioAction"; + progress: int; + fromReader(reader: Reader): SendMessageUploadAudioAction; + } + + export interface SendMessageUploadPhotoActionArgs { + /** Progress percentage */ + progress: int; + } + + /** User is uploading a photo.
*/ + export class SendMessageUploadPhotoAction extends VirtualClass implements SendMessageUploadPhotoActionArgs { + CONSTRUCTOR_id: -774682074; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageUploadPhotoAction"; + progress: int; + fromReader(reader: Reader): SendMessageUploadPhotoAction; + } + + export interface SendMessageUploadDocumentActionArgs { + /** Progress percentage */ + progress: int; + } + + /** User is uploading a file.
*/ + export class SendMessageUploadDocumentAction extends VirtualClass implements SendMessageUploadDocumentActionArgs { + CONSTRUCTOR_id: -1441998364; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageUploadDocumentAction"; + progress: int; + fromReader(reader: Reader): SendMessageUploadDocumentAction; + } + + /** User is selecting a location to share.
*/ + export class SendMessageGeoLocationAction extends VirtualClass { + CONSTRUCTOR_id: 393186209; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageGeoLocationAction"; + fromReader(reader: Reader): SendMessageGeoLocationAction; + } + + /** User is selecting a contact to share.
*/ + export class SendMessageChooseContactAction extends VirtualClass { + CONSTRUCTOR_id: 1653390447; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageChooseContactAction"; + fromReader(reader: Reader): SendMessageChooseContactAction; + } + + /** User is playing a game
*/ + export class SendMessageGamePlayAction extends VirtualClass { + CONSTRUCTOR_id: -580219064; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageGamePlayAction"; + fromReader(reader: Reader): SendMessageGamePlayAction; + } + + /** User is recording a round video to share
*/ + export class SendMessageRecordRoundAction extends VirtualClass { + CONSTRUCTOR_id: -1997373508; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageRecordRoundAction"; + fromReader(reader: Reader): SendMessageRecordRoundAction; + } + + export interface SendMessageUploadRoundActionArgs { + /** Progress percentage */ + progress: int; + } + + /** User is uploading a round video
*/ + export class SendMessageUploadRoundAction extends VirtualClass implements SendMessageUploadRoundActionArgs { + CONSTRUCTOR_id: 608050278; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageUploadRoundAction"; + progress: int; + fromReader(reader: Reader): SendMessageUploadRoundAction; + } + + /** User is currently speaking in the group call
*/ + export class SpeakingInGroupCallAction extends VirtualClass { + CONSTRUCTOR_id: -651419003; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SpeakingInGroupCallAction"; + fromReader(reader: Reader): SpeakingInGroupCallAction; + } + + export interface SendMessageHistoryImportActionArgs { + /** Progress percentage */ + progress: int; + } + + /** Chat history is being imported
*/ + export class SendMessageHistoryImportAction extends VirtualClass implements SendMessageHistoryImportActionArgs { + CONSTRUCTOR_id: -606432698; + SUBCLASS_OF_ID: 548588577; + classType: "constructor"; + className: "SendMessageHistoryImportAction"; + progress: int; + fromReader(reader: Reader): SendMessageHistoryImportAction; + } + + /** Whether we can see the exact last online timestamp of the user
*/ + export class InputPrivacyKeyStatusTimestamp extends VirtualClass { + CONSTRUCTOR_id: 1335282456; + SUBCLASS_OF_ID: 87435256; + classType: "constructor"; + className: "InputPrivacyKeyStatusTimestamp"; + fromReader(reader: Reader): InputPrivacyKeyStatusTimestamp; + } + + /** Whether the user can be invited to chats
*/ + export class InputPrivacyKeyChatInvite extends VirtualClass { + CONSTRUCTOR_id: -1107622874; + SUBCLASS_OF_ID: 87435256; + classType: "constructor"; + className: "InputPrivacyKeyChatInvite"; + fromReader(reader: Reader): InputPrivacyKeyChatInvite; + } + + /** Whether the user will accept phone calls
*/ + export class InputPrivacyKeyPhoneCall extends VirtualClass { + CONSTRUCTOR_id: -88417185; + SUBCLASS_OF_ID: 87435256; + classType: "constructor"; + className: "InputPrivacyKeyPhoneCall"; + fromReader(reader: Reader): InputPrivacyKeyPhoneCall; + } + + /** Whether the user allows P2P communication during VoIP calls
*/ + export class InputPrivacyKeyPhoneP2P extends VirtualClass { + CONSTRUCTOR_id: -610373422; + SUBCLASS_OF_ID: 87435256; + classType: "constructor"; + className: "InputPrivacyKeyPhoneP2P"; + fromReader(reader: Reader): InputPrivacyKeyPhoneP2P; + } + + /** Whether messages forwarded from this user will be anonymous
*/ + export class InputPrivacyKeyForwards extends VirtualClass { + CONSTRUCTOR_id: -1529000952; + SUBCLASS_OF_ID: 87435256; + classType: "constructor"; + className: "InputPrivacyKeyForwards"; + fromReader(reader: Reader): InputPrivacyKeyForwards; + } + + /** Whether people will be able to see the user's profile picture
*/ + export class InputPrivacyKeyProfilePhoto extends VirtualClass { + CONSTRUCTOR_id: 1461304012; + SUBCLASS_OF_ID: 87435256; + classType: "constructor"; + className: "InputPrivacyKeyProfilePhoto"; + fromReader(reader: Reader): InputPrivacyKeyProfilePhoto; + } + + /** Whether people will be able to see the user's phone number
*/ + export class InputPrivacyKeyPhoneNumber extends VirtualClass { + CONSTRUCTOR_id: 55761658; + SUBCLASS_OF_ID: 87435256; + classType: "constructor"; + className: "InputPrivacyKeyPhoneNumber"; + fromReader(reader: Reader): InputPrivacyKeyPhoneNumber; + } + + /** Whether people can add you to their contact list by your phone number
*/ + export class InputPrivacyKeyAddedByPhone extends VirtualClass { + CONSTRUCTOR_id: -786326563; + SUBCLASS_OF_ID: 87435256; + classType: "constructor"; + className: "InputPrivacyKeyAddedByPhone"; + fromReader(reader: Reader): InputPrivacyKeyAddedByPhone; + } + + /** Whether we can see the last online timestamp
*/ + export class PrivacyKeyStatusTimestamp extends VirtualClass { + CONSTRUCTOR_id: -1137792208; + SUBCLASS_OF_ID: 2185646531; + classType: "constructor"; + className: "PrivacyKeyStatusTimestamp"; + fromReader(reader: Reader): PrivacyKeyStatusTimestamp; + } + + /** Whether the user can be invited to chats
*/ + export class PrivacyKeyChatInvite extends VirtualClass { + CONSTRUCTOR_id: 1343122938; + SUBCLASS_OF_ID: 2185646531; + classType: "constructor"; + className: "PrivacyKeyChatInvite"; + fromReader(reader: Reader): PrivacyKeyChatInvite; + } + + /** Whether the user accepts phone calls
*/ + export class PrivacyKeyPhoneCall extends VirtualClass { + CONSTRUCTOR_id: 1030105979; + SUBCLASS_OF_ID: 2185646531; + classType: "constructor"; + className: "PrivacyKeyPhoneCall"; + fromReader(reader: Reader): PrivacyKeyPhoneCall; + } + + /** Whether P2P connections in phone calls are allowed
*/ + export class PrivacyKeyPhoneP2P extends VirtualClass { + CONSTRUCTOR_id: 961092808; + SUBCLASS_OF_ID: 2185646531; + classType: "constructor"; + className: "PrivacyKeyPhoneP2P"; + fromReader(reader: Reader): PrivacyKeyPhoneP2P; + } + + /** Whether messages forwarded from the user will be anonymously forwarded
*/ + export class PrivacyKeyForwards extends VirtualClass { + CONSTRUCTOR_id: 1777096355; + SUBCLASS_OF_ID: 2185646531; + classType: "constructor"; + className: "PrivacyKeyForwards"; + fromReader(reader: Reader): PrivacyKeyForwards; + } + + /** Whether the profile picture of the user is visible
*/ + export class PrivacyKeyProfilePhoto extends VirtualClass { + CONSTRUCTOR_id: -1777000467; + SUBCLASS_OF_ID: 2185646531; + classType: "constructor"; + className: "PrivacyKeyProfilePhoto"; + fromReader(reader: Reader): PrivacyKeyProfilePhoto; + } + + /** Whether the user allows us to see his phone number
*/ + export class PrivacyKeyPhoneNumber extends VirtualClass { + CONSTRUCTOR_id: -778378131; + SUBCLASS_OF_ID: 2185646531; + classType: "constructor"; + className: "PrivacyKeyPhoneNumber"; + fromReader(reader: Reader): PrivacyKeyPhoneNumber; + } + + /** Whether people can add you to their contact list by your phone number
*/ + export class PrivacyKeyAddedByPhone extends VirtualClass { + CONSTRUCTOR_id: 1124062251; + SUBCLASS_OF_ID: 2185646531; + classType: "constructor"; + className: "PrivacyKeyAddedByPhone"; + fromReader(reader: Reader): PrivacyKeyAddedByPhone; + } + + /** Allow only contacts
*/ + export class InputPrivacyValueAllowContacts extends VirtualClass { + CONSTRUCTOR_id: 218751099; + SUBCLASS_OF_ID: 1513843490; + classType: "constructor"; + className: "InputPrivacyValueAllowContacts"; + fromReader(reader: Reader): InputPrivacyValueAllowContacts; + } + + /** Allow all users
*/ + export class InputPrivacyValueAllowAll extends VirtualClass { + CONSTRUCTOR_id: 407582158; + SUBCLASS_OF_ID: 1513843490; + classType: "constructor"; + className: "InputPrivacyValueAllowAll"; + fromReader(reader: Reader): InputPrivacyValueAllowAll; + } + + export interface InputPrivacyValueAllowUsersArgs { + /** Allowed users */ + users: TypeInputUser[]; + } + + /** Allow only certain users
*/ + export class InputPrivacyValueAllowUsers extends VirtualClass implements InputPrivacyValueAllowUsersArgs { + CONSTRUCTOR_id: 320652927; + SUBCLASS_OF_ID: 1513843490; + classType: "constructor"; + className: "InputPrivacyValueAllowUsers"; + users: TypeInputUser[]; + fromReader(reader: Reader): InputPrivacyValueAllowUsers; + } + + /** Disallow only contacts
*/ + export class InputPrivacyValueDisallowContacts extends VirtualClass { + CONSTRUCTOR_id: 195371015; + SUBCLASS_OF_ID: 1513843490; + classType: "constructor"; + className: "InputPrivacyValueDisallowContacts"; + fromReader(reader: Reader): InputPrivacyValueDisallowContacts; + } + + /** Disallow all
*/ + export class InputPrivacyValueDisallowAll extends VirtualClass { + CONSTRUCTOR_id: -697604407; + SUBCLASS_OF_ID: 1513843490; + classType: "constructor"; + className: "InputPrivacyValueDisallowAll"; + fromReader(reader: Reader): InputPrivacyValueDisallowAll; + } + + export interface InputPrivacyValueDisallowUsersArgs { + /** Users to disallow */ + users: TypeInputUser[]; + } + + /** Disallow only certain users
*/ + export class InputPrivacyValueDisallowUsers extends VirtualClass implements InputPrivacyValueDisallowUsersArgs { + CONSTRUCTOR_id: -1877932953; + SUBCLASS_OF_ID: 1513843490; + classType: "constructor"; + className: "InputPrivacyValueDisallowUsers"; + users: TypeInputUser[]; + fromReader(reader: Reader): InputPrivacyValueDisallowUsers; + } + + export interface InputPrivacyValueAllowChatParticipantsArgs { + /** Allowed chat IDs */ + chats: int[]; + } + + /** Allow only participants of certain chats
*/ + export class InputPrivacyValueAllowChatParticipants extends VirtualClass implements InputPrivacyValueAllowChatParticipantsArgs { + CONSTRUCTOR_id: 1283572154; + SUBCLASS_OF_ID: 1513843490; + classType: "constructor"; + className: "InputPrivacyValueAllowChatParticipants"; + chats: int[]; + fromReader(reader: Reader): InputPrivacyValueAllowChatParticipants; + } + + export interface InputPrivacyValueDisallowChatParticipantsArgs { + /** Disallowed chat IDs */ + chats: int[]; + } + + /** Disallow only participants of certain chats
*/ + export class InputPrivacyValueDisallowChatParticipants extends VirtualClass implements InputPrivacyValueDisallowChatParticipantsArgs { + CONSTRUCTOR_id: -668769361; + SUBCLASS_OF_ID: 1513843490; + classType: "constructor"; + className: "InputPrivacyValueDisallowChatParticipants"; + chats: int[]; + fromReader(reader: Reader): InputPrivacyValueDisallowChatParticipants; + } + + /** Allow all contacts
*/ + export class PrivacyValueAllowContacts extends VirtualClass { + CONSTRUCTOR_id: -123988; + SUBCLASS_OF_ID: 3954700912; + classType: "constructor"; + className: "PrivacyValueAllowContacts"; + fromReader(reader: Reader): PrivacyValueAllowContacts; + } + + /** Allow all users
*/ + export class PrivacyValueAllowAll extends VirtualClass { + CONSTRUCTOR_id: 1698855810; + SUBCLASS_OF_ID: 3954700912; + classType: "constructor"; + className: "PrivacyValueAllowAll"; + fromReader(reader: Reader): PrivacyValueAllowAll; + } + + export interface PrivacyValueAllowUsersArgs { + /** Allowed users */ + users: int[]; + } + + /** Allow only certain users
*/ + export class PrivacyValueAllowUsers extends VirtualClass implements PrivacyValueAllowUsersArgs { + CONSTRUCTOR_id: 1297858060; + SUBCLASS_OF_ID: 3954700912; + classType: "constructor"; + className: "PrivacyValueAllowUsers"; + users: int[]; + fromReader(reader: Reader): PrivacyValueAllowUsers; + } + + /** Disallow only contacts
*/ + export class PrivacyValueDisallowContacts extends VirtualClass { + CONSTRUCTOR_id: -125240806; + SUBCLASS_OF_ID: 3954700912; + classType: "constructor"; + className: "PrivacyValueDisallowContacts"; + fromReader(reader: Reader): PrivacyValueDisallowContacts; + } + + /** Disallow all users
*/ + export class PrivacyValueDisallowAll extends VirtualClass { + CONSTRUCTOR_id: -1955338397; + SUBCLASS_OF_ID: 3954700912; + classType: "constructor"; + className: "PrivacyValueDisallowAll"; + fromReader(reader: Reader): PrivacyValueDisallowAll; + } + + export interface PrivacyValueDisallowUsersArgs { + /** Disallowed users */ + users: int[]; + } + + /** Disallow only certain users
*/ + export class PrivacyValueDisallowUsers extends VirtualClass implements PrivacyValueDisallowUsersArgs { + CONSTRUCTOR_id: 209668535; + SUBCLASS_OF_ID: 3954700912; + classType: "constructor"; + className: "PrivacyValueDisallowUsers"; + users: int[]; + fromReader(reader: Reader): PrivacyValueDisallowUsers; + } + + export interface PrivacyValueAllowChatParticipantsArgs { + /** Allowed chats */ + chats: int[]; + } + + /** Allow all participants of certain chats
*/ + export class PrivacyValueAllowChatParticipants extends VirtualClass implements PrivacyValueAllowChatParticipantsArgs { + CONSTRUCTOR_id: 415136107; + SUBCLASS_OF_ID: 3954700912; + classType: "constructor"; + className: "PrivacyValueAllowChatParticipants"; + chats: int[]; + fromReader(reader: Reader): PrivacyValueAllowChatParticipants; + } + + export interface PrivacyValueDisallowChatParticipantsArgs { + /** Disallowed chats */ + chats: int[]; + } + + /** Disallow only participants of certain chats
*/ + export class PrivacyValueDisallowChatParticipants extends VirtualClass implements PrivacyValueDisallowChatParticipantsArgs { + CONSTRUCTOR_id: -1397881200; + SUBCLASS_OF_ID: 3954700912; + classType: "constructor"; + className: "PrivacyValueDisallowChatParticipants"; + chats: int[]; + fromReader(reader: Reader): PrivacyValueDisallowChatParticipants; + } + + export interface AccountDaysTTLArgs { + /** This account will self-destruct in the specified number of days */ + days: int; + } + + /** Time to live in days of the current account
*/ + export class AccountDaysTTL extends VirtualClass implements AccountDaysTTLArgs { + CONSTRUCTOR_id: -1194283041; + SUBCLASS_OF_ID: 3131284872; + classType: "constructor"; + className: "AccountDaysTTL"; + days: int; + fromReader(reader: Reader): AccountDaysTTL; + } + + export interface DocumentAttributeImageSizeArgs { + /** Width of image */ + w: int; + /** Height of image */ + h: int; + } + + /** Defines the width and height of an image uploaded as document
*/ + export class DocumentAttributeImageSize extends VirtualClass implements DocumentAttributeImageSizeArgs { + CONSTRUCTOR_id: 1815593308; + SUBCLASS_OF_ID: 4146719643; + classType: "constructor"; + className: "DocumentAttributeImageSize"; + w: int; + h: int; + fromReader(reader: Reader): DocumentAttributeImageSize; + } + + /** Defines an animated GIF
*/ + export class DocumentAttributeAnimated extends VirtualClass { + CONSTRUCTOR_id: 297109817; + SUBCLASS_OF_ID: 4146719643; + classType: "constructor"; + className: "DocumentAttributeAnimated"; + fromReader(reader: Reader): DocumentAttributeAnimated; + } + + export interface DocumentAttributeStickerArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is a mask sticker */ + mask?: true; + /** Alternative emoji representation of sticker */ + alt: string; + /** Associated stickerset */ + stickerset: TypeInputStickerSet; + /** Mask coordinates (if this is a mask sticker, attached to a photo) */ + maskCoords?: TypeMaskCoords; + } + + /** Defines a sticker
*/ + export class DocumentAttributeSticker extends VirtualClass implements DocumentAttributeStickerArgs { + CONSTRUCTOR_id: 1662637586; + SUBCLASS_OF_ID: 4146719643; + classType: "constructor"; + className: "DocumentAttributeSticker"; + flags: number; + mask?: true; + alt: string; + stickerset: TypeInputStickerSet; + maskCoords?: TypeMaskCoords; + fromReader(reader: Reader): DocumentAttributeSticker; + } + + export interface DocumentAttributeVideoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is a round video */ + roundMessage?: true; + /** Whether the video supports streaming */ + supportsStreaming?: true; + /** Duration in seconds */ + duration: int; + /** Video width */ + w: int; + /** Video height */ + h: int; + } + + /** Defines a video
*/ + export class DocumentAttributeVideo extends VirtualClass implements DocumentAttributeVideoArgs { + CONSTRUCTOR_id: 250621158; + SUBCLASS_OF_ID: 4146719643; + classType: "constructor"; + className: "DocumentAttributeVideo"; + flags: number; + roundMessage?: true; + supportsStreaming?: true; + duration: int; + w: int; + h: int; + fromReader(reader: Reader): DocumentAttributeVideo; + } + + export interface DocumentAttributeAudioArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is a voice message */ + voice?: true; + /** Duration in seconds */ + duration: int; + /** Name of song */ + title?: string; + /** Performer */ + performer?: string; + /** Waveform */ + waveform?: bytes; + } + + /** Represents an audio file
*/ + export class DocumentAttributeAudio extends VirtualClass implements DocumentAttributeAudioArgs { + CONSTRUCTOR_id: -1739392570; + SUBCLASS_OF_ID: 4146719643; + classType: "constructor"; + className: "DocumentAttributeAudio"; + flags: number; + voice?: true; + duration: int; + title?: string; + performer?: string; + waveform?: bytes; + fromReader(reader: Reader): DocumentAttributeAudio; + } + + export interface DocumentAttributeFilenameArgs { + /** The file name */ + fileName: string; + } + + /** A simple document with a file name
*/ + export class DocumentAttributeFilename extends VirtualClass implements DocumentAttributeFilenameArgs { + CONSTRUCTOR_id: 358154344; + SUBCLASS_OF_ID: 4146719643; + classType: "constructor"; + className: "DocumentAttributeFilename"; + fileName: string; + fromReader(reader: Reader): DocumentAttributeFilename; + } + + /** Whether the current document has stickers attached
*/ + export class DocumentAttributeHasStickers extends VirtualClass { + CONSTRUCTOR_id: -1744710921; + SUBCLASS_OF_ID: 4146719643; + classType: "constructor"; + className: "DocumentAttributeHasStickers"; + fromReader(reader: Reader): DocumentAttributeHasStickers; + } + + export interface StickerPackArgs { + /** Emoji */ + emoticon: string; + /** Stickers */ + documents: long[]; + } + + /** + * A stickerpack is a group of stickers associated to the same emoji.
+ * It is not a sticker pack the way it is usually intended, you may be looking for a StickerSet.
+ * @link https://corefork.telegram.org/type/StickerSet + */ + export class StickerPack extends VirtualClass implements StickerPackArgs { + CONSTRUCTOR_id: 313694676; + SUBCLASS_OF_ID: 2683282644; + classType: "constructor"; + className: "StickerPack"; + emoticon: string; + documents: long[]; + fromReader(reader: Reader): StickerPack; + } + + export interface WebPageEmptyArgs { + /** Preview ID */ + id: long; + } + + /** No preview is available for the webpage
*/ + export class WebPageEmpty extends VirtualClass implements WebPageEmptyArgs { + CONSTRUCTOR_id: -350980120; + SUBCLASS_OF_ID: 1437168769; + classType: "constructor"; + className: "WebPageEmpty"; + id: long; + fromReader(reader: Reader): WebPageEmpty; + } + + export interface WebPagePendingArgs { + /** ID of preview */ + id: long; + /** When was the processing started */ + date: int; + } + + /** A preview of the webpage is currently being generated
*/ + export class WebPagePending extends VirtualClass implements WebPagePendingArgs { + CONSTRUCTOR_id: -981018084; + SUBCLASS_OF_ID: 1437168769; + classType: "constructor"; + className: "WebPagePending"; + id: long; + date: int; + fromReader(reader: Reader): WebPagePending; + } + + export interface WebPageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Preview ID */ + id: long; + /** URL of previewed webpage */ + url: string; + /** Webpage URL to be displayed to the user */ + displayUrl: string; + /** Hash for pagination, for more info click here */ + hash: int; + /** Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else */ + type?: string; + /** Short name of the site (e.g., Google Docs, App Store) */ + siteName?: string; + /** Title of the content */ + title?: string; + /** Content description */ + description?: string; + /** Image representing the content */ + photo?: TypePhoto; + /** URL to show in the embedded preview */ + embedUrl?: string; + /** MIME type of the embedded preview, (e.g., text/html or video/mp4) */ + embedType?: string; + /** Width of the embedded preview */ + embedWidth?: int; + /** Height of the embedded preview */ + embedHeight?: int; + /** Duration of the content, in seconds */ + duration?: int; + /** Author of the content */ + author?: string; + /** Preview of the content as a media file */ + document?: TypeDocument; + /** Page contents in instant view format */ + cachedPage?: TypePage; + /** Webpage attributes */ + attributes?: TypeWebPageAttribute[]; + } + + /** + * Webpage preview
+ * @link https://corefork.telegram.org/api/offsets + */ + export class WebPage extends VirtualClass implements WebPageArgs { + CONSTRUCTOR_id: -392411726; + SUBCLASS_OF_ID: 1437168769; + classType: "constructor"; + className: "WebPage"; + flags: number; + id: long; + url: string; + displayUrl: string; + hash: int; + type?: string; + siteName?: string; + title?: string; + description?: string; + photo?: TypePhoto; + embedUrl?: string; + embedType?: string; + embedWidth?: int; + embedHeight?: int; + duration?: int; + author?: string; + document?: TypeDocument; + cachedPage?: TypePage; + attributes?: TypeWebPageAttribute[]; + fromReader(reader: Reader): WebPage; + } + + export interface WebPageNotModifiedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Page view count */ + cachedPageViews?: int; + } + + /** The preview of the webpage hasn't changed
*/ + export class WebPageNotModified extends VirtualClass implements WebPageNotModifiedArgs { + CONSTRUCTOR_id: 1930545681; + SUBCLASS_OF_ID: 1437168769; + classType: "constructor"; + className: "WebPageNotModified"; + flags: number; + cachedPageViews?: int; + fromReader(reader: Reader): WebPageNotModified; + } + + export interface AuthorizationArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is the current session */ + current?: true; + /** Whether the session is from an official app */ + officialApp?: true; + /** Whether the session is still waiting for a 2FA password */ + passwordPending?: true; + /** Identifier */ + hash: long; + /** Device model */ + deviceModel: string; + /** Platform */ + platform: string; + /** System version */ + systemVersion: string; + /** API ID */ + apiId: int; + /** App name */ + appName: string; + /** App version */ + appVersion: string; + /** When was the session created */ + dateCreated: int; + /** When was the session last active */ + dateActive: int; + /** Last known IP */ + ip: string; + /** Country determined from IP */ + country: string; + /** Region determined from IP */ + region: string; + } + + /** + * Logged-in session
+ * @link https://corefork.telegram.org/api/obtaining_api_id + */ + export class Authorization extends VirtualClass implements AuthorizationArgs { + CONSTRUCTOR_id: -1392388579; + SUBCLASS_OF_ID: 3373514778; + classType: "constructor"; + className: "Authorization"; + flags: number; + current?: true; + officialApp?: true; + passwordPending?: true; + hash: long; + deviceModel: string; + platform: string; + systemVersion: string; + apiId: int; + appName: string; + appVersion: string; + dateCreated: int; + dateActive: int; + ip: string; + country: string; + region: string; + fromReader(reader: Reader): Authorization; + } + + export interface ReceivedNotifyMessageArgs { + /** Message ID, for which PUSH-notifications were canceled */ + id: int; + /** Reserved for future use */ + flags: int; + } + + /** Message ID, for which PUSH-notifications were cancelled.
*/ + export class ReceivedNotifyMessage extends VirtualClass implements ReceivedNotifyMessageArgs { + CONSTRUCTOR_id: -1551583367; + SUBCLASS_OF_ID: 2841786398; + classType: "constructor"; + className: "ReceivedNotifyMessage"; + id: int; + flags: int; + fromReader(reader: Reader): ReceivedNotifyMessage; + } + + export interface ChatInviteExportedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this chat invite was revoked */ + revoked?: true; + /** Whether this chat invite has no expiration */ + permanent?: true; + /** Chat invitation link */ + link: string; + /** ID of the admin that created this chat invite */ + adminId: int; + /** When was this chat invite created */ + date: int; + /** When was this chat invite last modified */ + startDate?: int; + /** When does this chat invite expire */ + expireDate?: int; + /** Maximum number of users that can join using this link */ + usageLimit?: int; + /** How many users joined using this link */ + usage?: int; + } + + /** Exported chat invite
*/ + export class ChatInviteExported extends VirtualClass implements ChatInviteExportedArgs { + CONSTRUCTOR_id: 1847917725; + SUBCLASS_OF_ID: 3027536472; + classType: "constructor"; + className: "ChatInviteExported"; + flags: number; + revoked?: true; + permanent?: true; + link: string; + adminId: int; + date: int; + startDate?: int; + expireDate?: int; + usageLimit?: int; + usage?: int; + fromReader(reader: Reader): ChatInviteExported; + } + + export interface ChatInviteAlreadyArgs { + /** The chat connected to the invite */ + chat: TypeChat; + } + + /** The user has already joined this chat
*/ + export class ChatInviteAlready extends VirtualClass implements ChatInviteAlreadyArgs { + CONSTRUCTOR_id: 1516793212; + SUBCLASS_OF_ID: 72750902; + classType: "constructor"; + className: "ChatInviteAlready"; + chat: TypeChat; + fromReader(reader: Reader): ChatInviteAlready; + } + + export interface ChatInviteArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is a channel/supergroup or a normal group */ + channel?: true; + /** Whether this is a channel */ + broadcast?: true; + /** Whether this is a public channel/supergroup */ + public?: true; + /** Whether this is a supergroup */ + megagroup?: true; + /** Chat/supergroup/channel title */ + title: string; + /** Chat/supergroup/channel photo */ + photo: TypePhoto; + /** Participant count */ + participantsCount: int; + /** A few of the participants that are in the group */ + participants?: TypeUser[]; + } + + /** + * Chat invite info
+ * @link https://corefork.telegram.org/api/channel + */ + export class ChatInvite extends VirtualClass implements ChatInviteArgs { + CONSTRUCTOR_id: -540871282; + SUBCLASS_OF_ID: 72750902; + classType: "constructor"; + className: "ChatInvite"; + flags: number; + channel?: true; + broadcast?: true; + public?: true; + megagroup?: true; + title: string; + photo: TypePhoto; + participantsCount: int; + participants?: TypeUser[]; + fromReader(reader: Reader): ChatInvite; + } + + export interface ChatInvitePeekArgs { + /** Chat information */ + chat: TypeChat; + /** Read-only anonymous access to this group will be revoked at this date */ + expires: int; + } + + /** A chat invitation that also allows peeking into the group to read messages without joining it.
*/ + export class ChatInvitePeek extends VirtualClass implements ChatInvitePeekArgs { + CONSTRUCTOR_id: 1634294960; + SUBCLASS_OF_ID: 72750902; + classType: "constructor"; + className: "ChatInvitePeek"; + chat: TypeChat; + expires: int; + fromReader(reader: Reader): ChatInvitePeek; + } + + /** Empty constructor
*/ + export class InputStickerSetEmpty extends VirtualClass { + CONSTRUCTOR_id: -4838507; + SUBCLASS_OF_ID: 1034127786; + classType: "constructor"; + className: "InputStickerSetEmpty"; + fromReader(reader: Reader): InputStickerSetEmpty; + } + + export interface InputStickerSetIDArgs { + /** ID */ + id: long; + /** Access hash */ + accessHash: long; + } + + /** Stickerset by ID
*/ + export class InputStickerSetID extends VirtualClass implements InputStickerSetIDArgs { + CONSTRUCTOR_id: -1645763991; + SUBCLASS_OF_ID: 1034127786; + classType: "constructor"; + className: "InputStickerSetID"; + id: long; + accessHash: long; + fromReader(reader: Reader): InputStickerSetID; + } + + export interface InputStickerSetShortNameArgs { + /** From tg://addstickers?set=short_name */ + shortName: string; + } + + /** Stickerset by short name, from tg://addstickers?set=short_name
*/ + export class InputStickerSetShortName extends VirtualClass implements InputStickerSetShortNameArgs { + CONSTRUCTOR_id: -2044933984; + SUBCLASS_OF_ID: 1034127786; + classType: "constructor"; + className: "InputStickerSetShortName"; + shortName: string; + fromReader(reader: Reader): InputStickerSetShortName; + } + + /** Animated emojis stickerset
*/ + export class InputStickerSetAnimatedEmoji extends VirtualClass { + CONSTRUCTOR_id: 42402760; + SUBCLASS_OF_ID: 1034127786; + classType: "constructor"; + className: "InputStickerSetAnimatedEmoji"; + fromReader(reader: Reader): InputStickerSetAnimatedEmoji; + } + + export interface InputStickerSetDiceArgs { + /** The emoji, for now 🏀, 🎲 and 🎯 are supported */ + emoticon: string; + } + + /** + * Used for fetching animated dice stickers
+ * @link https://corefork.telegram.org/api/dice + */ + export class InputStickerSetDice extends VirtualClass implements InputStickerSetDiceArgs { + CONSTRUCTOR_id: -427863538; + SUBCLASS_OF_ID: 1034127786; + classType: "constructor"; + className: "InputStickerSetDice"; + emoticon: string; + fromReader(reader: Reader): InputStickerSetDice; + } + + export interface StickerSetArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this stickerset was archived (due to too many saved stickers in the current account) */ + archived?: true; + /** Is this stickerset official */ + official?: true; + /** Is this a mask stickerset */ + masks?: true; + /** Is this an animated stickerpack */ + animated?: true; + /** When was this stickerset installed */ + installedDate?: int; + /** ID of the stickerset */ + id: long; + /** Access hash of stickerset */ + accessHash: long; + /** Title of stickerset */ + title: string; + /** Short name of stickerset to use in tg://addstickers?set=short_name */ + shortName: string; + /** Stickerset thumbnail */ + thumbs?: TypePhotoSize[]; + /** DC ID of thumbnail */ + thumbDcId?: int; + /** Thumbnail version */ + thumbVersion?: int; + /** Number of stickers in pack */ + count: int; + /** Hash */ + hash: int; + } + + /** Represents a stickerset (stickerpack)
*/ + export class StickerSet extends VirtualClass implements StickerSetArgs { + CONSTRUCTOR_id: -673242758; + SUBCLASS_OF_ID: 3134455697; + classType: "constructor"; + className: "StickerSet"; + flags: number; + archived?: true; + official?: true; + masks?: true; + animated?: true; + installedDate?: int; + id: long; + accessHash: long; + title: string; + shortName: string; + thumbs?: TypePhotoSize[]; + thumbDcId?: int; + thumbVersion?: int; + count: int; + hash: int; + fromReader(reader: Reader): StickerSet; + } + + export interface BotCommandArgs { + /** /command name */ + command: string; + /** Description of the command */ + description: string; + } + + /** Describes a bot command that can be used in a chat
*/ + export class BotCommand extends VirtualClass implements BotCommandArgs { + CONSTRUCTOR_id: -1032140601; + SUBCLASS_OF_ID: 236872386; + classType: "constructor"; + className: "BotCommand"; + command: string; + description: string; + fromReader(reader: Reader): BotCommand; + } + + export interface BotInfoArgs { + /** ID of the bot */ + userId: int; + /** Description of the bot */ + description: string; + /** Bot commands that can be used in the chat */ + commands: TypeBotCommand[]; + } + + /** Info about bots (available bot commands, etc)
*/ + export class BotInfo extends VirtualClass implements BotInfoArgs { + CONSTRUCTOR_id: -1729618630; + SUBCLASS_OF_ID: 4059496923; + classType: "constructor"; + className: "BotInfo"; + userId: int; + description: string; + commands: TypeBotCommand[]; + fromReader(reader: Reader): BotInfo; + } + + export interface KeyboardButtonArgs { + /** Button text */ + text: string; + } + + /** Bot keyboard button
*/ + export class KeyboardButton extends VirtualClass implements KeyboardButtonArgs { + CONSTRUCTOR_id: -1560655744; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "KeyboardButton"; + text: string; + fromReader(reader: Reader): KeyboardButton; + } + + export interface KeyboardButtonUrlArgs { + /** Button label */ + text: string; + /** URL */ + url: string; + } + + /** URL button
*/ + export class KeyboardButtonUrl extends VirtualClass implements KeyboardButtonUrlArgs { + CONSTRUCTOR_id: 629866245; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "KeyboardButtonUrl"; + text: string; + url: string; + fromReader(reader: Reader): KeyboardButtonUrl; + } + + export interface KeyboardButtonCallbackArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the user should verify his identity by entering his 2FA SRP parameters to the messages.getBotCallbackAnswer method. NOTE: telegram and the bot WILL NOT have access to the plaintext password, thanks to SRP. This button is mainly used by the official @botfather bot, for verifying the user's identity before transferring ownership of a bot to another user. */ + requiresPassword?: true; + /** Button text */ + text: string; + /** Callback data */ + data: bytes; + } + + /** + * Callback button
+ * @link https://corefork.telegram.org/api/srp + * @link https://corefork.telegram.org/method/messages.getBotCallbackAnswer + */ + export class KeyboardButtonCallback extends VirtualClass implements KeyboardButtonCallbackArgs { + CONSTRUCTOR_id: 901503851; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "KeyboardButtonCallback"; + flags: number; + requiresPassword?: true; + text: string; + data: bytes; + fromReader(reader: Reader): KeyboardButtonCallback; + } + + export interface KeyboardButtonRequestPhoneArgs { + /** Button text */ + text: string; + } + + /** Button to request a user's phone number
*/ + export class KeyboardButtonRequestPhone extends VirtualClass implements KeyboardButtonRequestPhoneArgs { + CONSTRUCTOR_id: -1318425559; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "KeyboardButtonRequestPhone"; + text: string; + fromReader(reader: Reader): KeyboardButtonRequestPhone; + } + + export interface KeyboardButtonRequestGeoLocationArgs { + /** Button text */ + text: string; + } + + /** Button to request a user's geolocation
*/ + export class KeyboardButtonRequestGeoLocation extends VirtualClass implements KeyboardButtonRequestGeoLocationArgs { + CONSTRUCTOR_id: -59151553; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "KeyboardButtonRequestGeoLocation"; + text: string; + fromReader(reader: Reader): KeyboardButtonRequestGeoLocation; + } + + export interface KeyboardButtonSwitchInlineArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. */ + samePeer?: true; + /** Button label */ + text: string; + /** The inline query to use */ + query: string; + } + + /** Button to force a user to switch to inline mode Pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field.
*/ + export class KeyboardButtonSwitchInline extends VirtualClass implements KeyboardButtonSwitchInlineArgs { + CONSTRUCTOR_id: 90744648; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "KeyboardButtonSwitchInline"; + flags: number; + samePeer?: true; + text: string; + query: string; + fromReader(reader: Reader): KeyboardButtonSwitchInline; + } + + export interface KeyboardButtonGameArgs { + /** Button text */ + text: string; + } + + /** Button to start a game
*/ + export class KeyboardButtonGame extends VirtualClass implements KeyboardButtonGameArgs { + CONSTRUCTOR_id: 1358175439; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "KeyboardButtonGame"; + text: string; + fromReader(reader: Reader): KeyboardButtonGame; + } + + export interface KeyboardButtonBuyArgs { + /** Button text */ + text: string; + } + + /** Button to buy a product
*/ + export class KeyboardButtonBuy extends VirtualClass implements KeyboardButtonBuyArgs { + CONSTRUCTOR_id: -1344716869; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "KeyboardButtonBuy"; + text: string; + fromReader(reader: Reader): KeyboardButtonBuy; + } + + export interface KeyboardButtonUrlAuthArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Button label */ + text: string; + /** New text of the button in forwarded messages. */ + fwdText?: string; + /** An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.

NOTE: Services must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. */ + url: string; + /** ID of the button to pass to messages.requestUrlAuth */ + buttonId: int; + } + + /** + * Button to request a user to authorize via URL using Seamless Telegram Login. When the user clicks on such a button, messages.requestUrlAuth should be called, providing the button_id and the ID of the container message. The returned urlAuthResultRequest object will contain more details about the authorization request (request_write_access if the bot would like to send messages to the user along with the username of the bot which will be used for user authorization). Finally, the user can choose to call messages.acceptUrlAuth to get a urlAuthResultAccepted with the URL to open instead of the url of this constructor, or a urlAuthResultDefault, in which case the url of this constructor must be opened, instead. If the user refuses the authorization request but still wants to open the link, the url of this constructor must be used.
+ * @link https://corefork.telegram.org/widgets/login + * @link https://corefork.telegram.org/method/messages.requestUrlAuth + * @link https://corefork.telegram.org/api/url-authorization + * @link https://corefork.telegram.org/constructor/urlAuthResultRequest + * @link https://corefork.telegram.org/api/url-authorization + * @link https://corefork.telegram.org/method/messages.acceptUrlAuth + * @link https://corefork.telegram.org/api/url-authorization + * @link https://corefork.telegram.org/constructor/urlAuthResultAccepted + * @link https://corefork.telegram.org/api/url-authorization + * @link https://corefork.telegram.org/constructor/urlAuthResultDefault + * @link https://corefork.telegram.org/api/url-authorization + */ + export class KeyboardButtonUrlAuth extends VirtualClass implements KeyboardButtonUrlAuthArgs { + CONSTRUCTOR_id: 280464681; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "KeyboardButtonUrlAuth"; + flags: number; + text: string; + fwdText?: string; + url: string; + buttonId: int; + fromReader(reader: Reader): KeyboardButtonUrlAuth; + } + + export interface InputKeyboardButtonUrlAuthArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Set this flag to request the permission for your bot to send messages to the user. */ + requestWriteAccess?: true; + /** Button text */ + text: string; + /** New text of the button in forwarded messages. */ + fwdText?: string; + /** An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. */ + url: string; + /** Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. */ + bot: TypeInputUser; + } + + /** + * Button to request a user to authorize via URL using Seamless Telegram Login.
+ * @link https://corefork.telegram.org/widgets/login + * @link https://corefork.telegram.org/method/messages.acceptUrlAuth + * @link https://corefork.telegram.org/api/url-authorization + */ + export class InputKeyboardButtonUrlAuth extends VirtualClass implements InputKeyboardButtonUrlAuthArgs { + CONSTRUCTOR_id: -802258988; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "InputKeyboardButtonUrlAuth"; + flags: number; + requestWriteAccess?: true; + text: string; + fwdText?: string; + url: string; + bot: TypeInputUser; + fromReader(reader: Reader): InputKeyboardButtonUrlAuth; + } + + export interface KeyboardButtonRequestPollArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, only quiz polls can be sent */ + quiz?: Bool; + /** Button text */ + text: string; + } + + /** A button that allows the user to create and send a poll when pressed; available only in private
*/ + export class KeyboardButtonRequestPoll extends VirtualClass implements KeyboardButtonRequestPollArgs { + CONSTRUCTOR_id: -1144565411; + SUBCLASS_OF_ID: 195916963; + classType: "constructor"; + className: "KeyboardButtonRequestPoll"; + flags: number; + quiz?: Bool; + text: string; + fromReader(reader: Reader): KeyboardButtonRequestPoll; + } + + export interface KeyboardButtonRowArgs { + /** Bot or inline keyboard buttons */ + buttons: TypeKeyboardButton[]; + } + + /** Inline keyboard row
*/ + export class KeyboardButtonRow extends VirtualClass implements KeyboardButtonRowArgs { + CONSTRUCTOR_id: 2002815875; + SUBCLASS_OF_ID: 2222403758; + classType: "constructor"; + className: "KeyboardButtonRow"; + buttons: TypeKeyboardButton[]; + fromReader(reader: Reader): KeyboardButtonRow; + } + + export interface ReplyKeyboardHideArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Use this flag if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet */ + selective?: true; + } + + /** Hide sent bot keyboard
*/ + export class ReplyKeyboardHide extends VirtualClass implements ReplyKeyboardHideArgs { + CONSTRUCTOR_id: -1606526075; + SUBCLASS_OF_ID: 3806400242; + classType: "constructor"; + className: "ReplyKeyboardHide"; + flags: number; + selective?: true; + fromReader(reader: Reader): ReplyKeyboardHide; + } + + export interface ReplyKeyboardForceReplyArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. */ + singleUse?: true; + /** Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
Example: A user requests to change the bot‘s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard. */ + selective?: true; + /** The placeholder to be shown in the input field when the keyboard is active; 1-64 characters. */ + placeholder?: string; + } + + /** Force the user to send a reply
*/ + export class ReplyKeyboardForceReply extends VirtualClass implements ReplyKeyboardForceReplyArgs { + CONSTRUCTOR_id: -2035021048; + SUBCLASS_OF_ID: 3806400242; + classType: "constructor"; + className: "ReplyKeyboardForceReply"; + flags: number; + singleUse?: true; + selective?: true; + placeholder?: string; + fromReader(reader: Reader): ReplyKeyboardForceReply; + } + + export interface ReplyKeyboardMarkupArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). If not set, the custom keyboard is always of the same height as the app's standard keyboard. */ + resize?: true; + /** Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. */ + singleUse?: true; + /** Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

Example: A user requests to change the bot‘s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard. */ + selective?: true; + /** Button row */ + rows: TypeKeyboardButtonRow[]; + /** The placeholder to be shown in the input field when the keyboard is active; 1-64 characters. */ + placeholder?: string; + } + + /** Bot keyboard
*/ + export class ReplyKeyboardMarkup extends VirtualClass implements ReplyKeyboardMarkupArgs { + CONSTRUCTOR_id: -2049074735; + SUBCLASS_OF_ID: 3806400242; + classType: "constructor"; + className: "ReplyKeyboardMarkup"; + flags: number; + resize?: true; + singleUse?: true; + selective?: true; + rows: TypeKeyboardButtonRow[]; + placeholder?: string; + fromReader(reader: Reader): ReplyKeyboardMarkup; + } + + export interface ReplyInlineMarkupArgs { + /** Bot or inline keyboard rows */ + rows: TypeKeyboardButtonRow[]; + } + + /** Bot or inline keyboard
*/ + export class ReplyInlineMarkup extends VirtualClass implements ReplyInlineMarkupArgs { + CONSTRUCTOR_id: 1218642516; + SUBCLASS_OF_ID: 3806400242; + classType: "constructor"; + className: "ReplyInlineMarkup"; + rows: TypeKeyboardButtonRow[]; + fromReader(reader: Reader): ReplyInlineMarkup; + } + + export interface MessageEntityUnknownArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Unknown message entity
*/ + export class MessageEntityUnknown extends VirtualClass implements MessageEntityUnknownArgs { + CONSTRUCTOR_id: -1148011883; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityUnknown"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityUnknown; + } + + export interface MessageEntityMentionArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** + * Message entity mentioning the current user
+ * @link https://corefork.telegram.org/api/mentions + */ + export class MessageEntityMention extends VirtualClass implements MessageEntityMentionArgs { + CONSTRUCTOR_id: -100378723; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityMention"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityMention; + } + + export interface MessageEntityHashtagArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** #hashtag message entity
*/ + export class MessageEntityHashtag extends VirtualClass implements MessageEntityHashtagArgs { + CONSTRUCTOR_id: 1868782349; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityHashtag"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityHashtag; + } + + export interface MessageEntityBotCommandArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Message entity representing a bot /command
*/ + export class MessageEntityBotCommand extends VirtualClass implements MessageEntityBotCommandArgs { + CONSTRUCTOR_id: 1827637959; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityBotCommand"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityBotCommand; + } + + export interface MessageEntityUrlArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** + * Message entity representing an in-text url: https://google.com; for text urls, use messageEntityTextUrl.
+ * @link https://corefork.telegram.org/constructor/messageEntityTextUrl + * @link https://google.com/ + * @link https://google.com/ + * @link https://corefork.telegram.org/constructor/messageEntityUrl + */ + export class MessageEntityUrl extends VirtualClass implements MessageEntityUrlArgs { + CONSTRUCTOR_id: 1859134776; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityUrl"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityUrl; + } + + export interface MessageEntityEmailArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Message entity representing an email@example.com.
*/ + export class MessageEntityEmail extends VirtualClass implements MessageEntityEmailArgs { + CONSTRUCTOR_id: 1692693954; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityEmail"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityEmail; + } + + export interface MessageEntityBoldArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Message entity representing bold text.
*/ + export class MessageEntityBold extends VirtualClass implements MessageEntityBoldArgs { + CONSTRUCTOR_id: -1117713463; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityBold"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityBold; + } + + export interface MessageEntityItalicArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Message entity representing italic text.
*/ + export class MessageEntityItalic extends VirtualClass implements MessageEntityItalicArgs { + CONSTRUCTOR_id: -2106619040; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityItalic"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityItalic; + } + + export interface MessageEntityCodeArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Message entity representing a codeblock.
*/ + export class MessageEntityCode extends VirtualClass implements MessageEntityCodeArgs { + CONSTRUCTOR_id: 681706865; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityCode"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityCode; + } + + export interface MessageEntityPreArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + /** Programming language of the code */ + language: string; + } + + /** Message entity representing a preformatted codeblock, allowing the user to specify a programming language for the codeblock.
*/ + export class MessageEntityPre extends VirtualClass implements MessageEntityPreArgs { + CONSTRUCTOR_id: 1938967520; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityPre"; + offset: int; + length: int; + language: string; + fromReader(reader: Reader): MessageEntityPre; + } + + export interface MessageEntityTextUrlArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + /** The actual URL */ + url: string; + } + + /** + * Message entity representing a text url: for in-text urls like https://google.com use messageEntityUrl.
+ * @link https://corefork.telegram.org/constructor/messageEntityUrl + * @link https://google.com/ + * @link https://google.com/ + * @link https://corefork.telegram.org/constructor/messageEntityTextUrl + */ + export class MessageEntityTextUrl extends VirtualClass implements MessageEntityTextUrlArgs { + CONSTRUCTOR_id: 1990644519; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityTextUrl"; + offset: int; + length: int; + url: string; + fromReader(reader: Reader): MessageEntityTextUrl; + } + + export interface MessageEntityMentionNameArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + /** Identifier of the user that was mentioned */ + userId: int; + } + + /** + * Message entity representing a user mention: for creating a mention use inputMessageEntityMentionName.
+ * @link https://corefork.telegram.org/api/mentions + * @link https://corefork.telegram.org/constructor/inputMessageEntityMentionName + * @link https://corefork.telegram.org/api/mentions + * @link https://corefork.telegram.org/constructor/messageEntityMentionName + */ + export class MessageEntityMentionName extends VirtualClass implements MessageEntityMentionNameArgs { + CONSTRUCTOR_id: 892193368; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityMentionName"; + offset: int; + length: int; + userId: int; + fromReader(reader: Reader): MessageEntityMentionName; + } + + export interface InputMessageEntityMentionNameArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + /** Identifier of the user that was mentioned */ + userId: TypeInputUser; + } + + /** + * Message entity that can be used to create a user user mention: received mentions use the messageEntityMentionName constructor, instead.
+ * @link https://corefork.telegram.org/api/mentions + * @link https://corefork.telegram.org/constructor/messageEntityMentionName + * @link https://corefork.telegram.org/api/mentions + * @link https://corefork.telegram.org/constructor/inputMessageEntityMentionName + */ + export class InputMessageEntityMentionName extends VirtualClass implements InputMessageEntityMentionNameArgs { + CONSTRUCTOR_id: 546203849; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "InputMessageEntityMentionName"; + offset: int; + length: int; + userId: TypeInputUser; + fromReader(reader: Reader): InputMessageEntityMentionName; + } + + export interface MessageEntityPhoneArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Message entity representing a phone number.
*/ + export class MessageEntityPhone extends VirtualClass implements MessageEntityPhoneArgs { + CONSTRUCTOR_id: -1687559349; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityPhone"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityPhone; + } + + export interface MessageEntityCashtagArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Message entity representing a $cashtag.
*/ + export class MessageEntityCashtag extends VirtualClass implements MessageEntityCashtagArgs { + CONSTRUCTOR_id: 1280209983; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityCashtag"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityCashtag; + } + + export interface MessageEntityUnderlineArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Message entity representing underlined text.
*/ + export class MessageEntityUnderline extends VirtualClass implements MessageEntityUnderlineArgs { + CONSTRUCTOR_id: -1672577397; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityUnderline"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityUnderline; + } + + export interface MessageEntityStrikeArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Message entity representing strikethrough text.
*/ + export class MessageEntityStrike extends VirtualClass implements MessageEntityStrikeArgs { + CONSTRUCTOR_id: -1090087980; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityStrike"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityStrike; + } + + export interface MessageEntityBlockquoteArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Message entity representing a block quote.
*/ + export class MessageEntityBlockquote extends VirtualClass implements MessageEntityBlockquoteArgs { + CONSTRUCTOR_id: 34469328; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityBlockquote"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityBlockquote; + } + + export interface MessageEntityBankCardArgs { + /** Offset of message entity within message (in UTF-8 codepoints) */ + offset: int; + /** Length of message entity within message (in UTF-8 codepoints) */ + length: int; + } + + /** Indicates a credit card number
*/ + export class MessageEntityBankCard extends VirtualClass implements MessageEntityBankCardArgs { + CONSTRUCTOR_id: 1981704948; + SUBCLASS_OF_ID: 3479443932; + classType: "constructor"; + className: "MessageEntityBankCard"; + offset: int; + length: int; + fromReader(reader: Reader): MessageEntityBankCard; + } + + /** Represents the absence of a channel
*/ + export class InputChannelEmpty extends VirtualClass { + CONSTRUCTOR_id: -292807034; + SUBCLASS_OF_ID: 1089602301; + classType: "constructor"; + className: "InputChannelEmpty"; + fromReader(reader: Reader): InputChannelEmpty; + } + + export interface InputChannelArgs { + /** Channel ID */ + channelId: int; + /** Access hash taken from the channel constructor */ + accessHash: long; + } + + /** + * Represents a channel
+ * @link https://corefork.telegram.org/constructor/channel + */ + export class InputChannel extends VirtualClass implements InputChannelArgs { + CONSTRUCTOR_id: -1343524562; + SUBCLASS_OF_ID: 1089602301; + classType: "constructor"; + className: "InputChannel"; + channelId: int; + accessHash: long; + fromReader(reader: Reader): InputChannel; + } + + export interface InputChannelFromMessageArgs { + /** The chat where the channel was seen */ + peer: TypeInputPeer; + /** The message ID in the chat where the channel was seen */ + msgId: MessageIDLike; + /** The channel ID */ + channelId: int; + } + + /** + * Defines a min channel that was seen in a certain message of a certain chat.
+ * @link https://corefork.telegram.org/api/min + */ + export class InputChannelFromMessage extends VirtualClass implements InputChannelFromMessageArgs { + CONSTRUCTOR_id: 707290417; + SUBCLASS_OF_ID: 1089602301; + classType: "constructor"; + className: "InputChannelFromMessage"; + peer: TypeInputPeer; + msgId: MessageIDLike; + channelId: int; + fromReader(reader: Reader): InputChannelFromMessage; + } + + export interface MessageRangeArgs { + /** Start of range (message ID) */ + minId: int; + /** End of range (message ID) */ + maxId: int; + } + + /** Indicates a range of chat messages
*/ + export class MessageRange extends VirtualClass implements MessageRangeArgs { + CONSTRUCTOR_id: 182649427; + SUBCLASS_OF_ID: 3200730487; + classType: "constructor"; + className: "MessageRange"; + minId: int; + maxId: int; + fromReader(reader: Reader): MessageRange; + } + + /** No filter
*/ + export class ChannelMessagesFilterEmpty extends VirtualClass { + CONSTRUCTOR_id: -1798033689; + SUBCLASS_OF_ID: 322136662; + classType: "constructor"; + className: "ChannelMessagesFilterEmpty"; + fromReader(reader: Reader): ChannelMessagesFilterEmpty; + } + + export interface ChannelMessagesFilterArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to exclude new messages from the search */ + excludeNewMessages?: true; + /** A range of messages to fetch */ + ranges: TypeMessageRange[]; + } + + /** Filter for getting only certain types of channel messages
*/ + export class ChannelMessagesFilter extends VirtualClass implements ChannelMessagesFilterArgs { + CONSTRUCTOR_id: -847783593; + SUBCLASS_OF_ID: 322136662; + classType: "constructor"; + className: "ChannelMessagesFilter"; + flags: number; + excludeNewMessages?: true; + ranges: TypeMessageRange[]; + fromReader(reader: Reader): ChannelMessagesFilter; + } + + export interface ChannelParticipantArgs { + /** Pariticipant user ID */ + userId: int; + /** Date joined */ + date: int; + } + + /** Channel/supergroup participant
*/ + export class ChannelParticipant extends VirtualClass implements ChannelParticipantArgs { + CONSTRUCTOR_id: 367766557; + SUBCLASS_OF_ID: 3653762072; + classType: "constructor"; + className: "ChannelParticipant"; + userId: int; + date: int; + fromReader(reader: Reader): ChannelParticipant; + } + + export interface ChannelParticipantSelfArgs { + /** User ID */ + userId: int; + /** User that invited me to the channel/supergroup */ + inviterId: int; + /** When did I join the channel/supergroup */ + date: int; + } + + /** Myself
*/ + export class ChannelParticipantSelf extends VirtualClass implements ChannelParticipantSelfArgs { + CONSTRUCTOR_id: -1557620115; + SUBCLASS_OF_ID: 3653762072; + classType: "constructor"; + className: "ChannelParticipantSelf"; + userId: int; + inviterId: int; + date: int; + fromReader(reader: Reader): ChannelParticipantSelf; + } + + export interface ChannelParticipantCreatorArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** User ID */ + userId: int; + /** Creator admin rights */ + adminRights: TypeChatAdminRights; + /** The role (rank) of the group creator in the group: just an arbitrary string, admin by default */ + rank?: string; + } + + /** Channel/supergroup creator
*/ + export class ChannelParticipantCreator extends VirtualClass implements ChannelParticipantCreatorArgs { + CONSTRUCTOR_id: 1149094475; + SUBCLASS_OF_ID: 3653762072; + classType: "constructor"; + className: "ChannelParticipantCreator"; + flags: number; + userId: int; + adminRights: TypeChatAdminRights; + rank?: string; + fromReader(reader: Reader): ChannelParticipantCreator; + } + + export interface ChannelParticipantAdminArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Can this admin promote other admins with the same permissions? */ + canEdit?: true; + /** Is this the current user */ + self?: true; + /** Admin user ID */ + userId: int; + /** User that invited the admin to the channel/group */ + inviterId?: int; + /** User that promoted the user to admin */ + promotedBy: int; + /** When did the user join */ + date: int; + /** Admin rights */ + adminRights: TypeChatAdminRights; + /** The role (rank) of the admin in the group: just an arbitrary string, admin by default */ + rank?: string; + } + + /** + * Admin
+ * @link https://corefork.telegram.org/api/rights + */ + export class ChannelParticipantAdmin extends VirtualClass implements ChannelParticipantAdminArgs { + CONSTRUCTOR_id: -859915345; + SUBCLASS_OF_ID: 3653762072; + classType: "constructor"; + className: "ChannelParticipantAdmin"; + flags: number; + canEdit?: true; + self?: true; + userId: int; + inviterId?: int; + promotedBy: int; + date: int; + adminRights: TypeChatAdminRights; + rank?: string; + fromReader(reader: Reader): ChannelParticipantAdmin; + } + + export interface ChannelParticipantBannedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the user has left the group */ + left?: true; + /** The banned peer */ + peer: TypePeer; + /** User was kicked by the specified admin */ + kickedBy: int; + /** When did the user join the group */ + date: int; + /** Banned rights */ + bannedRights: TypeChatBannedRights; + } + + /** + * Banned/kicked user
+ * @link https://corefork.telegram.org/api/rights + */ + export class ChannelParticipantBanned extends VirtualClass implements ChannelParticipantBannedArgs { + CONSTRUCTOR_id: 1352785878; + SUBCLASS_OF_ID: 3653762072; + classType: "constructor"; + className: "ChannelParticipantBanned"; + flags: number; + left?: true; + peer: TypePeer; + kickedBy: int; + date: int; + bannedRights: TypeChatBannedRights; + fromReader(reader: Reader): ChannelParticipantBanned; + } + + export interface ChannelParticipantLeftArgs { + /** The peer that left */ + peer: TypePeer; + } + + /** A participant that left the channel/supergroup
*/ + export class ChannelParticipantLeft extends VirtualClass implements ChannelParticipantLeftArgs { + CONSTRUCTOR_id: 453242886; + SUBCLASS_OF_ID: 3653762072; + classType: "constructor"; + className: "ChannelParticipantLeft"; + peer: TypePeer; + fromReader(reader: Reader): ChannelParticipantLeft; + } + + /** Fetch only recent participants
*/ + export class ChannelParticipantsRecent extends VirtualClass { + CONSTRUCTOR_id: -566281095; + SUBCLASS_OF_ID: 3209570131; + classType: "constructor"; + className: "ChannelParticipantsRecent"; + fromReader(reader: Reader): ChannelParticipantsRecent; + } + + /** Fetch only admin participants
*/ + export class ChannelParticipantsAdmins extends VirtualClass { + CONSTRUCTOR_id: -1268741783; + SUBCLASS_OF_ID: 3209570131; + classType: "constructor"; + className: "ChannelParticipantsAdmins"; + fromReader(reader: Reader): ChannelParticipantsAdmins; + } + + export interface ChannelParticipantsKickedArgs { + /** Optional filter for searching kicked participants by name (otherwise empty) */ + q: string; + } + + /** Fetch only kicked participants
*/ + export class ChannelParticipantsKicked extends VirtualClass implements ChannelParticipantsKickedArgs { + CONSTRUCTOR_id: -1548400251; + SUBCLASS_OF_ID: 3209570131; + classType: "constructor"; + className: "ChannelParticipantsKicked"; + q: string; + fromReader(reader: Reader): ChannelParticipantsKicked; + } + + /** Fetch only bot participants
*/ + export class ChannelParticipantsBots extends VirtualClass { + CONSTRUCTOR_id: -1328445861; + SUBCLASS_OF_ID: 3209570131; + classType: "constructor"; + className: "ChannelParticipantsBots"; + fromReader(reader: Reader): ChannelParticipantsBots; + } + + export interface ChannelParticipantsBannedArgs { + /** Optional filter for searching banned participants by name (otherwise empty) */ + q: string; + } + + /** Fetch only banned participants
*/ + export class ChannelParticipantsBanned extends VirtualClass implements ChannelParticipantsBannedArgs { + CONSTRUCTOR_id: 338142689; + SUBCLASS_OF_ID: 3209570131; + classType: "constructor"; + className: "ChannelParticipantsBanned"; + q: string; + fromReader(reader: Reader): ChannelParticipantsBanned; + } + + export interface ChannelParticipantsSearchArgs { + /** Search query */ + q: string; + } + + /** Query participants by name
*/ + export class ChannelParticipantsSearch extends VirtualClass implements ChannelParticipantsSearchArgs { + CONSTRUCTOR_id: 106343499; + SUBCLASS_OF_ID: 3209570131; + classType: "constructor"; + className: "ChannelParticipantsSearch"; + q: string; + fromReader(reader: Reader): ChannelParticipantsSearch; + } + + export interface ChannelParticipantsContactsArgs { + /** Optional search query for searching contact participants by name */ + q: string; + } + + /** Fetch only participants that are also contacts
*/ + export class ChannelParticipantsContacts extends VirtualClass implements ChannelParticipantsContactsArgs { + CONSTRUCTOR_id: -1150621555; + SUBCLASS_OF_ID: 3209570131; + classType: "constructor"; + className: "ChannelParticipantsContacts"; + q: string; + fromReader(reader: Reader): ChannelParticipantsContacts; + } + + export interface ChannelParticipantsMentionsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Filter by user name or username */ + q?: string; + /** Look only for users that posted in this thread */ + topMsgId?: MessageIDLike; + } + + /** + * This filter is used when looking for supergroup members to mention.
+ * This filter will automatically remove anonymous admins, and return even non-participant users that replied to a specific thread through the comment section of a channel.
+ * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + */ + export class ChannelParticipantsMentions extends VirtualClass implements ChannelParticipantsMentionsArgs { + CONSTRUCTOR_id: -531931925; + SUBCLASS_OF_ID: 3209570131; + classType: "constructor"; + className: "ChannelParticipantsMentions"; + flags: number; + q?: string; + topMsgId?: MessageIDLike; + fromReader(reader: Reader): ChannelParticipantsMentions; + } + + export interface InputBotInlineMessageMediaAutoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Caption */ + message: string; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** + * A media
+ * @link https://corefork.telegram.org/api/entities + */ + export class InputBotInlineMessageMediaAuto extends VirtualClass implements InputBotInlineMessageMediaAutoArgs { + CONSTRUCTOR_id: 864077702; + SUBCLASS_OF_ID: 1408974864; + classType: "constructor"; + className: "InputBotInlineMessageMediaAuto"; + flags: number; + message: string; + entities?: TypeMessageEntity[]; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): InputBotInlineMessageMediaAuto; + } + + export interface InputBotInlineMessageTextArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Disable webpage preview */ + noWebpage?: true; + /** Message */ + message: string; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** + * Simple text message
+ * @link https://corefork.telegram.org/api/entities + */ + export class InputBotInlineMessageText extends VirtualClass implements InputBotInlineMessageTextArgs { + CONSTRUCTOR_id: 1036876423; + SUBCLASS_OF_ID: 1408974864; + classType: "constructor"; + className: "InputBotInlineMessageText"; + flags: number; + noWebpage?: true; + message: string; + entities?: TypeMessageEntity[]; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): InputBotInlineMessageText; + } + + export interface InputBotInlineMessageMediaGeoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Geolocation */ + geoPoint: TypeInputGeoPoint; + /** For live locations, a direction in which the location moves, in degrees; 1-360 */ + heading?: int; + /** Validity period */ + period?: int; + /** For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000) */ + proximityNotificationRadius?: int; + /** Reply markup for bot/inline keyboards */ + replyMarkup?: TypeReplyMarkup; + } + + /** + * Geolocation
+ * @link https://corefork.telegram.org/api/live-location + */ + export class InputBotInlineMessageMediaGeo extends VirtualClass implements InputBotInlineMessageMediaGeoArgs { + CONSTRUCTOR_id: -1768777083; + SUBCLASS_OF_ID: 1408974864; + classType: "constructor"; + className: "InputBotInlineMessageMediaGeo"; + flags: number; + geoPoint: TypeInputGeoPoint; + heading?: int; + period?: int; + proximityNotificationRadius?: int; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): InputBotInlineMessageMediaGeo; + } + + export interface InputBotInlineMessageMediaVenueArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Geolocation */ + geoPoint: TypeInputGeoPoint; + /** Venue name */ + title: string; + /** Address */ + address: string; + /** Venue provider: currently only "foursquare" needs to be supported */ + provider: string; + /** Venue ID in the provider's database */ + venueId: string; + /** Venue type in the provider's database */ + venueType: string; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** Venue
*/ + export class InputBotInlineMessageMediaVenue extends VirtualClass implements InputBotInlineMessageMediaVenueArgs { + CONSTRUCTOR_id: 1098628881; + SUBCLASS_OF_ID: 1408974864; + classType: "constructor"; + className: "InputBotInlineMessageMediaVenue"; + flags: number; + geoPoint: TypeInputGeoPoint; + title: string; + address: string; + provider: string; + venueId: string; + venueType: string; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): InputBotInlineMessageMediaVenue; + } + + export interface InputBotInlineMessageMediaContactArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Phone number */ + phoneNumber: string; + /** First name */ + firstName: string; + /** Last name */ + lastName: string; + /** VCard info */ + vcard: string; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** A contact
*/ + export class InputBotInlineMessageMediaContact extends VirtualClass implements InputBotInlineMessageMediaContactArgs { + CONSTRUCTOR_id: -1494368259; + SUBCLASS_OF_ID: 1408974864; + classType: "constructor"; + className: "InputBotInlineMessageMediaContact"; + flags: number; + phoneNumber: string; + firstName: string; + lastName: string; + vcard: string; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): InputBotInlineMessageMediaContact; + } + + export interface InputBotInlineMessageGameArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** A game
*/ + export class InputBotInlineMessageGame extends VirtualClass implements InputBotInlineMessageGameArgs { + CONSTRUCTOR_id: 1262639204; + SUBCLASS_OF_ID: 1408974864; + classType: "constructor"; + className: "InputBotInlineMessageGame"; + flags: number; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): InputBotInlineMessageGame; + } + + export interface InputBotInlineMessageMediaInvoiceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Product name, 1-32 characters */ + title: string; + /** Product description, 1-255 characters */ + description: string; + /** Invoice photo */ + photo?: TypeInputWebDocument; + /** The invoice */ + invoice: TypeInvoice; + /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */ + payload: bytes; + /** Payments provider token, obtained via Botfather */ + provider: string; + /** A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. */ + providerData: TypeDataJSON; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** An invoice
*/ + export class InputBotInlineMessageMediaInvoice extends VirtualClass implements InputBotInlineMessageMediaInvoiceArgs { + CONSTRUCTOR_id: -672693723; + SUBCLASS_OF_ID: 1408974864; + classType: "constructor"; + className: "InputBotInlineMessageMediaInvoice"; + flags: number; + title: string; + description: string; + photo?: TypeInputWebDocument; + invoice: TypeInvoice; + payload: bytes; + provider: string; + providerData: TypeDataJSON; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): InputBotInlineMessageMediaInvoice; + } + + export interface InputBotInlineResultArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** ID of result */ + id: string; + /** Result type (see bot API docs) */ + type: string; + /** Result title */ + title?: string; + /** Result description */ + description?: string; + /** URL of result */ + url?: string; + /** Thumbnail for result */ + thumb?: TypeInputWebDocument; + /** Result contents */ + content?: TypeInputWebDocument; + /** Message to send when the result is selected */ + sendMessage: TypeInputBotInlineMessage; + } + + /** + * An inline bot result
+ * @link https://corefork.telegram.org/bots/api + */ + export class InputBotInlineResult extends VirtualClass implements InputBotInlineResultArgs { + CONSTRUCTOR_id: -2000710887; + SUBCLASS_OF_ID: 2158273502; + classType: "constructor"; + className: "InputBotInlineResult"; + flags: number; + id: string; + type: string; + title?: string; + description?: string; + url?: string; + thumb?: TypeInputWebDocument; + content?: TypeInputWebDocument; + sendMessage: TypeInputBotInlineMessage; + fromReader(reader: Reader): InputBotInlineResult; + } + + export interface InputBotInlineResultPhotoArgs { + /** Result ID */ + id: string; + /** Result type (see bot API docs) */ + type: string; + /** Photo to send */ + photo: TypeInputPhoto; + /** Message to send when the result is selected */ + sendMessage: TypeInputBotInlineMessage; + } + + /** + * Photo
+ * @link https://corefork.telegram.org/bots/api + */ + export class InputBotInlineResultPhoto extends VirtualClass implements InputBotInlineResultPhotoArgs { + CONSTRUCTOR_id: -1462213465; + SUBCLASS_OF_ID: 2158273502; + classType: "constructor"; + className: "InputBotInlineResultPhoto"; + id: string; + type: string; + photo: TypeInputPhoto; + sendMessage: TypeInputBotInlineMessage; + fromReader(reader: Reader): InputBotInlineResultPhoto; + } + + export interface InputBotInlineResultDocumentArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Result ID */ + id: string; + /** Result type (see bot API docs) */ + type: string; + /** Result title */ + title?: string; + /** Result description */ + description?: string; + /** Document to send */ + document: TypeInputDocument; + /** Message to send when the result is selected */ + sendMessage: TypeInputBotInlineMessage; + } + + /** + * Document (media of any type except for photos)
+ * @link https://corefork.telegram.org/bots/api + */ + export class InputBotInlineResultDocument extends VirtualClass implements InputBotInlineResultDocumentArgs { + CONSTRUCTOR_id: -459324; + SUBCLASS_OF_ID: 2158273502; + classType: "constructor"; + className: "InputBotInlineResultDocument"; + flags: number; + id: string; + type: string; + title?: string; + description?: string; + document: TypeInputDocument; + sendMessage: TypeInputBotInlineMessage; + fromReader(reader: Reader): InputBotInlineResultDocument; + } + + export interface InputBotInlineResultGameArgs { + /** Result ID */ + id: string; + /** Game short name */ + shortName: string; + /** Message to send when the result is selected */ + sendMessage: TypeInputBotInlineMessage; + } + + /** Game
*/ + export class InputBotInlineResultGame extends VirtualClass implements InputBotInlineResultGameArgs { + CONSTRUCTOR_id: 1336154098; + SUBCLASS_OF_ID: 2158273502; + classType: "constructor"; + className: "InputBotInlineResultGame"; + id: string; + shortName: string; + sendMessage: TypeInputBotInlineMessage; + fromReader(reader: Reader): InputBotInlineResultGame; + } + + export interface BotInlineMessageMediaAutoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Caption */ + message: string; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** + * Send whatever media is attached to the botInlineMediaResult
+ * @link https://corefork.telegram.org/api/entities + * @link https://corefork.telegram.org/constructor/botInlineMediaResult + */ + export class BotInlineMessageMediaAuto extends VirtualClass implements BotInlineMessageMediaAutoArgs { + CONSTRUCTOR_id: 1984755728; + SUBCLASS_OF_ID: 3297841032; + classType: "constructor"; + className: "BotInlineMessageMediaAuto"; + flags: number; + message: string; + entities?: TypeMessageEntity[]; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): BotInlineMessageMediaAuto; + } + + export interface BotInlineMessageTextArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Disable webpage preview */ + noWebpage?: true; + /** The message */ + message: string; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** + * Send a simple text message
+ * @link https://corefork.telegram.org/api/entities + */ + export class BotInlineMessageText extends VirtualClass implements BotInlineMessageTextArgs { + CONSTRUCTOR_id: -1937807902; + SUBCLASS_OF_ID: 3297841032; + classType: "constructor"; + className: "BotInlineMessageText"; + flags: number; + noWebpage?: true; + message: string; + entities?: TypeMessageEntity[]; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): BotInlineMessageText; + } + + export interface BotInlineMessageMediaGeoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Geolocation */ + geo: TypeGeoPoint; + /** For live locations, a direction in which the location moves, in degrees; 1-360. */ + heading?: int; + /** Validity period */ + period?: int; + /** For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). */ + proximityNotificationRadius?: int; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** + * Send a geolocation
+ * @link https://corefork.telegram.org/api/live-location + */ + export class BotInlineMessageMediaGeo extends VirtualClass implements BotInlineMessageMediaGeoArgs { + CONSTRUCTOR_id: 85477117; + SUBCLASS_OF_ID: 3297841032; + classType: "constructor"; + className: "BotInlineMessageMediaGeo"; + flags: number; + geo: TypeGeoPoint; + heading?: int; + period?: int; + proximityNotificationRadius?: int; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): BotInlineMessageMediaGeo; + } + + export interface BotInlineMessageMediaVenueArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Geolocation of venue */ + geo: TypeGeoPoint; + /** Venue name */ + title: string; + /** Address */ + address: string; + /** Venue provider: currently only "foursquare" needs to be supported */ + provider: string; + /** Venue ID in the provider's database */ + venueId: string; + /** Venue type in the provider's database */ + venueType: string; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** Send a venue
*/ + export class BotInlineMessageMediaVenue extends VirtualClass implements BotInlineMessageMediaVenueArgs { + CONSTRUCTOR_id: -1970903652; + SUBCLASS_OF_ID: 3297841032; + classType: "constructor"; + className: "BotInlineMessageMediaVenue"; + flags: number; + geo: TypeGeoPoint; + title: string; + address: string; + provider: string; + venueId: string; + venueType: string; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): BotInlineMessageMediaVenue; + } + + export interface BotInlineMessageMediaContactArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Phone number */ + phoneNumber: string; + /** First name */ + firstName: string; + /** Last name */ + lastName: string; + /** VCard info */ + vcard: string; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** Send a contact
*/ + export class BotInlineMessageMediaContact extends VirtualClass implements BotInlineMessageMediaContactArgs { + CONSTRUCTOR_id: 416402882; + SUBCLASS_OF_ID: 3297841032; + classType: "constructor"; + className: "BotInlineMessageMediaContact"; + flags: number; + phoneNumber: string; + firstName: string; + lastName: string; + vcard: string; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): BotInlineMessageMediaContact; + } + + export interface BotInlineMessageMediaInvoiceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Set this flag if you require the user's shipping address to complete the order */ + shippingAddressRequested?: true; + /** Test invoice */ + test?: true; + /** Product name, 1-32 characters */ + title: string; + /** Product description, 1-255 characters */ + description: string; + /** Product photo */ + photo?: TypeWebDocument; + /** Three-letter ISO 4217 currency code */ + currency: string; + /** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ + totalAmount: long; + /** Inline keyboard */ + replyMarkup?: TypeReplyMarkup; + } + + /** + * Send an invoice
+ * @link https://corefork.telegram.org/bots/payments + */ + export class BotInlineMessageMediaInvoice extends VirtualClass implements BotInlineMessageMediaInvoiceArgs { + CONSTRUCTOR_id: 894081801; + SUBCLASS_OF_ID: 3297841032; + classType: "constructor"; + className: "BotInlineMessageMediaInvoice"; + flags: number; + shippingAddressRequested?: true; + test?: true; + title: string; + description: string; + photo?: TypeWebDocument; + currency: string; + totalAmount: long; + replyMarkup?: TypeReplyMarkup; + fromReader(reader: Reader): BotInlineMessageMediaInvoice; + } + + export interface BotInlineResultArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Result ID */ + id: string; + /** Result type (see bot API docs) */ + type: string; + /** Result title */ + title?: string; + /** Result description */ + description?: string; + /** URL of article or webpage */ + url?: string; + /** Thumbnail for the result */ + thumb?: TypeWebDocument; + /** Content of the result */ + content?: TypeWebDocument; + /** Message to send */ + sendMessage: TypeBotInlineMessage; + } + + /** + * Generic result
+ * @link https://corefork.telegram.org/bots/api + */ + export class BotInlineResult extends VirtualClass implements BotInlineResultArgs { + CONSTRUCTOR_id: 295067450; + SUBCLASS_OF_ID: 942846933; + classType: "constructor"; + className: "BotInlineResult"; + flags: number; + id: string; + type: string; + title?: string; + description?: string; + url?: string; + thumb?: TypeWebDocument; + content?: TypeWebDocument; + sendMessage: TypeBotInlineMessage; + fromReader(reader: Reader): BotInlineResult; + } + + export interface BotInlineMediaResultArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Result ID */ + id: string; + /** Result type (see bot API docs) */ + type: string; + /** If type is photo, the photo to send */ + photo?: TypePhoto; + /** If type is document, the document to send */ + document?: TypeDocument; + /** Result title */ + title?: string; + /** Description */ + description?: string; + /** Depending on the type and on the constructor, contains the caption of the media or the content of the message to be sent instead of the media */ + sendMessage: TypeBotInlineMessage; + } + + /** + * Media result
+ * @link https://corefork.telegram.org/bots/api + * @link https://corefork.telegram.org/type/BotInlineMessage + */ + export class BotInlineMediaResult extends VirtualClass implements BotInlineMediaResultArgs { + CONSTRUCTOR_id: 400266251; + SUBCLASS_OF_ID: 942846933; + classType: "constructor"; + className: "BotInlineMediaResult"; + flags: number; + id: string; + type: string; + photo?: TypePhoto; + document?: TypeDocument; + title?: string; + description?: string; + sendMessage: TypeBotInlineMessage; + fromReader(reader: Reader): BotInlineMediaResult; + } + + export interface ExportedMessageLinkArgs { + /** URL */ + link: string; + /** Embed code */ + html: string; + } + + /** Link to a message in a supergroup/channel
*/ + export class ExportedMessageLink extends VirtualClass implements ExportedMessageLinkArgs { + CONSTRUCTOR_id: 1571494644; + SUBCLASS_OF_ID: 3739632844; + classType: "constructor"; + className: "ExportedMessageLink"; + link: string; + html: string; + fromReader(reader: Reader): ExportedMessageLink; + } + + export interface MessageFwdHeaderArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this message was imported from a foreign chat service, click here for more info » */ + imported?: true; + /** The ID of the user that originally sent the message */ + fromId?: TypePeer; + /** The name of the user that originally sent the message */ + fromName?: string; + /** When was the message originally sent */ + date: int; + /** ID of the channel message that was forwarded */ + channelPost?: int; + /** For channels and if signatures are enabled, author of the channel message */ + postAuthor?: string; + /** Only for messages forwarded to the current user (inputPeerSelf), full info about the user/channel that originally sent the message */ + savedFromPeer?: TypePeer; + /** Only for messages forwarded to the current user (inputPeerSelf), ID of the message that was forwarded from the original user/channel */ + savedFromMsgId?: MessageIDLike; + /** PSA type */ + psaType?: string; + } + + /** + * Info about a forwarded message
+ * @link https://corefork.telegram.org/api/import + */ + export class MessageFwdHeader extends VirtualClass implements MessageFwdHeaderArgs { + CONSTRUCTOR_id: 1601666510; + SUBCLASS_OF_ID: 2049468420; + classType: "constructor"; + className: "MessageFwdHeader"; + flags: number; + imported?: true; + fromId?: TypePeer; + fromName?: string; + date: int; + channelPost?: int; + postAuthor?: string; + savedFromPeer?: TypePeer; + savedFromMsgId?: MessageIDLike; + psaType?: string; + fromReader(reader: Reader): MessageFwdHeader; + } + + export interface InputBotInlineMessageIDArgs { + /** DC ID to use when working with this inline message */ + dcId: int; + /** ID of message, contains both the (32-bit, legacy) owner ID and the message ID, used only for Bot API backwards compatibility with 32-bit user ID. */ + id: long; + /** Access hash of message */ + accessHash: long; + } + + /** Represents a sent inline message from the perspective of a bot (legacy constructor)
*/ + export class InputBotInlineMessageID extends VirtualClass implements InputBotInlineMessageIDArgs { + CONSTRUCTOR_id: -1995686519; + SUBCLASS_OF_ID: 768434944; + classType: "constructor"; + className: "InputBotInlineMessageID"; + dcId: int; + id: long; + accessHash: long; + fromReader(reader: Reader): InputBotInlineMessageID; + } + + export interface InlineBotSwitchPMArgs { + /** Text for the button that switches the user to a private chat with the bot and sends the bot a start message with the parameter start_parameter (can be empty) */ + text: string; + /** The parameter for the /start parameter */ + startParam: string; + } + + /** The bot requested the user to message him in private
*/ + export class InlineBotSwitchPM extends VirtualClass implements InlineBotSwitchPMArgs { + CONSTRUCTOR_id: 1008755359; + SUBCLASS_OF_ID: 2192701243; + classType: "constructor"; + className: "InlineBotSwitchPM"; + text: string; + startParam: string; + fromReader(reader: Reader): InlineBotSwitchPM; + } + + export interface TopPeerArgs { + /** Peer */ + peer: TypePeer; + /** Rating as computed in top peer rating » */ + rating: double; + } + + /** + * Top peer
+ * @link https://corefork.telegram.org/api/top-rating + */ + export class TopPeer extends VirtualClass implements TopPeerArgs { + CONSTRUCTOR_id: -305282981; + SUBCLASS_OF_ID: 1763100161; + classType: "constructor"; + className: "TopPeer"; + peer: TypePeer; + rating: double; + fromReader(reader: Reader): TopPeer; + } + + /** Most used bots
*/ + export class TopPeerCategoryBotsPM extends VirtualClass { + CONSTRUCTOR_id: -1419371685; + SUBCLASS_OF_ID: 3723502850; + classType: "constructor"; + className: "TopPeerCategoryBotsPM"; + fromReader(reader: Reader): TopPeerCategoryBotsPM; + } + + /** Most used inline bots
*/ + export class TopPeerCategoryBotsInline extends VirtualClass { + CONSTRUCTOR_id: 344356834; + SUBCLASS_OF_ID: 3723502850; + classType: "constructor"; + className: "TopPeerCategoryBotsInline"; + fromReader(reader: Reader): TopPeerCategoryBotsInline; + } + + /** Users we've chatted most frequently with
*/ + export class TopPeerCategoryCorrespondents extends VirtualClass { + CONSTRUCTOR_id: 104314861; + SUBCLASS_OF_ID: 3723502850; + classType: "constructor"; + className: "TopPeerCategoryCorrespondents"; + fromReader(reader: Reader): TopPeerCategoryCorrespondents; + } + + /** Often-opened groups and supergroups
*/ + export class TopPeerCategoryGroups extends VirtualClass { + CONSTRUCTOR_id: -1122524854; + SUBCLASS_OF_ID: 3723502850; + classType: "constructor"; + className: "TopPeerCategoryGroups"; + fromReader(reader: Reader): TopPeerCategoryGroups; + } + + /** Most frequently visited channels
*/ + export class TopPeerCategoryChannels extends VirtualClass { + CONSTRUCTOR_id: 371037736; + SUBCLASS_OF_ID: 3723502850; + classType: "constructor"; + className: "TopPeerCategoryChannels"; + fromReader(reader: Reader): TopPeerCategoryChannels; + } + + /** Most frequently called users
*/ + export class TopPeerCategoryPhoneCalls extends VirtualClass { + CONSTRUCTOR_id: 511092620; + SUBCLASS_OF_ID: 3723502850; + classType: "constructor"; + className: "TopPeerCategoryPhoneCalls"; + fromReader(reader: Reader): TopPeerCategoryPhoneCalls; + } + + /** Users to which the users often forwards messages to
*/ + export class TopPeerCategoryForwardUsers extends VirtualClass { + CONSTRUCTOR_id: -1472172887; + SUBCLASS_OF_ID: 3723502850; + classType: "constructor"; + className: "TopPeerCategoryForwardUsers"; + fromReader(reader: Reader): TopPeerCategoryForwardUsers; + } + + /** Chats to which the users often forwards messages to
*/ + export class TopPeerCategoryForwardChats extends VirtualClass { + CONSTRUCTOR_id: -68239120; + SUBCLASS_OF_ID: 3723502850; + classType: "constructor"; + className: "TopPeerCategoryForwardChats"; + fromReader(reader: Reader): TopPeerCategoryForwardChats; + } + + export interface TopPeerCategoryPeersArgs { + /** Top peer category of peers */ + category: TypeTopPeerCategory; + /** Count of peers */ + count: int; + /** Peers */ + peers: TypeTopPeer[]; + } + + /** Top peer category
*/ + export class TopPeerCategoryPeers extends VirtualClass implements TopPeerCategoryPeersArgs { + CONSTRUCTOR_id: -75283823; + SUBCLASS_OF_ID: 78563632; + classType: "constructor"; + className: "TopPeerCategoryPeers"; + category: TypeTopPeerCategory; + count: int; + peers: TypeTopPeer[]; + fromReader(reader: Reader): TopPeerCategoryPeers; + } + + export interface DraftMessageEmptyArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** When was the draft last updated */ + date?: int; + } + + /** Empty draft
*/ + export class DraftMessageEmpty extends VirtualClass implements DraftMessageEmptyArgs { + CONSTRUCTOR_id: 453805082; + SUBCLASS_OF_ID: 869564229; + classType: "constructor"; + className: "DraftMessageEmpty"; + flags: number; + date?: int; + fromReader(reader: Reader): DraftMessageEmpty; + } + + export interface DraftMessageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether no webpage preview will be generated */ + noWebpage?: true; + /** The message this message will reply to */ + replyToMsgId?: MessageIDLike; + /** The draft */ + message: string; + /** Message entities for styled text. */ + entities?: TypeMessageEntity[]; + /** Date of last update of the draft. */ + date: int; + } + + /** + * Represents a message draft.
+ * @link https://corefork.telegram.org/api/entities + * @link https://corefork.telegram.org/api/drafts + */ + export class DraftMessage extends VirtualClass implements DraftMessageArgs { + CONSTRUCTOR_id: -40996577; + SUBCLASS_OF_ID: 869564229; + classType: "constructor"; + className: "DraftMessage"; + flags: number; + noWebpage?: true; + replyToMsgId?: MessageIDLike; + message: string; + entities?: TypeMessageEntity[]; + date: int; + fromReader(reader: Reader): DraftMessage; + } + + export interface StickerSetCoveredArgs { + /** Stickerset */ + set: TypeStickerSet; + /** Preview */ + cover: TypeDocument; + } + + /** Stickerset, with a specific sticker as preview
*/ + export class StickerSetCovered extends VirtualClass implements StickerSetCoveredArgs { + CONSTRUCTOR_id: 1678812626; + SUBCLASS_OF_ID: 2139546853; + classType: "constructor"; + className: "StickerSetCovered"; + set: TypeStickerSet; + cover: TypeDocument; + fromReader(reader: Reader): StickerSetCovered; + } + + export interface StickerSetMultiCoveredArgs { + /** Stickerset */ + set: TypeStickerSet; + /** Preview stickers */ + covers: TypeDocument[]; + } + + /** Stickerset, with a specific stickers as preview
*/ + export class StickerSetMultiCovered extends VirtualClass implements StickerSetMultiCoveredArgs { + CONSTRUCTOR_id: 872932635; + SUBCLASS_OF_ID: 2139546853; + classType: "constructor"; + className: "StickerSetMultiCovered"; + set: TypeStickerSet; + covers: TypeDocument[]; + fromReader(reader: Reader): StickerSetMultiCovered; + } + + export interface MaskCoordsArgs { + /** Part of the face, relative to which the mask should be placed */ + n: int; + /** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position) */ + x: double; + /** Shift by Y-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position) */ + y: double; + /** Mask scaling coefficient. (For example, 2.0 means a doubled size) */ + zoom: double; + } + + /** Position on a photo where a mask should be placed
The n position indicates where the mask should be placed: */ + export class MaskCoords extends VirtualClass implements MaskCoordsArgs { + CONSTRUCTOR_id: -1361650766; + SUBCLASS_OF_ID: 112964349; + classType: "constructor"; + className: "MaskCoords"; + n: int; + x: double; + y: double; + zoom: double; + fromReader(reader: Reader): MaskCoords; + } + + export interface InputStickeredMediaPhotoArgs { + /** The photo */ + id: TypeInputPhoto; + } + + /** A photo with stickers attached
*/ + export class InputStickeredMediaPhoto extends VirtualClass implements InputStickeredMediaPhotoArgs { + CONSTRUCTOR_id: 1251549527; + SUBCLASS_OF_ID: 1363597726; + classType: "constructor"; + className: "InputStickeredMediaPhoto"; + id: TypeInputPhoto; + fromReader(reader: Reader): InputStickeredMediaPhoto; + } + + export interface InputStickeredMediaDocumentArgs { + /** The document */ + id: TypeInputDocument; + } + + /** A document with stickers attached
*/ + export class InputStickeredMediaDocument extends VirtualClass implements InputStickeredMediaDocumentArgs { + CONSTRUCTOR_id: 70813275; + SUBCLASS_OF_ID: 1363597726; + classType: "constructor"; + className: "InputStickeredMediaDocument"; + id: TypeInputDocument; + fromReader(reader: Reader): InputStickeredMediaDocument; + } + + export interface GameArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** ID of the game */ + id: long; + /** Access hash of the game */ + accessHash: long; + /** Short name for the game */ + shortName: string; + /** Title of the game */ + title: string; + /** Game description */ + description: string; + /** Game preview */ + photo: TypePhoto; + /** Optional attached document */ + document?: TypeDocument; + } + + /** Indicates an already sent game
*/ + export class Game extends VirtualClass implements GameArgs { + CONSTRUCTOR_id: -1107729093; + SUBCLASS_OF_ID: 2199494322; + classType: "constructor"; + className: "Game"; + flags: number; + id: long; + accessHash: long; + shortName: string; + title: string; + description: string; + photo: TypePhoto; + document?: TypeDocument; + fromReader(reader: Reader): Game; + } + + export interface InputGameIDArgs { + /** game ID from Game constructor */ + id: long; + /** access hash from Game constructor */ + accessHash: long; + } + + /** + * Indicates an already sent game
+ * @link https://corefork.telegram.org/type/Game + */ + export class InputGameID extends VirtualClass implements InputGameIDArgs { + CONSTRUCTOR_id: 53231223; + SUBCLASS_OF_ID: 1221679235; + classType: "constructor"; + className: "InputGameID"; + id: long; + accessHash: long; + fromReader(reader: Reader): InputGameID; + } + + export interface InputGameShortNameArgs { + /** The bot that provides the game */ + botId: TypeInputUser; + /** The game's short name */ + shortName: string; + } + + /** Game by short name
*/ + export class InputGameShortName extends VirtualClass implements InputGameShortNameArgs { + CONSTRUCTOR_id: -1020139510; + SUBCLASS_OF_ID: 1221679235; + classType: "constructor"; + className: "InputGameShortName"; + botId: TypeInputUser; + shortName: string; + fromReader(reader: Reader): InputGameShortName; + } + + export interface HighScoreArgs { + /** Position in highscore list */ + pos: int; + /** User ID */ + userId: int; + /** Score */ + score: int; + } + + /** Game highscore
*/ + export class HighScore extends VirtualClass implements HighScoreArgs { + CONSTRUCTOR_id: 1493171408; + SUBCLASS_OF_ID: 3542818357; + classType: "constructor"; + className: "HighScore"; + pos: int; + userId: int; + score: int; + fromReader(reader: Reader): HighScore; + } + + /** Empty rich text element
*/ + export class TextEmpty extends VirtualClass { + CONSTRUCTOR_id: -599948721; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextEmpty"; + fromReader(reader: Reader): TextEmpty; + } + + export interface TextPlainArgs { + /** Text */ + text: string; + } + + /** Plain text
*/ + export class TextPlain extends VirtualClass implements TextPlainArgs { + CONSTRUCTOR_id: 1950782688; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextPlain"; + text: string; + fromReader(reader: Reader): TextPlain; + } + + export interface TextBoldArgs { + /** Text */ + text: TypeRichText; + } + + /** Bold text
*/ + export class TextBold extends VirtualClass implements TextBoldArgs { + CONSTRUCTOR_id: 1730456516; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextBold"; + text: TypeRichText; + fromReader(reader: Reader): TextBold; + } + + export interface TextItalicArgs { + /** Text */ + text: TypeRichText; + } + + /** Italic text
*/ + export class TextItalic extends VirtualClass implements TextItalicArgs { + CONSTRUCTOR_id: -653089380; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextItalic"; + text: TypeRichText; + fromReader(reader: Reader): TextItalic; + } + + export interface TextUnderlineArgs { + /** Text */ + text: TypeRichText; + } + + /** Underlined text
*/ + export class TextUnderline extends VirtualClass implements TextUnderlineArgs { + CONSTRUCTOR_id: -1054465340; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextUnderline"; + text: TypeRichText; + fromReader(reader: Reader): TextUnderline; + } + + export interface TextStrikeArgs { + /** Text */ + text: TypeRichText; + } + + /** Strikethrough text
*/ + export class TextStrike extends VirtualClass implements TextStrikeArgs { + CONSTRUCTOR_id: -1678197867; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextStrike"; + text: TypeRichText; + fromReader(reader: Reader): TextStrike; + } + + export interface TextFixedArgs { + /** Text */ + text: TypeRichText; + } + + /** fixed-width rich text
*/ + export class TextFixed extends VirtualClass implements TextFixedArgs { + CONSTRUCTOR_id: 1816074681; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextFixed"; + text: TypeRichText; + fromReader(reader: Reader): TextFixed; + } + + export interface TextUrlArgs { + /** Text of link */ + text: TypeRichText; + /** Webpage HTTP URL */ + url: string; + /** If a preview was already generated for the page, the page ID */ + webpageId: long; + } + + /** Link
*/ + export class TextUrl extends VirtualClass implements TextUrlArgs { + CONSTRUCTOR_id: 1009288385; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextUrl"; + text: TypeRichText; + url: string; + webpageId: long; + fromReader(reader: Reader): TextUrl; + } + + export interface TextEmailArgs { + /** Link text */ + text: TypeRichText; + /** Email address */ + email: string; + } + + /** Rich text email link
*/ + export class TextEmail extends VirtualClass implements TextEmailArgs { + CONSTRUCTOR_id: -564523562; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextEmail"; + text: TypeRichText; + email: string; + fromReader(reader: Reader): TextEmail; + } + + export interface TextConcatArgs { + /** Concatenated rich texts */ + texts: TypeRichText[]; + } + + /** Concatenation of rich texts
*/ + export class TextConcat extends VirtualClass implements TextConcatArgs { + CONSTRUCTOR_id: 2120376535; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextConcat"; + texts: TypeRichText[]; + fromReader(reader: Reader): TextConcat; + } + + export interface TextSubscriptArgs { + /** Text */ + text: TypeRichText; + } + + /** Subscript text
*/ + export class TextSubscript extends VirtualClass implements TextSubscriptArgs { + CONSTRUCTOR_id: -311786236; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextSubscript"; + text: TypeRichText; + fromReader(reader: Reader): TextSubscript; + } + + export interface TextSuperscriptArgs { + /** Text */ + text: TypeRichText; + } + + /** Superscript text
*/ + export class TextSuperscript extends VirtualClass implements TextSuperscriptArgs { + CONSTRUCTOR_id: -939827711; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextSuperscript"; + text: TypeRichText; + fromReader(reader: Reader): TextSuperscript; + } + + export interface TextMarkedArgs { + /** Text */ + text: TypeRichText; + } + + /** Highlighted text
*/ + export class TextMarked extends VirtualClass implements TextMarkedArgs { + CONSTRUCTOR_id: 55281185; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextMarked"; + text: TypeRichText; + fromReader(reader: Reader): TextMarked; + } + + export interface TextPhoneArgs { + /** Text */ + text: TypeRichText; + /** Phone number */ + phone: string; + } + + /** Rich text linked to a phone number
*/ + export class TextPhone extends VirtualClass implements TextPhoneArgs { + CONSTRUCTOR_id: 483104362; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextPhone"; + text: TypeRichText; + phone: string; + fromReader(reader: Reader): TextPhone; + } + + export interface TextImageArgs { + /** Document ID */ + documentId: long; + /** Width */ + w: int; + /** Height */ + h: int; + } + + /** Inline image
*/ + export class TextImage extends VirtualClass implements TextImageArgs { + CONSTRUCTOR_id: 136105807; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextImage"; + documentId: long; + w: int; + h: int; + fromReader(reader: Reader): TextImage; + } + + export interface TextAnchorArgs { + /** Text */ + text: TypeRichText; + /** Section name */ + name: string; + } + + /** Text linking to another section of the page
*/ + export class TextAnchor extends VirtualClass implements TextAnchorArgs { + CONSTRUCTOR_id: 894777186; + SUBCLASS_OF_ID: 4056986745; + classType: "constructor"; + className: "TextAnchor"; + text: TypeRichText; + name: string; + fromReader(reader: Reader): TextAnchor; + } + + /** Unsupported IV element
*/ + export class PageBlockUnsupported extends VirtualClass { + CONSTRUCTOR_id: 324435594; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockUnsupported"; + fromReader(reader: Reader): PageBlockUnsupported; + } + + export interface PageBlockTitleArgs { + /** Title */ + text: TypeRichText; + } + + /** Title
*/ + export class PageBlockTitle extends VirtualClass implements PageBlockTitleArgs { + CONSTRUCTOR_id: 1890305021; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockTitle"; + text: TypeRichText; + fromReader(reader: Reader): PageBlockTitle; + } + + export interface PageBlockSubtitleArgs { + /** Text */ + text: TypeRichText; + } + + /** Subtitle
*/ + export class PageBlockSubtitle extends VirtualClass implements PageBlockSubtitleArgs { + CONSTRUCTOR_id: -1879401953; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockSubtitle"; + text: TypeRichText; + fromReader(reader: Reader): PageBlockSubtitle; + } + + export interface PageBlockAuthorDateArgs { + /** Author name */ + author: TypeRichText; + /** Date of pubblication */ + publishedDate: int; + } + + /** Author and date of creation of article
*/ + export class PageBlockAuthorDate extends VirtualClass implements PageBlockAuthorDateArgs { + CONSTRUCTOR_id: -1162877472; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockAuthorDate"; + author: TypeRichText; + publishedDate: int; + fromReader(reader: Reader): PageBlockAuthorDate; + } + + export interface PageBlockHeaderArgs { + /** Contents */ + text: TypeRichText; + } + + /** Page header
*/ + export class PageBlockHeader extends VirtualClass implements PageBlockHeaderArgs { + CONSTRUCTOR_id: -1076861716; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockHeader"; + text: TypeRichText; + fromReader(reader: Reader): PageBlockHeader; + } + + export interface PageBlockSubheaderArgs { + /** Subheader */ + text: TypeRichText; + } + + /** Subheader
*/ + export class PageBlockSubheader extends VirtualClass implements PageBlockSubheaderArgs { + CONSTRUCTOR_id: -248793375; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockSubheader"; + text: TypeRichText; + fromReader(reader: Reader): PageBlockSubheader; + } + + export interface PageBlockParagraphArgs { + /** Text */ + text: TypeRichText; + } + + /** A paragraph
*/ + export class PageBlockParagraph extends VirtualClass implements PageBlockParagraphArgs { + CONSTRUCTOR_id: 1182402406; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockParagraph"; + text: TypeRichText; + fromReader(reader: Reader): PageBlockParagraph; + } + + export interface PageBlockPreformattedArgs { + /** Text */ + text: TypeRichText; + /** Programming language of preformatted text */ + language: string; + } + + /** Preformatted (<pre> text)
*/ + export class PageBlockPreformatted extends VirtualClass implements PageBlockPreformattedArgs { + CONSTRUCTOR_id: -1066346178; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockPreformatted"; + text: TypeRichText; + language: string; + fromReader(reader: Reader): PageBlockPreformatted; + } + + export interface PageBlockFooterArgs { + /** Contents */ + text: TypeRichText; + } + + /** Page footer
*/ + export class PageBlockFooter extends VirtualClass implements PageBlockFooterArgs { + CONSTRUCTOR_id: 1216809369; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockFooter"; + text: TypeRichText; + fromReader(reader: Reader): PageBlockFooter; + } + + /** An empty block separating a page
*/ + export class PageBlockDivider extends VirtualClass { + CONSTRUCTOR_id: -618614392; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockDivider"; + fromReader(reader: Reader): PageBlockDivider; + } + + export interface PageBlockAnchorArgs { + /** Name of target section */ + name: string; + } + + /** Link to section within the page itself (like <a href="#target">anchor</a>)
*/ + export class PageBlockAnchor extends VirtualClass implements PageBlockAnchorArgs { + CONSTRUCTOR_id: -837994576; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockAnchor"; + name: string; + fromReader(reader: Reader): PageBlockAnchor; + } + + export interface PageBlockListArgs { + /** List of blocks in an IV page */ + items: TypePageListItem[]; + } + + /** Unordered list of IV blocks
*/ + export class PageBlockList extends VirtualClass implements PageBlockListArgs { + CONSTRUCTOR_id: -454524911; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockList"; + items: TypePageListItem[]; + fromReader(reader: Reader): PageBlockList; + } + + export interface PageBlockBlockquoteArgs { + /** Quote contents */ + text: TypeRichText; + /** Caption */ + caption: TypeRichText; + } + + /** Quote (equivalent to the HTML <blockquote>)
*/ + export class PageBlockBlockquote extends VirtualClass implements PageBlockBlockquoteArgs { + CONSTRUCTOR_id: 641563686; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockBlockquote"; + text: TypeRichText; + caption: TypeRichText; + fromReader(reader: Reader): PageBlockBlockquote; + } + + export interface PageBlockPullquoteArgs { + /** Text */ + text: TypeRichText; + /** Caption */ + caption: TypeRichText; + } + + /** Pullquote
*/ + export class PageBlockPullquote extends VirtualClass implements PageBlockPullquoteArgs { + CONSTRUCTOR_id: 1329878739; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockPullquote"; + text: TypeRichText; + caption: TypeRichText; + fromReader(reader: Reader): PageBlockPullquote; + } + + export interface PageBlockPhotoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Photo ID */ + photoId: long; + /** Caption */ + caption: TypePageCaption; + /** HTTP URL of page the photo leads to when clicked */ + url?: string; + /** ID of preview of the page the photo leads to when clicked */ + webpageId?: long; + } + + /** A photo
*/ + export class PageBlockPhoto extends VirtualClass implements PageBlockPhotoArgs { + CONSTRUCTOR_id: 391759200; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockPhoto"; + flags: number; + photoId: long; + caption: TypePageCaption; + url?: string; + webpageId?: long; + fromReader(reader: Reader): PageBlockPhoto; + } + + export interface PageBlockVideoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the video is set to autoplay */ + autoplay?: true; + /** Whether the video is set to loop */ + loop?: true; + /** Video ID */ + videoId: long; + /** Caption */ + caption: TypePageCaption; + } + + /** Video
*/ + export class PageBlockVideo extends VirtualClass implements PageBlockVideoArgs { + CONSTRUCTOR_id: 2089805750; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockVideo"; + flags: number; + autoplay?: true; + loop?: true; + videoId: long; + caption: TypePageCaption; + fromReader(reader: Reader): PageBlockVideo; + } + + export interface PageBlockCoverArgs { + /** Cover */ + cover: TypePageBlock; + } + + /** A page cover
*/ + export class PageBlockCover extends VirtualClass implements PageBlockCoverArgs { + CONSTRUCTOR_id: 972174080; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockCover"; + cover: TypePageBlock; + fromReader(reader: Reader): PageBlockCover; + } + + export interface PageBlockEmbedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the block should be full width */ + fullWidth?: true; + /** Whether scrolling should be allowed */ + allowScrolling?: true; + /** Web page URL, if available */ + url?: string; + /** HTML-markup of the embedded page */ + html?: string; + /** Poster photo, if available */ + posterPhotoId?: long; + /** Block width, if known */ + w?: int; + /** Block height, if known */ + h?: int; + /** Caption */ + caption: TypePageCaption; + } + + /** An embedded webpage
*/ + export class PageBlockEmbed extends VirtualClass implements PageBlockEmbedArgs { + CONSTRUCTOR_id: -1468953147; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockEmbed"; + flags: number; + fullWidth?: true; + allowScrolling?: true; + url?: string; + html?: string; + posterPhotoId?: long; + w?: int; + h?: int; + caption: TypePageCaption; + fromReader(reader: Reader): PageBlockEmbed; + } + + export interface PageBlockEmbedPostArgs { + /** Web page URL */ + url: string; + /** ID of generated webpage preview */ + webpageId: long; + /** ID of the author's photo */ + authorPhotoId: long; + /** Author name */ + author: string; + /** Creation date */ + date: int; + /** Post contents */ + blocks: TypePageBlock[]; + /** Caption */ + caption: TypePageCaption; + } + + /** An embedded post
*/ + export class PageBlockEmbedPost extends VirtualClass implements PageBlockEmbedPostArgs { + CONSTRUCTOR_id: -229005301; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockEmbedPost"; + url: string; + webpageId: long; + authorPhotoId: long; + author: string; + date: int; + blocks: TypePageBlock[]; + caption: TypePageCaption; + fromReader(reader: Reader): PageBlockEmbedPost; + } + + export interface PageBlockCollageArgs { + /** Media elements */ + items: TypePageBlock[]; + /** Caption */ + caption: TypePageCaption; + } + + /** Collage of media
*/ + export class PageBlockCollage extends VirtualClass implements PageBlockCollageArgs { + CONSTRUCTOR_id: 1705048653; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockCollage"; + items: TypePageBlock[]; + caption: TypePageCaption; + fromReader(reader: Reader): PageBlockCollage; + } + + export interface PageBlockSlideshowArgs { + /** Slideshow items */ + items: TypePageBlock[]; + /** Caption */ + caption: TypePageCaption; + } + + /** Slideshow
*/ + export class PageBlockSlideshow extends VirtualClass implements PageBlockSlideshowArgs { + CONSTRUCTOR_id: 52401552; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockSlideshow"; + items: TypePageBlock[]; + caption: TypePageCaption; + fromReader(reader: Reader): PageBlockSlideshow; + } + + export interface PageBlockChannelArgs { + /** The channel/supergroup/chat */ + channel: TypeChat; + } + + /** Reference to a telegram channel
*/ + export class PageBlockChannel extends VirtualClass implements PageBlockChannelArgs { + CONSTRUCTOR_id: -283684427; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockChannel"; + channel: TypeChat; + fromReader(reader: Reader): PageBlockChannel; + } + + export interface PageBlockAudioArgs { + /** Audio ID (to be fetched from the container page constructor */ + audioId: long; + /** Audio caption */ + caption: TypePageCaption; + } + + /** + * Audio
+ * @link https://corefork.telegram.org/constructor/page + * @link https://instantview.telegram.org/ + */ + export class PageBlockAudio extends VirtualClass implements PageBlockAudioArgs { + CONSTRUCTOR_id: -2143067670; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockAudio"; + audioId: long; + caption: TypePageCaption; + fromReader(reader: Reader): PageBlockAudio; + } + + export interface PageBlockKickerArgs { + /** Contents */ + text: TypeRichText; + } + + /** Kicker
*/ + export class PageBlockKicker extends VirtualClass implements PageBlockKickerArgs { + CONSTRUCTOR_id: 504660880; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockKicker"; + text: TypeRichText; + fromReader(reader: Reader): PageBlockKicker; + } + + export interface PageBlockTableArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Does the table have a visible border? */ + bordered?: true; + /** Is the table striped? */ + striped?: true; + /** Title */ + title: TypeRichText; + /** Table rows */ + rows: TypePageTableRow[]; + } + + /** Table
*/ + export class PageBlockTable extends VirtualClass implements PageBlockTableArgs { + CONSTRUCTOR_id: -1085412734; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockTable"; + flags: number; + bordered?: true; + striped?: true; + title: TypeRichText; + rows: TypePageTableRow[]; + fromReader(reader: Reader): PageBlockTable; + } + + export interface PageBlockOrderedListArgs { + /** List items */ + items: TypePageListOrderedItem[]; + } + + /** Ordered list of IV blocks
*/ + export class PageBlockOrderedList extends VirtualClass implements PageBlockOrderedListArgs { + CONSTRUCTOR_id: -1702174239; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockOrderedList"; + items: TypePageListOrderedItem[]; + fromReader(reader: Reader): PageBlockOrderedList; + } + + export interface PageBlockDetailsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the block is open by default */ + open?: true; + /** Block contents */ + blocks: TypePageBlock[]; + /** Always visible heading for the block */ + title: TypeRichText; + } + + /** A collapsible details block
*/ + export class PageBlockDetails extends VirtualClass implements PageBlockDetailsArgs { + CONSTRUCTOR_id: 1987480557; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockDetails"; + flags: number; + open?: true; + blocks: TypePageBlock[]; + title: TypeRichText; + fromReader(reader: Reader): PageBlockDetails; + } + + export interface PageBlockRelatedArticlesArgs { + /** Title */ + title: TypeRichText; + /** Related articles */ + articles: TypePageRelatedArticle[]; + } + + /** Related articles
*/ + export class PageBlockRelatedArticles extends VirtualClass implements PageBlockRelatedArticlesArgs { + CONSTRUCTOR_id: 370236054; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockRelatedArticles"; + title: TypeRichText; + articles: TypePageRelatedArticle[]; + fromReader(reader: Reader): PageBlockRelatedArticles; + } + + export interface PageBlockMapArgs { + /** Location of the map center */ + geo: TypeGeoPoint; + /** Map zoom level; 13-20 */ + zoom: int; + /** Map width in pixels before applying scale; 16-102 */ + w: int; + /** Map height in pixels before applying scale; 16-1024 */ + h: int; + /** Caption */ + caption: TypePageCaption; + } + + /** A map
*/ + export class PageBlockMap extends VirtualClass implements PageBlockMapArgs { + CONSTRUCTOR_id: -1538310410; + SUBCLASS_OF_ID: 449467972; + classType: "constructor"; + className: "PageBlockMap"; + geo: TypeGeoPoint; + zoom: int; + w: int; + h: int; + caption: TypePageCaption; + fromReader(reader: Reader): PageBlockMap; + } + + /** The phone call was missed
*/ + export class PhoneCallDiscardReasonMissed extends VirtualClass { + CONSTRUCTOR_id: -2048646399; + SUBCLASS_OF_ID: 3634081085; + classType: "constructor"; + className: "PhoneCallDiscardReasonMissed"; + fromReader(reader: Reader): PhoneCallDiscardReasonMissed; + } + + /** The phone call was disconnected
*/ + export class PhoneCallDiscardReasonDisconnect extends VirtualClass { + CONSTRUCTOR_id: -527056480; + SUBCLASS_OF_ID: 3634081085; + classType: "constructor"; + className: "PhoneCallDiscardReasonDisconnect"; + fromReader(reader: Reader): PhoneCallDiscardReasonDisconnect; + } + + /** The phone call was ended normally
*/ + export class PhoneCallDiscardReasonHangup extends VirtualClass { + CONSTRUCTOR_id: 1471006352; + SUBCLASS_OF_ID: 3634081085; + classType: "constructor"; + className: "PhoneCallDiscardReasonHangup"; + fromReader(reader: Reader): PhoneCallDiscardReasonHangup; + } + + /** The phone call was discared because the user is busy in another call
*/ + export class PhoneCallDiscardReasonBusy extends VirtualClass { + CONSTRUCTOR_id: -84416311; + SUBCLASS_OF_ID: 3634081085; + classType: "constructor"; + className: "PhoneCallDiscardReasonBusy"; + fromReader(reader: Reader): PhoneCallDiscardReasonBusy; + } + + export interface DataJSONArgs { + /** JSON-encoded object */ + data: string; + } + + /** Represents a json-encoded object
*/ + export class DataJSON extends VirtualClass implements DataJSONArgs { + CONSTRUCTOR_id: 2104790276; + SUBCLASS_OF_ID: 2902676200; + classType: "constructor"; + className: "DataJSON"; + data: string; + fromReader(reader: Reader): DataJSON; + } + + export interface LabeledPriceArgs { + /** Portion label */ + label: string; + /** Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ + amount: long; + } + + /** + * This object represents a portion of the price for goods or services.
+ * @link https://corefork.telegram.org/bots/payments + */ + export class LabeledPrice extends VirtualClass implements LabeledPriceArgs { + CONSTRUCTOR_id: -886477832; + SUBCLASS_OF_ID: 478413946; + classType: "constructor"; + className: "LabeledPrice"; + label: string; + amount: long; + fromReader(reader: Reader): LabeledPrice; + } + + export interface InvoiceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Test invoice */ + test?: true; + /** Set this flag if you require the user's full name to complete the order */ + nameRequested?: true; + /** Set this flag if you require the user's phone number to complete the order */ + phoneRequested?: true; + /** Set this flag if you require the user's email address to complete the order */ + emailRequested?: true; + /** Set this flag if you require the user's shipping address to complete the order */ + shippingAddressRequested?: true; + /** Set this flag if the final price depends on the shipping method */ + flexible?: true; + /** Set this flag if user's phone number should be sent to provider */ + phoneToProvider?: true; + /** Set this flag if user's email address should be sent to provider */ + emailToProvider?: true; + /** Three-letter ISO 4217 currency code */ + currency: string; + /** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */ + prices: TypeLabeledPrice[]; + /** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ + maxTipAmount?: long; + /** A vector of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. */ + suggestedTipAmounts?: long[]; + } + + /** + * Invoice
+ * @link https://corefork.telegram.org/bots/payments + */ + export class Invoice extends VirtualClass implements InvoiceArgs { + CONSTRUCTOR_id: 215516896; + SUBCLASS_OF_ID: 1608003288; + classType: "constructor"; + className: "Invoice"; + flags: number; + test?: true; + nameRequested?: true; + phoneRequested?: true; + emailRequested?: true; + shippingAddressRequested?: true; + flexible?: true; + phoneToProvider?: true; + emailToProvider?: true; + currency: string; + prices: TypeLabeledPrice[]; + maxTipAmount?: long; + suggestedTipAmounts?: long[]; + fromReader(reader: Reader): Invoice; + } + + export interface PaymentChargeArgs { + /** Telegram payment identifier */ + id: string; + /** Provider payment identifier */ + providerChargeId: string; + } + + /** Payment identifier
*/ + export class PaymentCharge extends VirtualClass implements PaymentChargeArgs { + CONSTRUCTOR_id: -368917890; + SUBCLASS_OF_ID: 1019752665; + classType: "constructor"; + className: "PaymentCharge"; + id: string; + providerChargeId: string; + fromReader(reader: Reader): PaymentCharge; + } + + export interface PostAddressArgs { + /** First line for the address */ + streetLine1: string; + /** Second line for the address */ + streetLine2: string; + /** City */ + city: string; + /** State, if applicable (empty otherwise) */ + state: string; + /** ISO 3166-1 alpha-2 country code */ + countryIso2: string; + /** Address post code */ + postCode: string; + } + + /** Shipping address
*/ + export class PostAddress extends VirtualClass implements PostAddressArgs { + CONSTRUCTOR_id: 512535275; + SUBCLASS_OF_ID: 2373900844; + classType: "constructor"; + className: "PostAddress"; + streetLine1: string; + streetLine2: string; + city: string; + state: string; + countryIso2: string; + postCode: string; + fromReader(reader: Reader): PostAddress; + } + + export interface PaymentRequestedInfoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** User's full name */ + name?: string; + /** User's phone number */ + phone?: string; + /** User's email address */ + email?: string; + /** User's shipping address */ + shippingAddress?: TypePostAddress; + } + + /** Order info provided by the user
*/ + export class PaymentRequestedInfo extends VirtualClass implements PaymentRequestedInfoArgs { + CONSTRUCTOR_id: -1868808300; + SUBCLASS_OF_ID: 2377134406; + classType: "constructor"; + className: "PaymentRequestedInfo"; + flags: number; + name?: string; + phone?: string; + email?: string; + shippingAddress?: TypePostAddress; + fromReader(reader: Reader): PaymentRequestedInfo; + } + + export interface PaymentSavedCredentialsCardArgs { + /** Card ID */ + id: string; + /** Title */ + title: string; + } + + /** Saved credit card
*/ + export class PaymentSavedCredentialsCard extends VirtualClass implements PaymentSavedCredentialsCardArgs { + CONSTRUCTOR_id: -842892769; + SUBCLASS_OF_ID: 3009576675; + classType: "constructor"; + className: "PaymentSavedCredentialsCard"; + id: string; + title: string; + fromReader(reader: Reader): PaymentSavedCredentialsCard; + } + + export interface WebDocumentArgs { + /** Document URL */ + url: string; + /** Access hash */ + accessHash: long; + /** File size */ + size: int; + /** MIME type */ + mimeType: string; + /** Attributes for media types */ + attributes: TypeDocumentAttribute[]; + } + + /** Remote document
*/ + export class WebDocument extends VirtualClass implements WebDocumentArgs { + CONSTRUCTOR_id: 475467473; + SUBCLASS_OF_ID: 996419604; + classType: "constructor"; + className: "WebDocument"; + url: string; + accessHash: long; + size: int; + mimeType: string; + attributes: TypeDocumentAttribute[]; + fromReader(reader: Reader): WebDocument; + } + + export interface WebDocumentNoProxyArgs { + /** Document URL */ + url: string; + /** File size */ + size: int; + /** MIME type */ + mimeType: string; + /** Attributes for media types */ + attributes: TypeDocumentAttribute[]; + } + + /** + * Remote document that can be downloaded without proxying through telegram
+ * @link https://corefork.telegram.org/api/files + */ + export class WebDocumentNoProxy extends VirtualClass implements WebDocumentNoProxyArgs { + CONSTRUCTOR_id: -104284986; + SUBCLASS_OF_ID: 996419604; + classType: "constructor"; + className: "WebDocumentNoProxy"; + url: string; + size: int; + mimeType: string; + attributes: TypeDocumentAttribute[]; + fromReader(reader: Reader): WebDocumentNoProxy; + } + + export interface InputWebDocumentArgs { + /** Remote document URL to be downloaded using the appropriate method */ + url: string; + /** Remote file size */ + size: int; + /** Mime type */ + mimeType: string; + /** Attributes for media types */ + attributes: TypeDocumentAttribute[]; + } + + /** + * The document
+ * @link https://corefork.telegram.org/api/files + */ + export class InputWebDocument extends VirtualClass implements InputWebDocumentArgs { + CONSTRUCTOR_id: -1678949555; + SUBCLASS_OF_ID: 2330505542; + classType: "constructor"; + className: "InputWebDocument"; + url: string; + size: int; + mimeType: string; + attributes: TypeDocumentAttribute[]; + fromReader(reader: Reader): InputWebDocument; + } + + export interface InputWebFileLocationArgs { + /** HTTP URL of file */ + url: string; + /** Access hash */ + accessHash: long; + } + + /** Location of a remote HTTP(s) file
*/ + export class InputWebFileLocation extends VirtualClass implements InputWebFileLocationArgs { + CONSTRUCTOR_id: -1036396922; + SUBCLASS_OF_ID: 4147042521; + classType: "constructor"; + className: "InputWebFileLocation"; + url: string; + accessHash: long; + fromReader(reader: Reader): InputWebFileLocation; + } + + export interface InputWebFileGeoPointLocationArgs { + /** Geolocation */ + geoPoint: TypeInputGeoPoint; + /** Access hash */ + accessHash: long; + /** Map width in pixels before applying scale; 16-1024 */ + w: int; + /** Map height in pixels before applying scale; 16-1024 */ + h: int; + /** Map zoom level; 13-20 */ + zoom: int; + /** Map scale; 1-3 */ + scale: int; + } + + /** Geolocation
*/ + export class InputWebFileGeoPointLocation extends VirtualClass implements InputWebFileGeoPointLocationArgs { + CONSTRUCTOR_id: -1625153079; + SUBCLASS_OF_ID: 4147042521; + classType: "constructor"; + className: "InputWebFileGeoPointLocation"; + geoPoint: TypeInputGeoPoint; + accessHash: long; + w: int; + h: int; + zoom: int; + scale: int; + fromReader(reader: Reader): InputWebFileGeoPointLocation; + } + + export interface InputPaymentCredentialsSavedArgs { + /** Credential ID */ + id: string; + /** Temporary password */ + tmpPassword: bytes; + } + + /** Saved payment credentials
*/ + export class InputPaymentCredentialsSaved extends VirtualClass implements InputPaymentCredentialsSavedArgs { + CONSTRUCTOR_id: -1056001329; + SUBCLASS_OF_ID: 681157949; + classType: "constructor"; + className: "InputPaymentCredentialsSaved"; + id: string; + tmpPassword: bytes; + fromReader(reader: Reader): InputPaymentCredentialsSaved; + } + + export interface InputPaymentCredentialsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Save payment credential for future use */ + save?: true; + /** Payment credentials */ + data: TypeDataJSON; + } + + /** Payment credentials
*/ + export class InputPaymentCredentials extends VirtualClass implements InputPaymentCredentialsArgs { + CONSTRUCTOR_id: 873977640; + SUBCLASS_OF_ID: 681157949; + classType: "constructor"; + className: "InputPaymentCredentials"; + flags: number; + save?: true; + data: TypeDataJSON; + fromReader(reader: Reader): InputPaymentCredentials; + } + + export interface InputPaymentCredentialsApplePayArgs { + /** Payment data */ + paymentData: TypeDataJSON; + } + + /** Apple pay payment credentials
*/ + export class InputPaymentCredentialsApplePay extends VirtualClass implements InputPaymentCredentialsApplePayArgs { + CONSTRUCTOR_id: 178373535; + SUBCLASS_OF_ID: 681157949; + classType: "constructor"; + className: "InputPaymentCredentialsApplePay"; + paymentData: TypeDataJSON; + fromReader(reader: Reader): InputPaymentCredentialsApplePay; + } + + export interface InputPaymentCredentialsGooglePayArgs { + /** Payment token */ + paymentToken: TypeDataJSON; + } + + /** Google Pay payment credentials
*/ + export class InputPaymentCredentialsGooglePay extends VirtualClass implements InputPaymentCredentialsGooglePayArgs { + CONSTRUCTOR_id: -1966921727; + SUBCLASS_OF_ID: 681157949; + classType: "constructor"; + className: "InputPaymentCredentialsGooglePay"; + paymentToken: TypeDataJSON; + fromReader(reader: Reader): InputPaymentCredentialsGooglePay; + } + + export interface ShippingOptionArgs { + /** Option ID */ + id: string; + /** Title */ + title: string; + /** List of price portions */ + prices: TypeLabeledPrice[]; + } + + /** Shipping option
*/ + export class ShippingOption extends VirtualClass implements ShippingOptionArgs { + CONSTRUCTOR_id: -1239335713; + SUBCLASS_OF_ID: 4108930168; + classType: "constructor"; + className: "ShippingOption"; + id: string; + title: string; + prices: TypeLabeledPrice[]; + fromReader(reader: Reader): ShippingOption; + } + + export interface InputStickerSetItemArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The sticker */ + document: TypeInputDocument; + /** Associated emoji */ + emoji: string; + /** Coordinates for mask sticker */ + maskCoords?: TypeMaskCoords; + } + + /** Sticker in a stickerset
*/ + export class InputStickerSetItem extends VirtualClass implements InputStickerSetItemArgs { + CONSTRUCTOR_id: -6249322; + SUBCLASS_OF_ID: 2925129845; + classType: "constructor"; + className: "InputStickerSetItem"; + flags: number; + document: TypeInputDocument; + emoji: string; + maskCoords?: TypeMaskCoords; + fromReader(reader: Reader): InputStickerSetItem; + } + + export interface InputPhoneCallArgs { + /** Call ID */ + id: long; + /** Access hash */ + accessHash: long; + } + + /** Phone call
*/ + export class InputPhoneCall extends VirtualClass implements InputPhoneCallArgs { + CONSTRUCTOR_id: 506920429; + SUBCLASS_OF_ID: 3165319744; + classType: "constructor"; + className: "InputPhoneCall"; + id: long; + accessHash: long; + fromReader(reader: Reader): InputPhoneCall; + } + + export interface PhoneCallEmptyArgs { + /** Call ID */ + id: long; + } + + /** Empty constructor
*/ + export class PhoneCallEmpty extends VirtualClass implements PhoneCallEmptyArgs { + CONSTRUCTOR_id: 1399245077; + SUBCLASS_OF_ID: 3296664529; + classType: "constructor"; + className: "PhoneCallEmpty"; + id: long; + fromReader(reader: Reader): PhoneCallEmpty; + } + + export interface PhoneCallWaitingArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Is this a video call */ + video?: true; + /** Call ID */ + id: long; + /** Access hash */ + accessHash: long; + /** Date */ + date: int; + /** Admin ID */ + adminId: int; + /** Participant ID */ + participantId: int; + /** Phone call protocol info */ + protocol: TypePhoneCallProtocol; + /** When was the phone call received */ + receiveDate?: int; + } + + /** Incoming phone call
*/ + export class PhoneCallWaiting extends VirtualClass implements PhoneCallWaitingArgs { + CONSTRUCTOR_id: 462375633; + SUBCLASS_OF_ID: 3296664529; + classType: "constructor"; + className: "PhoneCallWaiting"; + flags: number; + video?: true; + id: long; + accessHash: long; + date: int; + adminId: int; + participantId: int; + protocol: TypePhoneCallProtocol; + receiveDate?: int; + fromReader(reader: Reader): PhoneCallWaiting; + } + + export interface PhoneCallRequestedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is a video call */ + video?: true; + /** Phone call ID */ + id: long; + /** Access hash */ + accessHash: long; + /** When was the phone call created */ + date: int; + /** ID of the creator of the phone call */ + adminId: int; + /** ID of the other participant of the phone call */ + participantId: int; + /** Parameter for key exchange */ + gAHash: bytes; + /** Call protocol info to be passed to libtgvoip */ + protocol: TypePhoneCallProtocol; + } + + /** + * Requested phone call
+ * @link https://corefork.telegram.org/api/end-to-end/voice-calls + */ + export class PhoneCallRequested extends VirtualClass implements PhoneCallRequestedArgs { + CONSTRUCTOR_id: -2014659757; + SUBCLASS_OF_ID: 3296664529; + classType: "constructor"; + className: "PhoneCallRequested"; + flags: number; + video?: true; + id: long; + accessHash: long; + date: int; + adminId: int; + participantId: int; + gAHash: bytes; + protocol: TypePhoneCallProtocol; + fromReader(reader: Reader): PhoneCallRequested; + } + + export interface PhoneCallAcceptedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is a video call */ + video?: true; + /** ID of accepted phone call */ + id: long; + /** Access hash of phone call */ + accessHash: long; + /** When was the call accepted */ + date: int; + /** ID of the call creator */ + adminId: int; + /** ID of the other user in the call */ + participantId: int; + /** B parameter for secure E2E phone call key exchange */ + gB: bytes; + /** Protocol to use for phone call */ + protocol: TypePhoneCallProtocol; + } + + /** + * An accepted phone call
+ * @link https://corefork.telegram.org/api/end-to-end/voice-calls + */ + export class PhoneCallAccepted extends VirtualClass implements PhoneCallAcceptedArgs { + CONSTRUCTOR_id: -1719909046; + SUBCLASS_OF_ID: 3296664529; + classType: "constructor"; + className: "PhoneCallAccepted"; + flags: number; + video?: true; + id: long; + accessHash: long; + date: int; + adminId: int; + participantId: int; + gB: bytes; + protocol: TypePhoneCallProtocol; + fromReader(reader: Reader): PhoneCallAccepted; + } + + export interface PhoneCallArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether P2P connection to the other peer is allowed */ + p2pAllowed?: true; + /** Whether this is a video call */ + video?: true; + /** Call ID */ + id: long; + /** Access hash */ + accessHash: long; + /** Date of creation of the call */ + date: int; + /** User ID of the creator of the call */ + adminId: int; + /** User ID of the other participant in the call */ + participantId: int; + /** Parameter for key exchange */ + gAOrB: bytes; + /** Key fingerprint */ + keyFingerprint: long; + /** Call protocol info to be passed to libtgvoip */ + protocol: TypePhoneCallProtocol; + /** List of endpoints the user can connect to to exchange call data */ + connections: TypePhoneConnection[]; + /** When was the call actually started */ + startDate: int; + } + + /** + * Phone call
+ * @link https://corefork.telegram.org/api/end-to-end/voice-calls + */ + export class PhoneCall extends VirtualClass implements PhoneCallArgs { + CONSTRUCTOR_id: -2025673089; + SUBCLASS_OF_ID: 3296664529; + classType: "constructor"; + className: "PhoneCall"; + flags: number; + p2pAllowed?: true; + video?: true; + id: long; + accessHash: long; + date: int; + adminId: int; + participantId: int; + gAOrB: bytes; + keyFingerprint: long; + protocol: TypePhoneCallProtocol; + connections: TypePhoneConnection[]; + startDate: int; + fromReader(reader: Reader): PhoneCall; + } + + export interface PhoneCallDiscardedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the server required the user to rate the call */ + needRating?: true; + /** Whether the server required the client to send the libtgvoip call debug data */ + needDebug?: true; + /** Whether the call was a video call */ + video?: true; + /** Call ID */ + id: long; + /** Why was the phone call discarded */ + reason?: TypePhoneCallDiscardReason; + /** Duration of the phone call in seconds */ + duration?: int; + } + + /** + * Indicates a discarded phone call
+ * @link https://corefork.telegram.org/method/phone.setCallRating + * @link https://corefork.telegram.org/method/phone.saveCallDebug + */ + export class PhoneCallDiscarded extends VirtualClass implements PhoneCallDiscardedArgs { + CONSTRUCTOR_id: 1355435489; + SUBCLASS_OF_ID: 3296664529; + classType: "constructor"; + className: "PhoneCallDiscarded"; + flags: number; + needRating?: true; + needDebug?: true; + video?: true; + id: long; + reason?: TypePhoneCallDiscardReason; + duration?: int; + fromReader(reader: Reader): PhoneCallDiscarded; + } + + export interface PhoneConnectionArgs { + /** Endpoint ID */ + id: long; + /** IP address of endpoint */ + ip: string; + /** IPv6 address of endpoint */ + ipv6: string; + /** Port ID */ + port: int; + /** Our peer tag */ + peerTag: bytes; + } + + /** Identifies an endpoint that can be used to connect to the other user in a phone call
*/ + export class PhoneConnection extends VirtualClass implements PhoneConnectionArgs { + CONSTRUCTOR_id: -1655957568; + SUBCLASS_OF_ID: 2861425677; + classType: "constructor"; + className: "PhoneConnection"; + id: long; + ip: string; + ipv6: string; + port: int; + peerTag: bytes; + fromReader(reader: Reader): PhoneConnection; + } + + export interface PhoneConnectionWebrtcArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is a TURN endpoint */ + turn?: true; + /** Whether this is a STUN endpoint */ + stun?: true; + /** Endpoint ID */ + id: long; + /** IP address */ + ip: string; + /** IPv6 address */ + ipv6: string; + /** Port */ + port: int; + /** Username */ + username: string; + /** Password */ + password: string; + } + + /** WebRTC connection parameters
*/ + export class PhoneConnectionWebrtc extends VirtualClass implements PhoneConnectionWebrtcArgs { + CONSTRUCTOR_id: 1667228533; + SUBCLASS_OF_ID: 2861425677; + classType: "constructor"; + className: "PhoneConnectionWebrtc"; + flags: number; + turn?: true; + stun?: true; + id: long; + ip: string; + ipv6: string; + port: int; + username: string; + password: string; + fromReader(reader: Reader): PhoneConnectionWebrtc; + } + + export interface PhoneCallProtocolArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to allow P2P connection to the other participant */ + udpP2p?: true; + /** Whether to allow connection to the other participants through the reflector servers */ + udpReflector?: true; + /** Minimum layer for remote libtgvoip */ + minLayer: int; + /** Maximum layer for remote libtgvoip */ + maxLayer: int; + /** When using phone.requestCall and phone.acceptCall, specify all library versions supported by the client.
The server will merge and choose the best library version supported by both peers, returning only the best value in the result of the callee's phone.acceptCall and in the phoneCallAccepted update received by the caller. */ + libraryVersions: string[]; + } + + /** + * Protocol info for libtgvoip
+ * @link https://corefork.telegram.org/method/phone.requestCall + * @link https://corefork.telegram.org/method/phone.acceptCall + * @link https://corefork.telegram.org/constructor/phoneCallAccepted + */ + export class PhoneCallProtocol extends VirtualClass implements PhoneCallProtocolArgs { + CONSTRUCTOR_id: -58224696; + SUBCLASS_OF_ID: 2017038755; + classType: "constructor"; + className: "PhoneCallProtocol"; + flags: number; + udpP2p?: true; + udpReflector?: true; + minLayer: int; + maxLayer: int; + libraryVersions: string[]; + fromReader(reader: Reader): PhoneCallProtocol; + } + + export interface CdnPublicKeyArgs { + /** CDN DC ID */ + dcId: int; + /** RSA public key */ + publicKey: string; + } + + /** + * Public key to use only during handshakes to CDN DCs.
+ * @link https://corefork.telegram.org/cdn + */ + export class CdnPublicKey extends VirtualClass implements CdnPublicKeyArgs { + CONSTRUCTOR_id: -914167110; + SUBCLASS_OF_ID: 383469555; + classType: "constructor"; + className: "CdnPublicKey"; + dcId: int; + publicKey: string; + fromReader(reader: Reader): CdnPublicKey; + } + + export interface CdnConfigArgs { + /** Vector of public keys to use only during handshakes to CDN DCs. */ + publicKeys: TypeCdnPublicKey[]; + } + + /** + * Configuration for CDN file downloads.
+ * @link https://corefork.telegram.org/cdn + */ + export class CdnConfig extends VirtualClass implements CdnConfigArgs { + CONSTRUCTOR_id: 1462101002; + SUBCLASS_OF_ID: 3973724540; + classType: "constructor"; + className: "CdnConfig"; + publicKeys: TypeCdnPublicKey[]; + fromReader(reader: Reader): CdnConfig; + } + + export interface LangPackStringArgs { + /** Language key */ + key: string; + /** Value */ + value: string; + } + + /** Translated localization string
*/ + export class LangPackString extends VirtualClass implements LangPackStringArgs { + CONSTRUCTOR_id: -892239370; + SUBCLASS_OF_ID: 3692534457; + classType: "constructor"; + className: "LangPackString"; + key: string; + value: string; + fromReader(reader: Reader): LangPackString; + } + + export interface LangPackStringPluralizedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Localization key */ + key: string; + /** Value for zero objects */ + zeroValue?: string; + /** Value for one object */ + oneValue?: string; + /** Value for two objects */ + twoValue?: string; + /** Value for a few objects */ + fewValue?: string; + /** Value for many objects */ + manyValue?: string; + /** Default value */ + otherValue: string; + } + + /** A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info
*/ + export class LangPackStringPluralized extends VirtualClass implements LangPackStringPluralizedArgs { + CONSTRUCTOR_id: 1816636575; + SUBCLASS_OF_ID: 3692534457; + classType: "constructor"; + className: "LangPackStringPluralized"; + flags: number; + key: string; + zeroValue?: string; + oneValue?: string; + twoValue?: string; + fewValue?: string; + manyValue?: string; + otherValue: string; + fromReader(reader: Reader): LangPackStringPluralized; + } + + export interface LangPackStringDeletedArgs { + /** Localization key */ + key: string; + } + + /** Deleted localization string
*/ + export class LangPackStringDeleted extends VirtualClass implements LangPackStringDeletedArgs { + CONSTRUCTOR_id: 695856818; + SUBCLASS_OF_ID: 3692534457; + classType: "constructor"; + className: "LangPackStringDeleted"; + key: string; + fromReader(reader: Reader): LangPackStringDeleted; + } + + export interface LangPackDifferenceArgs { + /** Language code */ + langCode: string; + /** Previous version number */ + fromVersion: int; + /** New version number */ + version: int; + /** Localized strings */ + strings: TypeLangPackString[]; + } + + /** Changes to the app's localization pack
*/ + export class LangPackDifference extends VirtualClass implements LangPackDifferenceArgs { + CONSTRUCTOR_id: -209337866; + SUBCLASS_OF_ID: 1382427989; + classType: "constructor"; + className: "LangPackDifference"; + langCode: string; + fromVersion: int; + version: int; + strings: TypeLangPackString[]; + fromReader(reader: Reader): LangPackDifference; + } + + export interface LangPackLanguageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the language pack is official */ + official?: true; + /** Is this a localization pack for an RTL language */ + rtl?: true; + /** Is this a beta localization pack? */ + beta?: true; + /** Language name */ + name: string; + /** Language name in the language itself */ + nativeName: string; + /** Language code (pack identifier) */ + langCode: string; + /** Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it should be fetched from base language pack. Unsupported in custom language packs */ + baseLangCode?: string; + /** A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info */ + pluralCode: string; + /** Total number of non-deleted strings from the language pack */ + stringsCount: int; + /** Total number of translated strings from the language pack */ + translatedCount: int; + /** Link to language translation interface; empty for custom local language packs */ + translationsUrl: string; + } + + /** Identifies a localization pack
*/ + export class LangPackLanguage extends VirtualClass implements LangPackLanguageArgs { + CONSTRUCTOR_id: -288727837; + SUBCLASS_OF_ID: 2880211383; + classType: "constructor"; + className: "LangPackLanguage"; + flags: number; + official?: true; + rtl?: true; + beta?: true; + name: string; + nativeName: string; + langCode: string; + baseLangCode?: string; + pluralCode: string; + stringsCount: int; + translatedCount: int; + translationsUrl: string; + fromReader(reader: Reader): LangPackLanguage; + } + + export interface ChannelAdminLogEventActionChangeTitleArgs { + /** Previous title */ + prevValue: string; + /** New title */ + newValue: string; + } + + /** Channel/supergroup title was changed
*/ + export class ChannelAdminLogEventActionChangeTitle extends VirtualClass implements ChannelAdminLogEventActionChangeTitleArgs { + CONSTRUCTOR_id: -421545947; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionChangeTitle"; + prevValue: string; + newValue: string; + fromReader(reader: Reader): ChannelAdminLogEventActionChangeTitle; + } + + export interface ChannelAdminLogEventActionChangeAboutArgs { + /** Previous description */ + prevValue: string; + /** New description */ + newValue: string; + } + + /** The description was changed
*/ + export class ChannelAdminLogEventActionChangeAbout extends VirtualClass implements ChannelAdminLogEventActionChangeAboutArgs { + CONSTRUCTOR_id: 1427671598; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionChangeAbout"; + prevValue: string; + newValue: string; + fromReader(reader: Reader): ChannelAdminLogEventActionChangeAbout; + } + + export interface ChannelAdminLogEventActionChangeUsernameArgs { + /** Old username */ + prevValue: string; + /** New username */ + newValue: string; + } + + /** Channel/supergroup username was changed
*/ + export class ChannelAdminLogEventActionChangeUsername extends VirtualClass implements ChannelAdminLogEventActionChangeUsernameArgs { + CONSTRUCTOR_id: 1783299128; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionChangeUsername"; + prevValue: string; + newValue: string; + fromReader(reader: Reader): ChannelAdminLogEventActionChangeUsername; + } + + export interface ChannelAdminLogEventActionChangePhotoArgs { + /** Previous picture */ + prevPhoto: TypePhoto; + /** New picture */ + newPhoto: TypePhoto; + } + + /** The channel/supergroup's picture was changed
*/ + export class ChannelAdminLogEventActionChangePhoto extends VirtualClass implements ChannelAdminLogEventActionChangePhotoArgs { + CONSTRUCTOR_id: 1129042607; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionChangePhoto"; + prevPhoto: TypePhoto; + newPhoto: TypePhoto; + fromReader(reader: Reader): ChannelAdminLogEventActionChangePhoto; + } + + export interface ChannelAdminLogEventActionToggleInvitesArgs { + /** New value */ + newValue: Bool; + } + + /** Invites were enabled/disabled
*/ + export class ChannelAdminLogEventActionToggleInvites extends VirtualClass implements ChannelAdminLogEventActionToggleInvitesArgs { + CONSTRUCTOR_id: 460916654; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionToggleInvites"; + newValue: Bool; + fromReader(reader: Reader): ChannelAdminLogEventActionToggleInvites; + } + + export interface ChannelAdminLogEventActionToggleSignaturesArgs { + /** New value */ + newValue: Bool; + } + + /** Channel signatures were enabled/disabled
*/ + export class ChannelAdminLogEventActionToggleSignatures extends VirtualClass implements ChannelAdminLogEventActionToggleSignaturesArgs { + CONSTRUCTOR_id: 648939889; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionToggleSignatures"; + newValue: Bool; + fromReader(reader: Reader): ChannelAdminLogEventActionToggleSignatures; + } + + export interface ChannelAdminLogEventActionUpdatePinnedArgs { + /** The message that was pinned */ + message: TypeMessage; + } + + /** A message was pinned
*/ + export class ChannelAdminLogEventActionUpdatePinned extends VirtualClass implements ChannelAdminLogEventActionUpdatePinnedArgs { + CONSTRUCTOR_id: -370660328; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionUpdatePinned"; + message: TypeMessage; + fromReader(reader: Reader): ChannelAdminLogEventActionUpdatePinned; + } + + export interface ChannelAdminLogEventActionEditMessageArgs { + /** Old message */ + prevMessage: TypeMessage; + /** New message */ + newMessage: TypeMessage; + } + + /** A message was edited
*/ + export class ChannelAdminLogEventActionEditMessage extends VirtualClass implements ChannelAdminLogEventActionEditMessageArgs { + CONSTRUCTOR_id: 1889215493; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionEditMessage"; + prevMessage: TypeMessage; + newMessage: TypeMessage; + fromReader(reader: Reader): ChannelAdminLogEventActionEditMessage; + } + + export interface ChannelAdminLogEventActionDeleteMessageArgs { + /** The message that was deleted */ + message: TypeMessage; + } + + /** A message was deleted
*/ + export class ChannelAdminLogEventActionDeleteMessage extends VirtualClass implements ChannelAdminLogEventActionDeleteMessageArgs { + CONSTRUCTOR_id: 1121994683; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionDeleteMessage"; + message: TypeMessage; + fromReader(reader: Reader): ChannelAdminLogEventActionDeleteMessage; + } + + /** A user has joined the group (in the case of big groups, info of the user that has joined isn't shown)
*/ + export class ChannelAdminLogEventActionParticipantJoin extends VirtualClass { + CONSTRUCTOR_id: 405815507; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionParticipantJoin"; + fromReader(reader: Reader): ChannelAdminLogEventActionParticipantJoin; + } + + /** A user left the channel/supergroup (in the case of big groups, info of the user that has joined isn't shown)
*/ + export class ChannelAdminLogEventActionParticipantLeave extends VirtualClass { + CONSTRUCTOR_id: -124291086; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionParticipantLeave"; + fromReader(reader: Reader): ChannelAdminLogEventActionParticipantLeave; + } + + export interface ChannelAdminLogEventActionParticipantInviteArgs { + /** The user that was invited */ + participant: TypeChannelParticipant; + } + + /** A user was invited to the group
*/ + export class ChannelAdminLogEventActionParticipantInvite extends VirtualClass implements ChannelAdminLogEventActionParticipantInviteArgs { + CONSTRUCTOR_id: -484690728; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionParticipantInvite"; + participant: TypeChannelParticipant; + fromReader(reader: Reader): ChannelAdminLogEventActionParticipantInvite; + } + + export interface ChannelAdminLogEventActionParticipantToggleBanArgs { + /** Old banned rights of user */ + prevParticipant: TypeChannelParticipant; + /** New banned rights of user */ + newParticipant: TypeChannelParticipant; + } + + /** + * The banned rights of a user were changed
+ * @link https://corefork.telegram.org/api/rights + */ + export class ChannelAdminLogEventActionParticipantToggleBan extends VirtualClass implements ChannelAdminLogEventActionParticipantToggleBanArgs { + CONSTRUCTOR_id: -422036098; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionParticipantToggleBan"; + prevParticipant: TypeChannelParticipant; + newParticipant: TypeChannelParticipant; + fromReader(reader: Reader): ChannelAdminLogEventActionParticipantToggleBan; + } + + export interface ChannelAdminLogEventActionParticipantToggleAdminArgs { + /** Previous admin rights */ + prevParticipant: TypeChannelParticipant; + /** New admin rights */ + newParticipant: TypeChannelParticipant; + } + + /** + * The admin rights of a user were changed
+ * @link https://corefork.telegram.org/api/rights + */ + export class ChannelAdminLogEventActionParticipantToggleAdmin extends VirtualClass implements ChannelAdminLogEventActionParticipantToggleAdminArgs { + CONSTRUCTOR_id: -714643696; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionParticipantToggleAdmin"; + prevParticipant: TypeChannelParticipant; + newParticipant: TypeChannelParticipant; + fromReader(reader: Reader): ChannelAdminLogEventActionParticipantToggleAdmin; + } + + export interface ChannelAdminLogEventActionChangeStickerSetArgs { + /** Previous stickerset */ + prevStickerset: TypeInputStickerSet; + /** New stickerset */ + newStickerset: TypeInputStickerSet; + } + + /** The supergroup's stickerset was changed
*/ + export class ChannelAdminLogEventActionChangeStickerSet extends VirtualClass implements ChannelAdminLogEventActionChangeStickerSetArgs { + CONSTRUCTOR_id: -1312568665; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionChangeStickerSet"; + prevStickerset: TypeInputStickerSet; + newStickerset: TypeInputStickerSet; + fromReader(reader: Reader): ChannelAdminLogEventActionChangeStickerSet; + } + + export interface ChannelAdminLogEventActionTogglePreHistoryHiddenArgs { + /** New value */ + newValue: Bool; + } + + /** + * The hidden prehistory setting was changed
+ * @link https://corefork.telegram.org/method/channels.togglePreHistoryHidden + */ + export class ChannelAdminLogEventActionTogglePreHistoryHidden extends VirtualClass implements ChannelAdminLogEventActionTogglePreHistoryHiddenArgs { + CONSTRUCTOR_id: 1599903217; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionTogglePreHistoryHidden"; + newValue: Bool; + fromReader(reader: Reader): ChannelAdminLogEventActionTogglePreHistoryHidden; + } + + export interface ChannelAdminLogEventActionDefaultBannedRightsArgs { + /** Previous global banned rights */ + prevBannedRights: TypeChatBannedRights; + /** New glboal banned rights. */ + newBannedRights: TypeChatBannedRights; + } + + /** + * The default banned rights were modified
+ * @link https://corefork.telegram.org/api/rights + */ + export class ChannelAdminLogEventActionDefaultBannedRights extends VirtualClass implements ChannelAdminLogEventActionDefaultBannedRightsArgs { + CONSTRUCTOR_id: 771095562; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionDefaultBannedRights"; + prevBannedRights: TypeChatBannedRights; + newBannedRights: TypeChatBannedRights; + fromReader(reader: Reader): ChannelAdminLogEventActionDefaultBannedRights; + } + + export interface ChannelAdminLogEventActionStopPollArgs { + /** The poll that was stopped */ + message: TypeMessage; + } + + /** A poll was stopped
*/ + export class ChannelAdminLogEventActionStopPoll extends VirtualClass implements ChannelAdminLogEventActionStopPollArgs { + CONSTRUCTOR_id: -1895328189; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionStopPoll"; + message: TypeMessage; + fromReader(reader: Reader): ChannelAdminLogEventActionStopPoll; + } + + export interface ChannelAdminLogEventActionChangeLinkedChatArgs { + /** Previous linked chat */ + prevValue: int; + /** New linked chat */ + newValue: int; + } + + /** The linked chat was changed
*/ + export class ChannelAdminLogEventActionChangeLinkedChat extends VirtualClass implements ChannelAdminLogEventActionChangeLinkedChatArgs { + CONSTRUCTOR_id: -1569748965; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionChangeLinkedChat"; + prevValue: int; + newValue: int; + fromReader(reader: Reader): ChannelAdminLogEventActionChangeLinkedChat; + } + + export interface ChannelAdminLogEventActionChangeLocationArgs { + /** Previous location */ + prevValue: TypeChannelLocation; + /** New location */ + newValue: TypeChannelLocation; + } + + /** The geogroup location was changed
*/ + export class ChannelAdminLogEventActionChangeLocation extends VirtualClass implements ChannelAdminLogEventActionChangeLocationArgs { + CONSTRUCTOR_id: 241923758; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionChangeLocation"; + prevValue: TypeChannelLocation; + newValue: TypeChannelLocation; + fromReader(reader: Reader): ChannelAdminLogEventActionChangeLocation; + } + + export interface ChannelAdminLogEventActionToggleSlowModeArgs { + /** Previous slow mode value */ + prevValue: int; + /** New slow mode value */ + newValue: int; + } + + /** + * Slow mode setting for supergroups was changed
+ * @link https://corefork.telegram.org/method/channels.toggleSlowMode + */ + export class ChannelAdminLogEventActionToggleSlowMode extends VirtualClass implements ChannelAdminLogEventActionToggleSlowModeArgs { + CONSTRUCTOR_id: 1401984889; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionToggleSlowMode"; + prevValue: int; + newValue: int; + fromReader(reader: Reader): ChannelAdminLogEventActionToggleSlowMode; + } + + export interface ChannelAdminLogEventActionStartGroupCallArgs { + /** Group call */ + call: TypeInputGroupCall; + } + + /** A group call was started
*/ + export class ChannelAdminLogEventActionStartGroupCall extends VirtualClass implements ChannelAdminLogEventActionStartGroupCallArgs { + CONSTRUCTOR_id: 589338437; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionStartGroupCall"; + call: TypeInputGroupCall; + fromReader(reader: Reader): ChannelAdminLogEventActionStartGroupCall; + } + + export interface ChannelAdminLogEventActionDiscardGroupCallArgs { + /** The group call that was terminated */ + call: TypeInputGroupCall; + } + + /** A group call was terminated
*/ + export class ChannelAdminLogEventActionDiscardGroupCall extends VirtualClass implements ChannelAdminLogEventActionDiscardGroupCallArgs { + CONSTRUCTOR_id: -610299584; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionDiscardGroupCall"; + call: TypeInputGroupCall; + fromReader(reader: Reader): ChannelAdminLogEventActionDiscardGroupCall; + } + + export interface ChannelAdminLogEventActionParticipantMuteArgs { + /** The participant that was muted */ + participant: TypeGroupCallParticipant; + } + + /** A group call participant was muted
*/ + export class ChannelAdminLogEventActionParticipantMute extends VirtualClass implements ChannelAdminLogEventActionParticipantMuteArgs { + CONSTRUCTOR_id: -115071790; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionParticipantMute"; + participant: TypeGroupCallParticipant; + fromReader(reader: Reader): ChannelAdminLogEventActionParticipantMute; + } + + export interface ChannelAdminLogEventActionParticipantUnmuteArgs { + /** The participant that was unmuted */ + participant: TypeGroupCallParticipant; + } + + /** A group call participant was unmuted
*/ + export class ChannelAdminLogEventActionParticipantUnmute extends VirtualClass implements ChannelAdminLogEventActionParticipantUnmuteArgs { + CONSTRUCTOR_id: -431740480; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionParticipantUnmute"; + participant: TypeGroupCallParticipant; + fromReader(reader: Reader): ChannelAdminLogEventActionParticipantUnmute; + } + + export interface ChannelAdminLogEventActionToggleGroupCallSettingArgs { + /** Whether all users are muted by default upon joining */ + joinMuted: Bool; + } + + /** Group call settings were changed
*/ + export class ChannelAdminLogEventActionToggleGroupCallSetting extends VirtualClass implements ChannelAdminLogEventActionToggleGroupCallSettingArgs { + CONSTRUCTOR_id: 1456906823; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionToggleGroupCallSetting"; + joinMuted: Bool; + fromReader(reader: Reader): ChannelAdminLogEventActionToggleGroupCallSetting; + } + + export interface ChannelAdminLogEventActionParticipantJoinByInviteArgs { + /** The invite link used to join the supergroup/channel */ + invite: TypeExportedChatInvite; + } + + /** + * A user joined the supergroup/channel using a specific invite link
+ * @link https://corefork.telegram.org/api/channel + */ + export class ChannelAdminLogEventActionParticipantJoinByInvite extends VirtualClass implements ChannelAdminLogEventActionParticipantJoinByInviteArgs { + CONSTRUCTOR_id: 1557846647; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionParticipantJoinByInvite"; + invite: TypeExportedChatInvite; + fromReader(reader: Reader): ChannelAdminLogEventActionParticipantJoinByInvite; + } + + export interface ChannelAdminLogEventActionExportedInviteDeleteArgs { + /** The deleted chat invite */ + invite: TypeExportedChatInvite; + } + + /** A chat invite was deleted
*/ + export class ChannelAdminLogEventActionExportedInviteDelete extends VirtualClass implements ChannelAdminLogEventActionExportedInviteDeleteArgs { + CONSTRUCTOR_id: 1515256996; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionExportedInviteDelete"; + invite: TypeExportedChatInvite; + fromReader(reader: Reader): ChannelAdminLogEventActionExportedInviteDelete; + } + + export interface ChannelAdminLogEventActionExportedInviteRevokeArgs { + /** The invite link that was revoked */ + invite: TypeExportedChatInvite; + } + + /** A specific invite link was revoked
*/ + export class ChannelAdminLogEventActionExportedInviteRevoke extends VirtualClass implements ChannelAdminLogEventActionExportedInviteRevokeArgs { + CONSTRUCTOR_id: 1091179342; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionExportedInviteRevoke"; + invite: TypeExportedChatInvite; + fromReader(reader: Reader): ChannelAdminLogEventActionExportedInviteRevoke; + } + + export interface ChannelAdminLogEventActionExportedInviteEditArgs { + /** Previous chat invite information */ + prevInvite: TypeExportedChatInvite; + /** New chat invite information */ + newInvite: TypeExportedChatInvite; + } + + /** A chat invite was edited
*/ + export class ChannelAdminLogEventActionExportedInviteEdit extends VirtualClass implements ChannelAdminLogEventActionExportedInviteEditArgs { + CONSTRUCTOR_id: -384910503; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionExportedInviteEdit"; + prevInvite: TypeExportedChatInvite; + newInvite: TypeExportedChatInvite; + fromReader(reader: Reader): ChannelAdminLogEventActionExportedInviteEdit; + } + + export interface ChannelAdminLogEventActionParticipantVolumeArgs { + /** The participant whose volume was changed */ + participant: TypeGroupCallParticipant; + } + + /** channelAdminLogEvent.user_id has set the volume of participant.peer to participant.volume
*/ + export class ChannelAdminLogEventActionParticipantVolume extends VirtualClass implements ChannelAdminLogEventActionParticipantVolumeArgs { + CONSTRUCTOR_id: 1048537159; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionParticipantVolume"; + participant: TypeGroupCallParticipant; + fromReader(reader: Reader): ChannelAdminLogEventActionParticipantVolume; + } + + export interface ChannelAdminLogEventActionChangeHistoryTTLArgs { + /** Previous value */ + prevValue: int; + /** New value */ + newValue: int; + } + + /** The Time-To-Live of messages in this chat was changed
*/ + export class ChannelAdminLogEventActionChangeHistoryTTL extends VirtualClass implements ChannelAdminLogEventActionChangeHistoryTTLArgs { + CONSTRUCTOR_id: 1855199800; + SUBCLASS_OF_ID: 2998503411; + classType: "constructor"; + className: "ChannelAdminLogEventActionChangeHistoryTTL"; + prevValue: int; + newValue: int; + fromReader(reader: Reader): ChannelAdminLogEventActionChangeHistoryTTL; + } + + export interface ChannelAdminLogEventArgs { + /** Event ID */ + id: long; + /** Date */ + date: int; + /** User ID */ + userId: int; + /** Action */ + action: TypeChannelAdminLogEventAction; + } + + /** Admin log event
*/ + export class ChannelAdminLogEvent extends VirtualClass implements ChannelAdminLogEventArgs { + CONSTRUCTOR_id: 995769920; + SUBCLASS_OF_ID: 1083115929; + classType: "constructor"; + className: "ChannelAdminLogEvent"; + id: long; + date: int; + userId: int; + action: TypeChannelAdminLogEventAction; + fromReader(reader: Reader): ChannelAdminLogEvent; + } + + export interface ChannelAdminLogEventsFilterArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Join events */ + join?: true; + /** Leave events */ + leave?: true; + /** Invite events */ + invite?: true; + /** Ban events */ + ban?: true; + /** Unban events */ + unban?: true; + /** Kick events */ + kick?: true; + /** Unkick events */ + unkick?: true; + /** Admin promotion events */ + promote?: true; + /** Admin demotion events */ + demote?: true; + /** Info change events (when about, linked chat, location, photo, stickerset, title or username data of a channel gets modified) */ + info?: true; + /** Settings change events (invites, hidden prehistory, signatures, default banned rights) */ + settings?: true; + /** Message pin events */ + pinned?: true; + /** Message edit events */ + edit?: true; + /** Message deletion events */ + delete?: true; + /** Group call events */ + groupCall?: true; + /** Invite events */ + invites?: true; + } + + /** + * Filter only certain admin log events
+ * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionParticipantJoin + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionParticipantLeave + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionParticipantInvite + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionParticipantToggleBan + * @link https://corefork.telegram.org/api/rights + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionParticipantToggleAdmin + * @link https://corefork.telegram.org/api/rights + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionChangeAbout + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionChangeLinkedChat + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionChangeLocation + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionChangePhoto + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionChangeStickerSet + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionChangeTitle + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionChangeUsername + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionToggleInvites + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionTogglePreHistoryHidden + * @link https://corefork.telegram.org/method/channels.togglePreHistoryHidden + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionToggleSignatures + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionDefaultBannedRights + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionUpdatePinned + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionEditMessage + * @link https://corefork.telegram.org/constructor/channelAdminLogEventActionDeleteMessage + */ + export class ChannelAdminLogEventsFilter extends VirtualClass implements ChannelAdminLogEventsFilterArgs { + CONSTRUCTOR_id: -368018716; + SUBCLASS_OF_ID: 2092692249; + classType: "constructor"; + className: "ChannelAdminLogEventsFilter"; + flags: number; + join?: true; + leave?: true; + invite?: true; + ban?: true; + unban?: true; + kick?: true; + unkick?: true; + promote?: true; + demote?: true; + info?: true; + settings?: true; + pinned?: true; + edit?: true; + delete?: true; + groupCall?: true; + invites?: true; + fromReader(reader: Reader): ChannelAdminLogEventsFilter; + } + + export interface PopularContactArgs { + /** Contact identifier */ + clientId: long; + /** How many people imported this contact */ + importers: int; + } + + /** Popular contact
*/ + export class PopularContact extends VirtualClass implements PopularContactArgs { + CONSTRUCTOR_id: 1558266229; + SUBCLASS_OF_ID: 67708250; + classType: "constructor"; + className: "PopularContact"; + clientId: long; + importers: int; + fromReader(reader: Reader): PopularContact; + } + + export interface RecentMeUrlUnknownArgs { + /** URL */ + url: string; + } + + /** Unknown t.me url
*/ + export class RecentMeUrlUnknown extends VirtualClass implements RecentMeUrlUnknownArgs { + CONSTRUCTOR_id: 1189204285; + SUBCLASS_OF_ID: 1436889209; + classType: "constructor"; + className: "RecentMeUrlUnknown"; + url: string; + fromReader(reader: Reader): RecentMeUrlUnknown; + } + + export interface RecentMeUrlUserArgs { + /** URL */ + url: string; + /** User ID */ + userId: int; + } + + /** Recent t.me link to a user
*/ + export class RecentMeUrlUser extends VirtualClass implements RecentMeUrlUserArgs { + CONSTRUCTOR_id: -1917045962; + SUBCLASS_OF_ID: 1436889209; + classType: "constructor"; + className: "RecentMeUrlUser"; + url: string; + userId: int; + fromReader(reader: Reader): RecentMeUrlUser; + } + + export interface RecentMeUrlChatArgs { + /** t.me URL */ + url: string; + /** Chat ID */ + chatId: int; + } + + /** Recent t.me link to a chat
*/ + export class RecentMeUrlChat extends VirtualClass implements RecentMeUrlChatArgs { + CONSTRUCTOR_id: -1608834311; + SUBCLASS_OF_ID: 1436889209; + classType: "constructor"; + className: "RecentMeUrlChat"; + url: string; + chatId: int; + fromReader(reader: Reader): RecentMeUrlChat; + } + + export interface RecentMeUrlChatInviteArgs { + /** t.me URL */ + url: string; + /** Chat invitation */ + chatInvite: TypeChatInvite; + } + + /** Recent t.me invite link to a chat
*/ + export class RecentMeUrlChatInvite extends VirtualClass implements RecentMeUrlChatInviteArgs { + CONSTRUCTOR_id: -347535331; + SUBCLASS_OF_ID: 1436889209; + classType: "constructor"; + className: "RecentMeUrlChatInvite"; + url: string; + chatInvite: TypeChatInvite; + fromReader(reader: Reader): RecentMeUrlChatInvite; + } + + export interface RecentMeUrlStickerSetArgs { + /** t.me URL */ + url: string; + /** Stickerset */ + set: TypeStickerSetCovered; + } + + /** Recent t.me stickerset installation URL
*/ + export class RecentMeUrlStickerSet extends VirtualClass implements RecentMeUrlStickerSetArgs { + CONSTRUCTOR_id: -1140172836; + SUBCLASS_OF_ID: 1436889209; + classType: "constructor"; + className: "RecentMeUrlStickerSet"; + url: string; + set: TypeStickerSetCovered; + fromReader(reader: Reader): RecentMeUrlStickerSet; + } + + export interface InputSingleMediaArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The media */ + media: TypeInputMedia; + /** Unique client media ID required to prevent message resending */ + randomId: long; + /** A caption for the media */ + message: string; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + } + + /** + * A single media in an album or grouped media sent with messages.sendMultiMedia.
+ * @link https://corefork.telegram.org/api/entities + * @link https://corefork.telegram.org/api/files + * @link https://corefork.telegram.org/method/messages.sendMultiMedia + */ + export class InputSingleMedia extends VirtualClass implements InputSingleMediaArgs { + CONSTRUCTOR_id: 482797855; + SUBCLASS_OF_ID: 566922968; + classType: "constructor"; + className: "InputSingleMedia"; + flags: number; + media: TypeInputMedia; + randomId: long; + message: string; + entities?: TypeMessageEntity[]; + fromReader(reader: Reader): InputSingleMedia; + } + + export interface WebAuthorizationArgs { + /** Authorization hash */ + hash: long; + /** Bot ID */ + botId: int; + /** The domain name of the website on which the user has logged in. */ + domain: string; + /** Browser user-agent */ + browser: string; + /** Platform */ + platform: string; + /** When was the web session created */ + dateCreated: int; + /** When was the web session last active */ + dateActive: int; + /** IP address */ + ip: string; + /** Region, determined from IP address */ + region: string; + } + + /** + * Represents a bot logged in using the Telegram login widget
+ * @link https://corefork.telegram.org/widgets/login + */ + export class WebAuthorization extends VirtualClass implements WebAuthorizationArgs { + CONSTRUCTOR_id: -892779534; + SUBCLASS_OF_ID: 58084656; + classType: "constructor"; + className: "WebAuthorization"; + hash: long; + botId: int; + domain: string; + browser: string; + platform: string; + dateCreated: int; + dateActive: int; + ip: string; + region: string; + fromReader(reader: Reader): WebAuthorization; + } + + export interface InputMessageIDArgs { + /** Message ID */ + id: int; + } + + /** Message by ID
*/ + export class InputMessageID extends VirtualClass implements InputMessageIDArgs { + CONSTRUCTOR_id: -1502174430; + SUBCLASS_OF_ID: 1421262021; + classType: "constructor"; + className: "InputMessageID"; + id: int; + fromReader(reader: Reader): InputMessageID; + } + + export interface InputMessageReplyToArgs { + /** ID of the message that replies to the message we need */ + id: int; + } + + /** Message to which the specified message replies to
*/ + export class InputMessageReplyTo extends VirtualClass implements InputMessageReplyToArgs { + CONSTRUCTOR_id: -1160215659; + SUBCLASS_OF_ID: 1421262021; + classType: "constructor"; + className: "InputMessageReplyTo"; + id: int; + fromReader(reader: Reader): InputMessageReplyTo; + } + + /** Pinned message
*/ + export class InputMessagePinned extends VirtualClass { + CONSTRUCTOR_id: -2037963464; + SUBCLASS_OF_ID: 1421262021; + classType: "constructor"; + className: "InputMessagePinned"; + fromReader(reader: Reader): InputMessagePinned; + } + + export interface InputMessageCallbackQueryArgs { + /** Message ID */ + id: int; + /** Callback query ID */ + queryId: long; + } + + /** Used by bots for fetching information about the message that originated a callback query
*/ + export class InputMessageCallbackQuery extends VirtualClass implements InputMessageCallbackQueryArgs { + CONSTRUCTOR_id: -1392895362; + SUBCLASS_OF_ID: 1421262021; + classType: "constructor"; + className: "InputMessageCallbackQuery"; + id: int; + queryId: long; + fromReader(reader: Reader): InputMessageCallbackQuery; + } + + export interface InputDialogPeerArgs { + /** Peer */ + peer: TypeInputPeer; + } + + /** A peer
*/ + export class InputDialogPeer extends VirtualClass implements InputDialogPeerArgs { + CONSTRUCTOR_id: -55902537; + SUBCLASS_OF_ID: 2719782805; + classType: "constructor"; + className: "InputDialogPeer"; + peer: TypeInputPeer; + fromReader(reader: Reader): InputDialogPeer; + } + + export interface InputDialogPeerFolderArgs { + /** Peer folder ID, for more info click here */ + folderId: int; + } + + /** + * All peers in a peer folder
+ * @link https://corefork.telegram.org/api/folders + */ + export class InputDialogPeerFolder extends VirtualClass implements InputDialogPeerFolderArgs { + CONSTRUCTOR_id: 1684014375; + SUBCLASS_OF_ID: 2719782805; + classType: "constructor"; + className: "InputDialogPeerFolder"; + folderId: int; + fromReader(reader: Reader): InputDialogPeerFolder; + } + + export interface DialogPeerArgs { + /** Peer */ + peer: TypePeer; + } + + /** Peer
*/ + export class DialogPeer extends VirtualClass implements DialogPeerArgs { + CONSTRUCTOR_id: -445792507; + SUBCLASS_OF_ID: 627892654; + classType: "constructor"; + className: "DialogPeer"; + peer: TypePeer; + fromReader(reader: Reader): DialogPeer; + } + + export interface DialogPeerFolderArgs { + /** Peer folder ID, for more info click here */ + folderId: int; + } + + /** + * Peer folder
+ * @link https://corefork.telegram.org/api/folders + */ + export class DialogPeerFolder extends VirtualClass implements DialogPeerFolderArgs { + CONSTRUCTOR_id: 1363483106; + SUBCLASS_OF_ID: 627892654; + classType: "constructor"; + className: "DialogPeerFolder"; + folderId: int; + fromReader(reader: Reader): DialogPeerFolder; + } + + export interface FileHashArgs { + /** Offset from where to start computing SHA-256 hash */ + offset: int; + /** Length */ + limit: int; + /** SHA-256 Hash of file chunk, to be checked for validity after download */ + hash: bytes; + } + + /** SHA256 Hash of an uploaded file, to be checked for validity after download
*/ + export class FileHash extends VirtualClass implements FileHashArgs { + CONSTRUCTOR_id: 1648543603; + SUBCLASS_OF_ID: 3939776691; + classType: "constructor"; + className: "FileHash"; + offset: int; + limit: int; + hash: bytes; + fromReader(reader: Reader): FileHash; + } + + export interface InputClientProxyArgs { + /** Proxy address */ + address: string; + /** Proxy port */ + port: int; + } + + /** + * Info about an MTProxy used to connect.
+ * @link https://corefork.telegram.org/mtproto/mtproto-transports + */ + export class InputClientProxy extends VirtualClass implements InputClientProxyArgs { + CONSTRUCTOR_id: 1968737087; + SUBCLASS_OF_ID: 152716102; + classType: "constructor"; + className: "InputClientProxy"; + address: string; + port: int; + fromReader(reader: Reader): InputClientProxy; + } + + export interface InputSecureFileUploadedArgs { + /** Secure file ID */ + id: long; + /** Secure file part count */ + parts: int; + /** MD5 hash of encrypted uploaded file, to be checked server-side */ + md5Checksum: string; + /** File hash */ + fileHash: bytes; + /** Secret */ + secret: bytes; + } + + /** + * Uploaded secure file, for more info see the passport docs »
+ * @link https://corefork.telegram.org/passport/encryption + */ + export class InputSecureFileUploaded extends VirtualClass implements InputSecureFileUploadedArgs { + CONSTRUCTOR_id: 859091184; + SUBCLASS_OF_ID: 3670584828; + classType: "constructor"; + className: "InputSecureFileUploaded"; + id: long; + parts: int; + md5Checksum: string; + fileHash: bytes; + secret: bytes; + fromReader(reader: Reader): InputSecureFileUploaded; + } + + export interface InputSecureFileArgs { + /** Secure file ID */ + id: long; + /** Secure file access hash */ + accessHash: long; + } + + /** + * Preuploaded passport file, for more info see the passport docs »
+ * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport/encryption + */ + export class InputSecureFile extends VirtualClass implements InputSecureFileArgs { + CONSTRUCTOR_id: 1399317950; + SUBCLASS_OF_ID: 3670584828; + classType: "constructor"; + className: "InputSecureFile"; + id: long; + accessHash: long; + fromReader(reader: Reader): InputSecureFile; + } + + /** Empty constructor
*/ + export class SecureFileEmpty extends VirtualClass { + CONSTRUCTOR_id: 1679398724; + SUBCLASS_OF_ID: 1572395975; + classType: "constructor"; + className: "SecureFileEmpty"; + fromReader(reader: Reader): SecureFileEmpty; + } + + export interface SecureFileArgs { + /** ID */ + id: long; + /** Access hash */ + accessHash: long; + /** File size */ + size: int; + /** DC ID */ + dcId: int; + /** Date of upload */ + date: int; + /** File hash */ + fileHash: bytes; + /** Secret */ + secret: bytes; + } + + /** + * Secure passport file, for more info see the passport docs »
+ * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport/encryption + */ + export class SecureFile extends VirtualClass implements SecureFileArgs { + CONSTRUCTOR_id: -534283678; + SUBCLASS_OF_ID: 1572395975; + classType: "constructor"; + className: "SecureFile"; + id: long; + accessHash: long; + size: int; + dcId: int; + date: int; + fileHash: bytes; + secret: bytes; + fromReader(reader: Reader): SecureFile; + } + + export interface SecureDataArgs { + /** Data */ + data: bytes; + /** Data hash */ + dataHash: bytes; + /** Secret */ + secret: bytes; + } + + /** + * Secure passport data, for more info see the passport docs »
+ * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport/encryption + */ + export class SecureData extends VirtualClass implements SecureDataArgs { + CONSTRUCTOR_id: -1964327229; + SUBCLASS_OF_ID: 2094276276; + classType: "constructor"; + className: "SecureData"; + data: bytes; + dataHash: bytes; + secret: bytes; + fromReader(reader: Reader): SecureData; + } + + export interface SecurePlainPhoneArgs { + /** Phone number */ + phone: string; + } + + /** + * Phone number to use in telegram passport: it must be verified, first ».
+ * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport/encryption + */ + export class SecurePlainPhone extends VirtualClass implements SecurePlainPhoneArgs { + CONSTRUCTOR_id: 2103482845; + SUBCLASS_OF_ID: 598912950; + classType: "constructor"; + className: "SecurePlainPhone"; + phone: string; + fromReader(reader: Reader): SecurePlainPhone; + } + + export interface SecurePlainEmailArgs { + /** Email address */ + email: string; + } + + /** + * Email address to use in telegram passport: it must be verified, first ».
+ * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport/encryption + */ + export class SecurePlainEmail extends VirtualClass implements SecurePlainEmailArgs { + CONSTRUCTOR_id: 569137759; + SUBCLASS_OF_ID: 598912950; + classType: "constructor"; + className: "SecurePlainEmail"; + email: string; + fromReader(reader: Reader): SecurePlainEmail; + } + + /** Personal details
*/ + export class SecureValueTypePersonalDetails extends VirtualClass { + CONSTRUCTOR_id: -1658158621; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypePersonalDetails"; + fromReader(reader: Reader): SecureValueTypePersonalDetails; + } + + /** Passport
*/ + export class SecureValueTypePassport extends VirtualClass { + CONSTRUCTOR_id: 1034709504; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypePassport"; + fromReader(reader: Reader): SecureValueTypePassport; + } + + /** Driver's license
*/ + export class SecureValueTypeDriverLicense extends VirtualClass { + CONSTRUCTOR_id: 115615172; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypeDriverLicense"; + fromReader(reader: Reader): SecureValueTypeDriverLicense; + } + + /** Identity card
*/ + export class SecureValueTypeIdentityCard extends VirtualClass { + CONSTRUCTOR_id: -1596951477; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypeIdentityCard"; + fromReader(reader: Reader): SecureValueTypeIdentityCard; + } + + /** + * Internal passport
+ * @link https://corefork.telegram.org/passport + */ + export class SecureValueTypeInternalPassport extends VirtualClass { + CONSTRUCTOR_id: -1717268701; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypeInternalPassport"; + fromReader(reader: Reader): SecureValueTypeInternalPassport; + } + + /** Address
*/ + export class SecureValueTypeAddress extends VirtualClass { + CONSTRUCTOR_id: -874308058; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypeAddress"; + fromReader(reader: Reader): SecureValueTypeAddress; + } + + /** Utility bill
*/ + export class SecureValueTypeUtilityBill extends VirtualClass { + CONSTRUCTOR_id: -63531698; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypeUtilityBill"; + fromReader(reader: Reader): SecureValueTypeUtilityBill; + } + + /** Bank statement
*/ + export class SecureValueTypeBankStatement extends VirtualClass { + CONSTRUCTOR_id: -1995211763; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypeBankStatement"; + fromReader(reader: Reader): SecureValueTypeBankStatement; + } + + /** Rental agreement
*/ + export class SecureValueTypeRentalAgreement extends VirtualClass { + CONSTRUCTOR_id: -1954007928; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypeRentalAgreement"; + fromReader(reader: Reader): SecureValueTypeRentalAgreement; + } + + /** + * Internal registration passport
+ * @link https://corefork.telegram.org/passport + */ + export class SecureValueTypePassportRegistration extends VirtualClass { + CONSTRUCTOR_id: -1713143702; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypePassportRegistration"; + fromReader(reader: Reader): SecureValueTypePassportRegistration; + } + + /** Temporary registration
*/ + export class SecureValueTypeTemporaryRegistration extends VirtualClass { + CONSTRUCTOR_id: -368907213; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypeTemporaryRegistration"; + fromReader(reader: Reader): SecureValueTypeTemporaryRegistration; + } + + /** Phone
*/ + export class SecureValueTypePhone extends VirtualClass { + CONSTRUCTOR_id: -1289704741; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypePhone"; + fromReader(reader: Reader): SecureValueTypePhone; + } + + /** Email
*/ + export class SecureValueTypeEmail extends VirtualClass { + CONSTRUCTOR_id: -1908627474; + SUBCLASS_OF_ID: 2291398038; + classType: "constructor"; + className: "SecureValueTypeEmail"; + fromReader(reader: Reader): SecureValueTypeEmail; + } + + export interface SecureValueArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Secure passport value type */ + type: TypeSecureValueType; + /** Encrypted Telegram Passport element data */ + data?: TypeSecureData; + /** Encrypted passport file with the front side of the document */ + frontSide?: TypeSecureFile; + /** Encrypted passport file with the reverse side of the document */ + reverseSide?: TypeSecureFile; + /** Encrypted passport file with a selfie of the user holding the document */ + selfie?: TypeSecureFile; + /** Array of encrypted passport files with translated versions of the provided documents */ + translation?: TypeSecureFile[]; + /** Array of encrypted passport files with photos the of the documents */ + files?: TypeSecureFile[]; + /** Plaintext verified passport data */ + plainData?: TypeSecurePlainData; + /** Data hash */ + hash: bytes; + } + + /** + * Secure value
+ * @link https://corefork.telegram.org/passport + */ + export class SecureValue extends VirtualClass implements SecureValueArgs { + CONSTRUCTOR_id: 411017418; + SUBCLASS_OF_ID: 85014702; + classType: "constructor"; + className: "SecureValue"; + flags: number; + type: TypeSecureValueType; + data?: TypeSecureData; + frontSide?: TypeSecureFile; + reverseSide?: TypeSecureFile; + selfie?: TypeSecureFile; + translation?: TypeSecureFile[]; + files?: TypeSecureFile[]; + plainData?: TypeSecurePlainData; + hash: bytes; + fromReader(reader: Reader): SecureValue; + } + + export interface InputSecureValueArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Secure passport value type */ + type: TypeSecureValueType; + /** Encrypted Telegram Passport element data */ + data?: TypeSecureData; + /** Encrypted passport file with the front side of the document */ + frontSide?: TypeInputSecureFile; + /** Encrypted passport file with the reverse side of the document */ + reverseSide?: TypeInputSecureFile; + /** Encrypted passport file with a selfie of the user holding the document */ + selfie?: TypeInputSecureFile; + /** Array of encrypted passport files with translated versions of the provided documents */ + translation?: TypeInputSecureFile[]; + /** Array of encrypted passport files with photos the of the documents */ + files?: TypeInputSecureFile[]; + /** Plaintext verified passport data */ + plainData?: TypeSecurePlainData; + } + + /** + * Secure value, for more info see the passport docs »
+ * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport/encryption + */ + export class InputSecureValue extends VirtualClass implements InputSecureValueArgs { + CONSTRUCTOR_id: -618540889; + SUBCLASS_OF_ID: 3030229500; + classType: "constructor"; + className: "InputSecureValue"; + flags: number; + type: TypeSecureValueType; + data?: TypeSecureData; + frontSide?: TypeInputSecureFile; + reverseSide?: TypeInputSecureFile; + selfie?: TypeInputSecureFile; + translation?: TypeInputSecureFile[]; + files?: TypeInputSecureFile[]; + plainData?: TypeSecurePlainData; + fromReader(reader: Reader): InputSecureValue; + } + + export interface SecureValueHashArgs { + /** Secure value type */ + type: TypeSecureValueType; + /** Hash */ + hash: bytes; + } + + /** Secure value hash
*/ + export class SecureValueHash extends VirtualClass implements SecureValueHashArgs { + CONSTRUCTOR_id: -316748368; + SUBCLASS_OF_ID: 3589652487; + classType: "constructor"; + className: "SecureValueHash"; + type: TypeSecureValueType; + hash: bytes; + fromReader(reader: Reader): SecureValueHash; + } + + export interface SecureValueErrorDataArgs { + /** The section of the user's Telegram Passport which has the error, one of secureValueTypePersonalDetails, secureValueTypePassport, secureValueTypeDriverLicense, secureValueTypeIdentityCard, secureValueTypeInternalPassport, secureValueTypeAddress */ + type: TypeSecureValueType; + /** Data hash */ + dataHash: bytes; + /** Name of the data field which has the error */ + field: string; + /** Error message */ + text: string; + } + + /** + * Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.
+ * @link https://corefork.telegram.org/constructor/secureValueTypePersonalDetails + * @link https://corefork.telegram.org/constructor/secureValueTypePassport + * @link https://corefork.telegram.org/constructor/secureValueTypeDriverLicense + * @link https://corefork.telegram.org/constructor/secureValueTypeIdentityCard + * @link https://corefork.telegram.org/constructor/secureValueTypeInternalPassport + * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/constructor/secureValueTypeAddress + */ + export class SecureValueErrorData extends VirtualClass implements SecureValueErrorDataArgs { + CONSTRUCTOR_id: -391902247; + SUBCLASS_OF_ID: 101146574; + classType: "constructor"; + className: "SecureValueErrorData"; + type: TypeSecureValueType; + dataHash: bytes; + field: string; + text: string; + fromReader(reader: Reader): SecureValueErrorData; + } + + export interface SecureValueErrorFrontSideArgs { + /** One of secureValueTypePassport, secureValueTypeDriverLicense, secureValueTypeIdentityCard, secureValueTypeInternalPassport */ + type: TypeSecureValueType; + /** File hash */ + fileHash: bytes; + /** Error message */ + text: string; + } + + /** + * Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.
+ * @link https://corefork.telegram.org/constructor/secureValueTypePassport + * @link https://corefork.telegram.org/constructor/secureValueTypeDriverLicense + * @link https://corefork.telegram.org/constructor/secureValueTypeIdentityCard + * @link https://corefork.telegram.org/constructor/secureValueTypeInternalPassport + * @link https://corefork.telegram.org/passport + */ + export class SecureValueErrorFrontSide extends VirtualClass implements SecureValueErrorFrontSideArgs { + CONSTRUCTOR_id: -4309510; + SUBCLASS_OF_ID: 101146574; + classType: "constructor"; + className: "SecureValueErrorFrontSide"; + type: TypeSecureValueType; + fileHash: bytes; + text: string; + fromReader(reader: Reader): SecureValueErrorFrontSide; + } + + export interface SecureValueErrorReverseSideArgs { + /** One of secureValueTypeDriverLicense, secureValueTypeIdentityCard */ + type: TypeSecureValueType; + /** File hash */ + fileHash: bytes; + /** Error message */ + text: string; + } + + /** + * Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.
+ * @link https://corefork.telegram.org/constructor/secureValueTypeDriverLicense + * @link https://corefork.telegram.org/constructor/secureValueTypeIdentityCard + */ + export class SecureValueErrorReverseSide extends VirtualClass implements SecureValueErrorReverseSideArgs { + CONSTRUCTOR_id: -2037765467; + SUBCLASS_OF_ID: 101146574; + classType: "constructor"; + className: "SecureValueErrorReverseSide"; + type: TypeSecureValueType; + fileHash: bytes; + text: string; + fromReader(reader: Reader): SecureValueErrorReverseSide; + } + + export interface SecureValueErrorSelfieArgs { + /** One of secureValueTypePassport, secureValueTypeDriverLicense, secureValueTypeIdentityCard, secureValueTypeInternalPassport */ + type: TypeSecureValueType; + /** File hash */ + fileHash: bytes; + /** Error message */ + text: string; + } + + /** + * Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
+ * @link https://corefork.telegram.org/constructor/secureValueTypePassport + * @link https://corefork.telegram.org/constructor/secureValueTypeDriverLicense + * @link https://corefork.telegram.org/constructor/secureValueTypeIdentityCard + * @link https://corefork.telegram.org/constructor/secureValueTypeInternalPassport + * @link https://corefork.telegram.org/passport + */ + export class SecureValueErrorSelfie extends VirtualClass implements SecureValueErrorSelfieArgs { + CONSTRUCTOR_id: -449327402; + SUBCLASS_OF_ID: 101146574; + classType: "constructor"; + className: "SecureValueErrorSelfie"; + type: TypeSecureValueType; + fileHash: bytes; + text: string; + fromReader(reader: Reader): SecureValueErrorSelfie; + } + + export interface SecureValueErrorFileArgs { + /** One of secureValueTypeUtilityBill, secureValueTypeBankStatement, secureValueTypeRentalAgreement, secureValueTypePassportRegistration, secureValueTypeTemporaryRegistration */ + type: TypeSecureValueType; + /** File hash */ + fileHash: bytes; + /** Error message */ + text: string; + } + + /** + * Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
+ * @link https://corefork.telegram.org/constructor/secureValueTypeUtilityBill + * @link https://corefork.telegram.org/constructor/secureValueTypeBankStatement + * @link https://corefork.telegram.org/constructor/secureValueTypeRentalAgreement + * @link https://corefork.telegram.org/constructor/secureValueTypePassportRegistration + * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/constructor/secureValueTypeTemporaryRegistration + */ + export class SecureValueErrorFile extends VirtualClass implements SecureValueErrorFileArgs { + CONSTRUCTOR_id: 2054162547; + SUBCLASS_OF_ID: 101146574; + classType: "constructor"; + className: "SecureValueErrorFile"; + type: TypeSecureValueType; + fileHash: bytes; + text: string; + fromReader(reader: Reader): SecureValueErrorFile; + } + + export interface SecureValueErrorFilesArgs { + /** One of secureValueTypeUtilityBill, secureValueTypeBankStatement, secureValueTypeRentalAgreement, secureValueTypePassportRegistration, secureValueTypeTemporaryRegistration */ + type: TypeSecureValueType; + /** File hash */ + fileHash: bytes[]; + /** Error message */ + text: string; + } + + /** + * Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
+ * @link https://corefork.telegram.org/constructor/secureValueTypeUtilityBill + * @link https://corefork.telegram.org/constructor/secureValueTypeBankStatement + * @link https://corefork.telegram.org/constructor/secureValueTypeRentalAgreement + * @link https://corefork.telegram.org/constructor/secureValueTypePassportRegistration + * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/constructor/secureValueTypeTemporaryRegistration + */ + export class SecureValueErrorFiles extends VirtualClass implements SecureValueErrorFilesArgs { + CONSTRUCTOR_id: 1717706985; + SUBCLASS_OF_ID: 101146574; + classType: "constructor"; + className: "SecureValueErrorFiles"; + type: TypeSecureValueType; + fileHash: bytes[]; + text: string; + fromReader(reader: Reader): SecureValueErrorFiles; + } + + export interface SecureValueErrorArgs { + /** Type of element which has the issue */ + type: TypeSecureValueType; + /** Hash */ + hash: bytes; + /** Error message */ + text: string; + } + + /** Secure value error
*/ + export class SecureValueError extends VirtualClass implements SecureValueErrorArgs { + CONSTRUCTOR_id: -2036501105; + SUBCLASS_OF_ID: 101146574; + classType: "constructor"; + className: "SecureValueError"; + type: TypeSecureValueType; + hash: bytes; + text: string; + fromReader(reader: Reader): SecureValueError; + } + + export interface SecureValueErrorTranslationFileArgs { + /** One of secureValueTypePersonalDetails, secureValueTypePassport, secureValueTypeDriverLicense, secureValueTypeIdentityCard, secureValueTypeInternalPassport, secureValueTypeUtilityBill, secureValueTypeBankStatement, secureValueTypeRentalAgreement, secureValueTypePassportRegistration, secureValueTypeTemporaryRegistration */ + type: TypeSecureValueType; + /** File hash */ + fileHash: bytes; + /** Error message */ + text: string; + } + + /** + * Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
+ * @link https://corefork.telegram.org/constructor/secureValueTypePersonalDetails + * @link https://corefork.telegram.org/constructor/secureValueTypePassport + * @link https://corefork.telegram.org/constructor/secureValueTypeDriverLicense + * @link https://corefork.telegram.org/constructor/secureValueTypeIdentityCard + * @link https://corefork.telegram.org/constructor/secureValueTypeInternalPassport + * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/constructor/secureValueTypeUtilityBill + * @link https://corefork.telegram.org/constructor/secureValueTypeBankStatement + * @link https://corefork.telegram.org/constructor/secureValueTypeRentalAgreement + * @link https://corefork.telegram.org/constructor/secureValueTypePassportRegistration + * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/constructor/secureValueTypeTemporaryRegistration + */ + export class SecureValueErrorTranslationFile extends VirtualClass implements SecureValueErrorTranslationFileArgs { + CONSTRUCTOR_id: -1592506512; + SUBCLASS_OF_ID: 101146574; + classType: "constructor"; + className: "SecureValueErrorTranslationFile"; + type: TypeSecureValueType; + fileHash: bytes; + text: string; + fromReader(reader: Reader): SecureValueErrorTranslationFile; + } + + export interface SecureValueErrorTranslationFilesArgs { + /** One of secureValueTypePersonalDetails, secureValueTypePassport, secureValueTypeDriverLicense, secureValueTypeIdentityCard, secureValueTypeInternalPassport, secureValueTypeUtilityBill, secureValueTypeBankStatement, secureValueTypeRentalAgreement, secureValueTypePassportRegistration, secureValueTypeTemporaryRegistration */ + type: TypeSecureValueType; + /** Hash */ + fileHash: bytes[]; + /** Error message */ + text: string; + } + + /** + * Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation changes.
+ * @link https://corefork.telegram.org/constructor/secureValueTypePersonalDetails + * @link https://corefork.telegram.org/constructor/secureValueTypePassport + * @link https://corefork.telegram.org/constructor/secureValueTypeDriverLicense + * @link https://corefork.telegram.org/constructor/secureValueTypeIdentityCard + * @link https://corefork.telegram.org/constructor/secureValueTypeInternalPassport + * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/constructor/secureValueTypeUtilityBill + * @link https://corefork.telegram.org/constructor/secureValueTypeBankStatement + * @link https://corefork.telegram.org/constructor/secureValueTypeRentalAgreement + * @link https://corefork.telegram.org/constructor/secureValueTypePassportRegistration + * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/constructor/secureValueTypeTemporaryRegistration + */ + export class SecureValueErrorTranslationFiles extends VirtualClass implements SecureValueErrorTranslationFilesArgs { + CONSTRUCTOR_id: 878931416; + SUBCLASS_OF_ID: 101146574; + classType: "constructor"; + className: "SecureValueErrorTranslationFiles"; + type: TypeSecureValueType; + fileHash: bytes[]; + text: string; + fromReader(reader: Reader): SecureValueErrorTranslationFiles; + } + + export interface SecureCredentialsEncryptedArgs { + /** Encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication, as described in decrypting data » */ + data: bytes; + /** Data hash for data authentication as described in decrypting data » */ + hash: bytes; + /** Secret, encrypted with the bot's public RSA key, required for data decryption as described in decrypting data » */ + secret: bytes; + } + + /** + * Encrypted credentials required to decrypt telegram passport data.
+ * @link https://corefork.telegram.org/passport + */ + export class SecureCredentialsEncrypted extends VirtualClass implements SecureCredentialsEncryptedArgs { + CONSTRUCTOR_id: 871426631; + SUBCLASS_OF_ID: 2497476147; + classType: "constructor"; + className: "SecureCredentialsEncrypted"; + data: bytes; + hash: bytes; + secret: bytes; + fromReader(reader: Reader): SecureCredentialsEncrypted; + } + + export interface SavedPhoneContactArgs { + /** Phone number */ + phone: string; + /** First name */ + firstName: string; + /** Last name */ + lastName: string; + /** Date added */ + date: int; + } + + /** Saved contact
*/ + export class SavedPhoneContact extends VirtualClass implements SavedPhoneContactArgs { + CONSTRUCTOR_id: 289586518; + SUBCLASS_OF_ID: 115054788; + classType: "constructor"; + className: "SavedPhoneContact"; + phone: string; + firstName: string; + lastName: string; + date: int; + fromReader(reader: Reader): SavedPhoneContact; + } + + /** Unknown KDF (most likely, the client is outdated and does not support the specified KDF algorithm)
*/ + export class PasswordKdfAlgoUnknown extends VirtualClass { + CONSTRUCTOR_id: -732254058; + SUBCLASS_OF_ID: 935130572; + classType: "constructor"; + className: "PasswordKdfAlgoUnknown"; + fromReader(reader: Reader): PasswordKdfAlgoUnknown; + } + + export interface PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPowArgs { + /** One of two salts used by the derivation function (see SRP 2FA login) */ + salt1: bytes; + /** One of two salts used by the derivation function (see SRP 2FA login) */ + salt2: bytes; + /** Base (see SRP 2FA login) */ + g: int; + /** 2048-bit modulus (see SRP 2FA login) */ + p: bytes; + } + + /** + * This key derivation algorithm defines that SRP 2FA login must be used
+ * @link https://corefork.telegram.org/api/srp + */ + export class PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow extends VirtualClass implements PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPowArgs { + CONSTRUCTOR_id: 982592842; + SUBCLASS_OF_ID: 935130572; + classType: "constructor"; + className: "PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow"; + salt1: bytes; + salt2: bytes; + g: int; + p: bytes; + fromReader(reader: Reader): PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow; + } + + /** Unknown KDF algo (most likely the client has to be updated)
*/ + export class SecurePasswordKdfAlgoUnknown extends VirtualClass { + CONSTRUCTOR_id: 4883767; + SUBCLASS_OF_ID: 1998989635; + classType: "constructor"; + className: "SecurePasswordKdfAlgoUnknown"; + fromReader(reader: Reader): SecurePasswordKdfAlgoUnknown; + } + + export interface SecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000Args { + /** Salt */ + salt: bytes; + } + + /** PBKDF2 with SHA512 and 100000 iterations KDF algo
*/ + export class SecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000 extends VirtualClass implements SecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000Args { + CONSTRUCTOR_id: -1141711456; + SUBCLASS_OF_ID: 1998989635; + classType: "constructor"; + className: "SecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000"; + salt: bytes; + fromReader(reader: Reader): SecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000; + } + + export interface SecurePasswordKdfAlgoSHA512Args { + /** Salt */ + salt: bytes; + } + + /** SHA512 KDF algo
*/ + export class SecurePasswordKdfAlgoSHA512 extends VirtualClass implements SecurePasswordKdfAlgoSHA512Args { + CONSTRUCTOR_id: -2042159726; + SUBCLASS_OF_ID: 1998989635; + classType: "constructor"; + className: "SecurePasswordKdfAlgoSHA512"; + salt: bytes; + fromReader(reader: Reader): SecurePasswordKdfAlgoSHA512; + } + + export interface SecureSecretSettingsArgs { + /** Secure KDF algo */ + secureAlgo: TypeSecurePasswordKdfAlgo; + /** Secure secret */ + secureSecret: bytes; + /** Secret ID */ + secureSecretId: long; + } + + /** Secure settings
*/ + export class SecureSecretSettings extends VirtualClass implements SecureSecretSettingsArgs { + CONSTRUCTOR_id: 354925740; + SUBCLASS_OF_ID: 3334996731; + classType: "constructor"; + className: "SecureSecretSettings"; + secureAlgo: TypeSecurePasswordKdfAlgo; + secureSecret: bytes; + secureSecretId: long; + fromReader(reader: Reader): SecureSecretSettings; + } + + /** There is no password
*/ + export class InputCheckPasswordEmpty extends VirtualClass { + CONSTRUCTOR_id: -1736378792; + SUBCLASS_OF_ID: 3558536544; + classType: "constructor"; + className: "InputCheckPasswordEmpty"; + fromReader(reader: Reader): InputCheckPasswordEmpty; + } + + export interface InputCheckPasswordSRPArgs { + /** SRP ID */ + srpId: long; + /** A parameter (see SRP) */ + a: bytes; + /** M1 parameter (see SRP) */ + m1: bytes; + } + + /** + * Constructor for checking the validity of a 2FA SRP password (see SRP)
+ * @link https://corefork.telegram.org/api/srp + */ + export class InputCheckPasswordSRP extends VirtualClass implements InputCheckPasswordSRPArgs { + CONSTRUCTOR_id: -763367294; + SUBCLASS_OF_ID: 3558536544; + classType: "constructor"; + className: "InputCheckPasswordSRP"; + srpId: long; + a: bytes; + m1: bytes; + fromReader(reader: Reader): InputCheckPasswordSRP; + } + + export interface SecureRequiredTypeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Native names */ + nativeNames?: true; + /** Is a selfie required */ + selfieRequired?: true; + /** Is a translation required */ + translationRequired?: true; + /** Secure value type */ + type: TypeSecureValueType; + } + + /** Required type
*/ + export class SecureRequiredType extends VirtualClass implements SecureRequiredTypeArgs { + CONSTRUCTOR_id: -2103600678; + SUBCLASS_OF_ID: 2088452618; + classType: "constructor"; + className: "SecureRequiredType"; + flags: number; + nativeNames?: true; + selfieRequired?: true; + translationRequired?: true; + type: TypeSecureValueType; + fromReader(reader: Reader): SecureRequiredType; + } + + export interface SecureRequiredTypeOneOfArgs { + /** Secure required value types */ + types: TypeSecureRequiredType[]; + } + + /** One of
*/ + export class SecureRequiredTypeOneOf extends VirtualClass implements SecureRequiredTypeOneOfArgs { + CONSTRUCTOR_id: 41187252; + SUBCLASS_OF_ID: 2088452618; + classType: "constructor"; + className: "SecureRequiredTypeOneOf"; + types: TypeSecureRequiredType[]; + fromReader(reader: Reader): SecureRequiredTypeOneOf; + } + + export interface InputAppEventArgs { + /** Client's exact timestamp for the event */ + time: double; + /** Type of event */ + type: string; + /** Arbitrary numeric value for more convenient selection of certain event types, or events referring to a certain object */ + peer: long; + /** Details of the event */ + data: TypeJSONValue; + } + + /** Event that occured in the application.
*/ + export class InputAppEvent extends VirtualClass implements InputAppEventArgs { + CONSTRUCTOR_id: 488313413; + SUBCLASS_OF_ID: 2301763846; + classType: "constructor"; + className: "InputAppEvent"; + time: double; + type: string; + peer: long; + data: TypeJSONValue; + fromReader(reader: Reader): InputAppEvent; + } + + export interface JsonObjectValueArgs { + /** Key */ + key: string; + /** Value */ + value: TypeJSONValue; + } + + /** JSON key: value pair
*/ + export class JsonObjectValue extends VirtualClass implements JsonObjectValueArgs { + CONSTRUCTOR_id: -1059185703; + SUBCLASS_OF_ID: 2474626745; + classType: "constructor"; + className: "JsonObjectValue"; + key: string; + value: TypeJSONValue; + fromReader(reader: Reader): JsonObjectValue; + } + + /** null JSON value
*/ + export class JsonNull extends VirtualClass { + CONSTRUCTOR_id: 1064139624; + SUBCLASS_OF_ID: 3952707507; + classType: "constructor"; + className: "JsonNull"; + fromReader(reader: Reader): JsonNull; + } + + export interface JsonBoolArgs { + /** Value */ + value: Bool; + } + + /** JSON boolean value
*/ + export class JsonBool extends VirtualClass implements JsonBoolArgs { + CONSTRUCTOR_id: -952869270; + SUBCLASS_OF_ID: 3952707507; + classType: "constructor"; + className: "JsonBool"; + value: Bool; + fromReader(reader: Reader): JsonBool; + } + + export interface JsonNumberArgs { + /** Value */ + value: double; + } + + /** JSON numeric value
*/ + export class JsonNumber extends VirtualClass implements JsonNumberArgs { + CONSTRUCTOR_id: 736157604; + SUBCLASS_OF_ID: 3952707507; + classType: "constructor"; + className: "JsonNumber"; + value: double; + fromReader(reader: Reader): JsonNumber; + } + + export interface JsonStringArgs { + /** Value */ + value: string; + } + + /** JSON string
*/ + export class JsonString extends VirtualClass implements JsonStringArgs { + CONSTRUCTOR_id: -1222740358; + SUBCLASS_OF_ID: 3952707507; + classType: "constructor"; + className: "JsonString"; + value: string; + fromReader(reader: Reader): JsonString; + } + + export interface JsonArrayArgs { + /** JSON values */ + value: TypeJSONValue[]; + } + + /** JSON array
*/ + export class JsonArray extends VirtualClass implements JsonArrayArgs { + CONSTRUCTOR_id: -146520221; + SUBCLASS_OF_ID: 3952707507; + classType: "constructor"; + className: "JsonArray"; + value: TypeJSONValue[]; + fromReader(reader: Reader): JsonArray; + } + + export interface JsonObjectArgs { + /** Values */ + value: TypeJSONObjectValue[]; + } + + /** JSON object value
*/ + export class JsonObject extends VirtualClass implements JsonObjectArgs { + CONSTRUCTOR_id: -1715350371; + SUBCLASS_OF_ID: 3952707507; + classType: "constructor"; + className: "JsonObject"; + value: TypeJSONObjectValue[]; + fromReader(reader: Reader): JsonObject; + } + + export interface PageTableCellArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Is this element part of the column header */ + header?: true; + /** Horizontally centered block */ + alignCenter?: true; + /** Right-aligned block */ + alignRight?: true; + /** Vertically centered block */ + valignMiddle?: true; + /** Block vertically-alligned to the bottom */ + valignBottom?: true; + /** Content */ + text?: TypeRichText; + /** For how many columns should this cell extend */ + colspan?: int; + /** For how many rows should this cell extend */ + rowspan?: int; + } + + /** Table cell
*/ + export class PageTableCell extends VirtualClass implements PageTableCellArgs { + CONSTRUCTOR_id: 878078826; + SUBCLASS_OF_ID: 2968203348; + classType: "constructor"; + className: "PageTableCell"; + flags: number; + header?: true; + alignCenter?: true; + alignRight?: true; + valignMiddle?: true; + valignBottom?: true; + text?: TypeRichText; + colspan?: int; + rowspan?: int; + fromReader(reader: Reader): PageTableCell; + } + + export interface PageTableRowArgs { + /** Table cells */ + cells: TypePageTableCell[]; + } + + /** Table row
*/ + export class PageTableRow extends VirtualClass implements PageTableRowArgs { + CONSTRUCTOR_id: -524237339; + SUBCLASS_OF_ID: 1504505361; + classType: "constructor"; + className: "PageTableRow"; + cells: TypePageTableCell[]; + fromReader(reader: Reader): PageTableRow; + } + + export interface PageCaptionArgs { + /** Caption */ + text: TypeRichText; + /** Credits */ + credit: TypeRichText; + } + + /** Page caption
*/ + export class PageCaption extends VirtualClass implements PageCaptionArgs { + CONSTRUCTOR_id: 1869903447; + SUBCLASS_OF_ID: 699985587; + classType: "constructor"; + className: "PageCaption"; + text: TypeRichText; + credit: TypeRichText; + fromReader(reader: Reader): PageCaption; + } + + export interface PageListItemTextArgs { + /** Text */ + text: TypeRichText; + } + + /** List item
*/ + export class PageListItemText extends VirtualClass implements PageListItemTextArgs { + CONSTRUCTOR_id: -1188055347; + SUBCLASS_OF_ID: 2360261809; + classType: "constructor"; + className: "PageListItemText"; + text: TypeRichText; + fromReader(reader: Reader): PageListItemText; + } + + export interface PageListItemBlocksArgs { + /** Blocks */ + blocks: TypePageBlock[]; + } + + /** List item
*/ + export class PageListItemBlocks extends VirtualClass implements PageListItemBlocksArgs { + CONSTRUCTOR_id: 635466748; + SUBCLASS_OF_ID: 2360261809; + classType: "constructor"; + className: "PageListItemBlocks"; + blocks: TypePageBlock[]; + fromReader(reader: Reader): PageListItemBlocks; + } + + export interface PageListOrderedItemTextArgs { + /** Number of element within ordered list */ + num: string; + /** Text */ + text: TypeRichText; + } + + /** Ordered list of text items
*/ + export class PageListOrderedItemText extends VirtualClass implements PageListOrderedItemTextArgs { + CONSTRUCTOR_id: 1577484359; + SUBCLASS_OF_ID: 4007268024; + classType: "constructor"; + className: "PageListOrderedItemText"; + num: string; + text: TypeRichText; + fromReader(reader: Reader): PageListOrderedItemText; + } + + export interface PageListOrderedItemBlocksArgs { + /** Number of element within ordered list */ + num: string; + /** Item contents */ + blocks: TypePageBlock[]; + } + + /** Ordered list of IV blocks
*/ + export class PageListOrderedItemBlocks extends VirtualClass implements PageListOrderedItemBlocksArgs { + CONSTRUCTOR_id: -1730311882; + SUBCLASS_OF_ID: 4007268024; + classType: "constructor"; + className: "PageListOrderedItemBlocks"; + num: string; + blocks: TypePageBlock[]; + fromReader(reader: Reader): PageListOrderedItemBlocks; + } + + export interface PageRelatedArticleArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** URL of article */ + url: string; + /** Webpage ID of generated IV preview */ + webpageId: long; + /** Title */ + title?: string; + /** Description */ + description?: string; + /** ID of preview photo */ + photoId?: long; + /** Author name */ + author?: string; + /** Date of pubblication */ + publishedDate?: int; + } + + /** Related article
*/ + export class PageRelatedArticle extends VirtualClass implements PageRelatedArticleArgs { + CONSTRUCTOR_id: -1282352120; + SUBCLASS_OF_ID: 919623714; + classType: "constructor"; + className: "PageRelatedArticle"; + flags: number; + url: string; + webpageId: long; + title?: string; + description?: string; + photoId?: long; + author?: string; + publishedDate?: int; + fromReader(reader: Reader): PageRelatedArticle; + } + + export interface PageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Indicates that not full page preview is available to the client and it will need to fetch full Instant View from the server using messages.getWebPagePreview. */ + part?: true; + /** Whether the page contains RTL text */ + rtl?: true; + /** Whether this is an IV v2 page */ + v2?: true; + /** Original page HTTP URL */ + url: string; + /** Page elements (like with HTML elements, only as TL constructors) */ + blocks: TypePageBlock[]; + /** Photos in page */ + photos: TypePhoto[]; + /** Media in page */ + documents: TypeDocument[]; + /** Viewcount */ + views?: int; + } + + /** + * Instant view page
+ * @link https://corefork.telegram.org/method/messages.getWebPagePreview + */ + export class Page extends VirtualClass implements PageArgs { + CONSTRUCTOR_id: -1738178803; + SUBCLASS_OF_ID: 3023575326; + classType: "constructor"; + className: "Page"; + flags: number; + part?: true; + rtl?: true; + v2?: true; + url: string; + blocks: TypePageBlock[]; + photos: TypePhoto[]; + documents: TypeDocument[]; + views?: int; + fromReader(reader: Reader): Page; + } + + export interface PollAnswerArgs { + /** Textual representation of the answer */ + text: string; + /** The param that has to be passed to messages.sendVote. */ + option: bytes; + } + + /** + * A possible answer of a poll
+ * @link https://corefork.telegram.org/method/messages.sendVote + * @link https://corefork.telegram.org/constructor/poll + */ + export class PollAnswer extends VirtualClass implements PollAnswerArgs { + CONSTRUCTOR_id: 1823064809; + SUBCLASS_OF_ID: 2124799390; + classType: "constructor"; + className: "PollAnswer"; + text: string; + option: bytes; + fromReader(reader: Reader): PollAnswer; + } + + export interface PollArgs { + /** ID of the poll */ + id: long; + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the poll is closed and doesn't accept any more answers */ + closed?: true; + /** Whether cast votes are publicly visible to all users (non-anonymous poll) */ + publicVoters?: true; + /** Whether multiple options can be chosen as answer */ + multipleChoice?: true; + /** Whether this is a quiz (with wrong and correct answers, results shown in the return type) */ + quiz?: true; + /** The question of the poll */ + question: string; + /** The possible answers, vote using messages.sendVote. */ + answers: TypePollAnswer[]; + /** Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. */ + closePeriod?: int; + /** Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future; can't be used together with close_period. */ + closeDate?: int; + } + + /** + * Poll
+ * @link https://corefork.telegram.org/method/messages.sendVote + * @link https://corefork.telegram.org/constructor/poll + */ + export class Poll extends VirtualClass implements PollArgs { + CONSTRUCTOR_id: -2032041631; + SUBCLASS_OF_ID: 613307771; + classType: "constructor"; + className: "Poll"; + id: long; + flags: number; + closed?: true; + publicVoters?: true; + multipleChoice?: true; + quiz?: true; + question: string; + answers: TypePollAnswer[]; + closePeriod?: int; + closeDate?: int; + fromReader(reader: Reader): Poll; + } + + export interface PollAnswerVotersArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether we have chosen this answer */ + chosen?: true; + /** For quizes, whether the option we have chosen is correct */ + correct?: true; + /** The param that has to be passed to messages.sendVote. */ + option: bytes; + /** How many users voted for this option */ + voters: int; + } + + /** + * A poll answer, and how users voted on it
+ * @link https://corefork.telegram.org/method/messages.sendVote + * @link https://corefork.telegram.org/constructor/poll + */ + export class PollAnswerVoters extends VirtualClass implements PollAnswerVotersArgs { + CONSTRUCTOR_id: 997055186; + SUBCLASS_OF_ID: 2095107985; + classType: "constructor"; + className: "PollAnswerVoters"; + flags: number; + chosen?: true; + correct?: true; + option: bytes; + voters: int; + fromReader(reader: Reader): PollAnswerVoters; + } + + export interface PollResultsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Similar to min objects, used for poll constructors that are the same for all users so they don't have option chosen by the current user (you can use messages.getPollResults to get the full poll results). */ + min?: true; + /** Poll results */ + results?: TypePollAnswerVoters[]; + /** Total number of people that voted in the poll */ + totalVoters?: int; + /** IDs of the last users that recently voted in the poll */ + recentVoters?: int[]; + /** Explanation of quiz solution */ + solution?: string; + /** Message entities for styled text in quiz solution */ + solutionEntities?: TypeMessageEntity[]; + } + + /** + * Results of poll
+ * @link https://corefork.telegram.org/api/min + * @link https://corefork.telegram.org/method/messages.getPollResults + * @link https://corefork.telegram.org/api/entities + */ + export class PollResults extends VirtualClass implements PollResultsArgs { + CONSTRUCTOR_id: -1159937629; + SUBCLASS_OF_ID: 3283416711; + classType: "constructor"; + className: "PollResults"; + flags: number; + min?: true; + results?: TypePollAnswerVoters[]; + totalVoters?: int; + recentVoters?: int[]; + solution?: string; + solutionEntities?: TypeMessageEntity[]; + fromReader(reader: Reader): PollResults; + } + + export interface ChatOnlinesArgs { + /** Number of online users */ + onlines: int; + } + + /** Number of online users in a chat
*/ + export class ChatOnlines extends VirtualClass implements ChatOnlinesArgs { + CONSTRUCTOR_id: -264117680; + SUBCLASS_OF_ID: 2357301306; + classType: "constructor"; + className: "ChatOnlines"; + onlines: int; + fromReader(reader: Reader): ChatOnlines; + } + + export interface StatsURLArgs { + /** Chat statistics */ + url: string; + } + + /** URL with chat statistics
*/ + export class StatsURL extends VirtualClass implements StatsURLArgs { + CONSTRUCTOR_id: 1202287072; + SUBCLASS_OF_ID: 2370606272; + classType: "constructor"; + className: "StatsURL"; + url: string; + fromReader(reader: Reader): StatsURL; + } + + export interface ChatAdminRightsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, allows the admin to modify the description of the channel/supergroup */ + changeInfo?: true; + /** If set, allows the admin to post messages in the channel */ + postMessages?: true; + /** If set, allows the admin to also edit messages from other admins in the channel */ + editMessages?: true; + /** If set, allows the admin to also delete messages from other admins in the channel */ + deleteMessages?: true; + /** If set, allows the admin to ban users from the channel/supergroup */ + banUsers?: true; + /** If set, allows the admin to invite users in the channel/supergroup */ + inviteUsers?: true; + /** If set, allows the admin to pin messages in the channel/supergroup */ + pinMessages?: true; + /** If set, allows the admin to add other admins with the same (or more limited) permissions in the channel/supergroup */ + addAdmins?: true; + /** Whether this admin is anonymous */ + anonymous?: true; + /** If set, allows the admin to change group call/livestream settings */ + manageCall?: true; + /** Set this flag if none of the other flags are set, but you stil want the user to be an admin. */ + other?: true; + } + + /** + * Represents the rights of an admin in a channel/supergroup.
+ * @link https://corefork.telegram.org/api/channel + */ + export class ChatAdminRights extends VirtualClass implements ChatAdminRightsArgs { + CONSTRUCTOR_id: 1605510357; + SUBCLASS_OF_ID: 2252195780; + classType: "constructor"; + className: "ChatAdminRights"; + flags: number; + changeInfo?: true; + postMessages?: true; + editMessages?: true; + deleteMessages?: true; + banUsers?: true; + inviteUsers?: true; + pinMessages?: true; + addAdmins?: true; + anonymous?: true; + manageCall?: true; + other?: true; + fromReader(reader: Reader): ChatAdminRights; + } + + export interface ChatBannedRightsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, does not allow a user to view messages in a supergroup/channel/chat */ + viewMessages?: true; + /** If set, does not allow a user to send messages in a supergroup/chat */ + sendMessages?: true; + /** If set, does not allow a user to send any media in a supergroup/chat */ + sendMedia?: true; + /** If set, does not allow a user to send stickers in a supergroup/chat */ + sendStickers?: true; + /** If set, does not allow a user to send gifs in a supergroup/chat */ + sendGifs?: true; + /** If set, does not allow a user to send games in a supergroup/chat */ + sendGames?: true; + /** If set, does not allow a user to use inline bots in a supergroup/chat */ + sendInline?: true; + /** If set, does not allow a user to embed links in the messages of a supergroup/chat */ + embedLinks?: true; + /** If set, does not allow a user to send polls in a supergroup/chat */ + sendPolls?: true; + /** If set, does not allow any user to change the description of a supergroup/chat */ + changeInfo?: true; + /** If set, does not allow any user to invite users in a supergroup/chat */ + inviteUsers?: true; + /** If set, does not allow any user to pin messages in a supergroup/chat */ + pinMessages?: true; + /** Validity of said permissions (it is considered forever any value less then 30 seconds or more then 366 days). */ + untilDate: int; + } + + /** Represents the rights of a normal user in a supergroup/channel/chat. In this case, the flags are inverted: if set, a flag does not allow a user to do X.
*/ + export class ChatBannedRights extends VirtualClass implements ChatBannedRightsArgs { + CONSTRUCTOR_id: -1626209256; + SUBCLASS_OF_ID: 1263814057; + classType: "constructor"; + className: "ChatBannedRights"; + flags: number; + viewMessages?: true; + sendMessages?: true; + sendMedia?: true; + sendStickers?: true; + sendGifs?: true; + sendGames?: true; + sendInline?: true; + embedLinks?: true; + sendPolls?: true; + changeInfo?: true; + inviteUsers?: true; + pinMessages?: true; + untilDate: int; + fromReader(reader: Reader): ChatBannedRights; + } + + export interface InputWallPaperArgs { + /** Wallpaper ID */ + id: long; + /** Access hash */ + accessHash: long; + } + + /** Wallpaper
*/ + export class InputWallPaper extends VirtualClass implements InputWallPaperArgs { + CONSTRUCTOR_id: -433014407; + SUBCLASS_OF_ID: 4000784410; + classType: "constructor"; + className: "InputWallPaper"; + id: long; + accessHash: long; + fromReader(reader: Reader): InputWallPaper; + } + + export interface InputWallPaperSlugArgs { + /** Unique wallpaper ID */ + slug: string; + } + + /** Wallpaper by slug (a unique ID)
*/ + export class InputWallPaperSlug extends VirtualClass implements InputWallPaperSlugArgs { + CONSTRUCTOR_id: 1913199744; + SUBCLASS_OF_ID: 4000784410; + classType: "constructor"; + className: "InputWallPaperSlug"; + slug: string; + fromReader(reader: Reader): InputWallPaperSlug; + } + + export interface InputWallPaperNoFileArgs { + /** Wallpaper ID */ + id: long; + } + + /** + * Wallpaper with no file access hash, used for example when deleting (unsave=true) wallpapers using account.saveWallPaper, specifying just the wallpaper ID.
+ * @link https://corefork.telegram.org/method/account.saveWallPaper + */ + export class InputWallPaperNoFile extends VirtualClass implements InputWallPaperNoFileArgs { + CONSTRUCTOR_id: -1770371538; + SUBCLASS_OF_ID: 4000784410; + classType: "constructor"; + className: "InputWallPaperNoFile"; + id: long; + fromReader(reader: Reader): InputWallPaperNoFile; + } + + export interface CodeSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to allow phone verification via phone calls. */ + allowFlashcall?: true; + /** Pass true if the phone number is used on the current device. Ignored if allow_flashcall is not set. */ + currentNumber?: true; + /** If a token that will be included in eventually sent SMSs is required: required in newer versions of android, to use the android SMS receiver APIs */ + allowAppHash?: true; + } + + /** + * Settings used by telegram servers for sending the confirm code.
Example implementations: telegram for android, tdlib.
+ * @link https://corefork.telegram.org/api/auth + */ + export class CodeSettings extends VirtualClass implements CodeSettingsArgs { + CONSTRUCTOR_id: -557924733; + SUBCLASS_OF_ID: 1223539850; + classType: "constructor"; + className: "CodeSettings"; + flags: number; + allowFlashcall?: true; + currentNumber?: true; + allowAppHash?: true; + fromReader(reader: Reader): CodeSettings; + } + + export interface WallPaperSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12 */ + blur?: true; + /** If set, the background needs to be slightly moved when device is rotated */ + motion?: true; + /** If set, a PNG pattern is to be combined with the color chosen by the user: the main color of the background in RGB24 format */ + backgroundColor?: int; + /** If set, a PNG pattern is to be combined with the first and second background colors (RGB24 format) in a top-bottom gradient */ + secondBackgroundColor?: int; + /** If set, a PNG pattern is to be combined with the first, second and third background colors (RGB24 format) in a freeform gradient */ + thirdBackgroundColor?: int; + /** If set, a PNG pattern is to be combined with the first, second, third and fourth background colors (RGB24 format) in a freeform gradient */ + fourthBackgroundColor?: int; + /** Intensity of the pattern when it is shown above the main background color, 0-100 */ + intensity?: int; + /** Clockwise rotation angle of the gradient, in degrees; 0-359. Should be always divisible by 45 */ + rotation?: int; + } + + /** Wallpaper settings
*/ + export class WallPaperSettings extends VirtualClass implements WallPaperSettingsArgs { + CONSTRUCTOR_id: 499236004; + SUBCLASS_OF_ID: 1098244882; + classType: "constructor"; + className: "WallPaperSettings"; + flags: number; + blur?: true; + motion?: true; + backgroundColor?: int; + secondBackgroundColor?: int; + thirdBackgroundColor?: int; + fourthBackgroundColor?: int; + intensity?: int; + rotation?: int; + fromReader(reader: Reader): WallPaperSettings; + } + + export interface AutoDownloadSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Disable automatic media downloads? */ + disabled?: true; + /** Whether to preload the first seconds of videos larger than the specified limit */ + videoPreloadLarge?: true; + /** Whether to preload the next audio track when you're listening to music */ + audioPreloadNext?: true; + /** Whether to enable data saving mode in phone calls */ + phonecallsLessData?: true; + /** Maximum size of photos to preload */ + photoSizeMax: int; + /** Maximum size of videos to preload */ + videoSizeMax: int; + /** Maximum size of other files to preload */ + fileSizeMax: int; + /** Maximum suggested bitrate for uploading videos */ + videoUploadMaxbitrate: int; + } + + /** Autodownload settings
*/ + export class AutoDownloadSettings extends VirtualClass implements AutoDownloadSettingsArgs { + CONSTRUCTOR_id: -532532493; + SUBCLASS_OF_ID: 1361582535; + classType: "constructor"; + className: "AutoDownloadSettings"; + flags: number; + disabled?: true; + videoPreloadLarge?: true; + audioPreloadNext?: true; + phonecallsLessData?: true; + photoSizeMax: int; + videoSizeMax: int; + fileSizeMax: int; + videoUploadMaxbitrate: int; + fromReader(reader: Reader): AutoDownloadSettings; + } + + export interface EmojiKeywordArgs { + /** Keyword */ + keyword: string; + /** Emojis associated to keyword */ + emoticons: string[]; + } + + /** Emoji keyword
*/ + export class EmojiKeyword extends VirtualClass implements EmojiKeywordArgs { + CONSTRUCTOR_id: -709641735; + SUBCLASS_OF_ID: 1712497982; + classType: "constructor"; + className: "EmojiKeyword"; + keyword: string; + emoticons: string[]; + fromReader(reader: Reader): EmojiKeyword; + } + + export interface EmojiKeywordDeletedArgs { + /** Keyword */ + keyword: string; + /** Emojis that were associated to keyword */ + emoticons: string[]; + } + + /** Deleted emoji keyword
*/ + export class EmojiKeywordDeleted extends VirtualClass implements EmojiKeywordDeletedArgs { + CONSTRUCTOR_id: 594408994; + SUBCLASS_OF_ID: 1712497982; + classType: "constructor"; + className: "EmojiKeywordDeleted"; + keyword: string; + emoticons: string[]; + fromReader(reader: Reader): EmojiKeywordDeleted; + } + + export interface EmojiKeywordsDifferenceArgs { + /** Language code for keywords */ + langCode: string; + /** Previous emoji keyword list version */ + fromVersion: int; + /** Current version of emoji keyword list */ + version: int; + /** Emojis associated to keywords */ + keywords: TypeEmojiKeyword[]; + } + + /** Changes to emoji keywords
*/ + export class EmojiKeywordsDifference extends VirtualClass implements EmojiKeywordsDifferenceArgs { + CONSTRUCTOR_id: 1556570557; + SUBCLASS_OF_ID: 3531196018; + classType: "constructor"; + className: "EmojiKeywordsDifference"; + langCode: string; + fromVersion: int; + version: int; + keywords: TypeEmojiKeyword[]; + fromReader(reader: Reader): EmojiKeywordsDifference; + } + + export interface EmojiURLArgs { + /** An HTTP URL which can be used to automatically log in into translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation */ + url: string; + } + + /** An HTTP URL which can be used to automatically log in into translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation
*/ + export class EmojiURL extends VirtualClass implements EmojiURLArgs { + CONSTRUCTOR_id: -1519029347; + SUBCLASS_OF_ID: 530614809; + classType: "constructor"; + className: "EmojiURL"; + url: string; + fromReader(reader: Reader): EmojiURL; + } + + export interface EmojiLanguageArgs { + /** Language code */ + langCode: string; + } + + /** Emoji language
*/ + export class EmojiLanguage extends VirtualClass implements EmojiLanguageArgs { + CONSTRUCTOR_id: -1275374751; + SUBCLASS_OF_ID: 2760705262; + classType: "constructor"; + className: "EmojiLanguage"; + langCode: string; + fromReader(reader: Reader): EmojiLanguage; + } + + export interface FolderArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Automatically add new channels to this folder */ + autofillNewBroadcasts?: true; + /** Automatically add joined new public supergroups to this folder */ + autofillPublicGroups?: true; + /** Automatically add new private chats to this folder */ + autofillNewCorrespondents?: true; + /** Folder ID */ + id: int; + /** Folder title */ + title: string; + /** Folder picture */ + photo?: TypeChatPhoto; + } + + /** Folder
*/ + export class Folder extends VirtualClass implements FolderArgs { + CONSTRUCTOR_id: -11252123; + SUBCLASS_OF_ID: 3943566587; + classType: "constructor"; + className: "Folder"; + flags: number; + autofillNewBroadcasts?: true; + autofillPublicGroups?: true; + autofillNewCorrespondents?: true; + id: int; + title: string; + photo?: TypeChatPhoto; + fromReader(reader: Reader): Folder; + } + + export interface InputFolderPeerArgs { + /** Peer */ + peer: TypeInputPeer; + /** Peer folder ID, for more info click here */ + folderId: int; + } + + /** + * Peer in a folder
+ * @link https://corefork.telegram.org/api/folders + */ + export class InputFolderPeer extends VirtualClass implements InputFolderPeerArgs { + CONSTRUCTOR_id: -70073706; + SUBCLASS_OF_ID: 1954700800; + classType: "constructor"; + className: "InputFolderPeer"; + peer: TypeInputPeer; + folderId: int; + fromReader(reader: Reader): InputFolderPeer; + } + + export interface FolderPeerArgs { + /** Folder peer info */ + peer: TypePeer; + /** Peer folder ID, for more info click here */ + folderId: int; + } + + /** + * Peer in a folder
+ * @link https://corefork.telegram.org/api/folders + */ + export class FolderPeer extends VirtualClass implements FolderPeerArgs { + CONSTRUCTOR_id: -373643672; + SUBCLASS_OF_ID: 4092733499; + classType: "constructor"; + className: "FolderPeer"; + peer: TypePeer; + folderId: int; + fromReader(reader: Reader): FolderPeer; + } + + export interface UrlAuthResultRequestArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the bot would like to send messages to the user */ + requestWriteAccess?: true; + /** Username of a bot, which will be used for user authorization. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. */ + bot: TypeUser; + /** The domain name of the website on which the user will log in. */ + domain: string; + } + + /** + * Details about the authorization request, for more info click here »
+ * @link https://corefork.telegram.org/api/url-authorization + */ + export class UrlAuthResultRequest extends VirtualClass implements UrlAuthResultRequestArgs { + CONSTRUCTOR_id: -1831650802; + SUBCLASS_OF_ID: 2003159838; + classType: "constructor"; + className: "UrlAuthResultRequest"; + flags: number; + requestWriteAccess?: true; + bot: TypeUser; + domain: string; + fromReader(reader: Reader): UrlAuthResultRequest; + } + + export interface UrlAuthResultAcceptedArgs { + /** The URL name of the website on which the user has logged in. */ + url: string; + } + + /** + * Details about an accepted authorization request, for more info click here »
+ * @link https://corefork.telegram.org/api/url-authorization + */ + export class UrlAuthResultAccepted extends VirtualClass implements UrlAuthResultAcceptedArgs { + CONSTRUCTOR_id: -1886646706; + SUBCLASS_OF_ID: 2003159838; + classType: "constructor"; + className: "UrlAuthResultAccepted"; + url: string; + fromReader(reader: Reader): UrlAuthResultAccepted; + } + + /** + * Details about an accepted authorization request, for more info click here »
+ * @link https://corefork.telegram.org/api/url-authorization + */ + export class UrlAuthResultDefault extends VirtualClass { + CONSTRUCTOR_id: -1445536993; + SUBCLASS_OF_ID: 2003159838; + classType: "constructor"; + className: "UrlAuthResultDefault"; + fromReader(reader: Reader): UrlAuthResultDefault; + } + + /** No location (normal supergroup)
*/ + export class ChannelLocationEmpty extends VirtualClass { + CONSTRUCTOR_id: -1078612597; + SUBCLASS_OF_ID: 3961916287; + classType: "constructor"; + className: "ChannelLocationEmpty"; + fromReader(reader: Reader): ChannelLocationEmpty; + } + + export interface ChannelLocationArgs { + /** Geographical location of supergrup */ + geoPoint: TypeGeoPoint; + /** Textual description of the address */ + address: string; + } + + /** Geographical location of supergroup (geogroups)
*/ + export class ChannelLocation extends VirtualClass implements ChannelLocationArgs { + CONSTRUCTOR_id: 547062491; + SUBCLASS_OF_ID: 3961916287; + classType: "constructor"; + className: "ChannelLocation"; + geoPoint: TypeGeoPoint; + address: string; + fromReader(reader: Reader): ChannelLocation; + } + + export interface PeerLocatedArgs { + /** Peer */ + peer: TypePeer; + /** Validity period of current data */ + expires: int; + /** Distance from the peer in meters */ + distance: int; + } + + /** Peer geolocated nearby
*/ + export class PeerLocated extends VirtualClass implements PeerLocatedArgs { + CONSTRUCTOR_id: -901375139; + SUBCLASS_OF_ID: 4208604332; + classType: "constructor"; + className: "PeerLocated"; + peer: TypePeer; + expires: int; + distance: int; + fromReader(reader: Reader): PeerLocated; + } + + export interface PeerSelfLocatedArgs { + /** Expiry of geolocation info for current peer */ + expires: int; + } + + /** Current peer
*/ + export class PeerSelfLocated extends VirtualClass implements PeerSelfLocatedArgs { + CONSTRUCTOR_id: -118740917; + SUBCLASS_OF_ID: 4208604332; + classType: "constructor"; + className: "PeerSelfLocated"; + expires: int; + fromReader(reader: Reader): PeerSelfLocated; + } + + export interface RestrictionReasonArgs { + /** Platform identifier (ios, android, wp, all, etc.), can be concatenated with a dash as separator (android-ios, ios-wp, etc) */ + platform: string; + /** Restriction reason (porno, terms, etc.) */ + reason: string; + /** Error message to be shown to the user */ + text: string; + } + + /** Restriction reason.
Contains the reason why access to a certain object must be restricted. Clients are supposed to deny access to the channel if the platform field is equal to all or to the current platform (ios, android, wp, etc.). Platforms can be concatenated (ios-android, ios-wp), unknown platforms are to be ignored. The text is the error message that should be shown to the user.
*/ + export class RestrictionReason extends VirtualClass implements RestrictionReasonArgs { + CONSTRUCTOR_id: -797791052; + SUBCLASS_OF_ID: 112039341; + classType: "constructor"; + className: "RestrictionReason"; + platform: string; + reason: string; + text: string; + fromReader(reader: Reader): RestrictionReason; + } + + export interface InputThemeArgs { + /** ID */ + id: long; + /** Access hash */ + accessHash: long; + } + + /** Theme
*/ + export class InputTheme extends VirtualClass implements InputThemeArgs { + CONSTRUCTOR_id: 1012306921; + SUBCLASS_OF_ID: 127992048; + classType: "constructor"; + className: "InputTheme"; + id: long; + accessHash: long; + fromReader(reader: Reader): InputTheme; + } + + export interface InputThemeSlugArgs { + /** Unique theme ID */ + slug: string; + } + + /** Theme by theme ID
*/ + export class InputThemeSlug extends VirtualClass implements InputThemeSlugArgs { + CONSTRUCTOR_id: -175567375; + SUBCLASS_OF_ID: 127992048; + classType: "constructor"; + className: "InputThemeSlug"; + slug: string; + fromReader(reader: Reader): InputThemeSlug; + } + + export interface ThemeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the current user is the creator of this theme */ + creator?: true; + /** Whether this is the default theme */ + default?: true; + /** Whether this theme is meant to be used as a chat theme */ + id: long; + /** Theme ID */ + accessHash: long; + /** Theme access hash */ + slug: string; + /** Unique theme ID */ + title: string; + /** Theme name */ + document?: TypeDocument; + /** Theme */ + settings?: TypeThemeSettings; + /** Theme settings */ + installsCount: int; + } + + /** Theme
*/ + export class Theme extends VirtualClass implements ThemeArgs { + CONSTRUCTOR_id: 42930452; + SUBCLASS_OF_ID: 1454688268; + classType: "constructor"; + className: "Theme"; + flags: number; + creator?: true; + default?: true; + id: long; + accessHash: long; + slug: string; + title: string; + document?: TypeDocument; + settings?: TypeThemeSettings; + installsCount: int; + fromReader(reader: Reader): Theme; + } + + /** Classic theme
*/ + export class BaseThemeClassic extends VirtualClass { + CONSTRUCTOR_id: -1012849566; + SUBCLASS_OF_ID: 520352836; + classType: "constructor"; + className: "BaseThemeClassic"; + fromReader(reader: Reader): BaseThemeClassic; + } + + /** Day theme
*/ + export class BaseThemeDay extends VirtualClass { + CONSTRUCTOR_id: -69724536; + SUBCLASS_OF_ID: 520352836; + classType: "constructor"; + className: "BaseThemeDay"; + fromReader(reader: Reader): BaseThemeDay; + } + + /** Night theme
*/ + export class BaseThemeNight extends VirtualClass { + CONSTRUCTOR_id: -1212997976; + SUBCLASS_OF_ID: 520352836; + classType: "constructor"; + className: "BaseThemeNight"; + fromReader(reader: Reader): BaseThemeNight; + } + + /** Tinted theme
*/ + export class BaseThemeTinted extends VirtualClass { + CONSTRUCTOR_id: 1834973166; + SUBCLASS_OF_ID: 520352836; + classType: "constructor"; + className: "BaseThemeTinted"; + fromReader(reader: Reader): BaseThemeTinted; + } + + /** Arctic theme
*/ + export class BaseThemeArctic extends VirtualClass { + CONSTRUCTOR_id: 1527845466; + SUBCLASS_OF_ID: 520352836; + classType: "constructor"; + className: "BaseThemeArctic"; + fromReader(reader: Reader): BaseThemeArctic; + } + + export interface InputThemeSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, the freeform gradient fill needs to be animated on every sent message */ + baseTheme: TypeBaseTheme; + /** Default theme on which this theme is based */ + accentColor: int; + /** Accent color, ARGB format */ + messageTopColor?: int; + /** Accent color of outgoing messages in ARGB format */ + messageBottomColor?: int; + /** The fill to be used as a background for outgoing messages, in RGB24 format.
If just one or two equal colors are provided, describes a solid fill of a background.
If two different colors are provided, describes the top and bottom colors of a 0-degree gradient.
If three or four colors are provided, describes a freeform gradient fill of a background. */ + wallpaper?: TypeInputWallPaper; + /** Wallpaper */ + wallpaperSettings?: TypeWallPaperSettings; + } + + /** Theme settings
*/ + export class InputThemeSettings extends VirtualClass implements InputThemeSettingsArgs { + CONSTRUCTOR_id: -1118798639; + SUBCLASS_OF_ID: 2201536642; + classType: "constructor"; + className: "InputThemeSettings"; + flags: number; + baseTheme: TypeBaseTheme; + accentColor: int; + messageTopColor?: int; + messageBottomColor?: int; + wallpaper?: TypeInputWallPaper; + wallpaperSettings?: TypeWallPaperSettings; + fromReader(reader: Reader): InputThemeSettings; + } + + export interface ThemeSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, the freeform gradient fill needs to be animated on every sent message. */ + baseTheme: TypeBaseTheme; + /** Base theme */ + accentColor: int; + /** Accent color, ARGB format */ + messageTopColor?: int; + /** Accent color of outgoing messages in ARGB format */ + messageBottomColor?: int; + /** The fill to be used as a background for outgoing messages, in RGB24 format.
If just one or two equal colors are provided, describes a solid fill of a background.
If two different colors are provided, describes the top and bottom colors of a 0-degree gradient.
If three or four colors are provided, describes a freeform gradient fill of a background. */ + wallpaper?: TypeWallPaper; + } + + /** Theme settings
*/ + export class ThemeSettings extends VirtualClass implements ThemeSettingsArgs { + CONSTRUCTOR_id: -1676371894; + SUBCLASS_OF_ID: 2187750712; + classType: "constructor"; + className: "ThemeSettings"; + flags: number; + baseTheme: TypeBaseTheme; + accentColor: int; + messageTopColor?: int; + messageBottomColor?: int; + wallpaper?: TypeWallPaper; + fromReader(reader: Reader): ThemeSettings; + } + + export interface WebPageAttributeThemeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Theme files */ + documents?: TypeDocument[]; + /** Theme settings */ + settings?: TypeThemeSettings; + } + + /** Page theme
*/ + export class WebPageAttributeTheme extends VirtualClass implements WebPageAttributeThemeArgs { + CONSTRUCTOR_id: 1421174295; + SUBCLASS_OF_ID: 2949638599; + classType: "constructor"; + className: "WebPageAttributeTheme"; + flags: number; + documents?: TypeDocument[]; + settings?: TypeThemeSettings; + fromReader(reader: Reader): WebPageAttributeTheme; + } + + export interface MessageUserVoteArgs { + /** User ID */ + userId: int; + /** The option chosen by the user */ + option: bytes; + /** When did the user cast the vote */ + date: int; + } + + /** How a user voted in a poll
*/ + export class MessageUserVote extends VirtualClass implements MessageUserVoteArgs { + CONSTRUCTOR_id: -1567730343; + SUBCLASS_OF_ID: 3375158674; + classType: "constructor"; + className: "MessageUserVote"; + userId: int; + option: bytes; + date: int; + fromReader(reader: Reader): MessageUserVote; + } + + export interface MessageUserVoteInputOptionArgs { + /** The user that voted for the queried option */ + userId: int; + /** When did the user cast the vote */ + date: int; + } + + /** + * How a user voted in a poll (reduced constructor, returned if an option was provided to messages.getPollVotes)
+ * @link https://corefork.telegram.org/method/messages.getPollVotes + */ + export class MessageUserVoteInputOption extends VirtualClass implements MessageUserVoteInputOptionArgs { + CONSTRUCTOR_id: 909603888; + SUBCLASS_OF_ID: 3375158674; + classType: "constructor"; + className: "MessageUserVoteInputOption"; + userId: int; + date: int; + fromReader(reader: Reader): MessageUserVoteInputOption; + } + + export interface MessageUserVoteMultipleArgs { + /** User ID */ + userId: int; + /** Options chosen by the user */ + options: bytes[]; + /** When did the user cast their votes */ + date: int; + } + + /** How a user voted in a multiple-choice poll
*/ + export class MessageUserVoteMultiple extends VirtualClass implements MessageUserVoteMultipleArgs { + CONSTRUCTOR_id: 244310238; + SUBCLASS_OF_ID: 3375158674; + classType: "constructor"; + className: "MessageUserVoteMultiple"; + userId: int; + options: bytes[]; + date: int; + fromReader(reader: Reader): MessageUserVoteMultiple; + } + + export interface BankCardOpenUrlArgs { + /** Info URL */ + url: string; + /** Bank name */ + name: string; + } + + /** Credit card info URL provided by the bank
*/ + export class BankCardOpenUrl extends VirtualClass implements BankCardOpenUrlArgs { + CONSTRUCTOR_id: -177732982; + SUBCLASS_OF_ID: 4074915342; + classType: "constructor"; + className: "BankCardOpenUrl"; + url: string; + name: string; + fromReader(reader: Reader): BankCardOpenUrl; + } + + export interface DialogFilterArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to include all contacts in this folder */ + contacts?: true; + /** Whether to include all non-contacts in this folder */ + nonContacts?: true; + /** Whether to include all groups in this folder */ + groups?: true; + /** Whether to include all channels in this folder */ + broadcasts?: true; + /** Whether to include all bots in this folder */ + bots?: true; + /** Whether to exclude muted chats from this folder */ + excludeMuted?: true; + /** Whether to exclude read chats from this folder */ + excludeRead?: true; + /** Whether to exclude archived chats from this folder */ + excludeArchived?: true; + /** Folder ID */ + id: int; + /** Folder name */ + title: string; + /** Folder emoticon */ + emoticon?: string; + /** Pinned chats, folders can have unlimited pinned chats */ + pinnedPeers: TypeInputPeer[]; + /** Include the following chats in this folder */ + includePeers: TypeInputPeer[]; + /** Exclude the following chats from this folder */ + excludePeers: TypeInputPeer[]; + } + + /** + * Dialog filter AKA folder
+ * @link https://corefork.telegram.org/api/folders + */ + export class DialogFilter extends VirtualClass implements DialogFilterArgs { + CONSTRUCTOR_id: 1949890536; + SUBCLASS_OF_ID: 1764475991; + classType: "constructor"; + className: "DialogFilter"; + flags: number; + contacts?: true; + nonContacts?: true; + groups?: true; + broadcasts?: true; + bots?: true; + excludeMuted?: true; + excludeRead?: true; + excludeArchived?: true; + id: int; + title: string; + emoticon?: string; + pinnedPeers: TypeInputPeer[]; + includePeers: TypeInputPeer[]; + excludePeers: TypeInputPeer[]; + fromReader(reader: Reader): DialogFilter; + } + + export interface DialogFilterSuggestedArgs { + /** Folder info */ + filter: TypeDialogFilter; + /** Folder description */ + description: string; + } + + /** + * Suggested folders
+ * @link https://corefork.telegram.org/api/folders + */ + export class DialogFilterSuggested extends VirtualClass implements DialogFilterSuggestedArgs { + CONSTRUCTOR_id: 2004110666; + SUBCLASS_OF_ID: 837673094; + classType: "constructor"; + className: "DialogFilterSuggested"; + filter: TypeDialogFilter; + description: string; + fromReader(reader: Reader): DialogFilterSuggested; + } + + export interface StatsDateRangeDaysArgs { + /** Initial date */ + minDate: int; + /** Final date */ + maxDate: int; + } + + /** + * Channel statistics date range
+ * @link https://corefork.telegram.org/api/stats + */ + export class StatsDateRangeDays extends VirtualClass implements StatsDateRangeDaysArgs { + CONSTRUCTOR_id: -1237848657; + SUBCLASS_OF_ID: 2166579781; + classType: "constructor"; + className: "StatsDateRangeDays"; + minDate: int; + maxDate: int; + fromReader(reader: Reader): StatsDateRangeDays; + } + + export interface StatsAbsValueAndPrevArgs { + /** Current value */ + current: double; + /** Previous value */ + previous: double; + } + + /** Statistics value couple; initial and final value for period of time currently in consideration
*/ + export class StatsAbsValueAndPrev extends VirtualClass implements StatsAbsValueAndPrevArgs { + CONSTRUCTOR_id: -884757282; + SUBCLASS_OF_ID: 1052662191; + classType: "constructor"; + className: "StatsAbsValueAndPrev"; + current: double; + previous: double; + fromReader(reader: Reader): StatsAbsValueAndPrev; + } + + export interface StatsPercentValueArgs { + /** Partial value */ + part: double; + /** Total value */ + total: double; + } + + /** + * Channel statistics percentage.
+ * Compute the percentage simply by doing part * total / 100
+ * @link https://corefork.telegram.org/api/stats + */ + export class StatsPercentValue extends VirtualClass implements StatsPercentValueArgs { + CONSTRUCTOR_id: -875679776; + SUBCLASS_OF_ID: 2533541150; + classType: "constructor"; + className: "StatsPercentValue"; + part: double; + total: double; + fromReader(reader: Reader): StatsPercentValue; + } + + export interface StatsGraphAsyncArgs { + /** Token to use for fetching the async graph */ + token: string; + } + + /** + * This channel statistics graph must be generated asynchronously using stats.loadAsyncGraph to reduce server load
+ * @link https://corefork.telegram.org/api/stats + * @link https://corefork.telegram.org/method/stats.loadAsyncGraph + * @link https://corefork.telegram.org/api/stats + */ + export class StatsGraphAsync extends VirtualClass implements StatsGraphAsyncArgs { + CONSTRUCTOR_id: 1244130093; + SUBCLASS_OF_ID: 2609918291; + classType: "constructor"; + className: "StatsGraphAsync"; + token: string; + fromReader(reader: Reader): StatsGraphAsync; + } + + export interface StatsGraphErrorArgs { + /** The error */ + error: string; + } + + /** + * An error occurred while generating the statistics graph
+ * @link https://corefork.telegram.org/api/stats + */ + export class StatsGraphError extends VirtualClass implements StatsGraphErrorArgs { + CONSTRUCTOR_id: -1092839390; + SUBCLASS_OF_ID: 2609918291; + classType: "constructor"; + className: "StatsGraphError"; + error: string; + fromReader(reader: Reader): StatsGraphError; + } + + export interface StatsGraphArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Statistics data */ + json: TypeDataJSON; + /** Zoom token */ + zoomToken?: string; + } + + /** + * Channel statistics graph
+ * @link https://corefork.telegram.org/api/stats + */ + export class StatsGraph extends VirtualClass implements StatsGraphArgs { + CONSTRUCTOR_id: -1901828938; + SUBCLASS_OF_ID: 2609918291; + classType: "constructor"; + className: "StatsGraph"; + flags: number; + json: TypeDataJSON; + zoomToken?: string; + fromReader(reader: Reader): StatsGraph; + } + + export interface MessageInteractionCountersArgs { + /** Message ID */ + msgId: MessageIDLike; + /** Views */ + views: int; + /** Number of times this message was forwarded */ + forwards: int; + } + + /** Message interaction counters
*/ + export class MessageInteractionCounters extends VirtualClass implements MessageInteractionCountersArgs { + CONSTRUCTOR_id: -1387279939; + SUBCLASS_OF_ID: 641251104; + classType: "constructor"; + className: "MessageInteractionCounters"; + msgId: MessageIDLike; + views: int; + forwards: int; + fromReader(reader: Reader): MessageInteractionCounters; + } + + export interface VideoSizeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** u for animated profile pictures, and v for trimmed and downscaled video previews */ + type: string; + /** Video width */ + w: int; + /** Video height */ + h: int; + /** File size */ + size: int; + /** Timestamp that should be shown as static preview to the user (seconds) */ + videoStartTs?: double; + } + + /** + * Animated profile picture in MPEG4 format
+ * @link https://corefork.telegram.org/api/files + */ + export class VideoSize extends VirtualClass implements VideoSizeArgs { + CONSTRUCTOR_id: -567037804; + SUBCLASS_OF_ID: 1660015881; + classType: "constructor"; + className: "VideoSize"; + flags: number; + type: string; + w: int; + h: int; + size: int; + videoStartTs?: double; + fromReader(reader: Reader): VideoSize; + } + + export interface StatsGroupTopPosterArgs { + /** User ID */ + userId: int; + /** Number of messages for statistics period in consideration */ + messages: int; + /** Average number of characters per message */ + avgChars: int; + } + + /** + * Information about an active user in a supergroup
+ * @link https://corefork.telegram.org/api/stats + */ + export class StatsGroupTopPoster extends VirtualClass implements StatsGroupTopPosterArgs { + CONSTRUCTOR_id: 418631927; + SUBCLASS_OF_ID: 2177224227; + classType: "constructor"; + className: "StatsGroupTopPoster"; + userId: int; + messages: int; + avgChars: int; + fromReader(reader: Reader): StatsGroupTopPoster; + } + + export interface StatsGroupTopAdminArgs { + /** User ID */ + userId: int; + /** Number of deleted messages for statistics period in consideration */ + deleted: int; + /** Number of kicked users for statistics period in consideration */ + kicked: int; + /** Number of banned users for statistics period in consideration */ + banned: int; + } + + /** + * Information about an active admin in a supergroup
+ * @link https://corefork.telegram.org/api/stats + */ + export class StatsGroupTopAdmin extends VirtualClass implements StatsGroupTopAdminArgs { + CONSTRUCTOR_id: 1611985938; + SUBCLASS_OF_ID: 2150997085; + classType: "constructor"; + className: "StatsGroupTopAdmin"; + userId: int; + deleted: int; + kicked: int; + banned: int; + fromReader(reader: Reader): StatsGroupTopAdmin; + } + + export interface StatsGroupTopInviterArgs { + /** User ID */ + userId: int; + /** Number of invitations for statistics period in consideration */ + invitations: int; + } + + /** + * Information about an active supergroup inviter
+ * @link https://corefork.telegram.org/api/stats + */ + export class StatsGroupTopInviter extends VirtualClass implements StatsGroupTopInviterArgs { + CONSTRUCTOR_id: 831924812; + SUBCLASS_OF_ID: 2231438458; + classType: "constructor"; + className: "StatsGroupTopInviter"; + userId: int; + invitations: int; + fromReader(reader: Reader): StatsGroupTopInviter; + } + + export interface GlobalPrivacySettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to archive and mute new chats from non-contacts */ + archiveAndMuteNewNoncontactPeers?: Bool; + } + + /** Global privacy settings
*/ + export class GlobalPrivacySettings extends VirtualClass implements GlobalPrivacySettingsArgs { + CONSTRUCTOR_id: -1096616924; + SUBCLASS_OF_ID: 3373160304; + classType: "constructor"; + className: "GlobalPrivacySettings"; + flags: number; + archiveAndMuteNewNoncontactPeers?: Bool; + fromReader(reader: Reader): GlobalPrivacySettings; + } + + export interface MessageViewsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Viewcount of message */ + views?: int; + /** Forward count of message */ + forwards?: int; + /** Reply and thread information of message */ + replies?: TypeMessageReplies; + } + + /** + * View, forward counter + info about replies of a specific message
+ * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + */ + export class MessageViews extends VirtualClass implements MessageViewsArgs { + CONSTRUCTOR_id: 1163625789; + SUBCLASS_OF_ID: 1018201017; + classType: "constructor"; + className: "MessageViews"; + flags: number; + views?: int; + forwards?: int; + replies?: TypeMessageReplies; + fromReader(reader: Reader): MessageViews; + } + + export interface MessageReplyHeaderArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** ID of message to which this message is replying */ + replyToMsgId: MessageIDLike; + /** For replies sent in channel discussion threads of which the current user is not a member, the discussion group ID */ + replyToPeerId?: TypePeer; + /** ID of the message that started this message thread */ + replyToTopId?: int; + } + + /** + * Message replies and thread information
+ * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + */ + export class MessageReplyHeader extends VirtualClass implements MessageReplyHeaderArgs { + CONSTRUCTOR_id: -1495959709; + SUBCLASS_OF_ID: 1531810151; + classType: "constructor"; + className: "MessageReplyHeader"; + flags: number; + replyToMsgId: MessageIDLike; + replyToPeerId?: TypePeer; + replyToTopId?: int; + fromReader(reader: Reader): MessageReplyHeader; + } + + export interface MessageRepliesArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this constructor contains information about the comment section of a channel post, or a simple message thread */ + comments?: true; + /** Contains the total number of replies in this thread or comment section. */ + replies: int; + /** PTS of the message that started this thread. */ + repliesPts: int; + /** For channel post comments, contains information about the last few comment posters for a specific thread, to show a small list of commenter profile pictures in client previews. */ + recentRepliers?: TypePeer[]; + /** For channel post comments, contains the ID of the associated discussion supergroup */ + channelId?: int; + /** ID of the latest message in this thread or comment section. */ + maxId?: int; + /** Contains the ID of the latest read message in this thread or comment section. */ + readMaxId?: int; + } + + /** + * Info about the comment section of a channel post, or a simple message thread
+ * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/discussion + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://telegram.org/blog/privacy-discussions-web-bots + */ + export class MessageReplies extends VirtualClass implements MessageRepliesArgs { + CONSTRUCTOR_id: 1093204652; + SUBCLASS_OF_ID: 1825397986; + classType: "constructor"; + className: "MessageReplies"; + flags: number; + comments?: true; + replies: int; + repliesPts: int; + recentRepliers?: TypePeer[]; + channelId?: int; + maxId?: int; + readMaxId?: int; + fromReader(reader: Reader): MessageReplies; + } + + export interface PeerBlockedArgs { + /** Peer ID */ + peerId: TypePeer; + /** When was the peer blocked */ + date: int; + } + + /** Information about a blocked peer
*/ + export class PeerBlocked extends VirtualClass implements PeerBlockedArgs { + CONSTRUCTOR_id: -386039788; + SUBCLASS_OF_ID: 1425210520; + classType: "constructor"; + className: "PeerBlocked"; + peerId: TypePeer; + date: int; + fromReader(reader: Reader): PeerBlocked; + } + + export interface GroupCallDiscardedArgs { + /** Group call ID */ + id: long; + /** Group call access hash */ + accessHash: long; + /** Group call duration */ + duration: int; + } + + /** An ended group call
*/ + export class GroupCallDiscarded extends VirtualClass implements GroupCallDiscardedArgs { + CONSTRUCTOR_id: 2004925620; + SUBCLASS_OF_ID: 548729632; + classType: "constructor"; + className: "GroupCallDiscarded"; + id: long; + accessHash: long; + duration: int; + fromReader(reader: Reader): GroupCallDiscarded; + } + + export interface GroupCallArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the user should be muted upon joining the call */ + joinMuted?: true; + /** Whether the current user can change the value of the join_muted flag using phone.toggleGroupCallSettings */ + canChangeJoinMuted?: true; + /** Specifies the ordering to use when locally sorting by date and displaying in the UI group call participants. */ + joinDateAsc?: true; + /** Whether we subscribed to the scheduled call */ + scheduleStartSubscribed?: true; + /** Whether you can start streaming video into the call */ + canStartVideo?: true; + /** Whether the group call is currently being recorded */ + id: long; + /** Group call ID */ + accessHash: long; + /** Group call access hash */ + participantsCount: int; + /** Participant count */ + title?: string; + /** Group call title */ + streamDcId?: int; + /** DC ID to be used for livestream chunks */ + recordStartDate?: int; + /** When was the recording started */ + scheduleDate?: int; + /** When is the call scheduled to start */ + unmutedVideoCount?: int; + /** Number of people currently streaming video into the call */ + unmutedVideoLimit: int; + /** Maximum number of people allowed to stream video into the call */ + version: int; + } + + /** + * Info about a group call or livestream
+ * @link https://corefork.telegram.org/method/phone.toggleGroupCallSettings + */ + export class GroupCall extends VirtualClass implements GroupCallArgs { + CONSTRUCTOR_id: -711498484; + SUBCLASS_OF_ID: 548729632; + classType: "constructor"; + className: "GroupCall"; + flags: number; + joinMuted?: true; + canChangeJoinMuted?: true; + joinDateAsc?: true; + scheduleStartSubscribed?: true; + canStartVideo?: true; + id: long; + accessHash: long; + participantsCount: int; + title?: string; + streamDcId?: int; + recordStartDate?: int; + scheduleDate?: int; + unmutedVideoCount?: int; + unmutedVideoLimit: int; + version: int; + fromReader(reader: Reader): GroupCall; + } + + export interface InputGroupCallArgs { + /** Group call ID */ + id: long; + /** Group call access hash */ + accessHash: long; + } + + /** Points to a specific group call
*/ + export class InputGroupCall extends VirtualClass implements InputGroupCallArgs { + CONSTRUCTOR_id: -659913713; + SUBCLASS_OF_ID: 1482758833; + classType: "constructor"; + className: "InputGroupCall"; + id: long; + accessHash: long; + fromReader(reader: Reader): InputGroupCall; + } + + export interface GroupCallParticipantArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the participant is muted */ + muted?: true; + /** Whether the participant has left */ + left?: true; + /** Whether the participant can unmute themselves */ + canSelfUnmute?: true; + /** Whether the participant has just joined */ + justJoined?: true; + /** If set, and updateGroupCallParticipants.version < locally stored call.version, info about this participant should be ignored. If (...), and updateGroupCallParticipants.version > call.version+1, the participant list should be refetched using phone.getGroupParticipants. */ + versioned?: true; + /** If not set, the volume and muted_by_you fields can be safely used to overwrite locally cached information; otherwise, volume will contain valid information only if volume_by_admin is set both in the cache and in the received constructor. */ + min?: true; + /** Whether this participant was muted by the current user */ + mutedByYou?: true; + /** Whether our volume can only changed by an admin */ + volumeByAdmin?: true; + /** Whether this participant is the current user */ + self?: true; + /** Whether this participant is currently broadcasting video */ + videoJoined?: true; + /** Peer information */ + peer: TypePeer; + /** When did this participant join the group call */ + date: int; + /** When was this participant last active in the group call */ + activeDate?: int; + /** Source ID */ + source: int; + /** Volume, if not set the volume is set to 100%. */ + volume?: int; + /** Info about this participant */ + about?: string; + /** Specifies the UI visualization order of peers with raised hands: peers with a higher rating should be showed first in the list. */ + raiseHandRating?: long; + /** Info about the video stream the participant is currently broadcasting */ + video?: TypeGroupCallParticipantVideo; + /** Info about the screen sharing stream the participant is currently broadcasting */ + presentation?: TypeGroupCallParticipantVideo; + } + + /** + * Info about a group call participant
+ * @link https://corefork.telegram.org/constructor/updateGroupCallParticipants + * @link https://corefork.telegram.org/method/phone.getGroupParticipants + */ + export class GroupCallParticipant extends VirtualClass implements GroupCallParticipantArgs { + CONSTRUCTOR_id: -341428482; + SUBCLASS_OF_ID: 3222974284; + classType: "constructor"; + className: "GroupCallParticipant"; + flags: number; + muted?: true; + left?: true; + canSelfUnmute?: true; + justJoined?: true; + versioned?: true; + min?: true; + mutedByYou?: true; + volumeByAdmin?: true; + self?: true; + videoJoined?: true; + peer: TypePeer; + date: int; + activeDate?: int; + source: int; + volume?: int; + about?: string; + raiseHandRating?: long; + video?: TypeGroupCallParticipantVideo; + presentation?: TypeGroupCallParticipantVideo; + fromReader(reader: Reader): GroupCallParticipant; + } + + /** The inline query was sent in a private chat with the bot itself
*/ + export class InlineQueryPeerTypeSameBotPM extends VirtualClass { + CONSTRUCTOR_id: 813821341; + SUBCLASS_OF_ID: 2947611167; + classType: "constructor"; + className: "InlineQueryPeerTypeSameBotPM"; + fromReader(reader: Reader): InlineQueryPeerTypeSameBotPM; + } + + /** The inline query was sent in a private chat
*/ + export class InlineQueryPeerTypePM extends VirtualClass { + CONSTRUCTOR_id: -2093215828; + SUBCLASS_OF_ID: 2947611167; + classType: "constructor"; + className: "InlineQueryPeerTypePM"; + fromReader(reader: Reader): InlineQueryPeerTypePM; + } + + /** + * The inline query was sent in a chat
+ * @link https://corefork.telegram.org/api/channel + */ + export class InlineQueryPeerTypeChat extends VirtualClass { + CONSTRUCTOR_id: -681130742; + SUBCLASS_OF_ID: 2947611167; + classType: "constructor"; + className: "InlineQueryPeerTypeChat"; + fromReader(reader: Reader): InlineQueryPeerTypeChat; + } + + /** + * The inline query was sent in a supergroup
+ * @link https://corefork.telegram.org/api/channel + */ + export class InlineQueryPeerTypeMegagroup extends VirtualClass { + CONSTRUCTOR_id: 1589952067; + SUBCLASS_OF_ID: 2947611167; + classType: "constructor"; + className: "InlineQueryPeerTypeMegagroup"; + fromReader(reader: Reader): InlineQueryPeerTypeMegagroup; + } + + /** + * The inline query was sent in a channel
+ * @link https://corefork.telegram.org/api/channel + */ + export class InlineQueryPeerTypeBroadcast extends VirtualClass { + CONSTRUCTOR_id: 1664413338; + SUBCLASS_OF_ID: 2947611167; + classType: "constructor"; + className: "InlineQueryPeerTypeBroadcast"; + fromReader(reader: Reader): InlineQueryPeerTypeBroadcast; + } + + export interface ChatInviteImporterArgs { + /** The user */ + userId: int; + /** When did the user join */ + date: int; + } + + /** When and which user joined the chat using a chat invite
*/ + export class ChatInviteImporter extends VirtualClass implements ChatInviteImporterArgs { + CONSTRUCTOR_id: 507405952; + SUBCLASS_OF_ID: 1393710126; + classType: "constructor"; + className: "ChatInviteImporter"; + userId: int; + date: int; + fromReader(reader: Reader): ChatInviteImporter; + } + + export interface ChatAdminWithInvitesArgs { + /** The admin */ + adminId: int; + /** Number of invites generated by the admin */ + invitesCount: int; + /** Number of revoked invites */ + revokedInvitesCount: int; + } + + /** Info about chat invites generated by admins.
*/ + export class ChatAdminWithInvites extends VirtualClass implements ChatAdminWithInvitesArgs { + CONSTRUCTOR_id: -539872497; + SUBCLASS_OF_ID: 1348727704; + classType: "constructor"; + className: "ChatAdminWithInvites"; + adminId: int; + invitesCount: int; + revokedInvitesCount: int; + fromReader(reader: Reader): ChatAdminWithInvites; + } + + export interface GroupCallParticipantVideoSourceGroupArgs { + /** SDP semantics */ + semantics: string; + /** Source IDs */ + sources: int[]; + } + + /** Describes a group of video synchronization source identifiers
*/ + export class GroupCallParticipantVideoSourceGroup extends VirtualClass implements GroupCallParticipantVideoSourceGroupArgs { + CONSTRUCTOR_id: -592373577; + SUBCLASS_OF_ID: 806746236; + classType: "constructor"; + className: "GroupCallParticipantVideoSourceGroup"; + semantics: string; + sources: int[]; + fromReader(reader: Reader): GroupCallParticipantVideoSourceGroup; + } + + export interface GroupCallParticipantVideoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the stream is currently paused */ + paused?: true; + /** Endpoint */ + endpoint: string; + /** Source groups */ + sourceGroups: TypeGroupCallParticipantVideoSourceGroup[]; + /** Audio source ID */ + audioSource?: int; + } + + /** Info about a video stream
*/ + export class GroupCallParticipantVideo extends VirtualClass implements GroupCallParticipantVideoArgs { + CONSTRUCTOR_id: 1735736008; + SUBCLASS_OF_ID: 4014389467; + classType: "constructor"; + className: "GroupCallParticipantVideo"; + flags: number; + paused?: true; + endpoint: string; + sourceGroups: TypeGroupCallParticipantVideoSourceGroup[]; + audioSource?: int; + fromReader(reader: Reader): GroupCallParticipantVideo; + } + + /** The commands will be valid in all dialogs
*/ + export class BotCommandScopeDefault extends VirtualClass { + CONSTRUCTOR_id: 795652779; + SUBCLASS_OF_ID: 1269783824; + classType: "constructor"; + className: "BotCommandScopeDefault"; + fromReader(reader: Reader): BotCommandScopeDefault; + } + + /** The specified bot commands will only be valid in all private chats with users.
*/ + export class BotCommandScopeUsers extends VirtualClass { + CONSTRUCTOR_id: 1011811544; + SUBCLASS_OF_ID: 1269783824; + classType: "constructor"; + className: "BotCommandScopeUsers"; + fromReader(reader: Reader): BotCommandScopeUsers; + } + + /** + * The specified bot commands will be valid in all groups and supergroups.
+ * @link https://corefork.telegram.org/api/channel + */ + export class BotCommandScopeChats extends VirtualClass { + CONSTRUCTOR_id: 1877059713; + SUBCLASS_OF_ID: 1269783824; + classType: "constructor"; + className: "BotCommandScopeChats"; + fromReader(reader: Reader): BotCommandScopeChats; + } + + /** + * The specified bot commands will be valid only for chat administrators, in all groups and supergroups.
+ * @link https://corefork.telegram.org/api/channel + */ + export class BotCommandScopeChatAdmins extends VirtualClass { + CONSTRUCTOR_id: -1180016534; + SUBCLASS_OF_ID: 1269783824; + classType: "constructor"; + className: "BotCommandScopeChatAdmins"; + fromReader(reader: Reader): BotCommandScopeChatAdmins; + } + + export interface BotCommandScopePeerArgs { + /** The dialog */ + peer: TypeInputPeer; + } + + /** The specified bot commands will be valid only in a specific dialog.
*/ + export class BotCommandScopePeer extends VirtualClass implements BotCommandScopePeerArgs { + CONSTRUCTOR_id: -610432643; + SUBCLASS_OF_ID: 1269783824; + classType: "constructor"; + className: "BotCommandScopePeer"; + peer: TypeInputPeer; + fromReader(reader: Reader): BotCommandScopePeer; + } + + export interface BotCommandScopePeerAdminsArgs { + /** The chat */ + peer: TypeInputPeer; + } + + /** + * The specified bot commands will be valid for all admins of the specified group or supergroup.
+ * @link https://corefork.telegram.org/api/channel + */ + export class BotCommandScopePeerAdmins extends VirtualClass implements BotCommandScopePeerAdminsArgs { + CONSTRUCTOR_id: 1071145937; + SUBCLASS_OF_ID: 1269783824; + classType: "constructor"; + className: "BotCommandScopePeerAdmins"; + peer: TypeInputPeer; + fromReader(reader: Reader): BotCommandScopePeerAdmins; + } + + export interface BotCommandScopePeerUserArgs { + /** The chat */ + peer: TypeInputPeer; + /** The user */ + userId: TypeInputUser; + } + + /** + * The specified bot commands will be valid only for a specific user in the specified group or supergroup.
+ * @link https://corefork.telegram.org/api/channel + */ + export class BotCommandScopePeerUser extends VirtualClass implements BotCommandScopePeerUserArgs { + CONSTRUCTOR_id: 169026035; + SUBCLASS_OF_ID: 1269783824; + classType: "constructor"; + className: "BotCommandScopePeerUser"; + peer: TypeInputPeer; + userId: TypeInputUser; + fromReader(reader: Reader): BotCommandScopePeerUser; + } + + export interface InvokeAfterMsgArgs { + /** Message identifier on which a current query depends */ + msgId: long; + /** The query itself */ + query: X; + } + + /** Invokes a query after successfull completion of one of the previous queries.
*/ + export class InvokeAfterMsg extends Request,X> implements InvokeAfterMsgArgs { + CONSTRUCTOR_id: -878758099; + SUBCLASS_OF_ID: 3081909835; + classType: "request"; + className: "InvokeAfterMsg"; + msgId: long; + query: X; + fromReader(reader: Reader): InvokeAfterMsg; + } + + export interface InvokeAfterMsgsArgs { + /** List of messages on which a current query depends */ + msgIds: long[]; + /** The query itself */ + query: X; + } + + /** Invokes a query after a successfull completion of previous queries
*/ + export class InvokeAfterMsgs extends Request,X> implements InvokeAfterMsgsArgs { + CONSTRUCTOR_id: 1036301552; + SUBCLASS_OF_ID: 3081909835; + classType: "request"; + className: "InvokeAfterMsgs"; + msgIds: long[]; + query: X; + fromReader(reader: Reader): InvokeAfterMsgs; + } + + export interface InitConnectionArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Application identifier (see. App configuration) */ + apiId: int; + /** Device model */ + deviceModel: string; + /** Operation system version */ + systemVersion: string; + /** Application version */ + appVersion: string; + /** Code for the language used on the device's OS, ISO 639-1 standard */ + systemLangCode: string; + /** Language pack to use */ + langPack: string; + /** Code for the language used on the client, ISO 639-1 standard */ + langCode: string; + /** Info about an MTProto proxy */ + proxy?: TypeInputClientProxy; + /** Additional initConnection parameters.
For now, only the tz_offset field is supported, for specifying timezone offset in seconds. */ + params?: TypeJSONValue; + /** The query itself */ + query: X; + } + + /** + * Initialize connection
+ * @throws {{code:400,type:"CONNECTION_LAYER_INVALID"}} Layer invalid. + */ + export class InitConnection extends Request,X> implements InitConnectionArgs { + CONSTRUCTOR_id: -1043505495; + SUBCLASS_OF_ID: 3081909835; + classType: "request"; + className: "InitConnection"; + flags: number; + apiId: int; + deviceModel: string; + systemVersion: string; + appVersion: string; + systemLangCode: string; + langPack: string; + langCode: string; + proxy?: TypeInputClientProxy; + params?: TypeJSONValue; + query: X; + fromReader(reader: Reader): InitConnection; + } + + export interface InvokeWithLayerArgs { + /** The layer to use */ + layer: int; + /** The query */ + query: X; + } + + /** + * Invoke the specified query using the specified API layer
+ * @link https://corefork.telegram.org/api/invoking + * @throws {{code:400,type:"AUTH_BYTES_INVALID"}} The provided authorization is invalid. + * @throws {{code:400,type:"CDN_METHOD_INVALID"}} You can't call this method in a CDN DC. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"CONNECTION_API_ID_INVALID"}} The provided API id is invalid. + * @throws {{code:400,type:"CONNECTION_NOT_INITED"}} Connection not initialized. + * @throws {{code:400,type:"INPUT_LAYER_INVALID"}} The provided layer is invalid. + * @throws {{code:400,type:"INVITE_HASH_EXPIRED"}} The invite link has expired. + */ + export class InvokeWithLayer extends Request,X> implements InvokeWithLayerArgs { + CONSTRUCTOR_id: -627372787; + SUBCLASS_OF_ID: 3081909835; + classType: "request"; + className: "InvokeWithLayer"; + layer: int; + query: X; + fromReader(reader: Reader): InvokeWithLayer; + } + + export interface InvokeWithoutUpdatesArgs { + /** The query */ + query: X; + } + + /** + * Invoke a request without subscribing the used connection for updates (this is enabled by default for file queries).
+ * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/api/files + */ + export class InvokeWithoutUpdates extends Request,X> implements InvokeWithoutUpdatesArgs { + CONSTRUCTOR_id: -1080796745; + SUBCLASS_OF_ID: 3081909835; + classType: "request"; + className: "InvokeWithoutUpdates"; + query: X; + fromReader(reader: Reader): InvokeWithoutUpdates; + } + + export interface InvokeWithMessagesRangeArgs { + /** Message range */ + range: TypeMessageRange; + /** Query */ + query: X; + } + + /** Invoke with the given message range
*/ + export class InvokeWithMessagesRange extends Request,X> implements InvokeWithMessagesRangeArgs { + CONSTRUCTOR_id: 911373810; + SUBCLASS_OF_ID: 3081909835; + classType: "request"; + className: "InvokeWithMessagesRange"; + range: TypeMessageRange; + query: X; + fromReader(reader: Reader): InvokeWithMessagesRange; + } + + export interface InvokeWithTakeoutArgs { + /** Takeout session ID */ + takeoutId: long; + /** Query */ + query: X; + } + + /** Invoke a method within a takeout session
*/ + export class InvokeWithTakeout extends Request,X> implements InvokeWithTakeoutArgs { + CONSTRUCTOR_id: -1398145746; + SUBCLASS_OF_ID: 3081909835; + classType: "request"; + className: "InvokeWithTakeout"; + takeoutId: long; + query: X; + fromReader(reader: Reader): InvokeWithTakeout; + } + + type TypeInputPeer = InputPeerEmpty | InputPeerSelf | InputPeerChat | InputPeerUser | InputPeerChannel | InputPeerUserFromMessage | InputPeerChannelFromMessage; + type TypeInputUser = InputUserEmpty | InputUserSelf | InputUser | InputUserFromMessage; + type TypeInputContact = InputPhoneContact; + type TypeInputFile = InputFile | InputFileBig; + type TypeInputMedia = InputMediaEmpty | InputMediaUploadedPhoto | InputMediaPhoto | InputMediaGeoPoint | InputMediaContact | InputMediaUploadedDocument | InputMediaDocument | InputMediaVenue | InputMediaPhotoExternal | InputMediaDocumentExternal | InputMediaGame | InputMediaInvoice | InputMediaGeoLive | InputMediaPoll | InputMediaDice; + type TypeInputChatPhoto = InputChatPhotoEmpty | InputChatUploadedPhoto | InputChatPhoto; + type TypeInputGeoPoint = InputGeoPointEmpty | InputGeoPoint; + type TypeInputPhoto = InputPhotoEmpty | InputPhoto; + type TypeInputFileLocation = InputFileLocation | InputEncryptedFileLocation | InputDocumentFileLocation | InputSecureFileLocation | InputTakeoutFileLocation | InputPhotoFileLocation | InputPhotoLegacyFileLocation | InputPeerPhotoFileLocation | InputStickerSetThumb | InputGroupCallStream; + type TypePeer = PeerUser | PeerChat | PeerChannel; + type TypeUser = UserEmpty | User; + type TypeUserProfilePhoto = UserProfilePhotoEmpty | UserProfilePhoto; + type TypeUserStatus = UserStatusEmpty | UserStatusOnline | UserStatusOffline | UserStatusRecently | UserStatusLastWeek | UserStatusLastMonth; + type TypeChat = ChatEmpty | Chat | ChatForbidden | Channel | ChannelForbidden; + type TypeChatFull = ChatFull | ChannelFull; + type TypeChatParticipant = ChatParticipant | ChatParticipantCreator | ChatParticipantAdmin; + type TypeChatParticipants = ChatParticipantsForbidden | ChatParticipants; + type TypeChatPhoto = ChatPhotoEmpty | ChatPhoto; + type TypeMessage = MessageEmpty | Message | MessageService; + type TypeMessageMedia = MessageMediaEmpty | MessageMediaPhoto | MessageMediaGeo | MessageMediaContact | MessageMediaUnsupported | MessageMediaDocument | MessageMediaWebPage | MessageMediaVenue | MessageMediaGame | MessageMediaInvoice | MessageMediaGeoLive | MessageMediaPoll | MessageMediaDice; + type TypeMessageAction = MessageActionEmpty | MessageActionChatCreate | MessageActionChatEditTitle | MessageActionChatEditPhoto | MessageActionChatDeletePhoto | MessageActionChatAddUser | MessageActionChatDeleteUser | MessageActionChatJoinedByLink | MessageActionChannelCreate | MessageActionChatMigrateTo | MessageActionChannelMigrateFrom | MessageActionPinMessage | MessageActionHistoryClear | MessageActionGameScore | MessageActionPaymentSentMe | MessageActionPaymentSent | MessageActionPhoneCall | MessageActionScreenshotTaken | MessageActionCustomAction | MessageActionBotAllowed | MessageActionSecureValuesSentMe | MessageActionSecureValuesSent | MessageActionContactSignUp | MessageActionGeoProximityReached | MessageActionGroupCall | MessageActionInviteToGroupCall | MessageActionSetMessagesTTL | MessageActionGroupCallScheduled; + type TypeDialog = Dialog | DialogFolder; + type TypePhoto = PhotoEmpty | Photo; + type TypePhotoSize = PhotoSizeEmpty | PhotoSize | PhotoCachedSize | PhotoStrippedSize | PhotoSizeProgressive | PhotoPathSize; + type TypeGeoPoint = GeoPointEmpty | GeoPoint; + type TypeInputNotifyPeer = InputNotifyPeer | InputNotifyUsers | InputNotifyChats | InputNotifyBroadcasts; + type TypeInputPeerNotifySettings = InputPeerNotifySettings; + type TypePeerNotifySettings = PeerNotifySettings; + type TypePeerSettings = PeerSettings; + type TypeWallPaper = WallPaper | WallPaperNoFile; + type TypeReportReason = InputReportReasonSpam | InputReportReasonViolence | InputReportReasonPornography | InputReportReasonChildAbuse | InputReportReasonOther | InputReportReasonCopyright | InputReportReasonGeoIrrelevant | InputReportReasonFake; + type TypeUserFull = UserFull; + type TypeContact = Contact; + type TypeImportedContact = ImportedContact; + type TypeContactStatus = ContactStatus; + type TypeMessagesFilter = InputMessagesFilterEmpty | InputMessagesFilterPhotos | InputMessagesFilterVideo | InputMessagesFilterPhotoVideo | InputMessagesFilterDocument | InputMessagesFilterUrl | InputMessagesFilterGif | InputMessagesFilterVoice | InputMessagesFilterMusic | InputMessagesFilterChatPhotos | InputMessagesFilterPhoneCalls | InputMessagesFilterRoundVoice | InputMessagesFilterRoundVideo | InputMessagesFilterMyMentions | InputMessagesFilterGeo | InputMessagesFilterContacts | InputMessagesFilterPinned; + type TypeUpdate = UpdateNewMessage | UpdateMessageID | UpdateDeleteMessages | UpdateUserTyping | UpdateChatUserTyping | UpdateChatParticipants | UpdateUserStatus | UpdateUserName | UpdateUserPhoto | UpdateNewEncryptedMessage | UpdateEncryptedChatTyping | UpdateEncryption | UpdateEncryptedMessagesRead | UpdateChatParticipantAdd | UpdateChatParticipantDelete | UpdateDcOptions | UpdateNotifySettings | UpdateServiceNotification | UpdatePrivacy | UpdateUserPhone | UpdateReadHistoryInbox | UpdateReadHistoryOutbox | UpdateWebPage | UpdateReadMessagesContents | UpdateChannelTooLong | UpdateChannel | UpdateNewChannelMessage | UpdateReadChannelInbox | UpdateDeleteChannelMessages | UpdateChannelMessageViews | UpdateChatParticipantAdmin | UpdateNewStickerSet | UpdateStickerSetsOrder | UpdateStickerSets | UpdateSavedGifs | UpdateBotInlineQuery | UpdateBotInlineSend | UpdateEditChannelMessage | UpdateBotCallbackQuery | UpdateEditMessage | UpdateInlineBotCallbackQuery | UpdateReadChannelOutbox | UpdateDraftMessage | UpdateReadFeaturedStickers | UpdateRecentStickers | UpdateConfig | UpdatePtsChanged | UpdateChannelWebPage | UpdateDialogPinned | UpdatePinnedDialogs | UpdateBotWebhookJSON | UpdateBotWebhookJSONQuery | UpdateBotShippingQuery | UpdateBotPrecheckoutQuery | UpdatePhoneCall | UpdateLangPackTooLong | UpdateLangPack | UpdateFavedStickers | UpdateChannelReadMessagesContents | UpdateContactsReset | UpdateChannelAvailableMessages | UpdateDialogUnreadMark | UpdateMessagePoll | UpdateChatDefaultBannedRights | UpdateFolderPeers | UpdatePeerSettings | UpdatePeerLocated | UpdateNewScheduledMessage | UpdateDeleteScheduledMessages | UpdateTheme | UpdateGeoLiveViewed | UpdateLoginToken | UpdateMessagePollVote | UpdateDialogFilter | UpdateDialogFilterOrder | UpdateDialogFilters | UpdatePhoneCallSignalingData | UpdateChannelMessageForwards | UpdateReadChannelDiscussionInbox | UpdateReadChannelDiscussionOutbox | UpdatePeerBlocked | UpdateChannelUserTyping | UpdatePinnedMessages | UpdatePinnedChannelMessages | UpdateChat | UpdateGroupCallParticipants | UpdateGroupCall | UpdatePeerHistoryTTL | UpdateChatParticipant | UpdateChannelParticipant | UpdateBotStopped | UpdateGroupCallConnection | UpdateBotCommands; + type TypeUpdates = UpdatesTooLong | UpdateShortMessage | UpdateShortChatMessage | UpdateShort | UpdatesCombined | Updates | UpdateShortSentMessage; + type TypeDcOption = DcOption; + type TypeConfig = Config; + type TypeNearestDc = NearestDc; + type TypeEncryptedChat = EncryptedChatEmpty | EncryptedChatWaiting | EncryptedChatRequested | EncryptedChat | EncryptedChatDiscarded; + type TypeInputEncryptedChat = InputEncryptedChat; + type TypeEncryptedFile = EncryptedFileEmpty | EncryptedFile; + type TypeInputEncryptedFile = InputEncryptedFileEmpty | InputEncryptedFileUploaded | InputEncryptedFile | InputEncryptedFileBigUploaded; + type TypeEncryptedMessage = EncryptedMessage | EncryptedMessageService; + type TypeInputDocument = InputDocumentEmpty | InputDocument; + type TypeDocument = DocumentEmpty | Document; + type TypeNotifyPeer = NotifyPeer | NotifyUsers | NotifyChats | NotifyBroadcasts; + type TypeSendMessageAction = SendMessageTypingAction | SendMessageCancelAction | SendMessageRecordVideoAction | SendMessageUploadVideoAction | SendMessageRecordAudioAction | SendMessageUploadAudioAction | SendMessageUploadPhotoAction | SendMessageUploadDocumentAction | SendMessageGeoLocationAction | SendMessageChooseContactAction | SendMessageGamePlayAction | SendMessageRecordRoundAction | SendMessageUploadRoundAction | SpeakingInGroupCallAction | SendMessageHistoryImportAction; + type TypeInputPrivacyKey = InputPrivacyKeyStatusTimestamp | InputPrivacyKeyChatInvite | InputPrivacyKeyPhoneCall | InputPrivacyKeyPhoneP2P | InputPrivacyKeyForwards | InputPrivacyKeyProfilePhoto | InputPrivacyKeyPhoneNumber | InputPrivacyKeyAddedByPhone; + type TypePrivacyKey = PrivacyKeyStatusTimestamp | PrivacyKeyChatInvite | PrivacyKeyPhoneCall | PrivacyKeyPhoneP2P | PrivacyKeyForwards | PrivacyKeyProfilePhoto | PrivacyKeyPhoneNumber | PrivacyKeyAddedByPhone; + type TypeInputPrivacyRule = InputPrivacyValueAllowContacts | InputPrivacyValueAllowAll | InputPrivacyValueAllowUsers | InputPrivacyValueDisallowContacts | InputPrivacyValueDisallowAll | InputPrivacyValueDisallowUsers | InputPrivacyValueAllowChatParticipants | InputPrivacyValueDisallowChatParticipants; + type TypePrivacyRule = PrivacyValueAllowContacts | PrivacyValueAllowAll | PrivacyValueAllowUsers | PrivacyValueDisallowContacts | PrivacyValueDisallowAll | PrivacyValueDisallowUsers | PrivacyValueAllowChatParticipants | PrivacyValueDisallowChatParticipants; + type TypeAccountDaysTTL = AccountDaysTTL; + type TypeDocumentAttribute = DocumentAttributeImageSize | DocumentAttributeAnimated | DocumentAttributeSticker | DocumentAttributeVideo | DocumentAttributeAudio | DocumentAttributeFilename | DocumentAttributeHasStickers; + type TypeStickerPack = StickerPack; + type TypeWebPage = WebPageEmpty | WebPagePending | WebPage | WebPageNotModified; + type TypeAuthorization = Authorization; + type TypeReceivedNotifyMessage = ReceivedNotifyMessage; + type TypeExportedChatInvite = ChatInviteExported; + type TypeChatInvite = ChatInviteAlready | ChatInvite | ChatInvitePeek; + type TypeInputStickerSet = InputStickerSetEmpty | InputStickerSetID | InputStickerSetShortName | InputStickerSetAnimatedEmoji | InputStickerSetDice; + type TypeStickerSet = StickerSet; + type TypeBotCommand = BotCommand; + type TypeBotInfo = BotInfo; + type TypeKeyboardButton = KeyboardButton | KeyboardButtonUrl | KeyboardButtonCallback | KeyboardButtonRequestPhone | KeyboardButtonRequestGeoLocation | KeyboardButtonSwitchInline | KeyboardButtonGame | KeyboardButtonBuy | KeyboardButtonUrlAuth | InputKeyboardButtonUrlAuth | KeyboardButtonRequestPoll; + type TypeKeyboardButtonRow = KeyboardButtonRow; + type TypeReplyMarkup = ReplyKeyboardHide | ReplyKeyboardForceReply | ReplyKeyboardMarkup | ReplyInlineMarkup; + type TypeMessageEntity = MessageEntityUnknown | MessageEntityMention | MessageEntityHashtag | MessageEntityBotCommand | MessageEntityUrl | MessageEntityEmail | MessageEntityBold | MessageEntityItalic | MessageEntityCode | MessageEntityPre | MessageEntityTextUrl | MessageEntityMentionName | InputMessageEntityMentionName | MessageEntityPhone | MessageEntityCashtag | MessageEntityUnderline | MessageEntityStrike | MessageEntityBlockquote | MessageEntityBankCard; + type TypeInputChannel = InputChannelEmpty | InputChannel | InputChannelFromMessage; + type TypeMessageRange = MessageRange; + type TypeChannelMessagesFilter = ChannelMessagesFilterEmpty | ChannelMessagesFilter; + type TypeChannelParticipant = ChannelParticipant | ChannelParticipantSelf | ChannelParticipantCreator | ChannelParticipantAdmin | ChannelParticipantBanned | ChannelParticipantLeft; + type TypeChannelParticipantsFilter = ChannelParticipantsRecent | ChannelParticipantsAdmins | ChannelParticipantsKicked | ChannelParticipantsBots | ChannelParticipantsBanned | ChannelParticipantsSearch | ChannelParticipantsContacts | ChannelParticipantsMentions; + type TypeInputBotInlineMessage = InputBotInlineMessageMediaAuto | InputBotInlineMessageText | InputBotInlineMessageMediaGeo | InputBotInlineMessageMediaVenue | InputBotInlineMessageMediaContact | InputBotInlineMessageGame | InputBotInlineMessageMediaInvoice; + type TypeInputBotInlineResult = InputBotInlineResult | InputBotInlineResultPhoto | InputBotInlineResultDocument | InputBotInlineResultGame; + type TypeBotInlineMessage = BotInlineMessageMediaAuto | BotInlineMessageText | BotInlineMessageMediaGeo | BotInlineMessageMediaVenue | BotInlineMessageMediaContact | BotInlineMessageMediaInvoice; + type TypeBotInlineResult = BotInlineResult | BotInlineMediaResult; + type TypeExportedMessageLink = ExportedMessageLink; + type TypeMessageFwdHeader = MessageFwdHeader; + type TypeInputBotInlineMessageID = InputBotInlineMessageID; + type TypeInlineBotSwitchPM = InlineBotSwitchPM; + type TypeTopPeer = TopPeer; + type TypeTopPeerCategory = TopPeerCategoryBotsPM | TopPeerCategoryBotsInline | TopPeerCategoryCorrespondents | TopPeerCategoryGroups | TopPeerCategoryChannels | TopPeerCategoryPhoneCalls | TopPeerCategoryForwardUsers | TopPeerCategoryForwardChats; + type TypeTopPeerCategoryPeers = TopPeerCategoryPeers; + type TypeDraftMessage = DraftMessageEmpty | DraftMessage; + type TypeStickerSetCovered = StickerSetCovered | StickerSetMultiCovered; + type TypeMaskCoords = MaskCoords; + type TypeInputStickeredMedia = InputStickeredMediaPhoto | InputStickeredMediaDocument; + type TypeGame = Game; + type TypeInputGame = InputGameID | InputGameShortName; + type TypeHighScore = HighScore; + type TypeRichText = TextEmpty | TextPlain | TextBold | TextItalic | TextUnderline | TextStrike | TextFixed | TextUrl | TextEmail | TextConcat | TextSubscript | TextSuperscript | TextMarked | TextPhone | TextImage | TextAnchor; + type TypePageBlock = PageBlockUnsupported | PageBlockTitle | PageBlockSubtitle | PageBlockAuthorDate | PageBlockHeader | PageBlockSubheader | PageBlockParagraph | PageBlockPreformatted | PageBlockFooter | PageBlockDivider | PageBlockAnchor | PageBlockList | PageBlockBlockquote | PageBlockPullquote | PageBlockPhoto | PageBlockVideo | PageBlockCover | PageBlockEmbed | PageBlockEmbedPost | PageBlockCollage | PageBlockSlideshow | PageBlockChannel | PageBlockAudio | PageBlockKicker | PageBlockTable | PageBlockOrderedList | PageBlockDetails | PageBlockRelatedArticles | PageBlockMap; + type TypePhoneCallDiscardReason = PhoneCallDiscardReasonMissed | PhoneCallDiscardReasonDisconnect | PhoneCallDiscardReasonHangup | PhoneCallDiscardReasonBusy; + type TypeDataJSON = DataJSON; + type TypeLabeledPrice = LabeledPrice; + type TypeInvoice = Invoice; + type TypePaymentCharge = PaymentCharge; + type TypePostAddress = PostAddress; + type TypePaymentRequestedInfo = PaymentRequestedInfo; + type TypePaymentSavedCredentials = PaymentSavedCredentialsCard; + type TypeWebDocument = WebDocument | WebDocumentNoProxy; + type TypeInputWebDocument = InputWebDocument; + type TypeInputWebFileLocation = InputWebFileLocation | InputWebFileGeoPointLocation; + type TypeInputPaymentCredentials = InputPaymentCredentialsSaved | InputPaymentCredentials | InputPaymentCredentialsApplePay | InputPaymentCredentialsGooglePay; + type TypeShippingOption = ShippingOption; + type TypeInputStickerSetItem = InputStickerSetItem; + type TypeInputPhoneCall = InputPhoneCall; + type TypePhoneCall = PhoneCallEmpty | PhoneCallWaiting | PhoneCallRequested | PhoneCallAccepted | PhoneCall | PhoneCallDiscarded; + type TypePhoneConnection = PhoneConnection | PhoneConnectionWebrtc; + type TypePhoneCallProtocol = PhoneCallProtocol; + type TypeCdnPublicKey = CdnPublicKey; + type TypeCdnConfig = CdnConfig; + type TypeLangPackString = LangPackString | LangPackStringPluralized | LangPackStringDeleted; + type TypeLangPackDifference = LangPackDifference; + type TypeLangPackLanguage = LangPackLanguage; + type TypeChannelAdminLogEventAction = ChannelAdminLogEventActionChangeTitle | ChannelAdminLogEventActionChangeAbout | ChannelAdminLogEventActionChangeUsername | ChannelAdminLogEventActionChangePhoto | ChannelAdminLogEventActionToggleInvites | ChannelAdminLogEventActionToggleSignatures | ChannelAdminLogEventActionUpdatePinned | ChannelAdminLogEventActionEditMessage | ChannelAdminLogEventActionDeleteMessage | ChannelAdminLogEventActionParticipantJoin | ChannelAdminLogEventActionParticipantLeave | ChannelAdminLogEventActionParticipantInvite | ChannelAdminLogEventActionParticipantToggleBan | ChannelAdminLogEventActionParticipantToggleAdmin | ChannelAdminLogEventActionChangeStickerSet | ChannelAdminLogEventActionTogglePreHistoryHidden | ChannelAdminLogEventActionDefaultBannedRights | ChannelAdminLogEventActionStopPoll | ChannelAdminLogEventActionChangeLinkedChat | ChannelAdminLogEventActionChangeLocation | ChannelAdminLogEventActionToggleSlowMode | ChannelAdminLogEventActionStartGroupCall | ChannelAdminLogEventActionDiscardGroupCall | ChannelAdminLogEventActionParticipantMute | ChannelAdminLogEventActionParticipantUnmute | ChannelAdminLogEventActionToggleGroupCallSetting | ChannelAdminLogEventActionParticipantJoinByInvite | ChannelAdminLogEventActionExportedInviteDelete | ChannelAdminLogEventActionExportedInviteRevoke | ChannelAdminLogEventActionExportedInviteEdit | ChannelAdminLogEventActionParticipantVolume | ChannelAdminLogEventActionChangeHistoryTTL; + type TypeChannelAdminLogEvent = ChannelAdminLogEvent; + type TypeChannelAdminLogEventsFilter = ChannelAdminLogEventsFilter; + type TypePopularContact = PopularContact; + type TypeRecentMeUrl = RecentMeUrlUnknown | RecentMeUrlUser | RecentMeUrlChat | RecentMeUrlChatInvite | RecentMeUrlStickerSet; + type TypeInputSingleMedia = InputSingleMedia; + type TypeWebAuthorization = WebAuthorization; + type TypeInputMessage = InputMessageID | InputMessageReplyTo | InputMessagePinned | InputMessageCallbackQuery; + type TypeInputDialogPeer = InputDialogPeer | InputDialogPeerFolder; + type TypeDialogPeer = DialogPeer | DialogPeerFolder; + type TypeFileHash = FileHash; + type TypeInputClientProxy = InputClientProxy; + type TypeInputSecureFile = InputSecureFileUploaded | InputSecureFile; + type TypeSecureFile = SecureFileEmpty | SecureFile; + type TypeSecureData = SecureData; + type TypeSecurePlainData = SecurePlainPhone | SecurePlainEmail; + type TypeSecureValueType = SecureValueTypePersonalDetails | SecureValueTypePassport | SecureValueTypeDriverLicense | SecureValueTypeIdentityCard | SecureValueTypeInternalPassport | SecureValueTypeAddress | SecureValueTypeUtilityBill | SecureValueTypeBankStatement | SecureValueTypeRentalAgreement | SecureValueTypePassportRegistration | SecureValueTypeTemporaryRegistration | SecureValueTypePhone | SecureValueTypeEmail; + type TypeSecureValue = SecureValue; + type TypeInputSecureValue = InputSecureValue; + type TypeSecureValueHash = SecureValueHash; + type TypeSecureValueError = SecureValueErrorData | SecureValueErrorFrontSide | SecureValueErrorReverseSide | SecureValueErrorSelfie | SecureValueErrorFile | SecureValueErrorFiles | SecureValueError | SecureValueErrorTranslationFile | SecureValueErrorTranslationFiles; + type TypeSecureCredentialsEncrypted = SecureCredentialsEncrypted; + type TypeSavedContact = SavedPhoneContact; + type TypePasswordKdfAlgo = PasswordKdfAlgoUnknown | PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow; + type TypeSecurePasswordKdfAlgo = SecurePasswordKdfAlgoUnknown | SecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000 | SecurePasswordKdfAlgoSHA512; + type TypeSecureSecretSettings = SecureSecretSettings; + type TypeInputCheckPasswordSRP = InputCheckPasswordEmpty | InputCheckPasswordSRP; + type TypeSecureRequiredType = SecureRequiredType | SecureRequiredTypeOneOf; + type TypeInputAppEvent = InputAppEvent; + type TypeJSONObjectValue = JsonObjectValue; + type TypeJSONValue = JsonNull | JsonBool | JsonNumber | JsonString | JsonArray | JsonObject; + type TypePageTableCell = PageTableCell; + type TypePageTableRow = PageTableRow; + type TypePageCaption = PageCaption; + type TypePageListItem = PageListItemText | PageListItemBlocks; + type TypePageListOrderedItem = PageListOrderedItemText | PageListOrderedItemBlocks; + type TypePageRelatedArticle = PageRelatedArticle; + type TypePage = Page; + type TypePollAnswer = PollAnswer; + type TypePoll = Poll; + type TypePollAnswerVoters = PollAnswerVoters; + type TypePollResults = PollResults; + type TypeChatOnlines = ChatOnlines; + type TypeStatsURL = StatsURL; + type TypeChatAdminRights = ChatAdminRights; + type TypeChatBannedRights = ChatBannedRights; + type TypeInputWallPaper = InputWallPaper | InputWallPaperSlug | InputWallPaperNoFile; + type TypeCodeSettings = CodeSettings; + type TypeWallPaperSettings = WallPaperSettings; + type TypeAutoDownloadSettings = AutoDownloadSettings; + type TypeEmojiKeyword = EmojiKeyword | EmojiKeywordDeleted; + type TypeEmojiKeywordsDifference = EmojiKeywordsDifference; + type TypeEmojiURL = EmojiURL; + type TypeEmojiLanguage = EmojiLanguage; + type TypeFolder = Folder; + type TypeInputFolderPeer = InputFolderPeer; + type TypeFolderPeer = FolderPeer; + type TypeUrlAuthResult = UrlAuthResultRequest | UrlAuthResultAccepted | UrlAuthResultDefault; + type TypeChannelLocation = ChannelLocationEmpty | ChannelLocation; + type TypePeerLocated = PeerLocated | PeerSelfLocated; + type TypeRestrictionReason = RestrictionReason; + type TypeInputTheme = InputTheme | InputThemeSlug; + type TypeTheme = Theme; + type TypeBaseTheme = BaseThemeClassic | BaseThemeDay | BaseThemeNight | BaseThemeTinted | BaseThemeArctic; + type TypeInputThemeSettings = InputThemeSettings; + type TypeThemeSettings = ThemeSettings; + type TypeWebPageAttribute = WebPageAttributeTheme; + type TypeMessageUserVote = MessageUserVote | MessageUserVoteInputOption | MessageUserVoteMultiple; + type TypeBankCardOpenUrl = BankCardOpenUrl; + type TypeDialogFilter = DialogFilter; + type TypeDialogFilterSuggested = DialogFilterSuggested; + type TypeStatsDateRangeDays = StatsDateRangeDays; + type TypeStatsAbsValueAndPrev = StatsAbsValueAndPrev; + type TypeStatsPercentValue = StatsPercentValue; + type TypeStatsGraph = StatsGraphAsync | StatsGraphError | StatsGraph; + type TypeMessageInteractionCounters = MessageInteractionCounters; + type TypeVideoSize = VideoSize; + type TypeStatsGroupTopPoster = StatsGroupTopPoster; + type TypeStatsGroupTopAdmin = StatsGroupTopAdmin; + type TypeStatsGroupTopInviter = StatsGroupTopInviter; + type TypeGlobalPrivacySettings = GlobalPrivacySettings; + type TypeMessageViews = MessageViews; + type TypeMessageReplyHeader = MessageReplyHeader; + type TypeMessageReplies = MessageReplies; + type TypePeerBlocked = PeerBlocked; + type TypeGroupCall = GroupCallDiscarded | GroupCall; + type TypeInputGroupCall = InputGroupCall; + type TypeGroupCallParticipant = GroupCallParticipant; + type TypeInlineQueryPeerType = InlineQueryPeerTypeSameBotPM | InlineQueryPeerTypePM | InlineQueryPeerTypeChat | InlineQueryPeerTypeMegagroup | InlineQueryPeerTypeBroadcast; + type TypeChatInviteImporter = ChatInviteImporter; + type TypeChatAdminWithInvites = ChatAdminWithInvites; + type TypeGroupCallParticipantVideoSourceGroup = GroupCallParticipantVideoSourceGroup; + type TypeGroupCallParticipantVideo = GroupCallParticipantVideo; + type TypeBotCommandScope = BotCommandScopeDefault | BotCommandScopeUsers | BotCommandScopeChats | BotCommandScopeChatAdmins | BotCommandScopePeer | BotCommandScopePeerAdmins | BotCommandScopePeerUser; + + namespace storage { + /** Unknown type.
*/ + export class FileUnknown extends VirtualClass { + CONSTRUCTOR_id: -1432995067; + SUBCLASS_OF_ID: 4087473907; + classType: "constructor"; + className: "storage.FileUnknown"; + fromReader(reader: Reader): FileUnknown; + } + + /** Part of a bigger file.
*/ + export class FilePartial extends VirtualClass { + CONSTRUCTOR_id: 1086091090; + SUBCLASS_OF_ID: 4087473907; + classType: "constructor"; + className: "storage.FilePartial"; + fromReader(reader: Reader): FilePartial; + } + + /** JPEG image. MIME type: image/jpeg.
*/ + export class FileJpeg extends VirtualClass { + CONSTRUCTOR_id: 8322574; + SUBCLASS_OF_ID: 4087473907; + classType: "constructor"; + className: "storage.FileJpeg"; + fromReader(reader: Reader): FileJpeg; + } + + /** GIF image. MIME type: image/gif.
*/ + export class FileGif extends VirtualClass { + CONSTRUCTOR_id: -891180321; + SUBCLASS_OF_ID: 4087473907; + classType: "constructor"; + className: "storage.FileGif"; + fromReader(reader: Reader): FileGif; + } + + /** PNG image. MIME type: image/png.
*/ + export class FilePng extends VirtualClass { + CONSTRUCTOR_id: 172975040; + SUBCLASS_OF_ID: 4087473907; + classType: "constructor"; + className: "storage.FilePng"; + fromReader(reader: Reader): FilePng; + } + + /** PDF document image. MIME type: application/pdf.
*/ + export class FilePdf extends VirtualClass { + CONSTRUCTOR_id: -1373745011; + SUBCLASS_OF_ID: 4087473907; + classType: "constructor"; + className: "storage.FilePdf"; + fromReader(reader: Reader): FilePdf; + } + + /** Mp3 audio. MIME type: audio/mpeg.
*/ + export class FileMp3 extends VirtualClass { + CONSTRUCTOR_id: 1384777335; + SUBCLASS_OF_ID: 4087473907; + classType: "constructor"; + className: "storage.FileMp3"; + fromReader(reader: Reader): FileMp3; + } + + /** Quicktime video. MIME type: video/quicktime.
*/ + export class FileMov extends VirtualClass { + CONSTRUCTOR_id: 1258941372; + SUBCLASS_OF_ID: 4087473907; + classType: "constructor"; + className: "storage.FileMov"; + fromReader(reader: Reader): FileMov; + } + + /** MPEG-4 video. MIME type: video/mp4.
*/ + export class FileMp4 extends VirtualClass { + CONSTRUCTOR_id: -1278304028; + SUBCLASS_OF_ID: 4087473907; + classType: "constructor"; + className: "storage.FileMp4"; + fromReader(reader: Reader): FileMp4; + } + + /** WEBP image. MIME type: image/webp.
*/ + export class FileWebp extends VirtualClass { + CONSTRUCTOR_id: 276907596; + SUBCLASS_OF_ID: 4087473907; + classType: "constructor"; + className: "storage.FileWebp"; + fromReader(reader: Reader): FileWebp; + } + + type TypeFileType = FileUnknown | FilePartial | FileJpeg | FileGif | FilePng | FilePdf | FileMp3 | FileMov | FileMp4 | FileWebp; + } + + namespace auth { + export interface SentCodeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Phone code type */ + type: auth.TypeSentCodeType; + /** Phone code hash, to be stored and later re-used with auth.signIn */ + phoneCodeHash: string; + /** Phone code type that will be sent next, if the phone code is not received within timeout seconds: to send it use auth.resendCode */ + nextType?: auth.TypeCodeType; + /** Timeout for reception of the phone code */ + timeout?: int; + } + + /** + * Contains info about a sent verification code.
+ * @link https://corefork.telegram.org/method/auth.signIn + * @link https://corefork.telegram.org/method/auth.resendCode + * @link https://corefork.telegram.org/api/auth + */ + export class SentCode extends VirtualClass implements SentCodeArgs { + CONSTRUCTOR_id: 1577067778; + SUBCLASS_OF_ID: 1827172481; + classType: "constructor"; + className: "auth.SentCode"; + flags: number; + type: auth.TypeSentCodeType; + phoneCodeHash: string; + nextType?: auth.TypeCodeType; + timeout?: int; + fromReader(reader: Reader): SentCode; + } + + export interface AuthorizationArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Temporary passport sessions */ + tmpSessions?: int; + /** Info on authorized user */ + user: TypeUser; + } + + /** + * Contains user authorization info.
+ * @link https://corefork.telegram.org/passport + */ + export class Authorization extends VirtualClass implements AuthorizationArgs { + CONSTRUCTOR_id: -855308010; + SUBCLASS_OF_ID: 3118485049; + classType: "constructor"; + className: "auth.Authorization"; + flags: number; + tmpSessions?: int; + user: TypeUser; + fromReader(reader: Reader): Authorization; + } + + export interface AuthorizationSignUpRequiredArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Telegram's terms of service: the user must read and accept the terms of service before signing up to telegram */ + termsOfService?: help.TypeTermsOfService; + } + + /** + * An account with this phone number doesn't exist on telegram: the user has to enter basic information and sign up
+ * @link https://corefork.telegram.org/api/auth + */ + export class AuthorizationSignUpRequired extends VirtualClass implements AuthorizationSignUpRequiredArgs { + CONSTRUCTOR_id: 1148485274; + SUBCLASS_OF_ID: 3118485049; + classType: "constructor"; + className: "auth.AuthorizationSignUpRequired"; + flags: number; + termsOfService?: help.TypeTermsOfService; + fromReader(reader: Reader): AuthorizationSignUpRequired; + } + + export interface ExportedAuthorizationArgs { + /** current user identifier */ + id: int; + /** authorizes key */ + bytes: bytes; + } + + /** Data for copying of authorization between data centres.
*/ + export class ExportedAuthorization extends VirtualClass implements ExportedAuthorizationArgs { + CONSTRUCTOR_id: -543777747; + SUBCLASS_OF_ID: 1607593041; + classType: "constructor"; + className: "auth.ExportedAuthorization"; + id: int; + bytes: bytes; + fromReader(reader: Reader): ExportedAuthorization; + } + + export interface PasswordRecoveryArgs { + /** The email to which the recovery code was sent must match this pattern. */ + emailPattern: string; + } + + /** + * Recovery info of a 2FA password, only for accounts with a recovery email configured.
+ * @link https://corefork.telegram.org/api/pattern + * @link https://corefork.telegram.org/api/srp + */ + export class PasswordRecovery extends VirtualClass implements PasswordRecoveryArgs { + CONSTRUCTOR_id: 326715557; + SUBCLASS_OF_ID: 4201829434; + classType: "constructor"; + className: "auth.PasswordRecovery"; + emailPattern: string; + fromReader(reader: Reader): PasswordRecovery; + } + + /** Type of verification code that will be sent next if you call the resendCode method: SMS code
*/ + export class CodeTypeSms extends VirtualClass { + CONSTRUCTOR_id: 1923290508; + SUBCLASS_OF_ID: 3019105281; + classType: "constructor"; + className: "auth.CodeTypeSms"; + fromReader(reader: Reader): CodeTypeSms; + } + + /** Type of verification code that will be sent next if you call the resendCode method: SMS code
*/ + export class CodeTypeCall extends VirtualClass { + CONSTRUCTOR_id: 1948046307; + SUBCLASS_OF_ID: 3019105281; + classType: "constructor"; + className: "auth.CodeTypeCall"; + fromReader(reader: Reader): CodeTypeCall; + } + + /** Type of verification code that will be sent next if you call the resendCode method: SMS code
*/ + export class CodeTypeFlashCall extends VirtualClass { + CONSTRUCTOR_id: 577556219; + SUBCLASS_OF_ID: 3019105281; + classType: "constructor"; + className: "auth.CodeTypeFlashCall"; + fromReader(reader: Reader): CodeTypeFlashCall; + } + + export interface SentCodeTypeAppArgs { + /** Length of the code in bytes */ + length: int; + } + + /** The code was sent through the telegram app
*/ + export class SentCodeTypeApp extends VirtualClass implements SentCodeTypeAppArgs { + CONSTRUCTOR_id: 1035688326; + SUBCLASS_OF_ID: 4284159374; + classType: "constructor"; + className: "auth.SentCodeTypeApp"; + length: int; + fromReader(reader: Reader): SentCodeTypeApp; + } + + export interface SentCodeTypeSmsArgs { + /** Length of the code in bytes */ + length: int; + } + + /** The code was sent via SMS
*/ + export class SentCodeTypeSms extends VirtualClass implements SentCodeTypeSmsArgs { + CONSTRUCTOR_id: -1073693790; + SUBCLASS_OF_ID: 4284159374; + classType: "constructor"; + className: "auth.SentCodeTypeSms"; + length: int; + fromReader(reader: Reader): SentCodeTypeSms; + } + + export interface SentCodeTypeCallArgs { + /** Length of the verification code */ + length: int; + } + + /** The code will be sent via a phone call: a synthesized voice will tell the user which verification code to input.
*/ + export class SentCodeTypeCall extends VirtualClass implements SentCodeTypeCallArgs { + CONSTRUCTOR_id: 1398007207; + SUBCLASS_OF_ID: 4284159374; + classType: "constructor"; + className: "auth.SentCodeTypeCall"; + length: int; + fromReader(reader: Reader): SentCodeTypeCall; + } + + export interface SentCodeTypeFlashCallArgs { + /** pattern to match */ + pattern: string; + } + + /** + * The code will be sent via a flash phone call, that will be closed immediately. The phone code will then be the phone number itself, just make sure that the phone number matches the specified pattern.
+ * @link https://corefork.telegram.org/api/pattern + */ + export class SentCodeTypeFlashCall extends VirtualClass implements SentCodeTypeFlashCallArgs { + CONSTRUCTOR_id: -1425815847; + SUBCLASS_OF_ID: 4284159374; + classType: "constructor"; + className: "auth.SentCodeTypeFlashCall"; + pattern: string; + fromReader(reader: Reader): SentCodeTypeFlashCall; + } + + export interface LoginTokenArgs { + /** Expiry date of QR code */ + expires: int; + /** Token to render in QR code */ + token: bytes; + } + + /** + * Login token (for QR code login)
+ * @link https://corefork.telegram.org/api/qr-login + */ + export class LoginToken extends VirtualClass implements LoginTokenArgs { + CONSTRUCTOR_id: 1654593920; + SUBCLASS_OF_ID: 1800795702; + classType: "constructor"; + className: "auth.LoginToken"; + expires: int; + token: bytes; + fromReader(reader: Reader): LoginToken; + } + + export interface LoginTokenMigrateToArgs { + /** DC ID */ + dcId: int; + /** Token to use for login */ + token: bytes; + } + + /** Repeat the query to the specified DC
*/ + export class LoginTokenMigrateTo extends VirtualClass implements LoginTokenMigrateToArgs { + CONSTRUCTOR_id: 110008598; + SUBCLASS_OF_ID: 1800795702; + classType: "constructor"; + className: "auth.LoginTokenMigrateTo"; + dcId: int; + token: bytes; + fromReader(reader: Reader): LoginTokenMigrateTo; + } + + export interface LoginTokenSuccessArgs { + /** Authorization info */ + authorization: auth.TypeAuthorization; + } + + /** Login via token (QR code) succeded!
*/ + export class LoginTokenSuccess extends VirtualClass implements LoginTokenSuccessArgs { + CONSTRUCTOR_id: 957176926; + SUBCLASS_OF_ID: 1800795702; + classType: "constructor"; + className: "auth.LoginTokenSuccess"; + authorization: auth.TypeAuthorization; + fromReader(reader: Reader): LoginTokenSuccess; + } + + export interface SendCodeArgs { + /** Phone number in international format */ + phoneNumber: string; + /** Application identifier (see App configuration) */ + apiId: int; + /** Application secret hash (see App configuration) */ + apiHash: string; + /** Settings for the code type to send */ + settings: TypeCodeSettings; + } + + /** + * Send the verification code for login
+ * @throws {{code:400,type:"API_ID_INVALID"}} API ID invalid. + * @throws {{code:400,type:"API_ID_PUBLISHED_FLOOD"}} This API id was published somewhere, you can't use it now. + * @throws {{code:401,type:"AUTH_KEY_PERM_EMPTY"}} The temporary auth key must be binded to the permanent auth key to use these methods. + * @throws {{code:303,type:"NETWORK_MIGRATE_X"}} Repeat the query to data-center X. + * @throws {{code:303,type:"PHONE_MIGRATE_X"}} Repeat the query to data-center X. + * @throws {{code:400,type:"PHONE_NUMBER_APP_SIGNUP_FORBIDDEN"}} You can't sign up using this app. + * @throws {{code:400,type:"PHONE_NUMBER_BANNED"}} The provided phone number is banned from telegram. + * @throws {{code:400,type:"PHONE_NUMBER_FLOOD"}} You asked for the code too many times. + * @throws {{code:400,type:"PHONE_NUMBER_INVALID"}} Invalid phone number. + * @throws {{code:406,type:"PHONE_PASSWORD_FLOOD"}} You have tried logging in too many times. + * @throws {{code:400,type:"PHONE_PASSWORD_PROTECTED"}} This phone is password protected. + * @throws {{code:400,type:"SMS_CODE_CREATE_FAILED"}} An error occurred while creating the SMS code. + */ + export class SendCode extends Request,auth.TypeSentCode> implements SendCodeArgs { + CONSTRUCTOR_id: -1502141361; + SUBCLASS_OF_ID: 1827172481; + classType: "request"; + className: "auth.SendCode"; + phoneNumber: string; + apiId: int; + apiHash: string; + settings: TypeCodeSettings; + fromReader(reader: Reader): SendCode; + } + + export interface SignUpArgs { + /** Phone number in the international format */ + phoneNumber: string; + /** SMS-message ID */ + phoneCodeHash: string; + /** New user first name */ + firstName: string; + /** New user last name */ + lastName: string; + } + + /** + * Registers a validated phone number in the system.
+ * @throws {{code:400,type:"FIRSTNAME_INVALID"}} Invalid first name. + * @throws {{code:400,type:"LASTNAME_INVALID"}} Invalid last name. + * @throws {{code:400,type:"PHONE_CODE_EMPTY"}} phone_code from a SMS is empty. + * @throws {{code:400,type:"PHONE_CODE_EXPIRED"}} SMS expired. + * @throws {{code:400,type:"PHONE_CODE_INVALID"}} Invalid SMS code was sent. + * @throws {{code:400,type:"PHONE_NUMBER_FLOOD"}} You asked for the code too many times. + * @throws {{code:400,type:"PHONE_NUMBER_INVALID"}} Invalid phone number. + * @throws {{code:400,type:"PHONE_NUMBER_OCCUPIED"}} The phone number is already in use. + */ + export class SignUp extends Request,auth.TypeAuthorization> implements SignUpArgs { + CONSTRUCTOR_id: -2131827673; + SUBCLASS_OF_ID: 3118485049; + classType: "request"; + className: "auth.SignUp"; + phoneNumber: string; + phoneCodeHash: string; + firstName: string; + lastName: string; + fromReader(reader: Reader): SignUp; + } + + export interface SignInArgs { + /** Phone number in the international format */ + phoneNumber: string; + /** SMS-message ID, obtained from auth.sendCode */ + phoneCodeHash: string; + /** Valid numerical code from the SMS-message */ + phoneCode: string; + } + + /** + * Signs in a user with a validated phone number.
+ * @link https://corefork.telegram.org/method/auth.sendCode + * @throws {{code:400,type:"PHONE_CODE_EMPTY"}} phone_code from the SMS is empty. + * @throws {{code:400,type:"PHONE_CODE_EXPIRED"}} SMS expired. + * @throws {{code:400,type:"PHONE_CODE_INVALID"}} Invalid SMS code was sent. + * @throws {{code:400,type:"PHONE_NUMBER_INVALID"}} Invalid phone number. + * @throws {{code:400,type:"PHONE_NUMBER_UNOCCUPIED"}} The code is valid but no user with the given number is registered. + */ + export class SignIn extends Request,auth.TypeAuthorization> implements SignInArgs { + CONSTRUCTOR_id: -1126886015; + SUBCLASS_OF_ID: 3118485049; + classType: "request"; + className: "auth.SignIn"; + phoneNumber: string; + phoneCodeHash: string; + phoneCode: string; + fromReader(reader: Reader): SignIn; + } + + /** Logs out the user.
*/ + export class LogOut extends Request,Bool> { + CONSTRUCTOR_id: 1461180992; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "auth.LogOut"; + fromReader(reader: Reader): LogOut; + } + + /** + * Terminates all user's authorized sessions except for the current one.
After calling this method it is necessary to reregister the current device using the method account.registerDevice
+ * @link https://corefork.telegram.org/method/account.registerDevice + * @link https://corefork.telegram.org/api/push-updates + * @throws {{code:406,type:"FRESH_RESET_AUTHORISATION_FORBIDDEN"}} You can't logout other sessions if less than 24 hours have passed since you logged on the current session. + */ + export class ResetAuthorizations extends Request,Bool> { + CONSTRUCTOR_id: -1616179942; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "auth.ResetAuthorizations"; + fromReader(reader: Reader): ResetAuthorizations; + } + + export interface ExportAuthorizationArgs { + /** Number of a target data-centre */ + dcId: int; + } + + /** + * Returns data for copying authorization to another data-centre.
+ * @throws {{code:400,type:"DC_ID_INVALID"}} The provided DC ID is invalid. + */ + export class ExportAuthorization extends Request,auth.TypeExportedAuthorization> implements ExportAuthorizationArgs { + CONSTRUCTOR_id: -440401971; + SUBCLASS_OF_ID: 1607593041; + classType: "request"; + className: "auth.ExportAuthorization"; + dcId: int; + fromReader(reader: Reader): ExportAuthorization; + } + + export interface ImportAuthorizationArgs { + /** User ID */ + id: int; + /** Authorization key */ + bytes: bytes; + } + + /** + * Logs in a user using a key transmitted from his native data-centre.
+ * @throws {{code:400,type:"AUTH_BYTES_INVALID"}} The provided authorization is invalid. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class ImportAuthorization extends Request,auth.TypeAuthorization> implements ImportAuthorizationArgs { + CONSTRUCTOR_id: -470837741; + SUBCLASS_OF_ID: 3118485049; + classType: "request"; + className: "auth.ImportAuthorization"; + id: int; + bytes: bytes; + fromReader(reader: Reader): ImportAuthorization; + } + + export interface BindTempAuthKeyArgs { + /** Permanent auth_key_id to bind to */ + permAuthKeyId: long; + /** Random long from Binding message contents */ + nonce: long; + /** Unix timestamp to invalidate temporary key, see Binding message contents */ + expiresAt: int; + /** See Generating encrypted_message */ + encryptedMessage: bytes; + } + + /** + * Binds a temporary authorization key temp_auth_key_id to the permanent authorization key perm_auth_key_id. Each permanent key may only be bound to one temporary key at a time, binding a new temporary key overwrites the previous one.
For more information, see Perfect Forward Secrecy.
+ * @link https://corefork.telegram.org/api/pfs + * @link https://corefork.telegram.org/type/long + * @link https://corefork.telegram.org/mtproto/serialize + * @link https://corefork.telegram.org/type/int + * @link https://corefork.telegram.org/mtproto/serialize + * @link https://corefork.telegram.org/mtproto/description + * @link https://corefork.telegram.org/api/invoking + * @link https://corefork.telegram.org/method/initConnection + * @throws {{code:400,type:"ENCRYPTED_MESSAGE_INVALID"}} Encrypted message is incorrect. + * @throws {{code:400,type:"TEMP_AUTH_KEY_ALREADY_BOUND"}} The passed temporary key is already bound to another perm_auth_key_id. + * @throws {{code:400,type:"TEMP_AUTH_KEY_EMPTY"}} The request was not performed with a temporary authorization key. + */ + export class BindTempAuthKey extends Request,Bool> implements BindTempAuthKeyArgs { + CONSTRUCTOR_id: -841733627; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "auth.BindTempAuthKey"; + permAuthKeyId: long; + nonce: long; + expiresAt: int; + encryptedMessage: bytes; + fromReader(reader: Reader): BindTempAuthKey; + } + + export interface ImportBotAuthorizationArgs { + /** Reserved for future use */ + flags: int; + /** Application identifier (see. App configuration) */ + apiId: int; + /** Application identifier hash (see. App configuration) */ + apiHash: string; + /** Bot token (see bots) */ + botAuthToken: string; + } + + /** + * Login as a bot
+ * @link https://corefork.telegram.org/bots + * @throws {{code:400,type:"ACCESS_TOKEN_EXPIRED"}} Bot token expired. + * @throws {{code:400,type:"ACCESS_TOKEN_INVALID"}} The provided token is not valid. + * @throws {{code:400,type:"API_ID_INVALID"}} The api_id/api_hash combination is invalid. + * @throws {{code:400,type:"API_ID_PUBLISHED_FLOOD"}} This API id was published somewhere, you can't use it now. + * @throws {{code:401,type:"AUTH_KEY_INVALID"}} Auth key invalid. + */ + export class ImportBotAuthorization extends Request,auth.TypeAuthorization> implements ImportBotAuthorizationArgs { + CONSTRUCTOR_id: 1738800940; + SUBCLASS_OF_ID: 3118485049; + classType: "request"; + className: "auth.ImportBotAuthorization"; + flags: int; + apiId: int; + apiHash: string; + botAuthToken: string; + fromReader(reader: Reader): ImportBotAuthorization; + } + + export interface CheckPasswordArgs { + /** The account's password (see SRP) */ + password: TypeInputCheckPasswordSRP; + } + + /** + * Try logging to an account protected by a 2FA password.
+ * @link https://corefork.telegram.org/api/srp + * @throws {{code:400,type:"PASSWORD_HASH_INVALID"}} The provided password isn't valid. + * @throws {{code:400,type:"SRP_ID_INVALID"}} Invalid SRP ID provided. + * @throws {{code:400,type:"SRP_PASSWORD_CHANGED"}} Password has changed. + */ + export class CheckPassword extends Request,auth.TypeAuthorization> implements CheckPasswordArgs { + CONSTRUCTOR_id: -779399914; + SUBCLASS_OF_ID: 3118485049; + classType: "request"; + className: "auth.CheckPassword"; + password: TypeInputCheckPasswordSRP; + fromReader(reader: Reader): CheckPassword; + } + + /** + * Request recovery code of a 2FA password, only for accounts with a recovery email configured.
+ * @link https://corefork.telegram.org/api/srp + * @throws {{code:400,type:"PASSWORD_EMPTY"}} The provided password is empty. + * @throws {{code:400,type:"PASSWORD_RECOVERY_NA"}} No email was set, can't recover password via email. + */ + export class RequestPasswordRecovery extends Request,auth.TypePasswordRecovery> { + CONSTRUCTOR_id: -661144474; + SUBCLASS_OF_ID: 4201829434; + classType: "request"; + className: "auth.RequestPasswordRecovery"; + fromReader(reader: Reader): RequestPasswordRecovery; + } + + export interface RecoverPasswordArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Code received via email */ + code: string; + /** New password */ + newSettings?: account.TypePasswordInputSettings; + } + + /** + * Reset the 2FA password using the recovery code sent using auth.requestPasswordRecovery.
+ * @link https://corefork.telegram.org/api/srp + * @link https://corefork.telegram.org/method/auth.requestPasswordRecovery + * @link https://corefork.telegram.org/api/srp + * @throws {{code:400,type:"CODE_EMPTY"}} The provided code is empty. + * @throws {{code:400,type:"NEW_SETTINGS_INVALID"}} The new settings are invalid. + */ + export class RecoverPassword extends Request,auth.TypeAuthorization> implements RecoverPasswordArgs { + CONSTRUCTOR_id: 923364464; + SUBCLASS_OF_ID: 3118485049; + classType: "request"; + className: "auth.RecoverPassword"; + flags: number; + code: string; + newSettings?: account.TypePasswordInputSettings; + fromReader(reader: Reader): RecoverPassword; + } + + export interface ResendCodeArgs { + /** The phone number */ + phoneNumber: string; + /** The phone code hash obtained from auth.sendCode */ + phoneCodeHash: string; + } + + /** + * Resend the login code via another medium, the phone code type is determined by the return value of the previous auth.sendCode/auth.resendCode: see login for more info.
+ * @link https://corefork.telegram.org/method/auth.sendCode + * @link https://corefork.telegram.org/api/auth + * @throws {{code:400,type:"PHONE_CODE_EXPIRED"}} The phone code you provided has expired, this may happen if it was sent to any chat on telegram (if the code is sent through a telegram chat (not the official account) to avoid it append or prepend to the code some chars). + * @throws {{code:400,type:"PHONE_CODE_HASH_EMPTY"}} phone_code_hash is missing. + * @throws {{code:400,type:"PHONE_NUMBER_INVALID"}} The phone number is invalid. + * @throws {{code:406,type:"SEND_CODE_UNAVAILABLE"}} Returned when all available options for this type of number were already used (e.g. flash-call, then SMS, then this error might be returned to trigger a second resend). + */ + export class ResendCode extends Request,auth.TypeSentCode> implements ResendCodeArgs { + CONSTRUCTOR_id: 1056025023; + SUBCLASS_OF_ID: 1827172481; + classType: "request"; + className: "auth.ResendCode"; + phoneNumber: string; + phoneCodeHash: string; + fromReader(reader: Reader): ResendCode; + } + + export interface CancelCodeArgs { + /** Phone number */ + phoneNumber: string; + /** Phone code hash from auth.sendCode */ + phoneCodeHash: string; + } + + /** + * Cancel the login verification code
+ * @link https://corefork.telegram.org/method/auth.sendCode + * @throws {{code:400,type:"PHONE_CODE_EXPIRED"}} The phone code you provided has expired, this may happen if it was sent to any chat on telegram (if the code is sent through a telegram chat (not the official account) to avoid it append or prepend to the code some chars). + * @throws {{code:400,type:"PHONE_NUMBER_INVALID"}} The phone number is invalid. + */ + export class CancelCode extends Request,Bool> implements CancelCodeArgs { + CONSTRUCTOR_id: 520357240; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "auth.CancelCode"; + phoneNumber: string; + phoneCodeHash: string; + fromReader(reader: Reader): CancelCode; + } + + export interface DropTempAuthKeysArgs { + /** The auth keys that shouldn't be dropped. */ + exceptAuthKeys: long[]; + } + + /** Delete all temporary authorization keys except for the ones specified
*/ + export class DropTempAuthKeys extends Request,Bool> implements DropTempAuthKeysArgs { + CONSTRUCTOR_id: -1907842680; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "auth.DropTempAuthKeys"; + exceptAuthKeys: long[]; + fromReader(reader: Reader): DropTempAuthKeys; + } + + export interface ExportLoginTokenArgs { + /** Application identifier (see. App configuration) */ + apiId: int; + /** Application identifier hash (see. App configuration) */ + apiHash: string; + /** List of already logged-in user IDs, to prevent logging in twice with the same user */ + exceptIds: int[]; + } + + /** + * Generate a login token, for login via QR code.
+ * The generated login token should be encoded using base64url, then shown as a tg://login?token=base64encodedtoken URL in the QR code.
For more info, see login via QR code.
+ * @link https://corefork.telegram.org/api/qr-login + * @throws {{code:400,type:"API_ID_INVALID"}} API ID invalid. + */ + export class ExportLoginToken extends Request,auth.TypeLoginToken> implements ExportLoginTokenArgs { + CONSTRUCTOR_id: -1313598185; + SUBCLASS_OF_ID: 1800795702; + classType: "request"; + className: "auth.ExportLoginToken"; + apiId: int; + apiHash: string; + exceptIds: int[]; + fromReader(reader: Reader): ExportLoginToken; + } + + export interface ImportLoginTokenArgs { + /** Login token */ + token: bytes; + } + + /** + * Login using a redirected login token, generated in case of DC mismatch during QR code login.
For more info, see login via QR code.
+ * @link https://corefork.telegram.org/api/qr-login + * @throws {{code:400,type:"AUTH_TOKEN_ALREADY_ACCEPTED"}} The specified auth token was already accepted. + * @throws {{code:400,type:"AUTH_TOKEN_EXPIRED"}} The authorization token has expired. + * @throws {{code:400,type:"AUTH_TOKEN_INVALID"}} The specified auth token is invalid. + * @throws {{code:400,type:"AUTH_TOKEN_INVALIDX"}} The specified auth token is invalid. + */ + export class ImportLoginToken extends Request,auth.TypeLoginToken> implements ImportLoginTokenArgs { + CONSTRUCTOR_id: -1783866140; + SUBCLASS_OF_ID: 1800795702; + classType: "request"; + className: "auth.ImportLoginToken"; + token: bytes; + fromReader(reader: Reader): ImportLoginToken; + } + + export interface AcceptLoginTokenArgs { + /** Login token embedded in QR code, for more info, see login via QR code. */ + token: bytes; + } + + /** + * Accept QR code login token, logging in the app that generated it.
Returns info about the new session.
For more info, see login via QR code.
+ * @link https://corefork.telegram.org/api/qr-login + * @throws {{code:400,type:"AUTH_TOKEN_INVALIDX"}} The specified auth token is invalid. + */ + export class AcceptLoginToken extends Request,TypeAuthorization> implements AcceptLoginTokenArgs { + CONSTRUCTOR_id: -392909491; + SUBCLASS_OF_ID: 3373514778; + classType: "request"; + className: "auth.AcceptLoginToken"; + token: bytes; + fromReader(reader: Reader): AcceptLoginToken; + } + + export interface CheckRecoveryPasswordArgs { + /** Code received via email */ + code: string; + } + + /** + * Check if the 2FA recovery code sent using auth.requestPasswordRecovery is valid, before passing it to auth.recoverPassword.
+ * @link https://corefork.telegram.org/api/srp + * @link https://corefork.telegram.org/method/auth.requestPasswordRecovery + * @link https://corefork.telegram.org/api/srp + * @link https://corefork.telegram.org/method/auth.recoverPassword + * @link https://corefork.telegram.org/api/srp + * @link https://corefork.telegram.org/method/auth.requestPasswordRecovery + * @throws {{code:400,type:"PASSWORD_RECOVERY_EXPIRED"}} The recovery code has expired. + */ + export class CheckRecoveryPassword extends Request,Bool> implements CheckRecoveryPasswordArgs { + CONSTRUCTOR_id: 221691769; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "auth.CheckRecoveryPassword"; + code: string; + fromReader(reader: Reader): CheckRecoveryPassword; + } + + type TypeSentCode = SentCode; + type TypeAuthorization = Authorization | AuthorizationSignUpRequired; + type TypeExportedAuthorization = ExportedAuthorization; + type TypePasswordRecovery = PasswordRecovery; + type TypeCodeType = CodeTypeSms | CodeTypeCall | CodeTypeFlashCall; + type TypeSentCodeType = SentCodeTypeApp | SentCodeTypeSms | SentCodeTypeCall | SentCodeTypeFlashCall; + type TypeLoginToken = LoginToken | LoginTokenMigrateTo | LoginTokenSuccess; + } + + namespace contacts { + /** Contact list on the server is the same as the list on the client.
*/ + export class ContactsNotModified extends VirtualClass { + CONSTRUCTOR_id: -1219778094; + SUBCLASS_OF_ID: 951985654; + classType: "constructor"; + className: "contacts.ContactsNotModified"; + fromReader(reader: Reader): ContactsNotModified; + } + + export interface ContactsArgs { + /** Contact list */ + contacts: TypeContact[]; + /** Number of contacts that were saved successfully */ + savedCount: int; + /** User list */ + users: TypeUser[]; + } + + /** The current user's contact list and info on users.
*/ + export class Contacts extends VirtualClass implements ContactsArgs { + CONSTRUCTOR_id: -353862078; + SUBCLASS_OF_ID: 951985654; + classType: "constructor"; + className: "contacts.Contacts"; + contacts: TypeContact[]; + savedCount: int; + users: TypeUser[]; + fromReader(reader: Reader): Contacts; + } + + export interface ImportedContactsArgs { + /** List of succesfully imported contacts */ + imported: TypeImportedContact[]; + /** Popular contacts */ + popularInvites: TypePopularContact[]; + /** List of contact ids that could not be imported due to system limitation and will need to be imported at a later date.
Parameter added in Layer 13 */ + retryContacts: long[]; + /** List of users */ + users: TypeUser[]; + } + + /** + * Info on succesfully imported contacts.
+ * @link https://corefork.telegram.org/api/layers + */ + export class ImportedContacts extends VirtualClass implements ImportedContactsArgs { + CONSTRUCTOR_id: 2010127419; + SUBCLASS_OF_ID: 2171776403; + classType: "constructor"; + className: "contacts.ImportedContacts"; + imported: TypeImportedContact[]; + popularInvites: TypePopularContact[]; + retryContacts: long[]; + users: TypeUser[]; + fromReader(reader: Reader): ImportedContacts; + } + + export interface BlockedArgs { + /** List of blocked users */ + blocked: TypePeerBlocked[]; + /** Blocked chats */ + chats: TypeChat[]; + /** List of users */ + users: TypeUser[]; + } + + /** Full list of blocked users.
*/ + export class Blocked extends VirtualClass implements BlockedArgs { + CONSTRUCTOR_id: 182326673; + SUBCLASS_OF_ID: 4290400079; + classType: "constructor"; + className: "contacts.Blocked"; + blocked: TypePeerBlocked[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): Blocked; + } + + export interface BlockedSliceArgs { + /** Total number of elements in the list */ + count: int; + /** List of blocked users */ + blocked: TypePeerBlocked[]; + /** Blocked chats */ + chats: TypeChat[]; + /** List of users */ + users: TypeUser[]; + } + + /** Incomplete list of blocked users.
*/ + export class BlockedSlice extends VirtualClass implements BlockedSliceArgs { + CONSTRUCTOR_id: -513392236; + SUBCLASS_OF_ID: 4290400079; + classType: "constructor"; + className: "contacts.BlockedSlice"; + count: int; + blocked: TypePeerBlocked[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): BlockedSlice; + } + + export interface FoundArgs { + /** Personalized results */ + myResults: TypePeer[]; + /** List of found user identifiers */ + results: TypePeer[]; + /** Found chats */ + chats: TypeChat[]; + /** List of users */ + users: TypeUser[]; + } + + /** Users found by name substring and auxiliary data.
*/ + export class Found extends VirtualClass implements FoundArgs { + CONSTRUCTOR_id: -1290580579; + SUBCLASS_OF_ID: 1132896995; + classType: "constructor"; + className: "contacts.Found"; + myResults: TypePeer[]; + results: TypePeer[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): Found; + } + + export interface ResolvedPeerArgs { + /** The peer */ + peer: TypePeer; + /** Chats */ + chats: TypeChat[]; + /** Users */ + users: TypeUser[]; + } + + /** Resolved peer
*/ + export class ResolvedPeer extends VirtualClass implements ResolvedPeerArgs { + CONSTRUCTOR_id: 2131196633; + SUBCLASS_OF_ID: 4033196968; + classType: "constructor"; + className: "contacts.ResolvedPeer"; + peer: TypePeer; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): ResolvedPeer; + } + + /** Top peer info hasn't changed
*/ + export class TopPeersNotModified extends VirtualClass { + CONSTRUCTOR_id: -567906571; + SUBCLASS_OF_ID: 2666052488; + classType: "constructor"; + className: "contacts.TopPeersNotModified"; + fromReader(reader: Reader): TopPeersNotModified; + } + + export interface TopPeersArgs { + /** Top peers by top peer category */ + categories: TypeTopPeerCategoryPeers[]; + /** Chats */ + chats: TypeChat[]; + /** Users */ + users: TypeUser[]; + } + + /** Top peers
*/ + export class TopPeers extends VirtualClass implements TopPeersArgs { + CONSTRUCTOR_id: 1891070632; + SUBCLASS_OF_ID: 2666052488; + classType: "constructor"; + className: "contacts.TopPeers"; + categories: TypeTopPeerCategoryPeers[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): TopPeers; + } + + /** Top peers disabled
*/ + export class TopPeersDisabled extends VirtualClass { + CONSTRUCTOR_id: -1255369827; + SUBCLASS_OF_ID: 2666052488; + classType: "constructor"; + className: "contacts.TopPeersDisabled"; + fromReader(reader: Reader): TopPeersDisabled; + } + + export interface GetContactIDsArgs { + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get contact by telegram IDs
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetContactIDs extends Request,int[]> implements GetContactIDsArgs { + CONSTRUCTOR_id: 749357634; + SUBCLASS_OF_ID: 1344696591; + classType: "request"; + className: "contacts.GetContactIDs"; + hash: int; + fromReader(reader: Reader): GetContactIDs; + } + + /** Returns the list of contact statuses.
*/ + export class GetStatuses extends Request,TypeContactStatus[]> { + CONSTRUCTOR_id: -995929106; + SUBCLASS_OF_ID: 3749797008; + classType: "request"; + className: "contacts.GetStatuses"; + fromReader(reader: Reader): GetStatuses; + } + + export interface GetContactsArgs { + /** If there already is a full contact list on the client, a hash of a the list of contact IDs in ascending order may be passed in this parameter. If the contact set was not changed, (contacts.contactsNotModified) will be returned. */ + hash: int; + } + + /** + * Returns the current user's contact list.
+ * @link https://corefork.telegram.org/api/offsets + * @link https://corefork.telegram.org/constructor/contacts.contactsNotModified + */ + export class GetContacts extends Request,contacts.TypeContacts> implements GetContactsArgs { + CONSTRUCTOR_id: -1071414113; + SUBCLASS_OF_ID: 951985654; + classType: "request"; + className: "contacts.GetContacts"; + hash: int; + fromReader(reader: Reader): GetContacts; + } + + export interface ImportContactsArgs { + /** List of contacts to import */ + contacts: TypeInputContact[]; + } + + /** + * Imports contacts: saves a full list on the server, adds already registered contacts to the contact list, returns added contacts and their info.
Use contacts.addContact to add Telegram contacts without actually using their phone number.
+ * @link https://corefork.telegram.org/method/contacts.addContact + * @link https://corefork.telegram.org/method/contacts.importContacts + */ + export class ImportContacts extends Request,contacts.TypeImportedContacts> implements ImportContactsArgs { + CONSTRUCTOR_id: 746589157; + SUBCLASS_OF_ID: 2171776403; + classType: "request"; + className: "contacts.ImportContacts"; + contacts: TypeInputContact[]; + fromReader(reader: Reader): ImportContacts; + } + + export interface DeleteContactsArgs { + /** User ID list */ + id: TypeInputUser[]; + } + + /** Deletes several contacts from the list.
*/ + export class DeleteContacts extends Request,TypeUpdates> implements DeleteContactsArgs { + CONSTRUCTOR_id: 157945344; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "contacts.DeleteContacts"; + id: TypeInputUser[]; + fromReader(reader: Reader): DeleteContacts; + } + + export interface DeleteByPhonesArgs { + /** Phone numbers */ + phones: string[]; + } + + /** Delete contacts by phone number
*/ + export class DeleteByPhones extends Request,Bool> implements DeleteByPhonesArgs { + CONSTRUCTOR_id: 269745566; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "contacts.DeleteByPhones"; + phones: string[]; + fromReader(reader: Reader): DeleteByPhones; + } + + export interface BlockArgs { + /** User ID */ + id: EntityLike; + } + + /** + * Adds the user to the blacklist.
+ * @throws {{code:400,type:"CONTACT_ID_INVALID"}} The provided contact ID is invalid. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class Block extends Request,Bool> implements BlockArgs { + CONSTRUCTOR_id: 1758204945; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "contacts.Block"; + id: EntityLike; + fromReader(reader: Reader): Block; + } + + export interface UnblockArgs { + /** User ID */ + id: EntityLike; + } + + /** + * Deletes the user from the blacklist.
+ * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CONTACT_ID_INVALID"}} The provided contact ID is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class Unblock extends Request,Bool> implements UnblockArgs { + CONSTRUCTOR_id: -1096393392; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "contacts.Unblock"; + id: EntityLike; + fromReader(reader: Reader): Unblock; + } + + export interface GetBlockedArgs { + /** The number of list elements to be skipped */ + offset: int; + /** The number of list elements to be returned */ + limit: int; + } + + /** Returns the list of blocked users.
*/ + export class GetBlocked extends Request,contacts.TypeBlocked> implements GetBlockedArgs { + CONSTRUCTOR_id: -176409329; + SUBCLASS_OF_ID: 4290400079; + classType: "request"; + className: "contacts.GetBlocked"; + offset: int; + limit: int; + fromReader(reader: Reader): GetBlocked; + } + + export interface SearchArgs { + /** Target substring */ + q: string; + /** Maximum number of users to be returned */ + limit: int; + } + + /** + * Returns users found by username substring.
+ * @throws {{code:400,type:"QUERY_TOO_SHORT"}} The query string is too short. + * @throws {{code:400,type:"SEARCH_QUERY_EMPTY"}} The search query is empty. + */ + export class Search extends Request,contacts.TypeFound> implements SearchArgs { + CONSTRUCTOR_id: 301470424; + SUBCLASS_OF_ID: 1132896995; + classType: "request"; + className: "contacts.Search"; + q: string; + limit: int; + fromReader(reader: Reader): Search; + } + + export interface ResolveUsernameArgs { + /** @username to resolve */ + username: string; + } + + /** + * Resolve a @username to get peer info
+ * @throws {{code:401,type:"AUTH_KEY_PERM_EMPTY"}} The temporary auth key must be binded to the permanent auth key to use these methods. + * @throws {{code:400,type:"CONNECTION_LAYER_INVALID"}} Layer invalid. + * @throws {{code:400,type:"USERNAME_INVALID"}} The provided username is not valid. + * @throws {{code:400,type:"USERNAME_NOT_OCCUPIED"}} The provided username is not occupied. + */ + export class ResolveUsername extends Request,contacts.TypeResolvedPeer> implements ResolveUsernameArgs { + CONSTRUCTOR_id: -113456221; + SUBCLASS_OF_ID: 4033196968; + classType: "request"; + className: "contacts.ResolveUsername"; + username: string; + fromReader(reader: Reader): ResolveUsername; + } + + export interface GetTopPeersArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Users we've chatted most frequently with */ + correspondents?: true; + /** Most used bots */ + botsPm?: true; + /** Most used inline bots */ + botsInline?: true; + /** Most frequently called users */ + phoneCalls?: true; + /** Users to which the users often forwards messages to */ + forwardUsers?: true; + /** Chats to which the users often forwards messages to */ + forwardChats?: true; + /** Often-opened groups and supergroups */ + groups?: true; + /** Most frequently visited channels */ + channels?: true; + /** Offset for pagination */ + offset: int; + /** Maximum number of results to return, see pagination */ + limit: int; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get most used peers
+ * @link https://corefork.telegram.org/api/offsets + * @throws {{code:400,type:"TYPES_EMPTY"}} No top peer type was provided. + */ + export class GetTopPeers extends Request,contacts.TypeTopPeers> implements GetTopPeersArgs { + CONSTRUCTOR_id: -728224331; + SUBCLASS_OF_ID: 2666052488; + classType: "request"; + className: "contacts.GetTopPeers"; + flags: number; + correspondents?: true; + botsPm?: true; + botsInline?: true; + phoneCalls?: true; + forwardUsers?: true; + forwardChats?: true; + groups?: true; + channels?: true; + offset: int; + limit: int; + hash: int; + fromReader(reader: Reader): GetTopPeers; + } + + export interface ResetTopPeerRatingArgs { + /** Top peer category */ + category: TypeTopPeerCategory; + /** Peer whose rating should be reset */ + peer: EntityLike; + } + + /** + * Reset rating of top peer
+ * @link https://corefork.telegram.org/api/top-rating + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class ResetTopPeerRating extends Request,Bool> implements ResetTopPeerRatingArgs { + CONSTRUCTOR_id: 451113900; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "contacts.ResetTopPeerRating"; + category: TypeTopPeerCategory; + peer: EntityLike; + fromReader(reader: Reader): ResetTopPeerRating; + } + + /** Delete saved contacts
*/ + export class ResetSaved extends Request,Bool> { + CONSTRUCTOR_id: -2020263951; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "contacts.ResetSaved"; + fromReader(reader: Reader): ResetSaved; + } + + /** + * Get all contacts
+ * @throws {{code:403,type:"TAKEOUT_REQUIRED"}} A takeout session has to be initialized, first. + */ + export class GetSaved extends Request,TypeSavedContact[]> { + CONSTRUCTOR_id: -2098076769; + SUBCLASS_OF_ID: 158718959; + classType: "request"; + className: "contacts.GetSaved"; + fromReader(reader: Reader): GetSaved; + } + + export interface ToggleTopPeersArgs { + /** Enable/disable */ + enabled: Bool; + } + + /** + * Enable/disable top peers
+ * @link https://corefork.telegram.org/api/top-rating + */ + export class ToggleTopPeers extends Request,Bool> implements ToggleTopPeersArgs { + CONSTRUCTOR_id: -2062238246; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "contacts.ToggleTopPeers"; + enabled: Bool; + fromReader(reader: Reader): ToggleTopPeers; + } + + export interface AddContactArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Allow the other user to see our phone number? */ + addPhonePrivacyException?: true; + /** Telegram ID of the other user */ + id: TypeInputUser; + /** First name */ + firstName: string; + /** Last name */ + lastName: string; + /** User's phone number */ + phone: string; + } + + /** + * Add an existing telegram user as contact.
Use contacts.importContacts to add contacts by phone number, without knowing their Telegram ID.
+ * @link https://corefork.telegram.org/method/contacts.importContacts + * @link https://corefork.telegram.org/method/contacts.addContact + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CONTACT_ID_INVALID"}} The provided contact ID is invalid. + * @throws {{code:400,type:"CONTACT_NAME_EMPTY"}} Contact name empty. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class AddContact extends Request,TypeUpdates> implements AddContactArgs { + CONSTRUCTOR_id: -386636848; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "contacts.AddContact"; + flags: number; + addPhonePrivacyException?: true; + id: TypeInputUser; + firstName: string; + lastName: string; + phone: string; + fromReader(reader: Reader): AddContact; + } + + export interface AcceptContactArgs { + /** The user to add as contact */ + id: TypeInputUser; + } + + /** + * If the peer settings of a new user allow us to add him as contact, add that user as contact
+ * @link https://corefork.telegram.org/constructor/peerSettings + * @throws {{code:400,type:"CONTACT_ADD_MISSING"}} Contact to add is missing. + * @throws {{code:400,type:"CONTACT_ID_INVALID"}} The provided contact ID is invalid. + * @throws {{code:400,type:"CONTACT_REQ_MISSING"}} Missing contact request. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class AcceptContact extends Request,TypeUpdates> implements AcceptContactArgs { + CONSTRUCTOR_id: -130964977; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "contacts.AcceptContact"; + id: TypeInputUser; + fromReader(reader: Reader): AcceptContact; + } + + export interface GetLocatedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** While the geolocation of the current user is public, clients should update it in the background every half-an-hour or so, while setting this flag.
Do this only if the new location is more than 1 KM away from the previous one, or if the previous location is unknown. */ + background?: true; + /** Geolocation */ + geoPoint: TypeInputGeoPoint; + /** If set, the geolocation of the current user will be public for the specified number of seconds; pass 0x7fffffff to disable expiry, 0 to make the current geolocation private; if the flag isn't set, no changes will be applied. */ + selfExpires?: int; + } + + /** + * Get contacts near you
+ * @throws {{code:400,type:"GEO_POINT_INVALID"}} Invalid geoposition provided. + * @throws {{code:406,type:"USERPIC_PRIVACY_REQUIRED"}} You need to disable privacy settings for your profile picture in order to make your geolocation public. + * @throws {{code:406,type:"USERPIC_UPLOAD_REQUIRED"}} You must have a profile picture to publish your geolocation. + */ + export class GetLocated extends Request,TypeUpdates> implements GetLocatedArgs { + CONSTRUCTOR_id: -750207932; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "contacts.GetLocated"; + flags: number; + background?: true; + geoPoint: TypeInputGeoPoint; + selfExpires?: int; + fromReader(reader: Reader): GetLocated; + } + + export interface BlockFromRepliesArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to delete the specified message as well */ + deleteMessage?: true; + /** Whether to delete all @replies messages from this user as well */ + deleteHistory?: true; + /** Whether to also report this user for spam */ + reportSpam?: true; + /** ID of the message in the @replies chat */ + msgId: MessageIDLike; + } + + /** + * Stop getting notifications about thread replies of a certain user in @replies
+ * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + */ + export class BlockFromReplies extends Request,TypeUpdates> implements BlockFromRepliesArgs { + CONSTRUCTOR_id: 698914348; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "contacts.BlockFromReplies"; + flags: number; + deleteMessage?: true; + deleteHistory?: true; + reportSpam?: true; + msgId: MessageIDLike; + fromReader(reader: Reader): BlockFromReplies; + } + + type TypeContacts = ContactsNotModified | Contacts; + type TypeImportedContacts = ImportedContacts; + type TypeBlocked = Blocked | BlockedSlice; + type TypeFound = Found; + type TypeResolvedPeer = ResolvedPeer; + type TypeTopPeers = TopPeersNotModified | TopPeers | TopPeersDisabled; + } + + namespace messages { + export interface DialogsArgs { + /** List of chats */ + dialogs: TypeDialog[]; + /** List of last messages from each chat */ + messages: TypeMessage[]; + /** List of groups mentioned in the chats */ + chats: TypeChat[]; + /** List of users mentioned in messages and groups */ + users: TypeUser[]; + } + + /** Full list of chats with messages and auxiliary data.
*/ + export class Dialogs extends VirtualClass implements DialogsArgs { + CONSTRUCTOR_id: 364538944; + SUBCLASS_OF_ID: 236671726; + classType: "constructor"; + className: "messages.Dialogs"; + dialogs: TypeDialog[]; + messages: TypeMessage[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): Dialogs; + } + + export interface DialogsSliceArgs { + /** Total number of dialogs */ + count: int; + /** List of dialogs */ + dialogs: TypeDialog[]; + /** List of last messages from dialogs */ + messages: TypeMessage[]; + /** List of chats mentioned in dialogs */ + chats: TypeChat[]; + /** List of users mentioned in messages and chats */ + users: TypeUser[]; + } + + /** Incomplete list of dialogs with messages and auxiliary data.
*/ + export class DialogsSlice extends VirtualClass implements DialogsSliceArgs { + CONSTRUCTOR_id: 1910543603; + SUBCLASS_OF_ID: 236671726; + classType: "constructor"; + className: "messages.DialogsSlice"; + count: int; + dialogs: TypeDialog[]; + messages: TypeMessage[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): DialogsSlice; + } + + export interface DialogsNotModifiedArgs { + /** Number of dialogs found server-side by the query */ + count: int; + } + + /** Dialogs haven't changed
*/ + export class DialogsNotModified extends VirtualClass implements DialogsNotModifiedArgs { + CONSTRUCTOR_id: -253500010; + SUBCLASS_OF_ID: 236671726; + classType: "constructor"; + className: "messages.DialogsNotModified"; + count: int; + fromReader(reader: Reader): DialogsNotModified; + } + + export interface MessagesArgs { + /** List of messages */ + messages: TypeMessage[]; + /** List of chats mentioned in dialogs */ + chats: TypeChat[]; + /** List of users mentioned in messages and chats */ + users: TypeUser[]; + } + + /** Full list of messages with auxilary data.
*/ + export class Messages extends VirtualClass implements MessagesArgs { + CONSTRUCTOR_id: -1938715001; + SUBCLASS_OF_ID: 3568569182; + classType: "constructor"; + className: "messages.Messages"; + messages: TypeMessage[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): Messages; + } + + export interface MessagesSliceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, indicates that the results may be inexact */ + inexact?: true; + /** Total number of messages in the list */ + count: int; + /** Rate to use in the offset_rate parameter in the next call to messages.searchGlobal */ + nextRate?: int; + /** Indicates the absolute position of messages[0] within the total result set with count count.
This is useful, for example, if the result was fetched using offset_id, and we need to display a progress/total counter (like photo 134 of 200, for all media in a chat, we could simply use photo ${offset_id_offset} of ${count}. */ + offsetIdOffset?: int; + /** List of messages */ + messages: TypeMessage[]; + /** List of chats mentioned in messages */ + chats: TypeChat[]; + /** List of users mentioned in messages and chats */ + users: TypeUser[]; + } + + /** + * Incomplete list of messages and auxiliary data.
+ * @link https://corefork.telegram.org/method/messages.searchGlobal + */ + export class MessagesSlice extends VirtualClass implements MessagesSliceArgs { + CONSTRUCTOR_id: 978610270; + SUBCLASS_OF_ID: 3568569182; + classType: "constructor"; + className: "messages.MessagesSlice"; + flags: number; + inexact?: true; + count: int; + nextRate?: int; + offsetIdOffset?: int; + messages: TypeMessage[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): MessagesSlice; + } + + export interface ChannelMessagesArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, returned results may be inexact */ + inexact?: true; + /** Event count after generation */ + pts: int; + /** Total number of results were found server-side (may not be all included here) */ + count: int; + /** Indicates the absolute position of messages[0] within the total result set with count count.
This is useful, for example, if the result was fetched using offset_id, and we need to display a progress/total counter (like photo 134 of 200, for all media in a chat, we could simply use photo ${offset_id_offset} of ${count}. */ + offsetIdOffset?: int; + /** Found messages */ + messages: TypeMessage[]; + /** Chats */ + chats: TypeChat[]; + /** Users */ + users: TypeUser[]; + } + + /** + * Channel messages
+ * @link https://corefork.telegram.org/api/updates + */ + export class ChannelMessages extends VirtualClass implements ChannelMessagesArgs { + CONSTRUCTOR_id: 1682413576; + SUBCLASS_OF_ID: 3568569182; + classType: "constructor"; + className: "messages.ChannelMessages"; + flags: number; + inexact?: true; + pts: int; + count: int; + offsetIdOffset?: int; + messages: TypeMessage[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): ChannelMessages; + } + + export interface MessagesNotModifiedArgs { + /** Number of results found server-side by the given query */ + count: int; + } + + /** No new messages matching the query were found
*/ + export class MessagesNotModified extends VirtualClass implements MessagesNotModifiedArgs { + CONSTRUCTOR_id: 1951620897; + SUBCLASS_OF_ID: 3568569182; + classType: "constructor"; + className: "messages.MessagesNotModified"; + count: int; + fromReader(reader: Reader): MessagesNotModified; + } + + export interface ChatsArgs { + /** List of chats */ + chats: TypeChat[]; + } + + /** List of chats with auxiliary data.
*/ + export class Chats extends VirtualClass implements ChatsArgs { + CONSTRUCTOR_id: 1694474197; + SUBCLASS_OF_ID: 2580925204; + classType: "constructor"; + className: "messages.Chats"; + chats: TypeChat[]; + fromReader(reader: Reader): Chats; + } + + export interface ChatsSliceArgs { + /** Total number of results that were found server-side (not all are included in chats) */ + count: int; + /** Chats */ + chats: TypeChat[]; + } + + /** + * Partial list of chats, more would have to be fetched with pagination
+ * @link https://corefork.telegram.org/api/offsets + */ + export class ChatsSlice extends VirtualClass implements ChatsSliceArgs { + CONSTRUCTOR_id: -1663561404; + SUBCLASS_OF_ID: 2580925204; + classType: "constructor"; + className: "messages.ChatsSlice"; + count: int; + chats: TypeChat[]; + fromReader(reader: Reader): ChatsSlice; + } + + export interface ChatFullArgs { + /** Extended info on a chat */ + fullChat: TypeChatFull; + /** List containing basic info on chat */ + chats: TypeChat[]; + /** List of users mentioned above */ + users: TypeUser[]; + } + + /** Extended info on chat and auxiliary data.
*/ + export class ChatFull extends VirtualClass implements ChatFullArgs { + CONSTRUCTOR_id: -438840932; + SUBCLASS_OF_ID: 576344329; + classType: "constructor"; + className: "messages.ChatFull"; + fullChat: TypeChatFull; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): ChatFull; + } + + export interface AffectedHistoryArgs { + /** Number of events occured in a text box */ + pts: int; + /** Number of affected events */ + ptsCount: int; + /** If a parameter contains positive value, it is necessary to repeat the method call using the given value; during the proceeding of all the history the value itself shall gradually decrease */ + offset: int; + } + + /** Affected part of communication history with the user or in a chat.
*/ + export class AffectedHistory extends VirtualClass implements AffectedHistoryArgs { + CONSTRUCTOR_id: -1269012015; + SUBCLASS_OF_ID: 743031062; + classType: "constructor"; + className: "messages.AffectedHistory"; + pts: int; + ptsCount: int; + offset: int; + fromReader(reader: Reader): AffectedHistory; + } + + export interface DhConfigNotModifiedArgs { + /** Random sequence of bytes of assigned length */ + random: bytes; + } + + /** Configuring parameters did not change.
*/ + export class DhConfigNotModified extends VirtualClass implements DhConfigNotModifiedArgs { + CONSTRUCTOR_id: -1058912715; + SUBCLASS_OF_ID: 3834178955; + classType: "constructor"; + className: "messages.DhConfigNotModified"; + random: bytes; + fromReader(reader: Reader): DhConfigNotModified; + } + + export interface DhConfigArgs { + /** New value prime, see Wikipedia */ + g: int; + /** New value primitive root, see Wikipedia */ + p: bytes; + /** Vestion of set of parameters */ + version: int; + /** Random sequence of bytes of assigned length */ + random: bytes; + } + + /** New set of configuring parameters.
*/ + export class DhConfig extends VirtualClass implements DhConfigArgs { + CONSTRUCTOR_id: 740433629; + SUBCLASS_OF_ID: 3834178955; + classType: "constructor"; + className: "messages.DhConfig"; + g: int; + p: bytes; + version: int; + random: bytes; + fromReader(reader: Reader): DhConfig; + } + + export interface SentEncryptedMessageArgs { + /** Date of sending */ + date: int; + } + + /** Message without file attachemts sent to an encrypted file.
*/ + export class SentEncryptedMessage extends VirtualClass implements SentEncryptedMessageArgs { + CONSTRUCTOR_id: 1443858741; + SUBCLASS_OF_ID: 3382591056; + classType: "constructor"; + className: "messages.SentEncryptedMessage"; + date: int; + fromReader(reader: Reader): SentEncryptedMessage; + } + + export interface SentEncryptedFileArgs { + /** Sending date */ + date: int; + /** Attached file */ + file: TypeEncryptedFile; + } + + /** Message with a file enclosure sent to a protected chat
*/ + export class SentEncryptedFile extends VirtualClass implements SentEncryptedFileArgs { + CONSTRUCTOR_id: -1802240206; + SUBCLASS_OF_ID: 3382591056; + classType: "constructor"; + className: "messages.SentEncryptedFile"; + date: int; + file: TypeEncryptedFile; + fromReader(reader: Reader): SentEncryptedFile; + } + + /** No new stickers were found for the given query
*/ + export class StickersNotModified extends VirtualClass { + CONSTRUCTOR_id: -244016606; + SUBCLASS_OF_ID: 3611015646; + classType: "constructor"; + className: "messages.StickersNotModified"; + fromReader(reader: Reader): StickersNotModified; + } + + export interface StickersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + /** Stickers */ + stickers: TypeDocument[]; + } + + /** + * Found stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class Stickers extends VirtualClass implements StickersArgs { + CONSTRUCTOR_id: -463889475; + SUBCLASS_OF_ID: 3611015646; + classType: "constructor"; + className: "messages.Stickers"; + hash: int; + stickers: TypeDocument[]; + fromReader(reader: Reader): Stickers; + } + + /** Info about all installed stickers hasn't changed
*/ + export class AllStickersNotModified extends VirtualClass { + CONSTRUCTOR_id: -395967805; + SUBCLASS_OF_ID: 1166231593; + classType: "constructor"; + className: "messages.AllStickersNotModified"; + fromReader(reader: Reader): AllStickersNotModified; + } + + export interface AllStickersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + /** All stickersets */ + sets: TypeStickerSet[]; + } + + /** + * Info about all installed stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class AllStickers extends VirtualClass implements AllStickersArgs { + CONSTRUCTOR_id: -302170017; + SUBCLASS_OF_ID: 1166231593; + classType: "constructor"; + className: "messages.AllStickers"; + hash: int; + sets: TypeStickerSet[]; + fromReader(reader: Reader): AllStickers; + } + + export interface AffectedMessagesArgs { + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + } + + /** + * Events affected by operation
+ * @link https://corefork.telegram.org/api/updates + */ + export class AffectedMessages extends VirtualClass implements AffectedMessagesArgs { + CONSTRUCTOR_id: -2066640507; + SUBCLASS_OF_ID: 3469983854; + classType: "constructor"; + className: "messages.AffectedMessages"; + pts: int; + ptsCount: int; + fromReader(reader: Reader): AffectedMessages; + } + + export interface StickerSetArgs { + /** The stickerset */ + set: TypeStickerSet; + /** Emoji info for stickers */ + packs: TypeStickerPack[]; + /** Stickers in stickerset */ + documents: TypeDocument[]; + } + + /** Stickerset and stickers inside it
*/ + export class StickerSet extends VirtualClass implements StickerSetArgs { + CONSTRUCTOR_id: -1240849242; + SUBCLASS_OF_ID: 2607827546; + classType: "constructor"; + className: "messages.StickerSet"; + set: TypeStickerSet; + packs: TypeStickerPack[]; + documents: TypeDocument[]; + fromReader(reader: Reader): StickerSet; + } + + /** No new saved gifs were found
*/ + export class SavedGifsNotModified extends VirtualClass { + CONSTRUCTOR_id: -402498398; + SUBCLASS_OF_ID: 2794152437; + classType: "constructor"; + className: "messages.SavedGifsNotModified"; + fromReader(reader: Reader): SavedGifsNotModified; + } + + export interface SavedGifsArgs { + /** Hash for pagination, for more info click here */ + hash: int; + /** List of saved gifs */ + gifs: TypeDocument[]; + } + + /** + * Saved gifs
+ * @link https://corefork.telegram.org/api/offsets + */ + export class SavedGifs extends VirtualClass implements SavedGifsArgs { + CONSTRUCTOR_id: 772213157; + SUBCLASS_OF_ID: 2794152437; + classType: "constructor"; + className: "messages.SavedGifs"; + hash: int; + gifs: TypeDocument[]; + fromReader(reader: Reader): SavedGifs; + } + + export interface BotResultsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the result is a picture gallery */ + gallery?: true; + /** Query ID */ + queryId: long; + /** The next offset to use when navigating through results */ + nextOffset?: string; + /** Whether the bot requested the user to message him in private */ + switchPm?: TypeInlineBotSwitchPM; + /** The results */ + results: TypeBotInlineResult[]; + /** Caching validity of the results */ + cacheTime: int; + /** Users mentioned in the results */ + users: TypeUser[]; + } + + /** Result of a query to an inline bot
*/ + export class BotResults extends VirtualClass implements BotResultsArgs { + CONSTRUCTOR_id: -1803769784; + SUBCLASS_OF_ID: 1054136777; + classType: "constructor"; + className: "messages.BotResults"; + flags: number; + gallery?: true; + queryId: long; + nextOffset?: string; + switchPm?: TypeInlineBotSwitchPM; + results: TypeBotInlineResult[]; + cacheTime: int; + users: TypeUser[]; + fromReader(reader: Reader): BotResults; + } + + export interface BotCallbackAnswerArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether an alert should be shown to the user instead of a toast notification */ + alert?: true; + /** Whether an URL is present */ + hasUrl?: true; + /** Whether to show games in WebView or in native UI. */ + nativeUi?: true; + /** Alert to show */ + message?: string; + /** URL to open */ + url?: string; + /** For how long should this answer be cached */ + cacheTime: int; + } + + /** Callback answer sent by the bot in response to a button press
*/ + export class BotCallbackAnswer extends VirtualClass implements BotCallbackAnswerArgs { + CONSTRUCTOR_id: 911761060; + SUBCLASS_OF_ID: 1817039244; + classType: "constructor"; + className: "messages.BotCallbackAnswer"; + flags: number; + alert?: true; + hasUrl?: true; + nativeUi?: true; + message?: string; + url?: string; + cacheTime: int; + fromReader(reader: Reader): BotCallbackAnswer; + } + + export interface MessageEditDataArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Media caption, if the specified media's caption can be edited */ + caption?: true; + } + + /** Message edit data for media
*/ + export class MessageEditData extends VirtualClass implements MessageEditDataArgs { + CONSTRUCTOR_id: 649453030; + SUBCLASS_OF_ID: 4215772317; + classType: "constructor"; + className: "messages.MessageEditData"; + flags: number; + caption?: true; + fromReader(reader: Reader): MessageEditData; + } + + export interface PeerDialogsArgs { + /** Dialog info */ + dialogs: TypeDialog[]; + /** Messages mentioned in dialog info */ + messages: TypeMessage[]; + /** Chats */ + chats: TypeChat[]; + /** Users */ + users: TypeUser[]; + /** Current update state of dialog */ + state: updates.TypeState; + } + + /** + * Dialog info of multiple peers
+ * @link https://corefork.telegram.org/api/updates + */ + export class PeerDialogs extends VirtualClass implements PeerDialogsArgs { + CONSTRUCTOR_id: 863093588; + SUBCLASS_OF_ID: 986120498; + classType: "constructor"; + className: "messages.PeerDialogs"; + dialogs: TypeDialog[]; + messages: TypeMessage[]; + chats: TypeChat[]; + users: TypeUser[]; + state: updates.TypeState; + fromReader(reader: Reader): PeerDialogs; + } + + export interface FeaturedStickersNotModifiedArgs { + /** Total number of featured stickers */ + count: int; + } + + /** Featured stickers haven't changed
*/ + export class FeaturedStickersNotModified extends VirtualClass implements FeaturedStickersNotModifiedArgs { + CONSTRUCTOR_id: -958657434; + SUBCLASS_OF_ID: 638891810; + classType: "constructor"; + className: "messages.FeaturedStickersNotModified"; + count: int; + fromReader(reader: Reader): FeaturedStickersNotModified; + } + + export interface FeaturedStickersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + /** Total number of featured stickers */ + count: int; + /** Featured stickersets */ + sets: TypeStickerSetCovered[]; + /** IDs of new featured stickersets */ + unread: long[]; + } + + /** + * Featured stickersets
+ * @link https://corefork.telegram.org/api/offsets + */ + export class FeaturedStickers extends VirtualClass implements FeaturedStickersArgs { + CONSTRUCTOR_id: -1230257343; + SUBCLASS_OF_ID: 638891810; + classType: "constructor"; + className: "messages.FeaturedStickers"; + hash: int; + count: int; + sets: TypeStickerSetCovered[]; + unread: long[]; + fromReader(reader: Reader): FeaturedStickers; + } + + /** No new recent sticker was found
*/ + export class RecentStickersNotModified extends VirtualClass { + CONSTRUCTOR_id: 186120336; + SUBCLASS_OF_ID: 4151281283; + classType: "constructor"; + className: "messages.RecentStickersNotModified"; + fromReader(reader: Reader): RecentStickersNotModified; + } + + export interface RecentStickersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + /** Emojis associated to stickers */ + packs: TypeStickerPack[]; + /** Recent stickers */ + stickers: TypeDocument[]; + /** When was each sticker last used */ + dates: int[]; + } + + /** + * Recently used stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class RecentStickers extends VirtualClass implements RecentStickersArgs { + CONSTRUCTOR_id: 586395571; + SUBCLASS_OF_ID: 4151281283; + classType: "constructor"; + className: "messages.RecentStickers"; + hash: int; + packs: TypeStickerPack[]; + stickers: TypeDocument[]; + dates: int[]; + fromReader(reader: Reader): RecentStickers; + } + + export interface ArchivedStickersArgs { + /** Number of archived stickers */ + count: int; + /** Archived stickersets */ + sets: TypeStickerSetCovered[]; + } + + /** Archived stickersets
*/ + export class ArchivedStickers extends VirtualClass implements ArchivedStickersArgs { + CONSTRUCTOR_id: 1338747336; + SUBCLASS_OF_ID: 1922488177; + classType: "constructor"; + className: "messages.ArchivedStickers"; + count: int; + sets: TypeStickerSetCovered[]; + fromReader(reader: Reader): ArchivedStickers; + } + + /** The stickerset was installed successfully
*/ + export class StickerSetInstallResultSuccess extends VirtualClass { + CONSTRUCTOR_id: 946083368; + SUBCLASS_OF_ID: 1741373416; + classType: "constructor"; + className: "messages.StickerSetInstallResultSuccess"; + fromReader(reader: Reader): StickerSetInstallResultSuccess; + } + + export interface StickerSetInstallResultArchiveArgs { + /** Archived stickersets */ + sets: TypeStickerSetCovered[]; + } + + /** The stickerset was installed, but since there are too many stickersets some were archived
*/ + export class StickerSetInstallResultArchive extends VirtualClass implements StickerSetInstallResultArchiveArgs { + CONSTRUCTOR_id: 904138920; + SUBCLASS_OF_ID: 1741373416; + classType: "constructor"; + className: "messages.StickerSetInstallResultArchive"; + sets: TypeStickerSetCovered[]; + fromReader(reader: Reader): StickerSetInstallResultArchive; + } + + export interface HighScoresArgs { + /** Highscores */ + scores: TypeHighScore[]; + /** Users, associated to the highscores */ + users: TypeUser[]; + } + + /** Highscores in a game
*/ + export class HighScores extends VirtualClass implements HighScoresArgs { + CONSTRUCTOR_id: -1707344487; + SUBCLASS_OF_ID: 1825412605; + classType: "constructor"; + className: "messages.HighScores"; + scores: TypeHighScore[]; + users: TypeUser[]; + fromReader(reader: Reader): HighScores; + } + + /** No new favorited stickers were found
*/ + export class FavedStickersNotModified extends VirtualClass { + CONSTRUCTOR_id: -1634752813; + SUBCLASS_OF_ID: 2389929913; + classType: "constructor"; + className: "messages.FavedStickersNotModified"; + fromReader(reader: Reader): FavedStickersNotModified; + } + + export interface FavedStickersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + /** Emojis associated to stickers */ + packs: TypeStickerPack[]; + /** Favorited stickers */ + stickers: TypeDocument[]; + } + + /** + * Favorited stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class FavedStickers extends VirtualClass implements FavedStickersArgs { + CONSTRUCTOR_id: -209768682; + SUBCLASS_OF_ID: 2389929913; + classType: "constructor"; + className: "messages.FavedStickers"; + hash: int; + packs: TypeStickerPack[]; + stickers: TypeDocument[]; + fromReader(reader: Reader): FavedStickers; + } + + /** No further results were found
*/ + export class FoundStickerSetsNotModified extends VirtualClass { + CONSTRUCTOR_id: 223655517; + SUBCLASS_OF_ID: 68023137; + classType: "constructor"; + className: "messages.FoundStickerSetsNotModified"; + fromReader(reader: Reader): FoundStickerSetsNotModified; + } + + export interface FoundStickerSetsArgs { + /** Hash for pagination, for more info click here */ + hash: int; + /** Found stickersets */ + sets: TypeStickerSetCovered[]; + } + + /** + * Found stickersets
+ * @link https://corefork.telegram.org/api/offsets + */ + export class FoundStickerSets extends VirtualClass implements FoundStickerSetsArgs { + CONSTRUCTOR_id: 1359533640; + SUBCLASS_OF_ID: 68023137; + classType: "constructor"; + className: "messages.FoundStickerSets"; + hash: int; + sets: TypeStickerSetCovered[]; + fromReader(reader: Reader): FoundStickerSets; + } + + export interface SearchCounterArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, the results may be inexact */ + inexact?: true; + /** Provided message filter */ + filter: TypeMessagesFilter; + /** Number of results that were found server-side */ + count: int; + } + + /** + * Indicates how many results would be found by a messages.search call with the same parameters
+ * @link https://corefork.telegram.org/method/messages.search + */ + export class SearchCounter extends VirtualClass implements SearchCounterArgs { + CONSTRUCTOR_id: -398136321; + SUBCLASS_OF_ID: 3601317794; + classType: "constructor"; + className: "messages.SearchCounter"; + flags: number; + inexact?: true; + filter: TypeMessagesFilter; + count: int; + fromReader(reader: Reader): SearchCounter; + } + + export interface InactiveChatsArgs { + /** When was the chat last active */ + dates: int[]; + /** Chat list */ + chats: TypeChat[]; + /** Users mentioned in the chat list */ + users: TypeUser[]; + } + + /** Inactive chat list
*/ + export class InactiveChats extends VirtualClass implements InactiveChatsArgs { + CONSTRUCTOR_id: -1456996667; + SUBCLASS_OF_ID: 2348013524; + classType: "constructor"; + className: "messages.InactiveChats"; + dates: int[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): InactiveChats; + } + + export interface VotesListArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Total number of votes for all options (or only for the chosen option, if provided to messages.getPollVotes) */ + count: int; + /** Vote info for each user */ + votes: TypeMessageUserVote[]; + /** Info about users that voted in the poll */ + users: TypeUser[]; + /** Offset to use with the next messages.getPollVotes request, empty string if no more results are available. */ + nextOffset?: string; + } + + /** + * How users voted in a poll
+ * @link https://corefork.telegram.org/method/messages.getPollVotes + */ + export class VotesList extends VirtualClass implements VotesListArgs { + CONSTRUCTOR_id: 136574537; + SUBCLASS_OF_ID: 3256457349; + classType: "constructor"; + className: "messages.VotesList"; + flags: number; + count: int; + votes: TypeMessageUserVote[]; + users: TypeUser[]; + nextOffset?: string; + fromReader(reader: Reader): VotesList; + } + + export interface MessageViewsArgs { + /** View, forward counter + info about replies */ + views: TypeMessageViews[]; + /** Chats mentioned in constructor */ + chats: TypeChat[]; + /** Users mentioned in constructor */ + users: TypeUser[]; + } + + /** View, forward counter + info about replies
*/ + export class MessageViews extends VirtualClass implements MessageViewsArgs { + CONSTRUCTOR_id: -1228606141; + SUBCLASS_OF_ID: 2947935132; + classType: "constructor"; + className: "messages.MessageViews"; + views: TypeMessageViews[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): MessageViews; + } + + export interface DiscussionMessageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Discussion messages */ + messages: TypeMessage[]; + /** Message ID of latest reply in this thread */ + maxId?: int; + /** Message ID of latest read incoming message in this thread */ + readInboxMaxId?: int; + /** Message ID of latest read outgoing message in this thread */ + readOutboxMaxId?: int; + /** Number of unread messages */ + chats: TypeChat[]; + /** Chats mentioned in constructor */ + users: TypeUser[]; + } + + /** + * Information about a message thread
+ * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + */ + export class DiscussionMessage extends VirtualClass implements DiscussionMessageArgs { + CONSTRUCTOR_id: -170029155; + SUBCLASS_OF_ID: 1408820200; + classType: "constructor"; + className: "messages.DiscussionMessage"; + flags: number; + messages: TypeMessage[]; + maxId?: int; + readInboxMaxId?: int; + readOutboxMaxId?: int; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): DiscussionMessage; + } + + export interface HistoryImportArgs { + /** History import ID */ + id: long; + } + + /** + * ID of a specific chat import session, click here for more info ».
+ * @link https://corefork.telegram.org/api/import + */ + export class HistoryImport extends VirtualClass implements HistoryImportArgs { + CONSTRUCTOR_id: 375566091; + SUBCLASS_OF_ID: 2978723082; + classType: "constructor"; + className: "messages.HistoryImport"; + id: long; + fromReader(reader: Reader): HistoryImport; + } + + export interface HistoryImportParsedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The chat export file was generated from a private chat. */ + pm?: true; + /** The chat export file was generated from a group chat. */ + group?: true; + /** Title of the chat. */ + title?: string; + } + + /** + * Contains information about a chat export file generated by a foreign chat app, click here for more info.
+ * If neither the pm or group flags are set, the specified chat export was generated from a chat of unknown type.
+ * @link https://corefork.telegram.org/api/import + */ + export class HistoryImportParsed extends VirtualClass implements HistoryImportParsedArgs { + CONSTRUCTOR_id: 1578088377; + SUBCLASS_OF_ID: 1538421259; + classType: "constructor"; + className: "messages.HistoryImportParsed"; + flags: number; + pm?: true; + group?: true; + title?: string; + fromReader(reader: Reader): HistoryImportParsed; + } + + export interface AffectedFoundMessagesArgs { + /** Event count after generation */ + pts: int; + /** Number of events that were generated */ + ptsCount: int; + /** If bigger than zero, the request must be repeated to remove more messages */ + offset: int; + /** Affected message IDs */ + messages: int[]; + } + + /** + * Messages found and affected by changes
+ * @link https://corefork.telegram.org/api/updates + */ + export class AffectedFoundMessages extends VirtualClass implements AffectedFoundMessagesArgs { + CONSTRUCTOR_id: -275956116; + SUBCLASS_OF_ID: 4162282798; + classType: "constructor"; + className: "messages.AffectedFoundMessages"; + pts: int; + ptsCount: int; + offset: int; + messages: int[]; + fromReader(reader: Reader): AffectedFoundMessages; + } + + export interface ExportedChatInvitesArgs { + /** Number of invites exported by the admin */ + count: int; + /** Exported invites */ + invites: TypeExportedChatInvite[]; + /** Info about the admin */ + users: TypeUser[]; + } + + /** Info about chat invites exported by a certain admin.
*/ + export class ExportedChatInvites extends VirtualClass implements ExportedChatInvitesArgs { + CONSTRUCTOR_id: -1111085620; + SUBCLASS_OF_ID: 1614624881; + classType: "constructor"; + className: "messages.ExportedChatInvites"; + count: int; + invites: TypeExportedChatInvite[]; + users: TypeUser[]; + fromReader(reader: Reader): ExportedChatInvites; + } + + export interface ExportedChatInviteArgs { + /** Info about the chat invite */ + invite: TypeExportedChatInvite; + /** Mentioned users */ + users: TypeUser[]; + } + + /** Info about a chat invite
*/ + export class ExportedChatInvite extends VirtualClass implements ExportedChatInviteArgs { + CONSTRUCTOR_id: 410107472; + SUBCLASS_OF_ID: 2195510474; + classType: "constructor"; + className: "messages.ExportedChatInvite"; + invite: TypeExportedChatInvite; + users: TypeUser[]; + fromReader(reader: Reader): ExportedChatInvite; + } + + export interface ExportedChatInviteReplacedArgs { + /** The replaced chat invite */ + invite: TypeExportedChatInvite; + /** The invite that replaces the previous invite */ + newInvite: TypeExportedChatInvite; + /** Mentioned users */ + users: TypeUser[]; + } + + /** The specified chat invite was replaced with another one
*/ + export class ExportedChatInviteReplaced extends VirtualClass implements ExportedChatInviteReplacedArgs { + CONSTRUCTOR_id: 572915951; + SUBCLASS_OF_ID: 2195510474; + classType: "constructor"; + className: "messages.ExportedChatInviteReplaced"; + invite: TypeExportedChatInvite; + newInvite: TypeExportedChatInvite; + users: TypeUser[]; + fromReader(reader: Reader): ExportedChatInviteReplaced; + } + + export interface ChatInviteImportersArgs { + /** Number of users that joined */ + count: int; + /** The users that joined */ + importers: TypeChatInviteImporter[]; + /** The users that joined */ + users: TypeUser[]; + } + + /** Info about the users that joined the chat using a specific chat invite
*/ + export class ChatInviteImporters extends VirtualClass implements ChatInviteImportersArgs { + CONSTRUCTOR_id: -2118733814; + SUBCLASS_OF_ID: 3653012134; + classType: "constructor"; + className: "messages.ChatInviteImporters"; + count: int; + importers: TypeChatInviteImporter[]; + users: TypeUser[]; + fromReader(reader: Reader): ChatInviteImporters; + } + + export interface ChatAdminsWithInvitesArgs { + /** Info about chat invites generated by admins. */ + admins: TypeChatAdminWithInvites[]; + /** Mentioned users */ + users: TypeUser[]; + } + + /** Info about chat invites generated by admins.
*/ + export class ChatAdminsWithInvites extends VirtualClass implements ChatAdminsWithInvitesArgs { + CONSTRUCTOR_id: -1231326505; + SUBCLASS_OF_ID: 2405149995; + classType: "constructor"; + className: "messages.ChatAdminsWithInvites"; + admins: TypeChatAdminWithInvites[]; + users: TypeUser[]; + fromReader(reader: Reader): ChatAdminsWithInvites; + } + + export interface CheckedHistoryImportPeerArgs { + /** A confirmation text to be shown to the user, upon importing chat history ». */ + confirmText: string; + } + + /** + * Contains a confirmation text to be shown to the user, upon importing chat history, click here for more info ».
+ * @link https://corefork.telegram.org/api/import + */ + export class CheckedHistoryImportPeer extends VirtualClass implements CheckedHistoryImportPeerArgs { + CONSTRUCTOR_id: -1571952873; + SUBCLASS_OF_ID: 3091968823; + classType: "constructor"; + className: "messages.CheckedHistoryImportPeer"; + confirmText: string; + fromReader(reader: Reader): CheckedHistoryImportPeer; + } + + export interface GetMessagesArgs { + /** Message ID list */ + id: TypeInputMessage[]; + } + + /** Returns the list of messages by their IDs.
*/ + export class GetMessages extends Request,messages.TypeMessages> implements GetMessagesArgs { + CONSTRUCTOR_id: 1673946374; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "messages.GetMessages"; + id: TypeInputMessage[]; + fromReader(reader: Reader): GetMessages; + } + + export interface GetDialogsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Exclude pinned dialogs */ + excludePinned?: true; + /** Peer folder ID, for more info click here */ + folderId?: int; + /** Offsets for pagination, for more info click here */ + offsetDate: int; + /** Offsets for pagination, for more info click here */ + offsetId: int; + /** Offset peer for pagination */ + offsetPeer: EntityLike; + /** Number of list elements to be returned */ + limit: int; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Returns the current user dialog list.
+ * @link https://corefork.telegram.org/api/folders + * @link https://corefork.telegram.org/api/offsets + * @throws {{code:400,type:"FOLDER_ID_INVALID"}} Invalid folder ID. + * @throws {{code:400,type:"OFFSET_PEER_ID_INVALID"}} The provided offset peer is invalid. + */ + export class GetDialogs extends Request,messages.TypeDialogs> implements GetDialogsArgs { + CONSTRUCTOR_id: -1594999949; + SUBCLASS_OF_ID: 236671726; + classType: "request"; + className: "messages.GetDialogs"; + flags: number; + excludePinned?: true; + folderId?: int; + offsetDate: int; + offsetId: int; + offsetPeer: EntityLike; + limit: int; + hash: int; + fromReader(reader: Reader): GetDialogs; + } + + export interface GetHistoryArgs { + /** Target peer */ + peer: EntityLike; + /** Only return messages starting from the specified message ID */ + offsetId: int; + /** Only return messages sent before the specified date */ + offsetDate: int; + /** Number of list elements to be skipped, negative values are also accepted. */ + addOffset: int; + /** Number of results to return */ + limit: int; + /** If a positive value was transferred, the method will return only messages with IDs less than max_id */ + maxId: int; + /** If a positive value was transferred, the method will return only messages with IDs more than min_id */ + minId: int; + /** Result hash */ + hash: int; + } + + /** + * Gets back the conversation history with one interlocutor / within a chat
+ * @link https://corefork.telegram.org/api/offsets + * @throws {{code:401,type:"AUTH_KEY_PERM_EMPTY"}} The temporary auth key must be binded to the permanent auth key to use these methods. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetHistory extends Request,messages.TypeMessages> implements GetHistoryArgs { + CONSTRUCTOR_id: -591691168; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "messages.GetHistory"; + peer: EntityLike; + offsetId: int; + offsetDate: int; + addOffset: int; + limit: int; + maxId: int; + minId: int; + hash: int; + fromReader(reader: Reader): GetHistory; + } + + export interface SearchArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** User or chat, histories with which are searched, or (inputPeerEmpty) constructor for global search */ + peer: EntityLike; + /** Text search request */ + q: string; + /** Only return messages sent by the specified user ID */ + fromId?: EntityLike; + /** Thread ID */ + topMsgId?: MessageIDLike; + /** Filter to return only specified message types */ + filter: TypeMessagesFilter; + /** If a positive value was transferred, only messages with a sending date bigger than the transferred one will be returned */ + minDate: int; + /** If a positive value was transferred, only messages with a sending date smaller than the transferred one will be returned */ + maxDate: int; + /** Only return messages starting from the specified message ID */ + offsetId: int; + /** Additional offset */ + addOffset: int; + /** Number of results to return */ + limit: int; + /** Maximum message ID to return */ + maxId: int; + /** Minimum message ID to return */ + minId: int; + /** Hash */ + hash: int; + } + + /** + * Gets back found messages
+ * @link https://corefork.telegram.org/constructor/inputPeerEmpty + * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/offsets + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"FROM_PEER_INVALID"}} The specified from_id is invalid. + * @throws {{code:400,type:"INPUT_FILTER_INVALID"}} The specified filter is invalid. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"PEER_ID_NOT_SUPPORTED"}} The provided peer ID is not supported. + * @throws {{code:400,type:"SEARCH_QUERY_EMPTY"}} The search query is empty. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class Search extends Request,messages.TypeMessages> implements SearchArgs { + CONSTRUCTOR_id: 204812012; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "messages.Search"; + flags: number; + peer: EntityLike; + q: string; + fromId?: EntityLike; + topMsgId?: MessageIDLike; + filter: TypeMessagesFilter; + minDate: int; + maxDate: int; + offsetId: int; + addOffset: int; + limit: int; + maxId: int; + minId: int; + hash: int; + fromReader(reader: Reader): Search; + } + + export interface ReadHistoryArgs { + /** Target user or group */ + peer: EntityLike; + /** If a positive value is passed, only messages with identifiers less or equal than the given one will be read */ + maxId: int; + } + + /** + * Marks message history as read.
+ * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class ReadHistory extends Request,messages.TypeAffectedMessages> implements ReadHistoryArgs { + CONSTRUCTOR_id: 238054714; + SUBCLASS_OF_ID: 3469983854; + classType: "request"; + className: "messages.ReadHistory"; + peer: EntityLike; + maxId: int; + fromReader(reader: Reader): ReadHistory; + } + + export interface DeleteHistoryArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Just clear history for the current user, without actually removing messages for every chat user */ + justClear?: true; + /** Whether to delete the message history for all chat participants */ + revoke?: true; + /** User or chat, communication history of which will be deleted */ + peer: EntityLike; + /** Maximum ID of message to delete */ + maxId: int; + } + + /** + * Deletes communication history.
+ * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class DeleteHistory extends Request,messages.TypeAffectedHistory> implements DeleteHistoryArgs { + CONSTRUCTOR_id: 469850889; + SUBCLASS_OF_ID: 743031062; + classType: "request"; + className: "messages.DeleteHistory"; + flags: number; + justClear?: true; + revoke?: true; + peer: EntityLike; + maxId: int; + fromReader(reader: Reader): DeleteHistory; + } + + export interface DeleteMessagesArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to delete messages for all participants of the chat */ + revoke?: true; + /** Message ID list */ + id: int[]; + } + + /** + * Deletes messages by their identifiers.
+ * @throws {{code:403,type:"MESSAGE_DELETE_FORBIDDEN"}} You can't delete one of the messages you tried to delete, most likely because it is a service message. + */ + export class DeleteMessages extends Request,messages.TypeAffectedMessages> implements DeleteMessagesArgs { + CONSTRUCTOR_id: -443640366; + SUBCLASS_OF_ID: 3469983854; + classType: "request"; + className: "messages.DeleteMessages"; + flags: number; + revoke?: true; + id: int[]; + fromReader(reader: Reader): DeleteMessages; + } + + export interface ReceivedMessagesArgs { + /** Maximum message ID available in a client. */ + maxId: int; + } + + /** Confirms receipt of messages by a client, cancels PUSH-notification sending.
*/ + export class ReceivedMessages extends Request,TypeReceivedNotifyMessage[]> implements ReceivedMessagesArgs { + CONSTRUCTOR_id: 94983360; + SUBCLASS_OF_ID: 2238052503; + classType: "request"; + className: "messages.ReceivedMessages"; + maxId: int; + fromReader(reader: Reader): ReceivedMessages; + } + + export interface SetTypingArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Target user or group */ + peer: EntityLike; + /** Thread ID */ + topMsgId?: MessageIDLike; + /** Type of action
Parameter added in Layer 17. */ + action: TypeSendMessageAction; + } + + /** + * Sends a current user typing event (see SendMessageAction for all event types) to a conversation partner or group.
+ * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/layers + * @link https://corefork.telegram.org/type/SendMessageAction + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"USER_BANNED_IN_CHANNEL"}} You're banned from sending messages in supergroups/channels. + * @throws {{code:400,type:"USER_IS_BLOCKED"}} You were blocked by this user. + * @throws {{code:400,type:"USER_IS_BOT"}} Bots can't send messages to other bots. + */ + export class SetTyping extends Request,Bool> implements SetTypingArgs { + CONSTRUCTOR_id: 1486110434; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.SetTyping"; + flags: number; + peer: EntityLike; + topMsgId?: MessageIDLike; + action: TypeSendMessageAction; + fromReader(reader: Reader): SetTyping; + } + + export interface SendMessageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Set this flag to disable generation of the webpage preview */ + noWebpage?: true; + /** Send this message silently (no notifications for the receivers) */ + silent?: true; + /** Send this message as background message */ + background?: true; + /** Clear the draft field */ + clearDraft?: true; + /** The destination where the message will be sent */ + peer: EntityLike; + /** The message ID to which this message will reply to */ + replyToMsgId?: MessageIDLike; + /** The message */ + message: string; + /** Unique client message ID required to prevent message resending */ + randomId: long; + /** Reply markup for sending bot buttons */ + replyMarkup?: TypeReplyMarkup; + /** Message entities for sending styled text */ + entities?: TypeMessageEntity[]; + /** Scheduled message date for scheduled messages */ + scheduleDate?: int; + } + + /** + * Sends a message to a chat
+ * @link https://corefork.telegram.org/api/entities + * @link https://corefork.telegram.org/api/scheduled-messages + * @throws {{code:401,type:"AUTH_KEY_PERM_EMPTY"}} The temporary auth key must be binded to the permanent auth key to use these methods. + * @throws {{code:400,type:"BOT_DOMAIN_INVALID"}} Bot domain invalid. + * @throws {{code:400,type:"BOT_INVALID"}} This is not a valid bot. + * @throws {{code:400,type:"BUTTON_DATA_INVALID"}} The data of one or more of the buttons you provided is invalid. + * @throws {{code:400,type:"BUTTON_TYPE_INVALID"}} The type of one or more of the buttons you provided is invalid. + * @throws {{code:400,type:"BUTTON_URL_INVALID"}} Button URL invalid. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"CHAT_RESTRICTED"}} You can't send messages in this chat, you were restricted. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"ENCRYPTION_DECLINED"}} The secret chat was declined. + * @throws {{code:400,type:"ENTITIES_TOO_LONG"}} You provided too many styled message entities. + * @throws {{code:400,type:"ENTITY_MENTION_USER_INVALID"}} You mentioned an invalid user. + * @throws {{code:400,type:"FROM_MESSAGE_BOT_DISABLED"}} Bots can't use fromMessage min constructors. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MESSAGE_EMPTY"}} The provided message is empty. + * @throws {{code:400,type:"MESSAGE_TOO_LONG"}} The provided message is too long. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Provided reply_to_msg_id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"PINNED_DIALOGS_TOO_MUCH"}} Too many pinned dialogs. + * @throws {{code:400,type:"POLL_OPTION_INVALID"}} Invalid poll option provided. + * @throws {{code:400,type:"REPLY_MARKUP_INVALID"}} The provided reply markup is invalid. + * @throws {{code:400,type:"REPLY_MARKUP_TOO_LONG"}} The specified reply_markup is too long. + * @throws {{code:400,type:"SCHEDULE_BOT_NOT_ALLOWED"}} Bots cannot schedule messages. + * @throws {{code:400,type:"SCHEDULE_DATE_TOO_LATE"}} You can't schedule a message this far in the future. + * @throws {{code:400,type:"SCHEDULE_STATUS_PRIVATE"}} Can't schedule until user is online, if the user's last seen timestamp is hidden by their privacy settings. + * @throws {{code:400,type:"SCHEDULE_TOO_MUCH"}} There are too many scheduled messages. + * @throws {{code:420,type:"SLOWMODE_WAIT_X"}} Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat. + * @throws {{code:400,type:"USER_BANNED_IN_CHANNEL"}} You're banned from sending messages in supergroups/channels. + * @throws {{code:400,type:"USER_IS_BLOCKED"}} You were blocked by this user. + * @throws {{code:400,type:"USER_IS_BOT"}} Bots can't send messages to other bots. + * @throws {{code:400,type:"YOU_BLOCKED_USER"}} You blocked this user. + */ + export class SendMessage extends Request,TypeUpdates> implements SendMessageArgs { + CONSTRUCTOR_id: 1376532592; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.SendMessage"; + flags: number; + noWebpage?: true; + silent?: true; + background?: true; + clearDraft?: true; + peer: EntityLike; + replyToMsgId?: MessageIDLike; + message: string; + randomId: long; + replyMarkup?: TypeReplyMarkup; + entities?: TypeMessageEntity[]; + scheduleDate?: int; + fromReader(reader: Reader): SendMessage; + } + + export interface SendMediaArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Send message silently (no notification should be triggered) */ + silent?: true; + /** Send message in background */ + background?: true; + /** Clear the draft */ + clearDraft?: true; + /** Destination */ + peer: EntityLike; + /** Message ID to which this message should reply to */ + replyToMsgId?: MessageIDLike; + /** Attached media */ + media: TypeInputMedia; + /** Caption */ + message: string; + /** Random ID to avoid resending the same message */ + randomId: long; + /** Reply markup for bot keyboards */ + replyMarkup?: TypeReplyMarkup; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + /** Scheduled message date for scheduled messages */ + scheduleDate?: int; + } + + /** + * Send a media
+ * @link https://corefork.telegram.org/api/entities + * @link https://corefork.telegram.org/api/scheduled-messages + * @throws {{code:400,type:"BOT_PAYMENTS_DISABLED"}} Please enable bot payments in botfather before calling this method. + * @throws {{code:400,type:"BOT_POLLS_DISABLED"}}   + * @throws {{code:400,type:"BROADCAST_PUBLIC_VOTERS_FORBIDDEN"}} You can't forward polls with public voters. + * @throws {{code:400,type:"BUTTON_DATA_INVALID"}} The data of one or more of the buttons you provided is invalid. + * @throws {{code:400,type:"BUTTON_TYPE_INVALID"}} The type of one or more of the buttons you provided is invalid. + * @throws {{code:400,type:"BUTTON_URL_INVALID"}} Button URL invalid. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_RESTRICTED"}} You can't send messages in this chat, you were restricted. + * @throws {{code:403,type:"CHAT_SEND_GIFS_FORBIDDEN"}} You can't send gifs in this chat. + * @throws {{code:403,type:"CHAT_SEND_MEDIA_FORBIDDEN"}} You can't send media in this chat. + * @throws {{code:403,type:"CHAT_SEND_POLL_FORBIDDEN"}} You can't send polls in this chat. + * @throws {{code:403,type:"CHAT_SEND_STICKERS_FORBIDDEN"}} You can't send stickers in this chat. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"CURRENCY_TOTAL_AMOUNT_INVALID"}} The total amount of all prices is invalid. + * @throws {{code:400,type:"EMOTICON_INVALID"}} The specified emoji is invalid. + * @throws {{code:400,type:"EXTERNAL_URL_INVALID"}} External URL invalid. + * @throws {{code:400,type:"FILE_PARTS_INVALID"}} The number of file parts is invalid. + * @throws {{code:400,type:"FILE_PART_LENGTH_INVALID"}} The length of a file part is invalid. + * @throws {{code:400,type:"FILE_REFERENCE_EMPTY"}} An empty file reference was specified. + * @throws {{code:400,type:"FILE_REFERENCE_EXPIRED"}} File reference expired, it must be refetched as described in https://core.telegram.org/api/file_reference. + * @throws {{code:400,type:"GAME_BOT_INVALID"}} Bots can't send another bot's game. + * @throws {{code:400,type:"IMAGE_PROCESS_FAILED"}} Failure while processing image. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MD5_CHECKSUM_INVALID"}} The MD5 checksums do not match. + * @throws {{code:400,type:"MEDIA_CAPTION_TOO_LONG"}} The caption is too long. + * @throws {{code:400,type:"MEDIA_EMPTY"}} The provided media object is invalid. + * @throws {{code:400,type:"MEDIA_INVALID"}} Media invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PAYMENT_PROVIDER_INVALID"}} The specified payment provider is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"PHOTO_EXT_INVALID"}} The extension of the photo is invalid. + * @throws {{code:400,type:"PHOTO_INVALID_DIMENSIONS"}} The photo dimensions are invalid. + * @throws {{code:400,type:"PHOTO_SAVE_FILE_INVALID"}} Internal issues, try again later. + * @throws {{code:400,type:"POLL_ANSWERS_INVALID"}} Invalid poll answers were provided. + * @throws {{code:400,type:"POLL_ANSWER_INVALID"}} One of the poll answers is not acceptable. + * @throws {{code:400,type:"POLL_OPTION_DUPLICATE"}} Duplicate poll options provided. + * @throws {{code:400,type:"POLL_OPTION_INVALID"}} Invalid poll option provided. + * @throws {{code:400,type:"POLL_QUESTION_INVALID"}} One of the poll questions is not acceptable. + * @throws {{code:400,type:"QUIZ_CORRECT_ANSWERS_EMPTY"}} No correct quiz answer was specified. + * @throws {{code:400,type:"QUIZ_CORRECT_ANSWERS_TOO_MUCH"}} You specified too many correct answers in a quiz, quizes can only have one right answer! + * @throws {{code:400,type:"QUIZ_CORRECT_ANSWER_INVALID"}} An invalid value was provided to the correct_answers field. + * @throws {{code:400,type:"QUIZ_MULTIPLE_INVALID"}} Quizes can't have the multiple_choice flag set! + * @throws {{code:400,type:"REPLY_MARKUP_BUY_EMPTY"}} Reply markup for buy button empty. + * @throws {{code:400,type:"REPLY_MARKUP_INVALID"}} The provided reply markup is invalid. + * @throws {{code:400,type:"SCHEDULE_BOT_NOT_ALLOWED"}} Bots cannot schedule messages. + * @throws {{code:400,type:"SCHEDULE_DATE_TOO_LATE"}} You can't schedule a message this far in the future. + * @throws {{code:400,type:"SCHEDULE_TOO_MUCH"}} There are too many scheduled messages. + * @throws {{code:420,type:"SLOWMODE_WAIT_X"}} Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat. + * @throws {{code:400,type:"TTL_MEDIA_INVALID"}} Invalid media Time To Live was provided. + * @throws {{code:400,type:"USER_BANNED_IN_CHANNEL"}} You're banned from sending messages in supergroups/channels. + * @throws {{code:400,type:"USER_IS_BLOCKED"}} You were blocked by this user. + * @throws {{code:400,type:"USER_IS_BOT"}} Bots can't send messages to other bots. + * @throws {{code:400,type:"VIDEO_CONTENT_TYPE_INVALID"}} The video's content type is invalid. + * @throws {{code:400,type:"WEBPAGE_CURL_FAILED"}} Failure while fetching the webpage with cURL. + * @throws {{code:400,type:"WEBPAGE_MEDIA_EMPTY"}} Webpage media empty. + * @throws {{code:400,type:"YOU_BLOCKED_USER"}} You blocked this user. + */ + export class SendMedia extends Request,TypeUpdates> implements SendMediaArgs { + CONSTRUCTOR_id: 881978281; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.SendMedia"; + flags: number; + silent?: true; + background?: true; + clearDraft?: true; + peer: EntityLike; + replyToMsgId?: MessageIDLike; + media: TypeInputMedia; + message: string; + randomId: long; + replyMarkup?: TypeReplyMarkup; + entities?: TypeMessageEntity[]; + scheduleDate?: int; + fromReader(reader: Reader): SendMedia; + } + + export interface ForwardMessagesArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to send messages silently (no notification will be triggered on the destination clients) */ + silent?: true; + /** Whether to send the message in background */ + background?: true; + /** When forwarding games, whether to include your score in the game */ + withMyScore?: true; + /** Whether to forward messages without quoting the original author */ + fromPeer: EntityLike; + /** Whether to strip captions from media */ + id: int[]; + /** Source of messages */ + randomId: long[]; + /** IDs of messages */ + toPeer: EntityLike; + /** Random ID to prevent resending of messages */ + scheduleDate?: int; + } + + /** + * Forwards messages by their IDs.
+ * @throws {{code:400,type:"BROADCAST_PUBLIC_VOTERS_FORBIDDEN"}} You can't forward polls with public voters. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"CHAT_RESTRICTED"}} You can't send messages in this chat, you were restricted. + * @throws {{code:403,type:"CHAT_SEND_GAME_FORBIDDEN"}} You can't send a game to this chat. + * @throws {{code:403,type:"CHAT_SEND_GIFS_FORBIDDEN"}} You can't send gifs in this chat. + * @throws {{code:403,type:"CHAT_SEND_MEDIA_FORBIDDEN"}} You can't send media in this chat. + * @throws {{code:403,type:"CHAT_SEND_POLL_FORBIDDEN"}} You can't send polls in this chat. + * @throws {{code:403,type:"CHAT_SEND_STICKERS_FORBIDDEN"}} You can't send stickers in this chat. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"GROUPED_MEDIA_INVALID"}} Invalid grouped media. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MEDIA_EMPTY"}} The provided media object is invalid. + * @throws {{code:400,type:"MESSAGE_IDS_EMPTY"}} No message ids were provided. + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:420,type:"P0NY_FLOODWAIT"}}   + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"RANDOM_ID_INVALID"}} A provided random ID is invalid. + * @throws {{code:400,type:"SCHEDULE_DATE_TOO_LATE"}} You can't schedule a message this far in the future. + * @throws {{code:400,type:"SCHEDULE_TOO_MUCH"}} There are too many scheduled messages. + * @throws {{code:400,type:"SLOWMODE_MULTI_MSGS_DISABLED"}} Slowmode is enabled, you cannot forward multiple messages to this group. + * @throws {{code:420,type:"SLOWMODE_WAIT_X"}} Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat. + * @throws {{code:400,type:"USER_BANNED_IN_CHANNEL"}} You're banned from sending messages in supergroups/channels. + * @throws {{code:400,type:"USER_IS_BLOCKED"}} You were blocked by this user. + * @throws {{code:400,type:"USER_IS_BOT"}} Bots can't send messages to other bots. + * @throws {{code:400,type:"YOU_BLOCKED_USER"}} You blocked this user. + */ + export class ForwardMessages extends Request,TypeUpdates> implements ForwardMessagesArgs { + CONSTRUCTOR_id: -637606386; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.ForwardMessages"; + flags: number; + silent?: true; + background?: true; + withMyScore?: true; + fromPeer: EntityLike; + id: int[]; + randomId: long[]; + toPeer: EntityLike; + scheduleDate?: int; + fromReader(reader: Reader): ForwardMessages; + } + + export interface ReportSpamArgs { + /** Peer to report */ + peer: EntityLike; + } + + /** + * Report a new incoming chat for spam, if the peer settings of the chat allow us to do that
+ * @link https://corefork.telegram.org/constructor/peerSettings + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class ReportSpam extends Request,Bool> implements ReportSpamArgs { + CONSTRUCTOR_id: -820669733; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ReportSpam"; + peer: EntityLike; + fromReader(reader: Reader): ReportSpam; + } + + export interface GetPeerSettingsArgs { + /** The peer */ + peer: EntityLike; + } + + /** + * Get peer settings
+ * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetPeerSettings extends Request,TypePeerSettings> implements GetPeerSettingsArgs { + CONSTRUCTOR_id: 913498268; + SUBCLASS_OF_ID: 4138180484; + classType: "request"; + className: "messages.GetPeerSettings"; + peer: EntityLike; + fromReader(reader: Reader): GetPeerSettings; + } + + export interface ReportArgs { + /** Peer */ + peer: EntityLike; + /** IDs of messages to report */ + id: int[]; + /** Why are these messages being reported */ + reason: TypeReportReason; + /** Comment for report moderation */ + message: string; + } + + /** + * Report a message in a chat for violation of telegram's Terms of Service
+ * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class Report extends Request,Bool> implements ReportArgs { + CONSTRUCTOR_id: -1991005362; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.Report"; + peer: EntityLike; + id: int[]; + reason: TypeReportReason; + message: string; + fromReader(reader: Reader): Report; + } + + export interface GetChatsArgs { + /** List of chat IDs */ + id: int[]; + } + + /** + * Returns chat basic info on their IDs.
+ * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetChats extends Request,messages.TypeChats> implements GetChatsArgs { + CONSTRUCTOR_id: 1013621127; + SUBCLASS_OF_ID: 2580925204; + classType: "request"; + className: "messages.GetChats"; + id: int[]; + fromReader(reader: Reader): GetChats; + } + + export interface GetFullChatArgs { + /** Chat ID */ + chatId: int; + } + + /** + * Returns full chat info according to its ID.
+ * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetFullChat extends Request,messages.TypeChatFull> implements GetFullChatArgs { + CONSTRUCTOR_id: 998448230; + SUBCLASS_OF_ID: 576344329; + classType: "request"; + className: "messages.GetFullChat"; + chatId: int; + fromReader(reader: Reader): GetFullChat; + } + + export interface EditChatTitleArgs { + /** Chat ID */ + chatId: int; + /** New chat name, different from the old one */ + title: string; + } + + /** + * Chanages chat name and sends a service message on it.
+ * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:400,type:"CHAT_TITLE_EMPTY"}} No chat title provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class EditChatTitle extends Request,TypeUpdates> implements EditChatTitleArgs { + CONSTRUCTOR_id: -599447467; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.EditChatTitle"; + chatId: int; + title: string; + fromReader(reader: Reader): EditChatTitle; + } + + export interface EditChatPhotoArgs { + /** Chat ID */ + chatId: int; + /** Photo to be set */ + photo: TypeInputChatPhoto; + } + + /** + * Changes chat photo and sends a service message on it
+ * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"PHOTO_CROP_SIZE_SMALL"}} Photo is too small. + * @throws {{code:400,type:"PHOTO_EXT_INVALID"}} The extension of the photo is invalid. + * @throws {{code:400,type:"PHOTO_INVALID"}} Photo invalid. + */ + export class EditChatPhoto extends Request,TypeUpdates> implements EditChatPhotoArgs { + CONSTRUCTOR_id: -900957736; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.EditChatPhoto"; + chatId: int; + photo: TypeInputChatPhoto; + fromReader(reader: Reader): EditChatPhoto; + } + + export interface AddChatUserArgs { + /** Chat ID */ + chatId: int; + /** User ID to be added */ + userId: TypeInputUser; + /** Number of last messages to be forwarded */ + fwdLimit: int; + } + + /** + * Adds a user to a chat and sends a service message on it.
+ * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"USERS_TOO_MUCH"}} The maximum number of users has been exceeded (to create a chat, for example). + * @throws {{code:400,type:"USER_ALREADY_PARTICIPANT"}} The user is already in the group. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + * @throws {{code:400,type:"USER_IS_BLOCKED"}} You were blocked by this user. + * @throws {{code:403,type:"USER_NOT_MUTUAL_CONTACT"}} The provided user is not a mutual contact. + * @throws {{code:403,type:"USER_PRIVACY_RESTRICTED"}} The user's privacy settings do not allow you to do this. + * @throws {{code:400,type:"YOU_BLOCKED_USER"}} You blocked this user. + */ + export class AddChatUser extends Request,TypeUpdates> implements AddChatUserArgs { + CONSTRUCTOR_id: -106911223; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.AddChatUser"; + chatId: int; + userId: TypeInputUser; + fwdLimit: int; + fromReader(reader: Reader): AddChatUser; + } + + export interface DeleteChatUserArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Remove the entire chat history of the specified user in this chat. */ + revokeHistory?: true; + /** Chat ID */ + chatId: int; + /** User ID to be deleted */ + userId: TypeInputUser; + } + + /** + * Deletes a user from a chat and sends a service message on it.
+ * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + * @throws {{code:400,type:"USER_NOT_PARTICIPANT"}} You're not a member of this supergroup/channel. + */ + export class DeleteChatUser extends Request,TypeUpdates> implements DeleteChatUserArgs { + CONSTRUCTOR_id: -986430054; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.DeleteChatUser"; + flags: number; + revokeHistory?: true; + chatId: int; + userId: TypeInputUser; + fromReader(reader: Reader): DeleteChatUser; + } + + export interface CreateChatArgs { + /** List of user IDs to be invited */ + users: TypeInputUser[]; + /** Chat name */ + title: string; + } + + /** + * Creates a new chat.
+ * @throws {{code:400,type:"CHAT_INVALID"}} Invalid chat. + * @throws {{code:400,type:"CHAT_TITLE_EMPTY"}} No chat title provided. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"USERS_TOO_FEW"}} Not enough users (to create a chat, for example). + * @throws {{code:403,type:"USER_RESTRICTED"}} You're spamreported, you can't create channels or chats. + */ + export class CreateChat extends Request,TypeUpdates> implements CreateChatArgs { + CONSTRUCTOR_id: 164303470; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.CreateChat"; + users: TypeInputUser[]; + title: string; + fromReader(reader: Reader): CreateChat; + } + + export interface GetDhConfigArgs { + /** Value of the version parameter from messages.dhConfig, avialable at the client */ + version: int; + /** Length of the required random sequence */ + randomLength: int; + } + + /** + * Returns configuration parameters for Diffie-Hellman key generation. Can also return a random sequence of bytes of required length.
+ * @link https://corefork.telegram.org/constructor/messages.dhConfig + * @throws {{code:400,type:"RANDOM_LENGTH_INVALID"}} Random length invalid. + */ + export class GetDhConfig extends Request,messages.TypeDhConfig> implements GetDhConfigArgs { + CONSTRUCTOR_id: 651135312; + SUBCLASS_OF_ID: 3834178955; + classType: "request"; + className: "messages.GetDhConfig"; + version: int; + randomLength: int; + fromReader(reader: Reader): GetDhConfig; + } + + export interface RequestEncryptionArgs { + /** User ID */ + userId: TypeInputUser; + /** Unique client request ID required to prevent resending. This also doubles as the chat ID. */ + randomId: int; + /** A = g ^ a mod p, see Wikipedia */ + gA: bytes; + } + + /** + * Sends a request to start a secret chat to the user.
+ * @throws {{code:400,type:"DH_G_A_INVALID"}} g_a invalid. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class RequestEncryption extends Request,TypeEncryptedChat> implements RequestEncryptionArgs { + CONSTRUCTOR_id: -162681021; + SUBCLASS_OF_ID: 1831379834; + classType: "request"; + className: "messages.RequestEncryption"; + userId: TypeInputUser; + randomId: int; + gA: bytes; + fromReader(reader: Reader): RequestEncryption; + } + + export interface AcceptEncryptionArgs { + /** Secret chat ID */ + peer: TypeInputEncryptedChat; + /** B = g ^ b mod p, see Wikipedia */ + gB: bytes; + /** 64-bit fingerprint of the received key */ + keyFingerprint: long; + } + + /** + * Confirms creation of a secret chat
+ * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"ENCRYPTION_ALREADY_ACCEPTED"}} Secret chat already accepted. + * @throws {{code:400,type:"ENCRYPTION_ALREADY_DECLINED"}} The secret chat was already declined. + */ + export class AcceptEncryption extends Request,TypeEncryptedChat> implements AcceptEncryptionArgs { + CONSTRUCTOR_id: 1035731989; + SUBCLASS_OF_ID: 1831379834; + classType: "request"; + className: "messages.AcceptEncryption"; + peer: TypeInputEncryptedChat; + gB: bytes; + keyFingerprint: long; + fromReader(reader: Reader): AcceptEncryption; + } + + export interface DiscardEncryptionArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to delete the entire chat history for the other user as well */ + deleteHistory?: true; + /** Secret chat ID */ + chatId: int; + } + + /** + * Cancels a request for creation and/or delete info on secret chat.
+ * @throws {{code:400,type:"CHAT_ID_EMPTY"}} The provided chat ID is empty. + * @throws {{code:400,type:"ENCRYPTION_ALREADY_DECLINED"}} The secret chat was already declined. + * @throws {{code:400,type:"ENCRYPTION_ID_INVALID"}} The provided secret chat ID is invalid. + */ + export class DiscardEncryption extends Request,Bool> implements DiscardEncryptionArgs { + CONSTRUCTOR_id: -208425312; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.DiscardEncryption"; + flags: number; + deleteHistory?: true; + chatId: int; + fromReader(reader: Reader): DiscardEncryption; + } + + export interface SetEncryptedTypingArgs { + /** Secret chat ID */ + peer: TypeInputEncryptedChat; + /** Typing.
Possible values:
(boolTrue), if the user started typing and more than 5 seconds have passed since the last request
(boolFalse), if the user stopped typing */ + typing: Bool; + } + + /** + * Send typing event by the current user to a secret chat.
+ * @link https://corefork.telegram.org/constructor/boolTrue + * @link https://corefork.telegram.org/constructor/boolFalse + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + */ + export class SetEncryptedTyping extends Request,Bool> implements SetEncryptedTypingArgs { + CONSTRUCTOR_id: 2031374829; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.SetEncryptedTyping"; + peer: TypeInputEncryptedChat; + typing: Bool; + fromReader(reader: Reader): SetEncryptedTyping; + } + + export interface ReadEncryptedHistoryArgs { + /** Secret chat ID */ + peer: TypeInputEncryptedChat; + /** Maximum date value for received messages in history */ + maxDate: int; + } + + /** + * Marks message history within a secret chat as read.
+ * @throws {{code:400,type:"MSG_WAIT_FAILED"}} A waiting call returned an error. + */ + export class ReadEncryptedHistory extends Request,Bool> implements ReadEncryptedHistoryArgs { + CONSTRUCTOR_id: 2135648522; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ReadEncryptedHistory"; + peer: TypeInputEncryptedChat; + maxDate: int; + fromReader(reader: Reader): ReadEncryptedHistory; + } + + export interface SendEncryptedArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Send encrypted message without a notification */ + silent?: true; + /** Secret chat ID */ + peer: TypeInputEncryptedChat; + /** Unique client message ID, necessary to avoid message resending */ + randomId: long; + /** TL-serialization of DecryptedMessage type, encrypted with a key that was created during chat initialization */ + data: bytes; + } + + /** + * Sends a text message to a secret chat.
+ * @link https://corefork.telegram.org/type/DecryptedMessage + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"DATA_INVALID"}} Encrypted data invalid. + * @throws {{code:400,type:"ENCRYPTION_DECLINED"}} The secret chat was declined. + * @throws {{code:400,type:"MSG_WAIT_FAILED"}} A waiting call returned an error. + * @throws {{code:403,type:"USER_IS_BLOCKED"}} You were blocked by this user. + */ + export class SendEncrypted extends Request,messages.TypeSentEncryptedMessage> implements SendEncryptedArgs { + CONSTRUCTOR_id: 1157265941; + SUBCLASS_OF_ID: 3382591056; + classType: "request"; + className: "messages.SendEncrypted"; + flags: number; + silent?: true; + peer: TypeInputEncryptedChat; + randomId: long; + data: bytes; + fromReader(reader: Reader): SendEncrypted; + } + + export interface SendEncryptedFileArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to send the file without triggering a notification */ + silent?: true; + /** Secret chat ID */ + peer: TypeInputEncryptedChat; + /** Unique client message ID necessary to prevent message resending */ + randomId: long; + /** TL-serialization of DecryptedMessage type, encrypted with a key generated during chat initialization */ + data: bytes; + /** File attachment for the secret chat */ + file: TypeInputEncryptedFile; + } + + /** + * Sends a message with a file attachment to a secret chat
+ * @link https://corefork.telegram.org/type/DecryptedMessage + * @throws {{code:400,type:"DATA_TOO_LONG"}} Data too long. + * @throws {{code:400,type:"ENCRYPTION_DECLINED"}} The secret chat was declined. + * @throws {{code:400,type:"FILE_EMTPY"}} An empty file was provided. + * @throws {{code:400,type:"MD5_CHECKSUM_INVALID"}} The MD5 checksums do not match. + * @throws {{code:400,type:"MSG_WAIT_FAILED"}} A waiting call returned an error. + */ + export class SendEncryptedFile extends Request,messages.TypeSentEncryptedMessage> implements SendEncryptedFileArgs { + CONSTRUCTOR_id: 1431914525; + SUBCLASS_OF_ID: 3382591056; + classType: "request"; + className: "messages.SendEncryptedFile"; + flags: number; + silent?: true; + peer: TypeInputEncryptedChat; + randomId: long; + data: bytes; + file: TypeInputEncryptedFile; + fromReader(reader: Reader): SendEncryptedFile; + } + + export interface SendEncryptedServiceArgs { + /** Secret chat ID */ + peer: TypeInputEncryptedChat; + /** Unique client message ID required to prevent message resending */ + randomId: long; + /** TL-serialization of DecryptedMessage type, encrypted with a key generated during chat initialization */ + data: bytes; + } + + /** + * Sends a service message to a secret chat.
+ * @link https://corefork.telegram.org/type/DecryptedMessage + * @throws {{code:400,type:"DATA_INVALID"}} Encrypted data invalid. + * @throws {{code:400,type:"ENCRYPTION_DECLINED"}} The secret chat was declined. + * @throws {{code:400,type:"ENCRYPTION_ID_INVALID"}} The provided secret chat ID is invalid. + * @throws {{code:400,type:"MSG_WAIT_FAILED"}} A waiting call returned an error. + * @throws {{code:403,type:"USER_DELETED"}} You can't send this secret message because the other participant deleted their account. + * @throws {{code:403,type:"USER_IS_BLOCKED"}} You were blocked by this user. + */ + export class SendEncryptedService extends Request,messages.TypeSentEncryptedMessage> implements SendEncryptedServiceArgs { + CONSTRUCTOR_id: 852769188; + SUBCLASS_OF_ID: 3382591056; + classType: "request"; + className: "messages.SendEncryptedService"; + peer: TypeInputEncryptedChat; + randomId: long; + data: bytes; + fromReader(reader: Reader): SendEncryptedService; + } + + export interface ReceivedQueueArgs { + /** Maximum qts value available at the client */ + maxQts: int; + } + + /** + * Confirms receipt of messages in a secret chat by client, cancels push notifications.
+ * @throws {{code:400,type:"MAX_QTS_INVALID"}} The specified max_qts is invalid. + * @throws {{code:400,type:"MSG_WAIT_FAILED"}} A waiting call returned an error. + */ + export class ReceivedQueue extends Request,long[]> implements ReceivedQueueArgs { + CONSTRUCTOR_id: 1436924774; + SUBCLASS_OF_ID: 2300109160; + classType: "request"; + className: "messages.ReceivedQueue"; + maxQts: int; + fromReader(reader: Reader): ReceivedQueue; + } + + export interface ReportEncryptedSpamArgs { + /** The secret chat to report */ + peer: TypeInputEncryptedChat; + } + + /** + * Report a secret chat for spam
+ * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + */ + export class ReportEncryptedSpam extends Request,Bool> implements ReportEncryptedSpamArgs { + CONSTRUCTOR_id: 1259113487; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ReportEncryptedSpam"; + peer: TypeInputEncryptedChat; + fromReader(reader: Reader): ReportEncryptedSpam; + } + + export interface ReadMessageContentsArgs { + /** Message ID list */ + id: int[]; + } + + /** Notifies the sender about the recipient having listened a voice message or watched a video.
*/ + export class ReadMessageContents extends Request,messages.TypeAffectedMessages> implements ReadMessageContentsArgs { + CONSTRUCTOR_id: 916930423; + SUBCLASS_OF_ID: 3469983854; + classType: "request"; + className: "messages.ReadMessageContents"; + id: int[]; + fromReader(reader: Reader): ReadMessageContents; + } + + export interface GetStickersArgs { + /** The emoji */ + emoticon: string; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get stickers by emoji
+ * @link https://corefork.telegram.org/api/offsets + * @throws {{code:400,type:"EMOTICON_EMPTY"}} The emoji is empty. + */ + export class GetStickers extends Request,messages.TypeStickers> implements GetStickersArgs { + CONSTRUCTOR_id: 71126828; + SUBCLASS_OF_ID: 3611015646; + classType: "request"; + className: "messages.GetStickers"; + emoticon: string; + hash: int; + fromReader(reader: Reader): GetStickers; + } + + export interface GetAllStickersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get all installed stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetAllStickers extends Request,messages.TypeAllStickers> implements GetAllStickersArgs { + CONSTRUCTOR_id: 479598769; + SUBCLASS_OF_ID: 1166231593; + classType: "request"; + className: "messages.GetAllStickers"; + hash: int; + fromReader(reader: Reader): GetAllStickers; + } + + export interface GetWebPagePreviewArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Message from which to extract the preview */ + message: string; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + } + + /** + * Get preview of webpage
+ * @link https://corefork.telegram.org/api/entities + * @throws {{code:400,type:"MESSAGE_EMPTY"}} The provided message is empty. + */ + export class GetWebPagePreview extends Request,TypeMessageMedia> implements GetWebPagePreviewArgs { + CONSTRUCTOR_id: -1956073268; + SUBCLASS_OF_ID: 1198308914; + classType: "request"; + className: "messages.GetWebPagePreview"; + flags: number; + message: string; + entities?: TypeMessageEntity[]; + fromReader(reader: Reader): GetWebPagePreview; + } + + export interface ExportChatInviteArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Legacy flag, reproducing legacy behavior of this method: if set, revokes all previous links before creating a new one. Kept for bot API BC, should not be used by modern clients. */ + legacyRevokePermanent?: true; + /** Chat */ + peer: EntityLike; + /** Expiration date */ + expireDate?: int; + /** Maximum number of users that can join using this link */ + usageLimit?: int; + } + + /** + * Export an invite link for a chat
+ * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"EXPIRE_DATE_INVALID"}} The specified expiration date is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"USAGE_LIMIT_INVALID"}} The specified usage limit is invalid. + */ + export class ExportChatInvite extends Request,TypeExportedChatInvite> implements ExportChatInviteArgs { + CONSTRUCTOR_id: 347716823; + SUBCLASS_OF_ID: 3027536472; + classType: "request"; + className: "messages.ExportChatInvite"; + flags: number; + legacyRevokePermanent?: true; + peer: EntityLike; + expireDate?: int; + usageLimit?: int; + fromReader(reader: Reader): ExportChatInvite; + } + + export interface CheckChatInviteArgs { + /** Invite hash in t.me/joinchat/hash */ + hash: string; + } + + /** + * Check the validity of a chat invite link and get basic info about it
+ * @throws {{code:400,type:"INVITE_HASH_EMPTY"}} The invite hash is empty. + * @throws {{code:400,type:"INVITE_HASH_EXPIRED"}} The invite link has expired. + * @throws {{code:400,type:"INVITE_HASH_INVALID"}} The invite hash is invalid. + */ + export class CheckChatInvite extends Request,TypeChatInvite> implements CheckChatInviteArgs { + CONSTRUCTOR_id: 1051570619; + SUBCLASS_OF_ID: 72750902; + classType: "request"; + className: "messages.CheckChatInvite"; + hash: string; + fromReader(reader: Reader): CheckChatInvite; + } + + export interface ImportChatInviteArgs { + /** hash from t.me/joinchat/hash */ + hash: string; + } + + /** + * Import a chat invite and join a private chat/supergroup/channel
+ * @throws {{code:400,type:"CHANNELS_TOO_MUCH"}} You have joined too many channels/supergroups. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_INVALID"}} Invalid chat. + * @throws {{code:400,type:"INVITE_HASH_EMPTY"}} The invite hash is empty. + * @throws {{code:400,type:"INVITE_HASH_EXPIRED"}} The invite link has expired. + * @throws {{code:400,type:"INVITE_HASH_INVALID"}} The invite hash is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"USERS_TOO_MUCH"}} The maximum number of users has been exceeded (to create a chat, for example). + * @throws {{code:400,type:"USER_ALREADY_PARTICIPANT"}} The user is already in the group. + * @throws {{code:400,type:"USER_CHANNELS_TOO_MUCH"}} One of the users you tried to add is already in too many channels/supergroups. + */ + export class ImportChatInvite extends Request,TypeUpdates> implements ImportChatInviteArgs { + CONSTRUCTOR_id: 1817183516; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.ImportChatInvite"; + hash: string; + fromReader(reader: Reader): ImportChatInvite; + } + + export interface GetStickerSetArgs { + /** Stickerset */ + stickerset: TypeInputStickerSet; + } + + /** + * Get info about a stickerset
+ * @throws {{code:400,type:"EMOTICON_STICKERPACK_MISSING"}}   + * @throws {{code:400,type:"STICKERSET_INVALID"}} The provided sticker set is invalid. + */ + export class GetStickerSet extends Request,messages.TypeStickerSet> implements GetStickerSetArgs { + CONSTRUCTOR_id: 639215886; + SUBCLASS_OF_ID: 2607827546; + classType: "request"; + className: "messages.GetStickerSet"; + stickerset: TypeInputStickerSet; + fromReader(reader: Reader): GetStickerSet; + } + + export interface InstallStickerSetArgs { + /** Stickerset to install */ + stickerset: TypeInputStickerSet; + /** Whether to archive stickerset */ + archived: Bool; + } + + /** + * Install a stickerset
+ * @throws {{code:400,type:"STICKERSET_INVALID"}} The provided sticker set is invalid. + */ + export class InstallStickerSet extends Request,messages.TypeStickerSetInstallResult> implements InstallStickerSetArgs { + CONSTRUCTOR_id: -946871200; + SUBCLASS_OF_ID: 1741373416; + classType: "request"; + className: "messages.InstallStickerSet"; + stickerset: TypeInputStickerSet; + archived: Bool; + fromReader(reader: Reader): InstallStickerSet; + } + + export interface UninstallStickerSetArgs { + /** The stickerset to uninstall */ + stickerset: TypeInputStickerSet; + } + + /** + * Uninstall a stickerset
+ * @throws {{code:400,type:"STICKERSET_INVALID"}} The provided sticker set is invalid. + */ + export class UninstallStickerSet extends Request,Bool> implements UninstallStickerSetArgs { + CONSTRUCTOR_id: -110209570; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.UninstallStickerSet"; + stickerset: TypeInputStickerSet; + fromReader(reader: Reader): UninstallStickerSet; + } + + export interface StartBotArgs { + /** The bot */ + bot: TypeInputUser; + /** The chat where to start the bot, can be the bot's private chat or a group */ + peer: EntityLike; + /** Random ID to avoid resending the same message */ + randomId: long; + /** Deep linking parameter */ + startParam: string; + } + + /** + * Start a conversation with a bot using a deep linking parameter
+ * @link https://corefork.telegram.org/bots + * @throws {{code:400,type:"BOT_INVALID"}} This is not a valid bot. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"START_PARAM_EMPTY"}} The start parameter is empty. + * @throws {{code:400,type:"START_PARAM_INVALID"}} Start parameter invalid. + * @throws {{code:400,type:"START_PARAM_TOO_LONG"}} Start parameter is too long. + */ + export class StartBot extends Request,TypeUpdates> implements StartBotArgs { + CONSTRUCTOR_id: -421563528; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.StartBot"; + bot: TypeInputUser; + peer: EntityLike; + randomId: long; + startParam: string; + fromReader(reader: Reader): StartBot; + } + + export interface GetMessagesViewsArgs { + /** Peer where the message was found */ + peer: EntityLike; + /** ID of message */ + id: int[]; + /** Whether to mark the message as viewed and increment the view counter */ + increment: Bool; + } + + /** + * Get and increase the view counter of a message sent or forwarded from a channel
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetMessagesViews extends Request,messages.TypeMessageViews> implements GetMessagesViewsArgs { + CONSTRUCTOR_id: 1468322785; + SUBCLASS_OF_ID: 2947935132; + classType: "request"; + className: "messages.GetMessagesViews"; + peer: EntityLike; + id: int[]; + increment: Bool; + fromReader(reader: Reader): GetMessagesViews; + } + + export interface EditChatAdminArgs { + /** The ID of the group */ + chatId: int; + /** The user to make admin */ + userId: TypeInputUser; + /** Whether to make him admin */ + isAdmin: Bool; + } + + /** + * Make a user admin in a legacy group.
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + * @throws {{code:400,type:"USER_NOT_PARTICIPANT"}} You're not a member of this supergroup/channel. + */ + export class EditChatAdmin extends Request,Bool> implements EditChatAdminArgs { + CONSTRUCTOR_id: -1444503762; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.EditChatAdmin"; + chatId: int; + userId: TypeInputUser; + isAdmin: Bool; + fromReader(reader: Reader): EditChatAdmin; + } + + export interface MigrateChatArgs { + /** Legacy group to migrate */ + chatId: int; + } + + /** + * Turn a legacy group into a supergroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNELS_TOO_MUCH"}} You have joined too many channels/supergroups. + * @throws {{code:403,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class MigrateChat extends Request,TypeUpdates> implements MigrateChatArgs { + CONSTRUCTOR_id: 363051235; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.MigrateChat"; + chatId: int; + fromReader(reader: Reader): MigrateChat; + } + + export interface SearchGlobalArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Peer folder ID, for more info click here */ + folderId?: int; + /** Query */ + q: string; + /** Global search filter */ + filter: TypeMessagesFilter; + /** If a positive value was specified, the method will return only messages with date bigger than min_date */ + minDate: int; + /** If a positive value was transferred, the method will return only messages with date smaller than max_date */ + maxDate: int; + /** Initially 0, then set to the next_rate parameter of messages.messagesSlice */ + offsetRate: int; + /** Offsets for pagination, for more info click here */ + offsetPeer: EntityLike; + /** Offsets for pagination, for more info click here */ + offsetId: int; + /** Offsets for pagination, for more info click here */ + limit: int; + } + + /** + * Search for messages and peers globally
+ * @link https://corefork.telegram.org/api/folders + * @link https://corefork.telegram.org/constructor/messages.messagesSlice + * @link https://corefork.telegram.org/api/offsets + * @throws {{code:400,type:"FOLDER_ID_INVALID"}} Invalid folder ID. + * @throws {{code:400,type:"SEARCH_QUERY_EMPTY"}} The search query is empty. + */ + export class SearchGlobal extends Request,messages.TypeMessages> implements SearchGlobalArgs { + CONSTRUCTOR_id: 1271290010; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "messages.SearchGlobal"; + flags: number; + folderId?: int; + q: string; + filter: TypeMessagesFilter; + minDate: int; + maxDate: int; + offsetRate: int; + offsetPeer: EntityLike; + offsetId: int; + limit: int; + fromReader(reader: Reader): SearchGlobal; + } + + export interface ReorderStickerSetsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Reorder mask stickersets */ + masks?: true; + /** New stickerset order by stickerset IDs */ + order: long[]; + } + + /** Reorder installed stickersets
*/ + export class ReorderStickerSets extends Request,Bool> implements ReorderStickerSetsArgs { + CONSTRUCTOR_id: 2016638777; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ReorderStickerSets"; + flags: number; + masks?: true; + order: long[]; + fromReader(reader: Reader): ReorderStickerSets; + } + + export interface GetDocumentByHashArgs { + /** SHA256 of file */ + sha256: bytes; + /** Size of the file in bytes */ + size: int; + /** Mime type */ + mimeType: string; + } + + /** + * Get a document by its SHA256 hash, mainly used for gifs
+ * @throws {{code:400,type:"SHA256_HASH_INVALID"}} The provided SHA256 hash is invalid. + */ + export class GetDocumentByHash extends Request,TypeDocument> implements GetDocumentByHashArgs { + CONSTRUCTOR_id: 864953444; + SUBCLASS_OF_ID: 555739168; + classType: "request"; + className: "messages.GetDocumentByHash"; + sha256: bytes; + size: int; + mimeType: string; + fromReader(reader: Reader): GetDocumentByHash; + } + + export interface GetSavedGifsArgs { + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get saved GIFs
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetSavedGifs extends Request,messages.TypeSavedGifs> implements GetSavedGifsArgs { + CONSTRUCTOR_id: -2084618926; + SUBCLASS_OF_ID: 2794152437; + classType: "request"; + className: "messages.GetSavedGifs"; + hash: int; + fromReader(reader: Reader): GetSavedGifs; + } + + export interface SaveGifArgs { + /** GIF to save */ + id: TypeInputDocument; + /** Whether to remove GIF from saved gifs list */ + unsave: Bool; + } + + /** + * Add GIF to saved gifs list
+ * @throws {{code:400,type:"GIF_ID_INVALID"}} The provided GIF ID is invalid. + */ + export class SaveGif extends Request,Bool> implements SaveGifArgs { + CONSTRUCTOR_id: 846868683; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.SaveGif"; + id: TypeInputDocument; + unsave: Bool; + fromReader(reader: Reader): SaveGif; + } + + export interface GetInlineBotResultsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The bot to query */ + bot: TypeInputUser; + /** The currently opened chat */ + peer: EntityLike; + /** The geolocation, if requested */ + geoPoint?: TypeInputGeoPoint; + /** The query */ + query: string; + /** The offset within the results, will be passed directly as-is to the bot. */ + offset: string; + } + + /** + * Query an inline bot
+ * @throws {{code:400,type:"BOT_INLINE_DISABLED"}} This bot can't be used in inline mode. + * @throws {{code:400,type:"BOT_INVALID"}} This is not a valid bot. + * @throws {{code:400,type:"BOT_RESPONSE_TIMEOUT"}} A timeout occurred while fetching data from the bot. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:-503,type:"Timeout"}} Timeout while fetching data. + */ + export class GetInlineBotResults extends Request,messages.TypeBotResults> implements GetInlineBotResultsArgs { + CONSTRUCTOR_id: 1364105629; + SUBCLASS_OF_ID: 1054136777; + classType: "request"; + className: "messages.GetInlineBotResults"; + flags: number; + bot: TypeInputUser; + peer: EntityLike; + geoPoint?: TypeInputGeoPoint; + query: string; + offset: string; + fromReader(reader: Reader): GetInlineBotResults; + } + + export interface SetInlineBotResultsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Set this flag if the results are composed of media files */ + gallery?: true; + /** Set this flag if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query */ + private?: true; + /** Unique identifier for the answered query */ + queryId: long; + /** Vector of results for the inline query */ + results: TypeInputBotInlineResult[]; + /** The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. */ + cacheTime: int; + /** Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes. */ + nextOffset?: string; + /** If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with a certain parameter. */ + switchPm?: TypeInlineBotSwitchPM; + } + + /** + * Answer an inline query, for bots only
+ * @throws {{code:400,type:"ARTICLE_TITLE_EMPTY"}} The title of the article is empty. + * @throws {{code:400,type:"AUDIO_CONTENT_URL_EMPTY"}} The remote URL specified in the content field is empty. + * @throws {{code:400,type:"AUDIO_TITLE_EMPTY"}} An empty audio title was provided. + * @throws {{code:400,type:"BUTTON_DATA_INVALID"}} The data of one or more of the buttons you provided is invalid. + * @throws {{code:400,type:"BUTTON_TYPE_INVALID"}} The type of one or more of the buttons you provided is invalid. + * @throws {{code:400,type:"BUTTON_URL_INVALID"}} Button URL invalid. + * @throws {{code:400,type:"DOCUMENT_INVALID"}} The specified document is invalid. + * @throws {{code:400,type:"FILE_CONTENT_TYPE_INVALID"}} File content-type is invalid. + * @throws {{code:400,type:"FILE_TITLE_EMPTY"}} An empty file title was specified. + * @throws {{code:400,type:"GIF_CONTENT_TYPE_INVALID"}} GIF content-type invalid. + * @throws {{code:400,type:"MESSAGE_EMPTY"}} The provided message is empty. + * @throws {{code:400,type:"MESSAGE_TOO_LONG"}} The provided message is too long. + * @throws {{code:400,type:"NEXT_OFFSET_INVALID"}} The specified offset is longer than 64 bytes. + * @throws {{code:400,type:"PHOTO_CONTENT_TYPE_INVALID"}} Photo mime-type invalid. + * @throws {{code:400,type:"PHOTO_CONTENT_URL_EMPTY"}} Photo URL invalid. + * @throws {{code:400,type:"PHOTO_INVALID"}} Photo invalid. + * @throws {{code:400,type:"PHOTO_THUMB_URL_EMPTY"}} Photo thumbnail URL is empty. + * @throws {{code:400,type:"QUERY_ID_INVALID"}} The query ID is invalid. + * @throws {{code:400,type:"REPLY_MARKUP_INVALID"}} The provided reply markup is invalid. + * @throws {{code:400,type:"RESULTS_TOO_MUCH"}} Too many results were provided. + * @throws {{code:400,type:"RESULT_ID_DUPLICATE"}} You provided a duplicate result ID. + * @throws {{code:400,type:"RESULT_TYPE_INVALID"}} Result type invalid. + * @throws {{code:400,type:"SEND_MESSAGE_MEDIA_INVALID"}} Invalid media provided. + * @throws {{code:400,type:"SEND_MESSAGE_TYPE_INVALID"}} The message type is invalid. + * @throws {{code:400,type:"START_PARAM_INVALID"}} Start parameter invalid. + * @throws {{code:400,type:"STICKER_DOCUMENT_INVALID"}} The specified sticker document is invalid. + * @throws {{code:403,type:"USER_BOT_INVALID"}} This method can only be called by a bot. + * @throws {{code:400,type:"VIDEO_TITLE_EMPTY"}} The specified video title is empty. + * @throws {{code:400,type:"WEBDOCUMENT_INVALID"}} Invalid webdocument URL provided. + * @throws {{code:400,type:"WEBDOCUMENT_MIME_INVALID"}} Invalid webdocument mime type provided. + * @throws {{code:400,type:"WEBDOCUMENT_SIZE_TOO_BIG"}} Webdocument is too big! + * @throws {{code:400,type:"WEBDOCUMENT_URL_INVALID"}} The specified webdocument URL is invalid. + */ + export class SetInlineBotResults extends Request,Bool> implements SetInlineBotResultsArgs { + CONSTRUCTOR_id: -346119674; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.SetInlineBotResults"; + flags: number; + gallery?: true; + private?: true; + queryId: long; + results: TypeInputBotInlineResult[]; + cacheTime: int; + nextOffset?: string; + switchPm?: TypeInlineBotSwitchPM; + fromReader(reader: Reader): SetInlineBotResults; + } + + export interface SendInlineBotResultArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to send the message silently (no notification will be triggered on the other client) */ + silent?: true; + /** Whether to send the message in background */ + background?: true; + /** Whether to clear the draft */ + clearDraft?: true; + /** Whether to hide the via @botname in the resulting message (only for bot usernames encountered in the config) */ + hideVia?: true; + /** Destination */ + peer: EntityLike; + /** ID of the message this message should reply to */ + replyToMsgId?: MessageIDLike; + /** Random ID to avoid resending the same query */ + randomId: long; + /** Query ID from messages.getInlineBotResults */ + queryId: long; + /** Result ID from messages.getInlineBotResults */ + id: string; + /** Scheduled message date for scheduled messages */ + scheduleDate?: int; + } + + /** + * Send a result obtained using messages.getInlineBotResults.
+ * @link https://corefork.telegram.org/api/drafts + * @link https://corefork.telegram.org/constructor/config + * @link https://corefork.telegram.org/method/messages.getInlineBotResults + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_RESTRICTED"}} You can't send messages in this chat, you were restricted. + * @throws {{code:403,type:"CHAT_SEND_GAME_FORBIDDEN"}} You can't send a game to this chat. + * @throws {{code:403,type:"CHAT_SEND_GIFS_FORBIDDEN"}} You can't send gifs in this chat. + * @throws {{code:403,type:"CHAT_SEND_INLINE_FORBIDDEN"}} You can't send inline messages in this group. + * @throws {{code:403,type:"CHAT_SEND_MEDIA_FORBIDDEN"}} You can't send media in this chat. + * @throws {{code:403,type:"CHAT_SEND_STICKERS_FORBIDDEN"}} You can't send stickers in this chat. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"INLINE_RESULT_EXPIRED"}} The inline query expired. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MEDIA_EMPTY"}} The provided media object is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"QUERY_ID_EMPTY"}} The query ID is empty. + * @throws {{code:400,type:"RESULT_ID_EMPTY"}} Result ID empty. + * @throws {{code:400,type:"SCHEDULE_DATE_TOO_LATE"}} You can't schedule a message this far in the future. + * @throws {{code:400,type:"SCHEDULE_TOO_MUCH"}} There are too many scheduled messages. + * @throws {{code:420,type:"SLOWMODE_WAIT_X"}} Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat. + * @throws {{code:400,type:"USER_BANNED_IN_CHANNEL"}} You're banned from sending messages in supergroups/channels. + * @throws {{code:400,type:"WEBPAGE_CURL_FAILED"}} Failure while fetching the webpage with cURL. + * @throws {{code:400,type:"WEBPAGE_MEDIA_EMPTY"}} Webpage media empty. + * @throws {{code:400,type:"YOU_BLOCKED_USER"}} You blocked this user. + */ + export class SendInlineBotResult extends Request,TypeUpdates> implements SendInlineBotResultArgs { + CONSTRUCTOR_id: 570955184; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.SendInlineBotResult"; + flags: number; + silent?: true; + background?: true; + clearDraft?: true; + hideVia?: true; + peer: EntityLike; + replyToMsgId?: MessageIDLike; + randomId: long; + queryId: long; + id: string; + scheduleDate?: int; + fromReader(reader: Reader): SendInlineBotResult; + } + + export interface GetMessageEditDataArgs { + /** Peer where the media was sent */ + peer: EntityLike; + /** ID of message */ + id: int; + } + + /** + * Find out if a media message's caption can be edited
+ * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:403,type:"MESSAGE_AUTHOR_REQUIRED"}} Message author required. + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetMessageEditData extends Request,messages.TypeMessageEditData> implements GetMessageEditDataArgs { + CONSTRUCTOR_id: -39416522; + SUBCLASS_OF_ID: 4215772317; + classType: "request"; + className: "messages.GetMessageEditData"; + peer: EntityLike; + id: int; + fromReader(reader: Reader): GetMessageEditData; + } + + export interface EditMessageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Disable webpage preview */ + noWebpage?: true; + /** Where was the message sent */ + peer: EntityLike; + /** ID of the message to edit */ + id: int; + /** New message */ + message?: string; + /** New attached media */ + media?: TypeInputMedia; + /** Reply markup for inline keyboards */ + replyMarkup?: TypeReplyMarkup; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + /** Scheduled message date for scheduled messages */ + scheduleDate?: int; + } + + /** + * Edit message
+ * @link https://corefork.telegram.org/api/entities + * @link https://corefork.telegram.org/api/scheduled-messages + * @throws {{code:400,type:"BUTTON_DATA_INVALID"}} The data of one or more of the buttons you provided is invalid. + * @throws {{code:400,type:"BUTTON_TYPE_INVALID"}} The type of one or more of the buttons you provided is invalid. + * @throws {{code:400,type:"BUTTON_URL_INVALID"}} Button URL invalid. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"ENTITIES_TOO_LONG"}} You provided too many styled message entities. + * @throws {{code:403,type:"INLINE_BOT_REQUIRED"}} Only the inline bot can edit message. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MEDIA_CAPTION_TOO_LONG"}} The caption is too long. + * @throws {{code:400,type:"MEDIA_GROUPED_INVALID"}} You tried to send media of different types in an album. + * @throws {{code:400,type:"MEDIA_NEW_INVALID"}} The new media is invalid. + * @throws {{code:400,type:"MEDIA_PREV_INVALID"}} Previous media invalid. + * @throws {{code:403,type:"MESSAGE_AUTHOR_REQUIRED"}} Message author required. + * @throws {{code:400,type:"MESSAGE_EDIT_TIME_EXPIRED"}} You can't edit this message anymore, too much time has passed since its creation. + * @throws {{code:400,type:"MESSAGE_EMPTY"}} The provided message is empty. + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"MESSAGE_NOT_MODIFIED"}} The message text has not changed. + * @throws {{code:400,type:"MESSAGE_TOO_LONG"}} The provided message is too long. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"REPLY_MARKUP_INVALID"}} The provided reply markup is invalid. + * @throws {{code:400,type:"SCHEDULE_DATE_INVALID"}} Invalid schedule date provided. + * @throws {{code:400,type:"USER_BANNED_IN_CHANNEL"}} You're banned from sending messages in supergroups/channels. + */ + export class EditMessage extends Request,TypeUpdates> implements EditMessageArgs { + CONSTRUCTOR_id: 1224152952; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.EditMessage"; + flags: number; + noWebpage?: true; + peer: EntityLike; + id: int; + message?: string; + media?: TypeInputMedia; + replyMarkup?: TypeReplyMarkup; + entities?: TypeMessageEntity[]; + scheduleDate?: int; + fromReader(reader: Reader): EditMessage; + } + + export interface EditInlineBotMessageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Disable webpage preview */ + noWebpage?: true; + /** Sent inline message ID */ + id: TypeInputBotInlineMessageID; + /** Message */ + message?: string; + /** Media */ + media?: TypeInputMedia; + /** Reply markup for inline keyboards */ + replyMarkup?: TypeReplyMarkup; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + } + + /** + * Edit an inline bot message
+ * @link https://corefork.telegram.org/api/entities + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"MESSAGE_NOT_MODIFIED"}} The message text has not changed. + */ + export class EditInlineBotMessage extends Request,Bool> implements EditInlineBotMessageArgs { + CONSTRUCTOR_id: -2091549254; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.EditInlineBotMessage"; + flags: number; + noWebpage?: true; + id: TypeInputBotInlineMessageID; + message?: string; + media?: TypeInputMedia; + replyMarkup?: TypeReplyMarkup; + entities?: TypeMessageEntity[]; + fromReader(reader: Reader): EditInlineBotMessage; + } + + export interface GetBotCallbackAnswerArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is a "play game" button */ + game?: true; + /** Where was the inline keyboard sent */ + peer: EntityLike; + /** ID of the Message with the inline keyboard */ + msgId: MessageIDLike; + /** Callback data */ + data?: bytes; + /** For buttons requiring you to verify your identity with your 2FA password, the SRP payload generated using SRP. */ + password?: TypeInputCheckPasswordSRP; + } + + /** + * Press an inline callback button and get a callback answer from the bot
+ * @link https://corefork.telegram.org/constructor/keyboardButtonCallback + * @link https://corefork.telegram.org/api/srp + * @throws {{code:400,type:"BOT_RESPONSE_TIMEOUT"}} A timeout occurred while fetching data from the bot. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"DATA_INVALID"}} Encrypted data invalid. + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:-503,type:"Timeout"}} Timeout while fetching data. + */ + export class GetBotCallbackAnswer extends Request,messages.TypeBotCallbackAnswer> implements GetBotCallbackAnswerArgs { + CONSTRUCTOR_id: -1824339449; + SUBCLASS_OF_ID: 1817039244; + classType: "request"; + className: "messages.GetBotCallbackAnswer"; + flags: number; + game?: true; + peer: EntityLike; + msgId: MessageIDLike; + data?: bytes; + password?: TypeInputCheckPasswordSRP; + fromReader(reader: Reader): GetBotCallbackAnswer; + } + + export interface SetBotCallbackAnswerArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to show the message as a popup instead of a toast notification */ + alert?: true; + /** Query ID */ + queryId: long; + /** Popup to show */ + message?: string; + /** URL to open */ + url?: string; + /** Cache validity */ + cacheTime: int; + } + + /** + * Set the callback answer to a user button press (bots only)
+ * @throws {{code:400,type:"MESSAGE_TOO_LONG"}} The provided message is too long. + * @throws {{code:400,type:"QUERY_ID_INVALID"}} The query ID is invalid. + * @throws {{code:400,type:"URL_INVALID"}} Invalid URL provided. + */ + export class SetBotCallbackAnswer extends Request,Bool> implements SetBotCallbackAnswerArgs { + CONSTRUCTOR_id: -712043766; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.SetBotCallbackAnswer"; + flags: number; + alert?: true; + queryId: long; + message?: string; + url?: string; + cacheTime: int; + fromReader(reader: Reader): SetBotCallbackAnswer; + } + + export interface GetPeerDialogsArgs { + /** Peers */ + peers: TypeInputDialogPeer[]; + } + + /** + * Get dialog info of specified peers
+ * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetPeerDialogs extends Request,messages.TypePeerDialogs> implements GetPeerDialogsArgs { + CONSTRUCTOR_id: -462373635; + SUBCLASS_OF_ID: 986120498; + classType: "request"; + className: "messages.GetPeerDialogs"; + peers: TypeInputDialogPeer[]; + fromReader(reader: Reader): GetPeerDialogs; + } + + export interface SaveDraftArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Disable generation of the webpage preview */ + noWebpage?: true; + /** Message ID the message should reply to */ + replyToMsgId?: MessageIDLike; + /** Destination of the message that should be sent */ + peer: EntityLike; + /** The draft */ + message: string; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + } + + /** + * Save a message draft associated to a chat.
+ * @link https://corefork.telegram.org/api/entities + * @link https://corefork.telegram.org/api/drafts + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class SaveDraft extends Request,Bool> implements SaveDraftArgs { + CONSTRUCTOR_id: -1137057461; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.SaveDraft"; + flags: number; + noWebpage?: true; + replyToMsgId?: MessageIDLike; + peer: EntityLike; + message: string; + entities?: TypeMessageEntity[]; + fromReader(reader: Reader): SaveDraft; + } + + /** + * Save get all message drafts.
+ * @link https://corefork.telegram.org/api/drafts + */ + export class GetAllDrafts extends Request,TypeUpdates> { + CONSTRUCTOR_id: 1782549861; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.GetAllDrafts"; + fromReader(reader: Reader): GetAllDrafts; + } + + export interface GetFeaturedStickersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get featured stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetFeaturedStickers extends Request,messages.TypeFeaturedStickers> implements GetFeaturedStickersArgs { + CONSTRUCTOR_id: 766298703; + SUBCLASS_OF_ID: 638891810; + classType: "request"; + className: "messages.GetFeaturedStickers"; + hash: int; + fromReader(reader: Reader): GetFeaturedStickers; + } + + export interface ReadFeaturedStickersArgs { + /** IDs of stickersets to mark as read */ + id: long[]; + } + + /** Mark new featured stickers as read
*/ + export class ReadFeaturedStickers extends Request,Bool> implements ReadFeaturedStickersArgs { + CONSTRUCTOR_id: 1527873830; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ReadFeaturedStickers"; + id: long[]; + fromReader(reader: Reader): ReadFeaturedStickers; + } + + export interface GetRecentStickersArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Get stickers recently attached to photo or video files */ + attached?: true; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get recent stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetRecentStickers extends Request,messages.TypeRecentStickers> implements GetRecentStickersArgs { + CONSTRUCTOR_id: 1587647177; + SUBCLASS_OF_ID: 4151281283; + classType: "request"; + className: "messages.GetRecentStickers"; + flags: number; + attached?: true; + hash: int; + fromReader(reader: Reader): GetRecentStickers; + } + + export interface SaveRecentStickerArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to add/remove stickers recently attached to photo or video files */ + attached?: true; + /** Sticker */ + id: TypeInputDocument; + /** Whether to save or unsave the sticker */ + unsave: Bool; + } + + /** + * Add/remove sticker from recent stickers list
+ * @throws {{code:400,type:"STICKER_ID_INVALID"}} The provided sticker ID is invalid. + */ + export class SaveRecentSticker extends Request,Bool> implements SaveRecentStickerArgs { + CONSTRUCTOR_id: 958863608; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.SaveRecentSticker"; + flags: number; + attached?: true; + id: TypeInputDocument; + unsave: Bool; + fromReader(reader: Reader): SaveRecentSticker; + } + + export interface ClearRecentStickersArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Set this flag to clear the list of stickers recently attached to photo or video files */ + attached?: true; + } + + /** Clear recent stickers
*/ + export class ClearRecentStickers extends Request,Bool> implements ClearRecentStickersArgs { + CONSTRUCTOR_id: -1986437075; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ClearRecentStickers"; + flags: number; + attached?: true; + fromReader(reader: Reader): ClearRecentStickers; + } + + export interface GetArchivedStickersArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Get mask stickers */ + masks?: true; + /** Offsets for pagination, for more info click here */ + offsetId: long; + /** Maximum number of results to return, see pagination */ + limit: int; + } + + /** + * Get all archived stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetArchivedStickers extends Request,messages.TypeArchivedStickers> implements GetArchivedStickersArgs { + CONSTRUCTOR_id: 1475442322; + SUBCLASS_OF_ID: 1922488177; + classType: "request"; + className: "messages.GetArchivedStickers"; + flags: number; + masks?: true; + offsetId: long; + limit: int; + fromReader(reader: Reader): GetArchivedStickers; + } + + export interface GetMaskStickersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get installed mask stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetMaskStickers extends Request,messages.TypeAllStickers> implements GetMaskStickersArgs { + CONSTRUCTOR_id: 1706608543; + SUBCLASS_OF_ID: 1166231593; + classType: "request"; + className: "messages.GetMaskStickers"; + hash: int; + fromReader(reader: Reader): GetMaskStickers; + } + + export interface GetAttachedStickersArgs { + /** Stickered media */ + media: TypeInputStickeredMedia; + } + + /** Get stickers attached to a photo or video
*/ + export class GetAttachedStickers extends Request,TypeStickerSetCovered[]> implements GetAttachedStickersArgs { + CONSTRUCTOR_id: -866424884; + SUBCLASS_OF_ID: 3423756139; + classType: "request"; + className: "messages.GetAttachedStickers"; + media: TypeInputStickeredMedia; + fromReader(reader: Reader): GetAttachedStickers; + } + + export interface SetGameScoreArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Set this flag if the game message should be automatically edited to include the current scoreboard */ + editMessage?: true; + /** Set this flag if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters */ + force?: true; + /** Unique identifier of target chat */ + peer: EntityLike; + /** Identifier of the sent message */ + id: int; + /** User identifier */ + userId: TypeInputUser; + /** New score */ + score: int; + } + + /** + * Use this method to set the score of the specified user in a game sent as a normal message (bots only).
+ * @throws {{code:400,type:"BOT_SCORE_NOT_MODIFIED"}} The score wasn't modified. + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"USER_BOT_REQUIRED"}} This method can only be called by a bot. + */ + export class SetGameScore extends Request,TypeUpdates> implements SetGameScoreArgs { + CONSTRUCTOR_id: -1896289088; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.SetGameScore"; + flags: number; + editMessage?: true; + force?: true; + peer: EntityLike; + id: int; + userId: TypeInputUser; + score: int; + fromReader(reader: Reader): SetGameScore; + } + + export interface SetInlineGameScoreArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Set this flag if the game message should be automatically edited to include the current scoreboard */ + editMessage?: true; + /** Set this flag if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters */ + force?: true; + /** ID of the inline message */ + id: TypeInputBotInlineMessageID; + /** User identifier */ + userId: TypeInputUser; + /** New score */ + score: int; + } + + /** + * Use this method to set the score of the specified user in a game sent as an inline message (bots only).
+ * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"USER_BOT_REQUIRED"}} This method can only be called by a bot. + */ + export class SetInlineGameScore extends Request,Bool> implements SetInlineGameScoreArgs { + CONSTRUCTOR_id: 363700068; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.SetInlineGameScore"; + flags: number; + editMessage?: true; + force?: true; + id: TypeInputBotInlineMessageID; + userId: TypeInputUser; + score: int; + fromReader(reader: Reader): SetInlineGameScore; + } + + export interface GetGameHighScoresArgs { + /** Where was the game sent */ + peer: EntityLike; + /** ID of message with game media attachment */ + id: int; + /** Get high scores made by a certain user */ + userId: TypeInputUser; + } + + /** + * Get highscores of a game
+ * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"USER_BOT_REQUIRED"}} This method can only be called by a bot. + */ + export class GetGameHighScores extends Request,messages.TypeHighScores> implements GetGameHighScoresArgs { + CONSTRUCTOR_id: -400399203; + SUBCLASS_OF_ID: 1825412605; + classType: "request"; + className: "messages.GetGameHighScores"; + peer: EntityLike; + id: int; + userId: TypeInputUser; + fromReader(reader: Reader): GetGameHighScores; + } + + export interface GetInlineGameHighScoresArgs { + /** ID of inline message */ + id: TypeInputBotInlineMessageID; + /** Get high scores of a certain user */ + userId: TypeInputUser; + } + + /** + * Get highscores of a game sent using an inline bot
+ * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"USER_BOT_REQUIRED"}} This method can only be called by a bot. + */ + export class GetInlineGameHighScores extends Request,messages.TypeHighScores> implements GetInlineGameHighScoresArgs { + CONSTRUCTOR_id: 258170395; + SUBCLASS_OF_ID: 1825412605; + classType: "request"; + className: "messages.GetInlineGameHighScores"; + id: TypeInputBotInlineMessageID; + userId: TypeInputUser; + fromReader(reader: Reader): GetInlineGameHighScores; + } + + export interface GetCommonChatsArgs { + /** User ID */ + userId: TypeInputUser; + /** Maximum ID of chat to return (see pagination) */ + maxId: int; + /** Maximum number of results to return, see pagination */ + limit: int; + } + + /** + * Get chats in common with a user
+ * @link https://corefork.telegram.org/api/offsets + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class GetCommonChats extends Request,messages.TypeChats> implements GetCommonChatsArgs { + CONSTRUCTOR_id: 218777796; + SUBCLASS_OF_ID: 2580925204; + classType: "request"; + className: "messages.GetCommonChats"; + userId: TypeInputUser; + maxId: int; + limit: int; + fromReader(reader: Reader): GetCommonChats; + } + + export interface GetAllChatsArgs { + /** Except these chats/channels/supergroups */ + exceptIds: int[]; + } + + /** Get all chats, channels and supergroups
*/ + export class GetAllChats extends Request,messages.TypeChats> implements GetAllChatsArgs { + CONSTRUCTOR_id: -341307408; + SUBCLASS_OF_ID: 2580925204; + classType: "request"; + className: "messages.GetAllChats"; + exceptIds: int[]; + fromReader(reader: Reader): GetAllChats; + } + + export interface GetWebPageArgs { + /** URL of IV page to fetch */ + url: string; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get instant view page
+ * @link https://corefork.telegram.org/api/offsets + * @throws {{code:400,type:"WC_CONVERT_URL_INVALID"}} WC convert URL invalid. + */ + export class GetWebPage extends Request,TypeWebPage> implements GetWebPageArgs { + CONSTRUCTOR_id: 852135825; + SUBCLASS_OF_ID: 1437168769; + classType: "request"; + className: "messages.GetWebPage"; + url: string; + hash: int; + fromReader(reader: Reader): GetWebPage; + } + + export interface ToggleDialogPinArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to pin or unpin the dialog */ + pinned?: true; + /** The dialog to pin */ + peer: TypeInputDialogPeer; + } + + /** + * Pin/unpin a dialog
+ * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"PINNED_DIALOGS_TOO_MUCH"}} Too many pinned dialogs. + */ + export class ToggleDialogPin extends Request,Bool> implements ToggleDialogPinArgs { + CONSTRUCTOR_id: -1489903017; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ToggleDialogPin"; + flags: number; + pinned?: true; + peer: TypeInputDialogPeer; + fromReader(reader: Reader): ToggleDialogPin; + } + + export interface ReorderPinnedDialogsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, dialogs pinned server-side but not present in the order field will be unpinned. */ + force?: true; + /** Peer folder ID, for more info click here */ + folderId: int; + /** New dialog order */ + order: TypeInputDialogPeer[]; + } + + /** + * Reorder pinned dialogs
+ * @link https://corefork.telegram.org/api/folders + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class ReorderPinnedDialogs extends Request,Bool> implements ReorderPinnedDialogsArgs { + CONSTRUCTOR_id: 991616823; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ReorderPinnedDialogs"; + flags: number; + force?: true; + folderId: int; + order: TypeInputDialogPeer[]; + fromReader(reader: Reader): ReorderPinnedDialogs; + } + + export interface GetPinnedDialogsArgs { + /** Peer folder ID, for more info click here */ + folderId: int; + } + + /** + * Get pinned dialogs
+ * @link https://corefork.telegram.org/api/folders + * @throws {{code:400,type:"FOLDER_ID_INVALID"}} Invalid folder ID. + */ + export class GetPinnedDialogs extends Request,messages.TypePeerDialogs> implements GetPinnedDialogsArgs { + CONSTRUCTOR_id: -692498958; + SUBCLASS_OF_ID: 986120498; + classType: "request"; + className: "messages.GetPinnedDialogs"; + folderId: int; + fromReader(reader: Reader): GetPinnedDialogs; + } + + export interface SetBotShippingResultsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Unique identifier for the query to be answered */ + queryId: long; + /** Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. */ + error?: string; + /** A vector of available shipping options. */ + shippingOptions?: TypeShippingOption[]; + } + + /** + * If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the bot will receive an updateBotShippingQuery update. Use this method to reply to shipping queries.
+ * @link https://corefork.telegram.org/constructor/updateBotShippingQuery + * @throws {{code:400,type:"QUERY_ID_INVALID"}} The query ID is invalid. + */ + export class SetBotShippingResults extends Request,Bool> implements SetBotShippingResultsArgs { + CONSTRUCTOR_id: -436833542; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.SetBotShippingResults"; + flags: number; + queryId: long; + error?: string; + shippingOptions?: TypeShippingOption[]; + fromReader(reader: Reader): SetBotShippingResults; + } + + export interface SetBotPrecheckoutResultsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Set this flag if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order, otherwise do not set it, and set the error field, instead */ + success?: true; + /** Unique identifier for the query to be answered */ + queryId: long; + /** Required if the success isn't set. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. */ + error?: string; + } + + /** + * Once the user has confirmed their payment and shipping details, the bot receives an updateBotPrecheckoutQuery update.
+ * Use this method to respond to such pre-checkout queries.
+ * Note: Telegram must receive an answer within 10 seconds after the pre-checkout query was sent.
+ * @link https://corefork.telegram.org/constructor/updateBotPrecheckoutQuery + * @throws {{code:400,type:"ERROR_TEXT_EMPTY"}} The provided error message is empty. + */ + export class SetBotPrecheckoutResults extends Request,Bool> implements SetBotPrecheckoutResultsArgs { + CONSTRUCTOR_id: 163765653; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.SetBotPrecheckoutResults"; + flags: number; + success?: true; + queryId: long; + error?: string; + fromReader(reader: Reader): SetBotPrecheckoutResults; + } + + export interface UploadMediaArgs { + /** The chat, can be an inputPeerEmpty for bots */ + peer: EntityLike; + /** File uploaded in chunks as described in files » */ + media: TypeInputMedia; + } + + /** + * Upload a file and associate it to a chat (without actually sending it to the chat)
+ * @link https://corefork.telegram.org/constructor/inputPeerEmpty + * @link https://corefork.telegram.org/api/files + * @throws {{code:400,type:"BOT_MISSING"}} This method can only be run by a bot. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_RESTRICTED"}} You can't send messages in this chat, you were restricted. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"FILE_PARTS_INVALID"}} The number of file parts is invalid. + * @throws {{code:400,type:"IMAGE_PROCESS_FAILED"}} Failure while processing image. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MEDIA_INVALID"}} Media invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"PHOTO_EXT_INVALID"}} The extension of the photo is invalid. + * @throws {{code:400,type:"PHOTO_INVALID_DIMENSIONS"}} The photo dimensions are invalid. + * @throws {{code:400,type:"PHOTO_SAVE_FILE_INVALID"}} Internal issues, try again later. + * @throws {{code:400,type:"USER_BANNED_IN_CHANNEL"}} You're banned from sending messages in supergroups/channels. + * @throws {{code:400,type:"WEBPAGE_CURL_FAILED"}} Failure while fetching the webpage with cURL. + */ + export class UploadMedia extends Request,TypeMessageMedia> implements UploadMediaArgs { + CONSTRUCTOR_id: 1369162417; + SUBCLASS_OF_ID: 1198308914; + classType: "request"; + className: "messages.UploadMedia"; + peer: EntityLike; + media: TypeInputMedia; + fromReader(reader: Reader): UploadMedia; + } + + export interface SendScreenshotNotificationArgs { + /** Other user */ + peer: EntityLike; + /** ID of message that was screenshotted, can be 0 */ + replyToMsgId: MessageIDLike; + /** Random ID to avoid message resending */ + randomId: long; + } + + /** + * Notify the other user in a private chat that a screenshot of the chat was taken
+ * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"YOU_BLOCKED_USER"}} You blocked this user. + */ + export class SendScreenshotNotification extends Request,TypeUpdates> implements SendScreenshotNotificationArgs { + CONSTRUCTOR_id: -914493408; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.SendScreenshotNotification"; + peer: EntityLike; + replyToMsgId: MessageIDLike; + randomId: long; + fromReader(reader: Reader): SendScreenshotNotification; + } + + export interface GetFavedStickersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get faved stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetFavedStickers extends Request,messages.TypeFavedStickers> implements GetFavedStickersArgs { + CONSTRUCTOR_id: 567151374; + SUBCLASS_OF_ID: 2389929913; + classType: "request"; + className: "messages.GetFavedStickers"; + hash: int; + fromReader(reader: Reader): GetFavedStickers; + } + + export interface FaveStickerArgs { + /** Sticker to mark as favorite */ + id: TypeInputDocument; + /** Unfavorite */ + unfave: Bool; + } + + /** + * Mark a sticker as favorite
+ * @throws {{code:400,type:"STICKER_ID_INVALID"}} The provided sticker ID is invalid. + */ + export class FaveSticker extends Request,Bool> implements FaveStickerArgs { + CONSTRUCTOR_id: -1174420133; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.FaveSticker"; + id: TypeInputDocument; + unfave: Bool; + fromReader(reader: Reader): FaveSticker; + } + + export interface GetUnreadMentionsArgs { + /** Peer where to look for mentions */ + peer: EntityLike; + /** Offsets for pagination, for more info click here */ + offsetId: int; + /** Offsets for pagination, for more info click here */ + addOffset: int; + /** Maximum number of results to return, see pagination */ + limit: int; + /** Maximum message ID to return, see pagination */ + maxId: int; + /** Minimum message ID to return, see pagination */ + minId: int; + } + + /** + * Get unread messages where we were mentioned
+ * @link https://corefork.telegram.org/api/offsets + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetUnreadMentions extends Request,messages.TypeMessages> implements GetUnreadMentionsArgs { + CONSTRUCTOR_id: 1180140658; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "messages.GetUnreadMentions"; + peer: EntityLike; + offsetId: int; + addOffset: int; + limit: int; + maxId: int; + minId: int; + fromReader(reader: Reader): GetUnreadMentions; + } + + export interface ReadMentionsArgs { + /** Dialog */ + peer: EntityLike; + } + + /** + * Mark mentions as read
+ * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class ReadMentions extends Request,messages.TypeAffectedHistory> implements ReadMentionsArgs { + CONSTRUCTOR_id: 251759059; + SUBCLASS_OF_ID: 743031062; + classType: "request"; + className: "messages.ReadMentions"; + peer: EntityLike; + fromReader(reader: Reader): ReadMentions; + } + + export interface GetRecentLocationsArgs { + /** User */ + peer: EntityLike; + /** Maximum number of results to return, see pagination */ + limit: int; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get live location history of a certain user
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetRecentLocations extends Request,messages.TypeMessages> implements GetRecentLocationsArgs { + CONSTRUCTOR_id: -1144759543; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "messages.GetRecentLocations"; + peer: EntityLike; + limit: int; + hash: int; + fromReader(reader: Reader): GetRecentLocations; + } + + export interface SendMultiMediaArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to send the album silently (no notification triggered) */ + silent?: true; + /** Send in background? */ + background?: true; + /** Whether to clear drafts */ + clearDraft?: true; + /** The destination chat */ + peer: EntityLike; + /** The message to reply to */ + replyToMsgId?: MessageIDLike; + /** The medias to send */ + multiMedia: TypeInputSingleMedia[]; + /** Scheduled message date for scheduled messages */ + scheduleDate?: int; + } + + /** + * Send an album or grouped media
+ * @link https://corefork.telegram.org/api/drafts + * @link https://corefork.telegram.org/api/files + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"MEDIA_CAPTION_TOO_LONG"}} The caption is too long. + * @throws {{code:400,type:"MEDIA_EMPTY"}} The provided media object is invalid. + * @throws {{code:400,type:"MEDIA_INVALID"}} Media invalid. + * @throws {{code:400,type:"MULTI_MEDIA_TOO_LONG"}} Too many media files for album. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"RANDOM_ID_EMPTY"}} Random ID empty. + * @throws {{code:400,type:"SCHEDULE_DATE_TOO_LATE"}} You can't schedule a message this far in the future. + * @throws {{code:400,type:"SCHEDULE_TOO_MUCH"}} There are too many scheduled messages. + * @throws {{code:420,type:"SLOWMODE_WAIT_X"}} Slowmode is enabled in this chat: wait X seconds before sending another message to this chat. + */ + export class SendMultiMedia extends Request,TypeUpdates> implements SendMultiMediaArgs { + CONSTRUCTOR_id: -872345397; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.SendMultiMedia"; + flags: number; + silent?: true; + background?: true; + clearDraft?: true; + peer: EntityLike; + replyToMsgId?: MessageIDLike; + multiMedia: TypeInputSingleMedia[]; + scheduleDate?: int; + fromReader(reader: Reader): SendMultiMedia; + } + + export interface UploadEncryptedFileArgs { + /** The secret chat to associate the file to */ + peer: TypeInputEncryptedChat; + /** The file */ + file: TypeInputEncryptedFile; + } + + /** Upload encrypted file and associate it to a secret chat
*/ + export class UploadEncryptedFile extends Request,TypeEncryptedFile> implements UploadEncryptedFileArgs { + CONSTRUCTOR_id: 1347929239; + SUBCLASS_OF_ID: 2217371584; + classType: "request"; + className: "messages.UploadEncryptedFile"; + peer: TypeInputEncryptedChat; + file: TypeInputEncryptedFile; + fromReader(reader: Reader): UploadEncryptedFile; + } + + export interface SearchStickerSetsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Exclude featured stickersets from results */ + excludeFeatured?: true; + /** Query string */ + q: string; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Search for stickersets
+ * @link https://corefork.telegram.org/api/offsets + */ + export class SearchStickerSets extends Request,messages.TypeFoundStickerSets> implements SearchStickerSetsArgs { + CONSTRUCTOR_id: -1028140917; + SUBCLASS_OF_ID: 68023137; + classType: "request"; + className: "messages.SearchStickerSets"; + flags: number; + excludeFeatured?: true; + q: string; + hash: int; + fromReader(reader: Reader): SearchStickerSets; + } + + /** Get message ranges for saving the user's chat history
*/ + export class GetSplitRanges extends Request,TypeMessageRange[]> { + CONSTRUCTOR_id: 486505992; + SUBCLASS_OF_ID: 1537549572; + classType: "request"; + className: "messages.GetSplitRanges"; + fromReader(reader: Reader): GetSplitRanges; + } + + export interface MarkDialogUnreadArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Mark as unread/read */ + unread?: true; + /** Dialog */ + peer: TypeInputDialogPeer; + } + + /** Manually mark dialog as unread
*/ + export class MarkDialogUnread extends Request,Bool> implements MarkDialogUnreadArgs { + CONSTRUCTOR_id: -1031349873; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.MarkDialogUnread"; + flags: number; + unread?: true; + peer: TypeInputDialogPeer; + fromReader(reader: Reader): MarkDialogUnread; + } + + /** Get dialogs manually marked as unread
*/ + export class GetDialogUnreadMarks extends Request,TypeDialogPeer[]> { + CONSTRUCTOR_id: 585256482; + SUBCLASS_OF_ID: 3200666329; + classType: "request"; + className: "messages.GetDialogUnreadMarks"; + fromReader(reader: Reader): GetDialogUnreadMarks; + } + + /** + * Clear all drafts.
+ * @link https://corefork.telegram.org/api/drafts + */ + export class ClearAllDrafts extends Request,Bool> { + CONSTRUCTOR_id: 2119757468; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ClearAllDrafts"; + fromReader(reader: Reader): ClearAllDrafts; + } + + export interface UpdatePinnedMessageArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Pin the message silently, without triggering a notification */ + silent?: true; + /** Whether the message should unpinned or pinned */ + unpin?: true; + /** Whether the message should only be pinned on the local side of a one-to-one chat */ + pmOneside?: true; + /** The peer where to pin the message */ + peer: EntityLike; + /** The message to pin or unpin */ + id: int; + } + + /** + * Pin a message
+ * @throws {{code:400,type:"BOT_ONESIDE_NOT_AVAIL"}} Bots can't pin messages in PM just for themselves. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"PIN_RESTRICTED"}} You can't pin messages. + * @throws {{code:400,type:"USER_BANNED_IN_CHANNEL"}} You're banned from sending messages in supergroups/channels. + */ + export class UpdatePinnedMessage extends Request,TypeUpdates> implements UpdatePinnedMessageArgs { + CONSTRUCTOR_id: -760547348; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.UpdatePinnedMessage"; + flags: number; + silent?: true; + unpin?: true; + pmOneside?: true; + peer: EntityLike; + id: int; + fromReader(reader: Reader): UpdatePinnedMessage; + } + + export interface SendVoteArgs { + /** The chat where the poll was sent */ + peer: EntityLike; + /** The message ID of the poll */ + msgId: MessageIDLike; + /** The options that were chosen */ + options: bytes[]; + } + + /** + * Vote in a poll
+ * @link https://corefork.telegram.org/constructor/poll + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"MESSAGE_POLL_CLOSED"}} Poll closed. + * @throws {{code:400,type:"OPTIONS_TOO_MUCH"}} Too many options provided. + * @throws {{code:400,type:"OPTION_INVALID"}} Invalid option selected. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"REVOTE_NOT_ALLOWED"}} You cannot change your vote. + */ + export class SendVote extends Request,TypeUpdates> implements SendVoteArgs { + CONSTRUCTOR_id: 283795844; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.SendVote"; + peer: EntityLike; + msgId: MessageIDLike; + options: bytes[]; + fromReader(reader: Reader): SendVote; + } + + export interface GetPollResultsArgs { + /** Peer where the poll was found */ + peer: EntityLike; + /** Message ID of poll message */ + msgId: MessageIDLike; + } + + /** + * Get poll results
+ * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + */ + export class GetPollResults extends Request,TypeUpdates> implements GetPollResultsArgs { + CONSTRUCTOR_id: 1941660731; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.GetPollResults"; + peer: EntityLike; + msgId: MessageIDLike; + fromReader(reader: Reader): GetPollResults; + } + + export interface GetOnlinesArgs { + /** The chat */ + peer: EntityLike; + } + + /** + * Get count of online users in a chat
+ * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetOnlines extends Request,TypeChatOnlines> implements GetOnlinesArgs { + CONSTRUCTOR_id: 1848369232; + SUBCLASS_OF_ID: 2357301306; + classType: "request"; + className: "messages.GetOnlines"; + peer: EntityLike; + fromReader(reader: Reader): GetOnlines; + } + + export interface GetStatsURLArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Pass true if a URL with the dark theme must be returned */ + dark?: true; + /** Chat identifier */ + peer: EntityLike; + /** Parameters from tg://statsrefresh?params=****** link */ + params: string; + } + + /** + * Returns URL with the chat statistics. Currently this method can be used only for channels
{schema} + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetStatsURL extends Request,TypeStatsURL> implements GetStatsURLArgs { + CONSTRUCTOR_id: -2127811866; + SUBCLASS_OF_ID: 2370606272; + classType: "request"; + className: "messages.GetStatsURL"; + flags: number; + dark?: true; + peer: EntityLike; + params: string; + fromReader(reader: Reader): GetStatsURL; + } + + export interface EditChatAboutArgs { + /** The group/supergroup/channel. */ + peer: EntityLike; + /** The new description */ + about: string; + } + + /** + * Edit the description of a group/supergroup/channel.
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ABOUT_NOT_MODIFIED"}} About text has not changed. + * @throws {{code:400,type:"CHAT_ABOUT_TOO_LONG"}} Chat about too long. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class EditChatAbout extends Request,Bool> implements EditChatAboutArgs { + CONSTRUCTOR_id: -554301545; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.EditChatAbout"; + peer: EntityLike; + about: string; + fromReader(reader: Reader): EditChatAbout; + } + + export interface EditChatDefaultBannedRightsArgs { + /** The peer */ + peer: EntityLike; + /** The new global rights */ + bannedRights: TypeChatBannedRights; + } + + /** + * Edit the default banned rights of a channel/supergroup/group.
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"BANNED_RIGHTS_INVALID"}} You provided some invalid flags in the banned rights. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"UNTIL_DATE_INVALID"}} Invalid until date provided. + */ + export class EditChatDefaultBannedRights extends Request,TypeUpdates> implements EditChatDefaultBannedRightsArgs { + CONSTRUCTOR_id: -1517917375; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.EditChatDefaultBannedRights"; + peer: EntityLike; + bannedRights: TypeChatBannedRights; + fromReader(reader: Reader): EditChatDefaultBannedRights; + } + + export interface GetEmojiKeywordsArgs { + /** Language code */ + langCode: string; + } + + /** Get localized emoji keywords
*/ + export class GetEmojiKeywords extends Request,TypeEmojiKeywordsDifference> implements GetEmojiKeywordsArgs { + CONSTRUCTOR_id: 899735650; + SUBCLASS_OF_ID: 3531196018; + classType: "request"; + className: "messages.GetEmojiKeywords"; + langCode: string; + fromReader(reader: Reader): GetEmojiKeywords; + } + + export interface GetEmojiKeywordsDifferenceArgs { + /** Language code */ + langCode: string; + /** Previous emoji keyword localization version */ + fromVersion: int; + } + + /** Get changed emoji keywords
*/ + export class GetEmojiKeywordsDifference extends Request,TypeEmojiKeywordsDifference> implements GetEmojiKeywordsDifferenceArgs { + CONSTRUCTOR_id: 352892591; + SUBCLASS_OF_ID: 3531196018; + classType: "request"; + className: "messages.GetEmojiKeywordsDifference"; + langCode: string; + fromVersion: int; + fromReader(reader: Reader): GetEmojiKeywordsDifference; + } + + export interface GetEmojiKeywordsLanguagesArgs { + /** Language codes */ + langCodes: string[]; + } + + /** Get info about an emoji keyword localization
*/ + export class GetEmojiKeywordsLanguages extends Request,TypeEmojiLanguage[]> implements GetEmojiKeywordsLanguagesArgs { + CONSTRUCTOR_id: 1318675378; + SUBCLASS_OF_ID: 3885355911; + classType: "request"; + className: "messages.GetEmojiKeywordsLanguages"; + langCodes: string[]; + fromReader(reader: Reader): GetEmojiKeywordsLanguages; + } + + export interface GetEmojiURLArgs { + /** Language code for which the emoji replacements will be suggested */ + langCode: string; + } + + /** Returns an HTTP URL which can be used to automatically log in into translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation
*/ + export class GetEmojiURL extends Request,TypeEmojiURL> implements GetEmojiURLArgs { + CONSTRUCTOR_id: -709817306; + SUBCLASS_OF_ID: 530614809; + classType: "request"; + className: "messages.GetEmojiURL"; + langCode: string; + fromReader(reader: Reader): GetEmojiURL; + } + + export interface GetSearchCountersArgs { + /** Peer where to search */ + peer: EntityLike; + /** Search filters */ + filters: TypeMessagesFilter[]; + } + + /** + * Get the number of results that would be found by a messages.search call with the same parameters
+ * @link https://corefork.telegram.org/method/messages.search + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetSearchCounters extends Request,messages.TypeSearchCounter[]> implements GetSearchCountersArgs { + CONSTRUCTOR_id: 1932455680; + SUBCLASS_OF_ID: 1809726574; + classType: "request"; + className: "messages.GetSearchCounters"; + peer: EntityLike; + filters: TypeMessagesFilter[]; + fromReader(reader: Reader): GetSearchCounters; + } + + export interface RequestUrlAuthArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Peer where the message is located */ + peer?: EntityLike; + /** The message */ + msgId?: MessageIDLike; + /** The ID of the button with the authorization request */ + buttonId?: int; + /** URL used for link URL authorization, click here for more info » */ + url?: string; + } + + /** + * Get more info about a Seamless Telegram Login authorization request, for more info click here »
+ * @link https://corefork.telegram.org/api/url-authorization + */ + export class RequestUrlAuth extends Request,TypeUrlAuthResult> implements RequestUrlAuthArgs { + CONSTRUCTOR_id: 428848198; + SUBCLASS_OF_ID: 2003159838; + classType: "request"; + className: "messages.RequestUrlAuth"; + flags: number; + peer?: EntityLike; + msgId?: MessageIDLike; + buttonId?: int; + url?: string; + fromReader(reader: Reader): RequestUrlAuth; + } + + export interface AcceptUrlAuthArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Set this flag to allow the bot to send messages to you (if requested) */ + writeAllowed?: true; + /** The location of the message */ + peer?: EntityLike; + /** Message ID of the message with the login button */ + msgId?: MessageIDLike; + /** ID of the login button */ + buttonId?: int; + /** URL used for link URL authorization, click here for more info » */ + url?: string; + } + + /** + * Use this to accept a Seamless Telegram Login authorization request, for more info click here »
+ * @link https://corefork.telegram.org/api/url-authorization + */ + export class AcceptUrlAuth extends Request,TypeUrlAuthResult> implements AcceptUrlAuthArgs { + CONSTRUCTOR_id: -1322487515; + SUBCLASS_OF_ID: 2003159838; + classType: "request"; + className: "messages.AcceptUrlAuth"; + flags: number; + writeAllowed?: true; + peer?: EntityLike; + msgId?: MessageIDLike; + buttonId?: int; + url?: string; + fromReader(reader: Reader): AcceptUrlAuth; + } + + export interface HidePeerSettingsBarArgs { + /** Peer */ + peer: EntityLike; + } + + /** + * Should be called after the user hides the report spam/add as contact bar of a new chat, effectively prevents the user from executing the actions specified in the peer's settings.
+ * @link https://corefork.telegram.org/constructor/peerSettings + */ + export class HidePeerSettingsBar extends Request,Bool> implements HidePeerSettingsBarArgs { + CONSTRUCTOR_id: 1336717624; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.HidePeerSettingsBar"; + peer: EntityLike; + fromReader(reader: Reader): HidePeerSettingsBar; + } + + export interface GetScheduledHistoryArgs { + /** Peer */ + peer: EntityLike; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get scheduled messages
+ * @link https://corefork.telegram.org/api/offsets + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetScheduledHistory extends Request,messages.TypeMessages> implements GetScheduledHistoryArgs { + CONSTRUCTOR_id: -490575781; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "messages.GetScheduledHistory"; + peer: EntityLike; + hash: int; + fromReader(reader: Reader): GetScheduledHistory; + } + + export interface GetScheduledMessagesArgs { + /** Peer */ + peer: EntityLike; + /** IDs of scheduled messages */ + id: int[]; + } + + /** + * Get scheduled messages
+ * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetScheduledMessages extends Request,messages.TypeMessages> implements GetScheduledMessagesArgs { + CONSTRUCTOR_id: -1111817116; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "messages.GetScheduledMessages"; + peer: EntityLike; + id: int[]; + fromReader(reader: Reader): GetScheduledMessages; + } + + export interface SendScheduledMessagesArgs { + /** Peer */ + peer: EntityLike; + /** Scheduled message IDs */ + id: int[]; + } + + /** + * Send scheduled messages right away
+ * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class SendScheduledMessages extends Request,TypeUpdates> implements SendScheduledMessagesArgs { + CONSTRUCTOR_id: -1120369398; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.SendScheduledMessages"; + peer: EntityLike; + id: int[]; + fromReader(reader: Reader): SendScheduledMessages; + } + + export interface DeleteScheduledMessagesArgs { + /** Peer */ + peer: EntityLike; + /** Scheduled message IDs */ + id: int[]; + } + + /** Delete scheduled messages
*/ + export class DeleteScheduledMessages extends Request,TypeUpdates> implements DeleteScheduledMessagesArgs { + CONSTRUCTOR_id: 1504586518; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.DeleteScheduledMessages"; + peer: EntityLike; + id: int[]; + fromReader(reader: Reader): DeleteScheduledMessages; + } + + export interface GetPollVotesArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Chat where the poll was sent */ + peer: EntityLike; + /** Message ID */ + id: int; + /** Get only results for the specified poll option */ + option?: bytes; + /** Offset for results, taken from the next_offset field of messages.votesList, initially an empty string.
Note: if no more results are available, the method call will return an empty next_offset; thus, avoid providing the next_offset returned in messages.votesList if it is empty, to avoid an infinite loop. */ + offset?: string; + /** Number of results to return */ + limit: int; + } + + /** + * Get poll results for non-anonymous polls
+ * @link https://corefork.telegram.org/constructor/messages.votesList + * @throws {{code:403,type:"BROADCAST_FORBIDDEN"}} Participants of polls in channels should stay anonymous. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:403,type:"POLL_VOTE_REQUIRED"}} Cast a vote in the poll before calling this method. + */ + export class GetPollVotes extends Request,messages.TypeVotesList> implements GetPollVotesArgs { + CONSTRUCTOR_id: -1200736242; + SUBCLASS_OF_ID: 3256457349; + classType: "request"; + className: "messages.GetPollVotes"; + flags: number; + peer: EntityLike; + id: int; + option?: bytes; + offset?: string; + limit: int; + fromReader(reader: Reader): GetPollVotes; + } + + export interface ToggleStickerSetsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Uninstall the specified stickersets */ + uninstall?: true; + /** Archive the specified stickersets */ + archive?: true; + /** Unarchive the specified stickersets */ + unarchive?: true; + /** Stickersets to act upon */ + stickersets: TypeInputStickerSet[]; + } + + /** Apply changes to multiple stickersets
*/ + export class ToggleStickerSets extends Request,Bool> implements ToggleStickerSetsArgs { + CONSTRUCTOR_id: -1257951254; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ToggleStickerSets"; + flags: number; + uninstall?: true; + archive?: true; + unarchive?: true; + stickersets: TypeInputStickerSet[]; + fromReader(reader: Reader): ToggleStickerSets; + } + + /** + * Get folders
+ * @link https://corefork.telegram.org/api/folders + */ + export class GetDialogFilters extends Request,TypeDialogFilter[]> { + CONSTRUCTOR_id: -241247891; + SUBCLASS_OF_ID: 1612507469; + classType: "request"; + className: "messages.GetDialogFilters"; + fromReader(reader: Reader): GetDialogFilters; + } + + /** + * Get suggested folders
+ * @link https://corefork.telegram.org/api/folders + */ + export class GetSuggestedDialogFilters extends Request,TypeDialogFilterSuggested[]> { + CONSTRUCTOR_id: -1566780372; + SUBCLASS_OF_ID: 2066312249; + classType: "request"; + className: "messages.GetSuggestedDialogFilters"; + fromReader(reader: Reader): GetSuggestedDialogFilters; + } + + export interface UpdateDialogFilterArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Folder ID */ + id: int; + /** Folder info */ + filter?: TypeDialogFilter; + } + + /** + * Update folder
+ * @link https://corefork.telegram.org/api/folders + * @throws {{code:400,type:"FILTER_ID_INVALID"}} The specified filter ID is invalid. + * @throws {{code:400,type:"FILTER_INCLUDE_EMPTY"}} The include_peers vector of the filter is empty. + * @throws {{code:400,type:"FILTER_TITLE_EMPTY"}} The title field of the filter is empty. + */ + export class UpdateDialogFilter extends Request,Bool> implements UpdateDialogFilterArgs { + CONSTRUCTOR_id: 450142282; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.UpdateDialogFilter"; + flags: number; + id: int; + filter?: TypeDialogFilter; + fromReader(reader: Reader): UpdateDialogFilter; + } + + export interface UpdateDialogFiltersOrderArgs { + /** New folder order */ + order: int[]; + } + + /** + * Reorder folders
+ * @link https://corefork.telegram.org/api/folders + */ + export class UpdateDialogFiltersOrder extends Request,Bool> implements UpdateDialogFiltersOrderArgs { + CONSTRUCTOR_id: -983318044; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.UpdateDialogFiltersOrder"; + order: int[]; + fromReader(reader: Reader): UpdateDialogFiltersOrder; + } + + export interface GetOldFeaturedStickersArgs { + /** Offset */ + offset: int; + /** Maximum number of results to return, see pagination */ + limit: int; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Method for fetching previously featured stickers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetOldFeaturedStickers extends Request,messages.TypeFeaturedStickers> implements GetOldFeaturedStickersArgs { + CONSTRUCTOR_id: 1608974939; + SUBCLASS_OF_ID: 638891810; + classType: "request"; + className: "messages.GetOldFeaturedStickers"; + offset: int; + limit: int; + hash: int; + fromReader(reader: Reader): GetOldFeaturedStickers; + } + + export interface GetRepliesArgs { + /** Peer */ + peer: EntityLike; + /** Message ID */ + msgId: MessageIDLike; + /** Offsets for pagination, for more info click here */ + offsetId: int; + /** Offsets for pagination, for more info click here */ + offsetDate: int; + /** Offsets for pagination, for more info click here */ + addOffset: int; + /** Maximum number of results to return, see pagination */ + limit: int; + /** If a positive value was transferred, the method will return only messages with ID smaller than max_id */ + maxId: int; + /** If a positive value was transferred, the method will return only messages with ID bigger than min_id */ + minId: int; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get messages in a reply thread
+ * @link https://corefork.telegram.org/api/offsets + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetReplies extends Request,messages.TypeMessages> implements GetRepliesArgs { + CONSTRUCTOR_id: 615875002; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "messages.GetReplies"; + peer: EntityLike; + msgId: MessageIDLike; + offsetId: int; + offsetDate: int; + addOffset: int; + limit: int; + maxId: int; + minId: int; + hash: int; + fromReader(reader: Reader): GetReplies; + } + + export interface GetDiscussionMessageArgs { + /** Channel ID */ + peer: EntityLike; + /** Message ID */ + msgId: MessageIDLike; + } + + /** + * Get discussion message from the associated discussion group of a channel to show it on top of the comment section, without actually joining the group
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/discussion + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://telegram.org/blog/privacy-discussions-web-bots + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetDiscussionMessage extends Request,messages.TypeDiscussionMessage> implements GetDiscussionMessageArgs { + CONSTRUCTOR_id: 1147761405; + SUBCLASS_OF_ID: 1408820200; + classType: "request"; + className: "messages.GetDiscussionMessage"; + peer: EntityLike; + msgId: MessageIDLike; + fromReader(reader: Reader): GetDiscussionMessage; + } + + export interface ReadDiscussionArgs { + /** Group ID */ + peer: EntityLike; + /** ID of message that started the thread */ + msgId: MessageIDLike; + /** ID up to which thread messages were read */ + readMaxId: int; + } + + /** + * Mark a thread as read
+ * @link https://corefork.telegram.org/api/threads + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class ReadDiscussion extends Request,Bool> implements ReadDiscussionArgs { + CONSTRUCTOR_id: -147740172; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.ReadDiscussion"; + peer: EntityLike; + msgId: MessageIDLike; + readMaxId: int; + fromReader(reader: Reader): ReadDiscussion; + } + + export interface UnpinAllMessagesArgs { + /** Chat where to unpin */ + peer: EntityLike; + } + + /** + * Unpin all pinned messages
+ * @link https://corefork.telegram.org/api/pin + */ + export class UnpinAllMessages extends Request,messages.TypeAffectedHistory> implements UnpinAllMessagesArgs { + CONSTRUCTOR_id: -265962357; + SUBCLASS_OF_ID: 743031062; + classType: "request"; + className: "messages.UnpinAllMessages"; + peer: EntityLike; + fromReader(reader: Reader): UnpinAllMessages; + } + + export interface DeleteChatArgs { + /** Chat ID */ + chatId: int; + } + + /** + * Delete a chat
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class DeleteChat extends Request,Bool> implements DeleteChatArgs { + CONSTRUCTOR_id: -2094760687; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.DeleteChat"; + chatId: int; + fromReader(reader: Reader): DeleteChat; + } + + export interface DeletePhoneCallHistoryArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to remove phone call history for participants as well */ + revoke?: true; + } + + /** Delete the entire phone call history.
*/ + export class DeletePhoneCallHistory extends Request,messages.TypeAffectedFoundMessages> implements DeletePhoneCallHistoryArgs { + CONSTRUCTOR_id: -104078327; + SUBCLASS_OF_ID: 4162282798; + classType: "request"; + className: "messages.DeletePhoneCallHistory"; + flags: number; + revoke?: true; + fromReader(reader: Reader): DeletePhoneCallHistory; + } + + export interface CheckHistoryImportArgs { + /** Beginning of the message file; up to 100 lines. */ + importHead: string; + } + + /** + * Obtains information about a chat export file, generated by a foreign chat app, click here for more info about imported chats ».
+ * @link https://corefork.telegram.org/api/import + */ + export class CheckHistoryImport extends Request,messages.TypeHistoryImportParsed> implements CheckHistoryImportArgs { + CONSTRUCTOR_id: 1140726259; + SUBCLASS_OF_ID: 1538421259; + classType: "request"; + className: "messages.CheckHistoryImport"; + importHead: string; + fromReader(reader: Reader): CheckHistoryImport; + } + + export interface InitHistoryImportArgs { + /** The Telegram chat where the history should be imported. */ + peer: EntityLike; + /** File with messages to import. */ + file: TypeInputFile; + /** Number of media files associated with the chat that will be uploaded using messages.uploadImportedMedia. */ + mediaCount: int; + } + + /** + * Import chat history from a foreign chat app into a specific Telegram chat, click here for more info about imported chats ».
+ * @link https://corefork.telegram.org/api/import + * @link https://corefork.telegram.org/method/messages.uploadImportedMedia + * @link https://corefork.telegram.org/api/import + * @throws {{code:400,type:"IMPORT_FILE_INVALID"}} The specified chat export file is invalid. + * @throws {{code:400,type:"IMPORT_FORMAT_UNRECOGNIZED"}} The specified chat export file was exported from an unsupported chat app. + * @throws {{code:406,type:"PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_5MIN"}} Import for this chat is already in progress, wait 5 minutes before starting a new one. + */ + export class InitHistoryImport extends Request,messages.TypeHistoryImport> implements InitHistoryImportArgs { + CONSTRUCTOR_id: 873008187; + SUBCLASS_OF_ID: 2978723082; + classType: "request"; + className: "messages.InitHistoryImport"; + peer: EntityLike; + file: TypeInputFile; + mediaCount: int; + fromReader(reader: Reader): InitHistoryImport; + } + + export interface UploadImportedMediaArgs { + /** The Telegram chat where the media will be imported */ + peer: EntityLike; + /** Identifier of a history import session, returned by messages.initHistoryImport */ + importId: long; + /** File name */ + fileName: string; + /** Media metadata */ + media: TypeInputMedia; + } + + /** + * Upload a media file associated with an imported chat, click here for more info ».
+ * @link https://corefork.telegram.org/api/import + * @link https://corefork.telegram.org/method/messages.initHistoryImport + * @link https://corefork.telegram.org/api/import + */ + export class UploadImportedMedia extends Request,TypeMessageMedia> implements UploadImportedMediaArgs { + CONSTRUCTOR_id: 713433234; + SUBCLASS_OF_ID: 1198308914; + classType: "request"; + className: "messages.UploadImportedMedia"; + peer: EntityLike; + importId: long; + fileName: string; + media: TypeInputMedia; + fromReader(reader: Reader): UploadImportedMedia; + } + + export interface StartHistoryImportArgs { + /** The Telegram chat where the messages should be imported, click here for more info » */ + peer: EntityLike; + /** Identifier of a history import session, returned by messages.initHistoryImport. */ + importId: long; + } + + /** + * Complete the history import process, importing all messages into the chat.
+ * To be called only after initializing the import with messages.initHistoryImport and uploading all files using messages.uploadImportedMedia.
+ * @link https://corefork.telegram.org/api/import + * @link https://corefork.telegram.org/method/messages.initHistoryImport + * @link https://corefork.telegram.org/api/import + * @link https://corefork.telegram.org/method/messages.uploadImportedMedia + * @link https://corefork.telegram.org/api/import + * @throws {{code:400,type:"IMPORT_ID_INVALID"}} The specified import ID is invalid. + */ + export class StartHistoryImport extends Request,Bool> implements StartHistoryImportArgs { + CONSTRUCTOR_id: -1271008444; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.StartHistoryImport"; + peer: EntityLike; + importId: long; + fromReader(reader: Reader): StartHistoryImport; + } + + export interface GetExportedChatInvitesArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to fetch revoked chat invites */ + revoked?: true; + /** Chat */ + peer: EntityLike; + /** Whether to only fetch chat invites from this admin */ + adminId: TypeInputUser; + /** Offsets for pagination, for more info click here */ + offsetDate?: int; + /** Offsets for pagination, for more info click here */ + offsetLink?: string; + /** Maximum number of results to return, see pagination */ + limit: int; + } + + /** + * Get info about the chat invites of a specific chat
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetExportedChatInvites extends Request,messages.TypeExportedChatInvites> implements GetExportedChatInvitesArgs { + CONSTRUCTOR_id: -1565154314; + SUBCLASS_OF_ID: 1614624881; + classType: "request"; + className: "messages.GetExportedChatInvites"; + flags: number; + revoked?: true; + peer: EntityLike; + adminId: TypeInputUser; + offsetDate?: int; + offsetLink?: string; + limit: int; + fromReader(reader: Reader): GetExportedChatInvites; + } + + export interface GetExportedChatInviteArgs { + /** Chat */ + peer: EntityLike; + /** Invite link */ + link: string; + } + + /** Get info about a chat invite
*/ + export class GetExportedChatInvite extends Request,messages.TypeExportedChatInvite> implements GetExportedChatInviteArgs { + CONSTRUCTOR_id: 1937010524; + SUBCLASS_OF_ID: 2195510474; + classType: "request"; + className: "messages.GetExportedChatInvite"; + peer: EntityLike; + link: string; + fromReader(reader: Reader): GetExportedChatInvite; + } + + export interface EditExportedChatInviteArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to revoke the chat invite */ + revoked?: true; + /** Chat */ + peer: EntityLike; + /** Invite link */ + link: string; + /** New expiration date */ + expireDate?: int; + /** Maximum number of users that can join using this link */ + usageLimit?: int; + } + + /** + * Edit an exported chat invite
+ * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class EditExportedChatInvite extends Request,messages.TypeExportedChatInvite> implements EditExportedChatInviteArgs { + CONSTRUCTOR_id: 48562110; + SUBCLASS_OF_ID: 2195510474; + classType: "request"; + className: "messages.EditExportedChatInvite"; + flags: number; + revoked?: true; + peer: EntityLike; + link: string; + expireDate?: int; + usageLimit?: int; + fromReader(reader: Reader): EditExportedChatInvite; + } + + export interface DeleteRevokedExportedChatInvitesArgs { + /** Chat */ + peer: EntityLike; + /** ID of the admin that originally generated the revoked chat invites */ + adminId: TypeInputUser; + } + + /** Delete all revoked chat invites
*/ + export class DeleteRevokedExportedChatInvites extends Request,Bool> implements DeleteRevokedExportedChatInvitesArgs { + CONSTRUCTOR_id: 1452833749; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.DeleteRevokedExportedChatInvites"; + peer: EntityLike; + adminId: TypeInputUser; + fromReader(reader: Reader): DeleteRevokedExportedChatInvites; + } + + export interface DeleteExportedChatInviteArgs { + /** Peer */ + peer: EntityLike; + /** Invite link */ + link: string; + } + + /** Delete a chat invite
*/ + export class DeleteExportedChatInvite extends Request,Bool> implements DeleteExportedChatInviteArgs { + CONSTRUCTOR_id: -731601877; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "messages.DeleteExportedChatInvite"; + peer: EntityLike; + link: string; + fromReader(reader: Reader): DeleteExportedChatInvite; + } + + export interface GetAdminsWithInvitesArgs { + /** Chat */ + peer: EntityLike; + } + + /** Get info about chat invites generated by admins.
*/ + export class GetAdminsWithInvites extends Request,messages.TypeChatAdminsWithInvites> implements GetAdminsWithInvitesArgs { + CONSTRUCTOR_id: 958457583; + SUBCLASS_OF_ID: 2405149995; + classType: "request"; + className: "messages.GetAdminsWithInvites"; + peer: EntityLike; + fromReader(reader: Reader): GetAdminsWithInvites; + } + + export interface GetChatInviteImportersArgs { + /** Chat */ + peer: EntityLike; + /** Invite link */ + link: string; + /** Offsets for pagination, for more info click here */ + offsetDate: int; + /** User ID for pagination */ + offsetUser: TypeInputUser; + /** Maximum number of results to return, see pagination */ + limit: int; + } + + /** + * Get info about the users that joined the chat using a specific chat invite
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetChatInviteImporters extends Request,messages.TypeChatInviteImporters> implements GetChatInviteImportersArgs { + CONSTRUCTOR_id: 654013065; + SUBCLASS_OF_ID: 3653012134; + classType: "request"; + className: "messages.GetChatInviteImporters"; + peer: EntityLike; + link: string; + offsetDate: int; + offsetUser: TypeInputUser; + limit: int; + fromReader(reader: Reader): GetChatInviteImporters; + } + + export interface SetHistoryTTLArgs { + /** The dialog */ + peer: EntityLike; + /** Automatically delete all messages sent in the chat after this many seconds */ + period: int; + } + + /** + * Set maximum Time-To-Live of all messages in the specified chat
+ * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:400,type:"TTL_PERIOD_INVALID"}} The specified TTL period is invalid. + */ + export class SetHistoryTTL extends Request,TypeUpdates> implements SetHistoryTTLArgs { + CONSTRUCTOR_id: -1207017500; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "messages.SetHistoryTTL"; + peer: EntityLike; + period: int; + fromReader(reader: Reader): SetHistoryTTL; + } + + export interface CheckHistoryImportPeerArgs { + /** The chat where we want to import history ». */ + peer: EntityLike; + } + + /** + * Check whether chat history exported from another chat app can be imported into a specific Telegram chat, click here for more info ».
If the check succeeds, and no RPC errors are returned, a messages.CheckedHistoryImportPeer constructor will be returned, with a confirmation text to be shown to the user, before actually initializing the import.
+ * @link https://corefork.telegram.org/api/import + * @link https://corefork.telegram.org/type/messages.CheckedHistoryImportPeer + * @link https://corefork.telegram.org/api/import + * @throws {{code:400,type:"USER_NOT_MUTUAL_CONTACT"}} The provided user is not a mutual contact. + */ + export class CheckHistoryImportPeer extends Request,messages.TypeCheckedHistoryImportPeer> implements CheckHistoryImportPeerArgs { + CONSTRUCTOR_id: 1573261059; + SUBCLASS_OF_ID: 3091968823; + classType: "request"; + className: "messages.CheckHistoryImportPeer"; + peer: EntityLike; + fromReader(reader: Reader): CheckHistoryImportPeer; + } + + type TypeDialogs = Dialogs | DialogsSlice | DialogsNotModified; + type TypeMessages = Messages | MessagesSlice | ChannelMessages | MessagesNotModified; + type TypeChats = Chats | ChatsSlice; + type TypeChatFull = ChatFull; + type TypeAffectedHistory = AffectedHistory; + type TypeDhConfig = DhConfigNotModified | DhConfig; + type TypeSentEncryptedMessage = SentEncryptedMessage | SentEncryptedFile; + type TypeStickers = StickersNotModified | Stickers; + type TypeAllStickers = AllStickersNotModified | AllStickers; + type TypeAffectedMessages = AffectedMessages; + type TypeStickerSet = StickerSet; + type TypeSavedGifs = SavedGifsNotModified | SavedGifs; + type TypeBotResults = BotResults; + type TypeBotCallbackAnswer = BotCallbackAnswer; + type TypeMessageEditData = MessageEditData; + type TypePeerDialogs = PeerDialogs; + type TypeFeaturedStickers = FeaturedStickersNotModified | FeaturedStickers; + type TypeRecentStickers = RecentStickersNotModified | RecentStickers; + type TypeArchivedStickers = ArchivedStickers; + type TypeStickerSetInstallResult = StickerSetInstallResultSuccess | StickerSetInstallResultArchive; + type TypeHighScores = HighScores; + type TypeFavedStickers = FavedStickersNotModified | FavedStickers; + type TypeFoundStickerSets = FoundStickerSetsNotModified | FoundStickerSets; + type TypeSearchCounter = SearchCounter; + type TypeInactiveChats = InactiveChats; + type TypeVotesList = VotesList; + type TypeMessageViews = MessageViews; + type TypeDiscussionMessage = DiscussionMessage; + type TypeHistoryImport = HistoryImport; + type TypeHistoryImportParsed = HistoryImportParsed; + type TypeAffectedFoundMessages = AffectedFoundMessages; + type TypeExportedChatInvites = ExportedChatInvites; + type TypeExportedChatInvite = ExportedChatInvite | ExportedChatInviteReplaced; + type TypeChatInviteImporters = ChatInviteImporters; + type TypeChatAdminsWithInvites = ChatAdminsWithInvites; + type TypeCheckedHistoryImportPeer = CheckedHistoryImportPeer; + } + + namespace updates { + export interface StateArgs { + /** Number of events occured in a text box */ + pts: int; + /** Position in a sequence of updates in secret chats. For further detailes refer to article secret chats
Parameter was added in eigth layer. */ + qts: int; + /** Date of condition */ + date: int; + /** Number of sent updates */ + seq: int; + /** Number of unread messages */ + unreadCount: int; + } + + /** + * Updates state.
+ * @link https://corefork.telegram.org/api/end-to-end + * @link https://corefork.telegram.org/api/layers + */ + export class State extends VirtualClass implements StateArgs { + CONSTRUCTOR_id: -1519637954; + SUBCLASS_OF_ID: 601823745; + classType: "constructor"; + className: "updates.State"; + pts: int; + qts: int; + date: int; + seq: int; + unreadCount: int; + fromReader(reader: Reader): State; + } + + export interface DifferenceEmptyArgs { + /** Current date */ + date: int; + /** Number of sent updates */ + seq: int; + } + + /** No events.
*/ + export class DifferenceEmpty extends VirtualClass implements DifferenceEmptyArgs { + CONSTRUCTOR_id: 1567990072; + SUBCLASS_OF_ID: 541599860; + classType: "constructor"; + className: "updates.DifferenceEmpty"; + date: int; + seq: int; + fromReader(reader: Reader): DifferenceEmpty; + } + + export interface DifferenceArgs { + /** List of new messages */ + newMessages: TypeMessage[]; + /** List of new encrypted secret chat messages */ + newEncryptedMessages: TypeEncryptedMessage[]; + /** List of updates */ + otherUpdates: TypeUpdate[]; + /** List of chats mentioned in events */ + chats: TypeChat[]; + /** List of users mentioned in events */ + users: TypeUser[]; + /** Current state */ + state: updates.TypeState; + } + + /** Full list of occurred events.
*/ + export class Difference extends VirtualClass implements DifferenceArgs { + CONSTRUCTOR_id: -746336; + SUBCLASS_OF_ID: 541599860; + classType: "constructor"; + className: "updates.Difference"; + newMessages: TypeMessage[]; + newEncryptedMessages: TypeEncryptedMessage[]; + otherUpdates: TypeUpdate[]; + chats: TypeChat[]; + users: TypeUser[]; + state: updates.TypeState; + fromReader(reader: Reader): Difference; + } + + export interface DifferenceSliceArgs { + /** List of new messgaes */ + newMessages: TypeMessage[]; + /** New messages from the encrypted event sequence */ + newEncryptedMessages: TypeEncryptedMessage[]; + /** List of updates */ + otherUpdates: TypeUpdate[]; + /** List of chats mentioned in events */ + chats: TypeChat[]; + /** List of users mentioned in events */ + users: TypeUser[]; + /** Intermediary state */ + intermediateState: updates.TypeState; + } + + /** + * Incomplete list of occurred events.
+ * @link https://corefork.telegram.org/api/updates + */ + export class DifferenceSlice extends VirtualClass implements DifferenceSliceArgs { + CONSTRUCTOR_id: -1459938943; + SUBCLASS_OF_ID: 541599860; + classType: "constructor"; + className: "updates.DifferenceSlice"; + newMessages: TypeMessage[]; + newEncryptedMessages: TypeEncryptedMessage[]; + otherUpdates: TypeUpdate[]; + chats: TypeChat[]; + users: TypeUser[]; + intermediateState: updates.TypeState; + fromReader(reader: Reader): DifferenceSlice; + } + + export interface DifferenceTooLongArgs { + /** The new state to use. */ + pts: int; + } + + /** + * The difference is too long, and the specified state must be used to refetch updates.
+ * @link https://corefork.telegram.org/api/updates + */ + export class DifferenceTooLong extends VirtualClass implements DifferenceTooLongArgs { + CONSTRUCTOR_id: 1258196845; + SUBCLASS_OF_ID: 541599860; + classType: "constructor"; + className: "updates.DifferenceTooLong"; + pts: int; + fromReader(reader: Reader): DifferenceTooLong; + } + + export interface ChannelDifferenceEmptyArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether there are more updates that must be fetched (always false) */ + final?: true; + /** The latest PTS */ + pts: int; + /** Clients are supposed to refetch the channel difference after timeout seconds have elapsed */ + timeout?: int; + } + + /** + * There are no new updates
+ * @link https://corefork.telegram.org/api/updates + */ + export class ChannelDifferenceEmpty extends VirtualClass implements ChannelDifferenceEmptyArgs { + CONSTRUCTOR_id: 1041346555; + SUBCLASS_OF_ID: 696872797; + classType: "constructor"; + className: "updates.ChannelDifferenceEmpty"; + flags: number; + final?: true; + pts: int; + timeout?: int; + fromReader(reader: Reader): ChannelDifferenceEmpty; + } + + export interface ChannelDifferenceTooLongArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether there are more updates that must be fetched (always false) */ + final?: true; + /** Clients are supposed to refetch the channel difference after timeout seconds have elapsed */ + timeout?: int; + /** Dialog containing the latest PTS that can be used to reset the channel state */ + dialog: TypeDialog; + /** The latest messages */ + messages: TypeMessage[]; + /** Chats from messages */ + chats: TypeChat[]; + /** Users from messages */ + users: TypeUser[]; + } + + /** + * The provided pts + limit < remote pts. Simply, there are too many updates to be fetched (more than limit), the client has to resolve the update gap in one of the following ways: + * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/method/messages.getHistory + * @link https://corefork.telegram.org/method/messages.getMessages + */ + export class ChannelDifferenceTooLong extends VirtualClass implements ChannelDifferenceTooLongArgs { + CONSTRUCTOR_id: -1531132162; + SUBCLASS_OF_ID: 696872797; + classType: "constructor"; + className: "updates.ChannelDifferenceTooLong"; + flags: number; + final?: true; + timeout?: int; + dialog: TypeDialog; + messages: TypeMessage[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): ChannelDifferenceTooLong; + } + + export interface ChannelDifferenceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether there are more updates to be fetched using getDifference, starting from the provided pts */ + final?: true; + /** The PTS from which to start getting updates the next time */ + pts: int; + /** Clients are supposed to refetch the channel difference after timeout seconds have elapsed */ + timeout?: int; + /** New messages */ + newMessages: TypeMessage[]; + /** Other updates */ + otherUpdates: TypeUpdate[]; + /** Chats */ + chats: TypeChat[]; + /** Users */ + users: TypeUser[]; + } + + /** + * The new updates
+ * @link https://corefork.telegram.org/api/updates + */ + export class ChannelDifference extends VirtualClass implements ChannelDifferenceArgs { + CONSTRUCTOR_id: 543450958; + SUBCLASS_OF_ID: 696872797; + classType: "constructor"; + className: "updates.ChannelDifference"; + flags: number; + final?: true; + pts: int; + timeout?: int; + newMessages: TypeMessage[]; + otherUpdates: TypeUpdate[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): ChannelDifference; + } + + /** Returns a current state of updates.
*/ + export class GetState extends Request,updates.TypeState> { + CONSTRUCTOR_id: -304838614; + SUBCLASS_OF_ID: 601823745; + classType: "request"; + className: "updates.GetState"; + fromReader(reader: Reader): GetState; + } + + export interface GetDifferenceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** PTS, see updates. */ + pts: int; + /** For fast updating: if provided and pts + pts_total_limit < remote pts, updates.differenceTooLong will be returned.
Simply tells the server to not return the difference if it is bigger than pts_total_limit
If the remote pts is too big (> ~4000000), this field will default to 1000000 */ + ptsTotalLimit?: int; + /** date, see updates. */ + date: int; + /** QTS, see updates. */ + qts: int; + } + + /** + * Get new updates.
+ * @link https://corefork.telegram.org/api/updates + * @link https://corefork.telegram.org/constructor/updates.differenceTooLong + * @throws {{code:401,type:"AUTH_KEY_PERM_EMPTY"}} The temporary auth key must be binded to the permanent auth key to use these methods. + * @throws {{code:400,type:"CDN_METHOD_INVALID"}} You can't call this method in a CDN DC. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"DATE_EMPTY"}} Date empty. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PERSISTENT_TIMESTAMP_EMPTY"}} Persistent timestamp empty. + * @throws {{code:400,type:"PERSISTENT_TIMESTAMP_INVALID"}} Persistent timestamp invalid. + */ + export class GetDifference extends Request,updates.TypeDifference> implements GetDifferenceArgs { + CONSTRUCTOR_id: 630429265; + SUBCLASS_OF_ID: 541599860; + classType: "request"; + className: "updates.GetDifference"; + flags: number; + pts: int; + ptsTotalLimit?: int; + date: int; + qts: int; + fromReader(reader: Reader): GetDifference; + } + + export interface GetChannelDifferenceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Set to true to skip some possibly unneeded updates and reduce server-side load */ + force?: true; + /** The channel */ + channel: TypeInputChannel; + /** Messsage filter */ + filter: TypeChannelMessagesFilter; + /** Persistent timestamp (see updates) */ + pts: int; + /** How many updates to fetch, max 100000
Ordinary (non-bot) users are supposed to pass 10-100 */ + limit: int; + } + + /** + * Returns the difference between the current state of updates of a certain channel and transmitted.
+ * @link https://corefork.telegram.org/api/updates + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:403,type:"CHANNEL_PUBLIC_GROUP_NA"}} channel/supergroup not available. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"FROM_MESSAGE_BOT_DISABLED"}} Bots can't use fromMessage min constructors. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PERSISTENT_TIMESTAMP_EMPTY"}} Persistent timestamp empty. + * @throws {{code:400,type:"PERSISTENT_TIMESTAMP_INVALID"}} Persistent timestamp invalid. + * @throws {{code:400,type:"PINNED_DIALOGS_TOO_MUCH"}} Too many pinned dialogs. + * @throws {{code:400,type:"RANGES_INVALID"}} Invalid range provided. + * @throws {{code:400,type:"USER_BANNED_IN_CHANNEL"}} You're banned from sending messages in supergroups/channels. + */ + export class GetChannelDifference extends Request,updates.TypeChannelDifference> implements GetChannelDifferenceArgs { + CONSTRUCTOR_id: 51854712; + SUBCLASS_OF_ID: 696872797; + classType: "request"; + className: "updates.GetChannelDifference"; + flags: number; + force?: true; + channel: TypeInputChannel; + filter: TypeChannelMessagesFilter; + pts: int; + limit: int; + fromReader(reader: Reader): GetChannelDifference; + } + + type TypeState = State; + type TypeDifference = DifferenceEmpty | Difference | DifferenceSlice | DifferenceTooLong; + type TypeChannelDifference = ChannelDifferenceEmpty | ChannelDifferenceTooLong | ChannelDifference; + } + + namespace photos { + export interface PhotosArgs { + /** List of photos */ + photos: TypePhoto[]; + /** List of mentioned users */ + users: TypeUser[]; + } + + /** Full list of photos with auxiliary data.
*/ + export class Photos extends VirtualClass implements PhotosArgs { + CONSTRUCTOR_id: -1916114267; + SUBCLASS_OF_ID: 667924839; + classType: "constructor"; + className: "photos.Photos"; + photos: TypePhoto[]; + users: TypeUser[]; + fromReader(reader: Reader): Photos; + } + + export interface PhotosSliceArgs { + /** Total number of photos */ + count: int; + /** List of photos */ + photos: TypePhoto[]; + /** List of mentioned users */ + users: TypeUser[]; + } + + /** Incomplete list of photos with auxiliary data.
*/ + export class PhotosSlice extends VirtualClass implements PhotosSliceArgs { + CONSTRUCTOR_id: 352657236; + SUBCLASS_OF_ID: 667924839; + classType: "constructor"; + className: "photos.PhotosSlice"; + count: int; + photos: TypePhoto[]; + users: TypeUser[]; + fromReader(reader: Reader): PhotosSlice; + } + + export interface PhotoArgs { + /** Photo */ + photo: TypePhoto; + /** Users */ + users: TypeUser[]; + } + + /** Photo with auxiliary data.
*/ + export class Photo extends VirtualClass implements PhotoArgs { + CONSTRUCTOR_id: 539045032; + SUBCLASS_OF_ID: 3264396580; + classType: "constructor"; + className: "photos.Photo"; + photo: TypePhoto; + users: TypeUser[]; + fromReader(reader: Reader): Photo; + } + + export interface UpdateProfilePhotoArgs { + /** Input photo */ + id: TypeInputPhoto; + } + + /** + * Installs a previously uploaded photo as a profile photo.
+ * @throws {{code:400,type:"ALBUM_PHOTOS_TOO_MANY"}} Too many. + * @throws {{code:400,type:"FILE_PARTS_INVALID"}} The number of file parts is invalid. + * @throws {{code:400,type:"IMAGE_PROCESS_FAILED"}} Failure while processing image. + * @throws {{code:400,type:"LOCATION_INVALID"}} The provided location is invalid. + * @throws {{code:400,type:"PHOTO_CROP_SIZE_SMALL"}} Photo is too small. + * @throws {{code:400,type:"PHOTO_EXT_INVALID"}} The extension of the photo is invalid. + * @throws {{code:400,type:"PHOTO_ID_INVALID"}} Photo ID invalid. + */ + export class UpdateProfilePhoto extends Request,photos.TypePhoto> implements UpdateProfilePhotoArgs { + CONSTRUCTOR_id: 1926525996; + SUBCLASS_OF_ID: 3264396580; + classType: "request"; + className: "photos.UpdateProfilePhoto"; + id: TypeInputPhoto; + fromReader(reader: Reader): UpdateProfilePhoto; + } + + export interface UploadProfilePhotoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** File saved in parts by means of upload.saveFilePart method */ + file?: TypeInputFile; + /** Animated profile picture video */ + video?: TypeInputFile; + /** Floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview. */ + videoStartTs?: double; + } + + /** + * Updates current user profile photo.
+ * @link https://corefork.telegram.org/method/upload.saveFilePart + * @link https://corefork.telegram.org/api/files + * @throws {{code:400,type:"ALBUM_PHOTOS_TOO_MANY"}} Too many . + * @throws {{code:400,type:"FILE_PARTS_INVALID"}} The number of file parts is invalid. + * @throws {{code:400,type:"IMAGE_PROCESS_FAILED"}} Failure while processing image. + * @throws {{code:400,type:"PHOTO_CROP_FILE_MISSING"}} Photo crop file missing. + * @throws {{code:400,type:"PHOTO_CROP_SIZE_SMALL"}} Photo is too small. + * @throws {{code:400,type:"PHOTO_EXT_INVALID"}} The extension of the photo is invalid. + * @throws {{code:400,type:"PHOTO_FILE_MISSING"}} Profile photo file missing. + * @throws {{code:400,type:"VIDEO_FILE_INVALID"}} The specified video file is invalid. + */ + export class UploadProfilePhoto extends Request,photos.TypePhoto> implements UploadProfilePhotoArgs { + CONSTRUCTOR_id: -1980559511; + SUBCLASS_OF_ID: 3264396580; + classType: "request"; + className: "photos.UploadProfilePhoto"; + flags: number; + file?: TypeInputFile; + video?: TypeInputFile; + videoStartTs?: double; + fromReader(reader: Reader): UploadProfilePhoto; + } + + export interface DeletePhotosArgs { + /** Input photos to delete */ + id: TypeInputPhoto[]; + } + + /** Deletes profile photos.
*/ + export class DeletePhotos extends Request,long[]> implements DeletePhotosArgs { + CONSTRUCTOR_id: -2016444625; + SUBCLASS_OF_ID: 2300109160; + classType: "request"; + className: "photos.DeletePhotos"; + id: TypeInputPhoto[]; + fromReader(reader: Reader): DeletePhotos; + } + + export interface GetUserPhotosArgs { + /** User ID */ + userId: TypeInputUser; + /** Number of list elements to be skipped */ + offset: int; + /** If a positive value was transferred, the method will return only photos with IDs less than the set one */ + maxId: long; + /** Number of list elements to be returned */ + limit: int; + } + + /** + * Returns the list of user photos.
+ * @throws {{code:400,type:"MAX_ID_INVALID"}} The provided max ID is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class GetUserPhotos extends Request,photos.TypePhotos> implements GetUserPhotosArgs { + CONSTRUCTOR_id: -1848823128; + SUBCLASS_OF_ID: 667924839; + classType: "request"; + className: "photos.GetUserPhotos"; + userId: TypeInputUser; + offset: int; + maxId: long; + limit: int; + fromReader(reader: Reader): GetUserPhotos; + } + + type TypePhotos = Photos | PhotosSlice; + type TypePhoto = Photo; + } + + namespace upload { + export interface FileArgs { + /** File type */ + type: storage.TypeFileType; + /** Modification type */ + mtime: int; + /** Binary data, file content */ + bytes: bytes; + } + + /** File content.
*/ + export class File extends VirtualClass implements FileArgs { + CONSTRUCTOR_id: 157948117; + SUBCLASS_OF_ID: 1822152488; + classType: "constructor"; + className: "upload.File"; + type: storage.TypeFileType; + mtime: int; + bytes: bytes; + fromReader(reader: Reader): File; + } + + export interface FileCdnRedirectArgs { + /** CDN DC ID */ + dcId: int; + /** File token (see CDN files) */ + fileToken: bytes; + /** Encryption key (see CDN files) */ + encryptionKey: bytes; + /** Encryption IV (see CDN files) */ + encryptionIv: bytes; + /** File hashes (see CDN files) */ + fileHashes: TypeFileHash[]; + } + + /** + * The file must be downloaded from a CDN DC.
+ * @link https://corefork.telegram.org/cdn + */ + export class FileCdnRedirect extends VirtualClass implements FileCdnRedirectArgs { + CONSTRUCTOR_id: -242427324; + SUBCLASS_OF_ID: 1822152488; + classType: "constructor"; + className: "upload.FileCdnRedirect"; + dcId: int; + fileToken: bytes; + encryptionKey: bytes; + encryptionIv: bytes; + fileHashes: TypeFileHash[]; + fromReader(reader: Reader): FileCdnRedirect; + } + + export interface WebFileArgs { + /** File size */ + size: int; + /** Mime type */ + mimeType: string; + /** File type */ + fileType: storage.TypeFileType; + /** Modified time */ + mtime: int; + /** Data */ + bytes: bytes; + } + + /** + * Represents a chunk of an HTTP webfile downloaded through telegram's secure MTProto servers
+ * @link https://corefork.telegram.org/api/files + */ + export class WebFile extends VirtualClass implements WebFileArgs { + CONSTRUCTOR_id: 568808380; + SUBCLASS_OF_ID: 1760657233; + classType: "constructor"; + className: "upload.WebFile"; + size: int; + mimeType: string; + fileType: storage.TypeFileType; + mtime: int; + bytes: bytes; + fromReader(reader: Reader): WebFile; + } + + export interface CdnFileReuploadNeededArgs { + /** Request token (see CDN) */ + requestToken: bytes; + } + + /** + * The file was cleared from the temporary RAM cache of the CDN and has to be reuploaded.
+ * @link https://corefork.telegram.org/cdn + */ + export class CdnFileReuploadNeeded extends VirtualClass implements CdnFileReuploadNeededArgs { + CONSTRUCTOR_id: -290921362; + SUBCLASS_OF_ID: 4123851048; + classType: "constructor"; + className: "upload.CdnFileReuploadNeeded"; + requestToken: bytes; + fromReader(reader: Reader): CdnFileReuploadNeeded; + } + + export interface CdnFileArgs { + /** The data */ + bytes: bytes; + } + + /** + * Represent a chunk of a CDN file.
+ * @link https://corefork.telegram.org/cdn + */ + export class CdnFile extends VirtualClass implements CdnFileArgs { + CONSTRUCTOR_id: -1449145777; + SUBCLASS_OF_ID: 4123851048; + classType: "constructor"; + className: "upload.CdnFile"; + bytes: bytes; + fromReader(reader: Reader): CdnFile; + } + + export interface SaveFilePartArgs { + /** Random file identifier created by the client */ + fileId: long; + /** Numerical order of a part */ + filePart: int; + /** Binary data, contend of a part */ + bytes: bytes; + } + + /** + * Saves a part of file for futher sending to one of the methods.
+ * @throws {{code:400,type:"FILE_PART_EMPTY"}} The provided file part is empty. + * @throws {{code:400,type:"FILE_PART_INVALID"}} The file part number is invalid. + */ + export class SaveFilePart extends Request,Bool> implements SaveFilePartArgs { + CONSTRUCTOR_id: -1291540959; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "upload.SaveFilePart"; + fileId: long; + filePart: int; + bytes: bytes; + fromReader(reader: Reader): SaveFilePart; + } + + export interface GetFileArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Disable some checks on limit and offset values, useful for example to stream videos by keyframes */ + precise?: true; + /** Whether the current client supports CDN downloads */ + cdnSupported?: true; + /** File location */ + location: TypeInputFileLocation; + /** Number of bytes to be skipped */ + offset: int; + /** Number of bytes to be returned */ + limit: int; + } + + /** + * Returns content of a whole file or its part.
+ * @link https://corefork.telegram.org/cdn + * @link https://corefork.telegram.org/api/file_reference + * @throws {{code:401,type:"AUTH_KEY_PERM_EMPTY"}} The temporary auth key must be binded to the permanent auth key to use these methods. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:406,type:"FILEREF_UPGRADE_NEEDED"}} The client has to be updated in order to support file references. + * @throws {{code:400,type:"FILE_ID_INVALID"}} The provided file id is invalid. + * @throws {{code:400,type:"FILE_REFERENCE_*"}} The file reference expired, it must be refreshed. + * @throws {{code:400,type:"FILE_REFERENCE_EXPIRED"}} File reference expired, it must be refetched as described in https://core.telegram.org/api/file_reference. + * @throws {{code:400,type:"LIMIT_INVALID"}} The provided limit is invalid. + * @throws {{code:400,type:"LOCATION_INVALID"}} The provided location is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"OFFSET_INVALID"}} The provided offset is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetFile extends Request,upload.TypeFile> implements GetFileArgs { + CONSTRUCTOR_id: -1319462148; + SUBCLASS_OF_ID: 1822152488; + classType: "request"; + className: "upload.GetFile"; + flags: number; + precise?: true; + cdnSupported?: true; + location: TypeInputFileLocation; + offset: int; + limit: int; + fromReader(reader: Reader): GetFile; + } + + export interface SaveBigFilePartArgs { + /** Random file id, created by the client */ + fileId: long; + /** Part sequence number */ + filePart: int; + /** Total number of parts */ + fileTotalParts: int; + /** Binary data, part contents */ + bytes: bytes; + } + + /** + * Saves a part of a large file (over 10Mb in size) to be later passed to one of the methods.
+ * @throws {{code:400,type:"FILE_PARTS_INVALID"}} The number of file parts is invalid. + * @throws {{code:400,type:"FILE_PART_EMPTY"}} The provided file part is empty. + * @throws {{code:400,type:"FILE_PART_INVALID"}} The file part number is invalid. + * @throws {{code:400,type:"FILE_PART_SIZE_CHANGED"}} Provided file part size has changed. + * @throws {{code:400,type:"FILE_PART_SIZE_INVALID"}} The provided file part size is invalid. + * @throws {{code:400,type:"FILE_PART_TOO_BIG"}} The uploaded file part is too big. + */ + export class SaveBigFilePart extends Request,Bool> implements SaveBigFilePartArgs { + CONSTRUCTOR_id: -562337987; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "upload.SaveBigFilePart"; + fileId: long; + filePart: int; + fileTotalParts: int; + bytes: bytes; + fromReader(reader: Reader): SaveBigFilePart; + } + + export interface GetWebFileArgs { + /** The file to download */ + location: TypeInputWebFileLocation; + /** Number of bytes to be skipped */ + offset: int; + /** Number of bytes to be returned */ + limit: int; + } + + /** + * Returns content of an HTTP file or a part, by proxying the request through telegram.
+ * @throws {{code:400,type:"LOCATION_INVALID"}} The provided location is invalid. + */ + export class GetWebFile extends Request,upload.TypeWebFile> implements GetWebFileArgs { + CONSTRUCTOR_id: 619086221; + SUBCLASS_OF_ID: 1760657233; + classType: "request"; + className: "upload.GetWebFile"; + location: TypeInputWebFileLocation; + offset: int; + limit: int; + fromReader(reader: Reader): GetWebFile; + } + + export interface GetCdnFileArgs { + /** File token */ + fileToken: bytes; + /** Offset of chunk to download */ + offset: int; + /** Length of chunk to download */ + limit: int; + } + + /** + * Download a CDN file.
+ * @link https://corefork.telegram.org/cdn + */ + export class GetCdnFile extends Request,upload.TypeCdnFile> implements GetCdnFileArgs { + CONSTRUCTOR_id: 536919235; + SUBCLASS_OF_ID: 4123851048; + classType: "request"; + className: "upload.GetCdnFile"; + fileToken: bytes; + offset: int; + limit: int; + fromReader(reader: Reader): GetCdnFile; + } + + export interface ReuploadCdnFileArgs { + /** File token */ + fileToken: bytes; + /** Request token */ + requestToken: bytes; + } + + /** + * Request a reupload of a certain file to a CDN DC.
+ * @link https://corefork.telegram.org/cdn + * @throws {{code:400,type:"RSA_DECRYPT_FAILED"}} Internal RSA decryption failed. + */ + export class ReuploadCdnFile extends Request,TypeFileHash[]> implements ReuploadCdnFileArgs { + CONSTRUCTOR_id: -1691921240; + SUBCLASS_OF_ID: 2777941798; + classType: "request"; + className: "upload.ReuploadCdnFile"; + fileToken: bytes; + requestToken: bytes; + fromReader(reader: Reader): ReuploadCdnFile; + } + + export interface GetCdnFileHashesArgs { + /** File */ + fileToken: bytes; + /** Offset from which to start getting hashes */ + offset: int; + } + + /** + * Get SHA256 hashes for verifying downloaded CDN files
+ * @link https://corefork.telegram.org/cdn + * @throws {{code:400,type:"CDN_METHOD_INVALID"}} You can't call this method in a CDN DC. + * @throws {{code:400,type:"RSA_DECRYPT_FAILED"}} Internal RSA decryption failed. + */ + export class GetCdnFileHashes extends Request,TypeFileHash[]> implements GetCdnFileHashesArgs { + CONSTRUCTOR_id: 1302676017; + SUBCLASS_OF_ID: 2777941798; + classType: "request"; + className: "upload.GetCdnFileHashes"; + fileToken: bytes; + offset: int; + fromReader(reader: Reader): GetCdnFileHashes; + } + + export interface GetFileHashesArgs { + /** File */ + location: TypeInputFileLocation; + /** Offset from which to get file hashes */ + offset: int; + } + + /** + * Get SHA256 hashes for verifying downloaded files
+ * @throws {{code:400,type:"LOCATION_INVALID"}} The provided location is invalid. + */ + export class GetFileHashes extends Request,TypeFileHash[]> implements GetFileHashesArgs { + CONSTRUCTOR_id: -956147407; + SUBCLASS_OF_ID: 2777941798; + classType: "request"; + className: "upload.GetFileHashes"; + location: TypeInputFileLocation; + offset: int; + fromReader(reader: Reader): GetFileHashes; + } + + type TypeFile = File | FileCdnRedirect; + type TypeWebFile = WebFile; + type TypeCdnFile = CdnFileReuploadNeeded | CdnFile; + } + + namespace help { + export interface AppUpdateArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Unskippable, the new info must be shown to the user (with a popup or something else) */ + canNotSkip?: true; + /** Update ID */ + id: int; + /** New version name */ + version: string; + /** Text description of the update */ + text: string; + /** Message entities for styled text */ + entities: TypeMessageEntity[]; + /** Application binary */ + document?: TypeDocument; + /** Application download URL */ + url?: string; + /** Associated sticker */ + sticker?: TypeDocument; + } + + /** + * An update is available for the application.
+ * @link https://corefork.telegram.org/api/entities + */ + export class AppUpdate extends VirtualClass implements AppUpdateArgs { + CONSTRUCTOR_id: -860107216; + SUBCLASS_OF_ID: 1486292638; + classType: "constructor"; + className: "help.AppUpdate"; + flags: number; + canNotSkip?: true; + id: int; + version: string; + text: string; + entities: TypeMessageEntity[]; + document?: TypeDocument; + url?: string; + sticker?: TypeDocument; + fromReader(reader: Reader): AppUpdate; + } + + /** No updates are available for the application.
*/ + export class NoAppUpdate extends VirtualClass { + CONSTRUCTOR_id: -1000708810; + SUBCLASS_OF_ID: 1486292638; + classType: "constructor"; + className: "help.NoAppUpdate"; + fromReader(reader: Reader): NoAppUpdate; + } + + export interface InviteTextArgs { + /** Text of the message */ + message: string; + } + + /** Text of a text message with an invitation to install Telegram.
*/ + export class InviteText extends VirtualClass implements InviteTextArgs { + CONSTRUCTOR_id: 415997816; + SUBCLASS_OF_ID: 3480267317; + classType: "constructor"; + className: "help.InviteText"; + message: string; + fromReader(reader: Reader): InviteText; + } + + export interface SupportArgs { + /** Phone number */ + phoneNumber: string; + /** User */ + user: TypeUser; + } + + /** Info on support user.
*/ + export class Support extends VirtualClass implements SupportArgs { + CONSTRUCTOR_id: 398898678; + SUBCLASS_OF_ID: 1901706475; + classType: "constructor"; + className: "help.Support"; + phoneNumber: string; + user: TypeUser; + fromReader(reader: Reader): Support; + } + + export interface TermsOfServiceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether a prompt must be showed to the user, in order to accept the new terms. */ + popup?: true; + /** ID of the new terms */ + id: TypeDataJSON; + /** Text of the new terms */ + text: string; + /** Message entities for styled text */ + entities: TypeMessageEntity[]; + /** Minimum age required to sign up to telegram, the user must confirm that they is older than the minimum age. */ + minAgeConfirm?: int; + } + + /** + * Info about the latest telegram Terms Of Service
+ * @link https://corefork.telegram.org/api/entities + */ + export class TermsOfService extends VirtualClass implements TermsOfServiceArgs { + CONSTRUCTOR_id: 2013922064; + SUBCLASS_OF_ID: 552502034; + classType: "constructor"; + className: "help.TermsOfService"; + flags: number; + popup?: true; + id: TypeDataJSON; + text: string; + entities: TypeMessageEntity[]; + minAgeConfirm?: int; + fromReader(reader: Reader): TermsOfService; + } + + export interface RecentMeUrlsArgs { + /** URLs */ + urls: TypeRecentMeUrl[]; + /** Chats */ + chats: TypeChat[]; + /** Users */ + users: TypeUser[]; + } + + /** Recent t.me URLs
*/ + export class RecentMeUrls extends VirtualClass implements RecentMeUrlsArgs { + CONSTRUCTOR_id: 235081943; + SUBCLASS_OF_ID: 4067017847; + classType: "constructor"; + className: "help.RecentMeUrls"; + urls: TypeRecentMeUrl[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): RecentMeUrls; + } + + export interface TermsOfServiceUpdateEmptyArgs { + /** New TOS updates will have to be queried using help.getTermsOfServiceUpdate in expires seconds */ + expires: int; + } + + /** + * No changes were made to telegram's terms of service
+ * @link https://corefork.telegram.org/method/help.getTermsOfServiceUpdate + */ + export class TermsOfServiceUpdateEmpty extends VirtualClass implements TermsOfServiceUpdateEmptyArgs { + CONSTRUCTOR_id: -483352705; + SUBCLASS_OF_ID: 691808631; + classType: "constructor"; + className: "help.TermsOfServiceUpdateEmpty"; + expires: int; + fromReader(reader: Reader): TermsOfServiceUpdateEmpty; + } + + export interface TermsOfServiceUpdateArgs { + /** New TOS updates will have to be queried using help.getTermsOfServiceUpdate in expires seconds */ + expires: int; + /** New terms of service */ + termsOfService: help.TypeTermsOfService; + } + + /** + * Info about an update of telegram's terms of service. If the terms of service are declined, then the account.deleteAccount method should be called with the reason "Decline ToS update"
+ * @link https://corefork.telegram.org/method/help.getTermsOfServiceUpdate + * @link https://corefork.telegram.org/method/account.deleteAccount + * @link https://corefork.telegram.org/api/srp + */ + export class TermsOfServiceUpdate extends VirtualClass implements TermsOfServiceUpdateArgs { + CONSTRUCTOR_id: 686618977; + SUBCLASS_OF_ID: 691808631; + classType: "constructor"; + className: "help.TermsOfServiceUpdate"; + expires: int; + termsOfService: help.TypeTermsOfService; + fromReader(reader: Reader): TermsOfServiceUpdate; + } + + /** Deep link info empty
*/ + export class DeepLinkInfoEmpty extends VirtualClass { + CONSTRUCTOR_id: 1722786150; + SUBCLASS_OF_ID: 2555030584; + classType: "constructor"; + className: "help.DeepLinkInfoEmpty"; + fromReader(reader: Reader): DeepLinkInfoEmpty; + } + + export interface DeepLinkInfoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** An update of the app is required to parse this link */ + updateApp?: true; + /** Message to show to the user */ + message: string; + /** Message entities for styled text */ + entities?: TypeMessageEntity[]; + } + + /** + * Deep linking info
+ * @link https://corefork.telegram.org/api/entities + */ + export class DeepLinkInfo extends VirtualClass implements DeepLinkInfoArgs { + CONSTRUCTOR_id: 1783556146; + SUBCLASS_OF_ID: 2555030584; + classType: "constructor"; + className: "help.DeepLinkInfo"; + flags: number; + updateApp?: true; + message: string; + entities?: TypeMessageEntity[]; + fromReader(reader: Reader): DeepLinkInfo; + } + + /** Password configuration not modified
*/ + export class PassportConfigNotModified extends VirtualClass { + CONSTRUCTOR_id: -1078332329; + SUBCLASS_OF_ID: 3328622765; + classType: "constructor"; + className: "help.PassportConfigNotModified"; + fromReader(reader: Reader): PassportConfigNotModified; + } + + export interface PassportConfigArgs { + /** Hash for pagination, for more info click here */ + hash: int; + /** Localization */ + countriesLangs: TypeDataJSON; + } + + /** + * Telegram passport configuration
+ * @link https://corefork.telegram.org/api/offsets + * @link https://corefork.telegram.org/passport + */ + export class PassportConfig extends VirtualClass implements PassportConfigArgs { + CONSTRUCTOR_id: -1600596305; + SUBCLASS_OF_ID: 3328622765; + classType: "constructor"; + className: "help.PassportConfig"; + hash: int; + countriesLangs: TypeDataJSON; + fromReader(reader: Reader): PassportConfig; + } + + export interface SupportNameArgs { + /** Localized name */ + name: string; + } + + /** Localized name for telegram support
*/ + export class SupportName extends VirtualClass implements SupportNameArgs { + CONSTRUCTOR_id: -1945767479; + SUBCLASS_OF_ID: 2135996354; + classType: "constructor"; + className: "help.SupportName"; + name: string; + fromReader(reader: Reader): SupportName; + } + + /** Internal use
*/ + export class UserInfoEmpty extends VirtualClass { + CONSTRUCTOR_id: -206688531; + SUBCLASS_OF_ID: 1548998616; + classType: "constructor"; + className: "help.UserInfoEmpty"; + fromReader(reader: Reader): UserInfoEmpty; + } + + export interface UserInfoArgs { + /** Info */ + message: string; + /** Message entities for styled text */ + entities: TypeMessageEntity[]; + /** Author */ + author: string; + /** Date */ + date: int; + } + + /** + * Internal use
+ * @link https://corefork.telegram.org/api/entities + */ + export class UserInfo extends VirtualClass implements UserInfoArgs { + CONSTRUCTOR_id: 32192344; + SUBCLASS_OF_ID: 1548998616; + classType: "constructor"; + className: "help.UserInfo"; + message: string; + entities: TypeMessageEntity[]; + author: string; + date: int; + fromReader(reader: Reader): UserInfo; + } + + export interface PromoDataEmptyArgs { + /** Re-fetch PSA/MTProxy info after the specified number of seconds */ + expires: int; + } + + /** No PSA/MTProxy info is available
*/ + export class PromoDataEmpty extends VirtualClass implements PromoDataEmptyArgs { + CONSTRUCTOR_id: -1728664459; + SUBCLASS_OF_ID: 2639877442; + classType: "constructor"; + className: "help.PromoDataEmpty"; + expires: int; + fromReader(reader: Reader): PromoDataEmpty; + } + + export interface PromoDataArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** MTProxy-related channel */ + proxy?: true; + /** Expiry of PSA/MTProxy info */ + expires: int; + /** MTProxy/PSA peer */ + peer: TypePeer; + /** Chat info */ + chats: TypeChat[]; + /** User info */ + users: TypeUser[]; + /** PSA type */ + psaType?: string; + /** PSA message */ + psaMessage?: string; + } + + /** MTProxy/Public Service Announcement information
*/ + export class PromoData extends VirtualClass implements PromoDataArgs { + CONSTRUCTOR_id: -1942390465; + SUBCLASS_OF_ID: 2639877442; + classType: "constructor"; + className: "help.PromoData"; + flags: number; + proxy?: true; + expires: int; + peer: TypePeer; + chats: TypeChat[]; + users: TypeUser[]; + psaType?: string; + psaMessage?: string; + fromReader(reader: Reader): PromoData; + } + + export interface CountryCodeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** ISO country code */ + countryCode: string; + /** Possible phone prefixes */ + prefixes?: string[]; + /** Phone patterns: for example, XXX XXX XXX */ + patterns?: string[]; + } + + /** Country code and phone number pattern of a specific country
*/ + export class CountryCode extends VirtualClass implements CountryCodeArgs { + CONSTRUCTOR_id: 1107543535; + SUBCLASS_OF_ID: 1995654757; + classType: "constructor"; + className: "help.CountryCode"; + flags: number; + countryCode: string; + prefixes?: string[]; + patterns?: string[]; + fromReader(reader: Reader): CountryCode; + } + + export interface CountryArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this country should not be shown in the list */ + hidden?: true; + /** ISO code of country */ + iso2: string; + /** Name of the country in the country's language */ + defaultName: string; + /** Name of the country in the user's language, if different from the original name */ + name?: string; + /** Phone codes/patterns */ + countryCodes: help.TypeCountryCode[]; + } + + /** Name, ISO code, localized name and phone codes/patterns of a specific country
*/ + export class Country extends VirtualClass implements CountryArgs { + CONSTRUCTOR_id: -1014526429; + SUBCLASS_OF_ID: 2720964136; + classType: "constructor"; + className: "help.Country"; + flags: number; + hidden?: true; + iso2: string; + defaultName: string; + name?: string; + countryCodes: help.TypeCountryCode[]; + fromReader(reader: Reader): Country; + } + + /** The country list has not changed
*/ + export class CountriesListNotModified extends VirtualClass { + CONSTRUCTOR_id: -1815339214; + SUBCLASS_OF_ID: 3929144968; + classType: "constructor"; + className: "help.CountriesListNotModified"; + fromReader(reader: Reader): CountriesListNotModified; + } + + export interface CountriesListArgs { + /** Name, ISO code, localized name and phone codes/patterns of all available countries */ + countries: help.TypeCountry[]; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Name, ISO code, localized name and phone codes/patterns of all available countries
+ * @link https://corefork.telegram.org/api/offsets + */ + export class CountriesList extends VirtualClass implements CountriesListArgs { + CONSTRUCTOR_id: -2016381538; + SUBCLASS_OF_ID: 3929144968; + classType: "constructor"; + className: "help.CountriesList"; + countries: help.TypeCountry[]; + hash: int; + fromReader(reader: Reader): CountriesList; + } + + /** + * Returns current configuration, including data center configuration.
+ * @throws {{code:400,type:"CONNECTION_API_ID_INVALID"}} The provided API id is invalid. + * @throws {{code:400,type:"CONNECTION_APP_VERSION_EMPTY"}} App version is empty. + * @throws {{code:400,type:"CONNECTION_LAYER_INVALID"}} Layer invalid. + * @throws {{code:400,type:"CONNECTION_NOT_INITED"}} Connection not initialized. + * @throws {{code:400,type:"DATA_INVALID"}} Encrypted data invalid. + * @throws {{code:400,type:"INPUT_LAYER_INVALID"}} The provided layer is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"USERNAME_INVALID"}} The provided username is not valid. + * @throws {{code:403,type:"USER_PRIVACY_RESTRICTED"}} The user's privacy settings do not allow you to do this. + */ + export class GetConfig extends Request,TypeConfig> { + CONSTRUCTOR_id: -990308245; + SUBCLASS_OF_ID: 3542493770; + classType: "request"; + className: "help.GetConfig"; + fromReader(reader: Reader): GetConfig; + } + + /** Returns info on data centre nearest to the user.
*/ + export class GetNearestDc extends Request,TypeNearestDc> { + CONSTRUCTOR_id: 531836966; + SUBCLASS_OF_ID: 947323999; + classType: "request"; + className: "help.GetNearestDc"; + fromReader(reader: Reader): GetNearestDc; + } + + export interface GetAppUpdateArgs { + /** Source */ + source: string; + } + + /** Returns information on update availability for the current application.
*/ + export class GetAppUpdate extends Request,help.TypeAppUpdate> implements GetAppUpdateArgs { + CONSTRUCTOR_id: 1378703997; + SUBCLASS_OF_ID: 1486292638; + classType: "request"; + className: "help.GetAppUpdate"; + source: string; + fromReader(reader: Reader): GetAppUpdate; + } + + /** Returns localized text of a text message with an invitation.
*/ + export class GetInviteText extends Request,help.TypeInviteText> { + CONSTRUCTOR_id: 1295590211; + SUBCLASS_OF_ID: 3480267317; + classType: "request"; + className: "help.GetInviteText"; + fromReader(reader: Reader): GetInviteText; + } + + /** Returns the support user for the 'ask a question' feature.
*/ + export class GetSupport extends Request,help.TypeSupport> { + CONSTRUCTOR_id: -1663104819; + SUBCLASS_OF_ID: 1901706475; + classType: "request"; + className: "help.GetSupport"; + fromReader(reader: Reader): GetSupport; + } + + export interface GetAppChangelogArgs { + /** Previous app version */ + prevAppVersion: string; + } + + /** + * Get changelog of current app.
+ * Typically, an updates constructor will be returned, containing one or more updateServiceNotification updates with app-specific changelogs.
+ * @link https://corefork.telegram.org/constructor/updates + * @link https://corefork.telegram.org/constructor/updateServiceNotification + */ + export class GetAppChangelog extends Request,TypeUpdates> implements GetAppChangelogArgs { + CONSTRUCTOR_id: -1877938321; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "help.GetAppChangelog"; + prevAppVersion: string; + fromReader(reader: Reader): GetAppChangelog; + } + + export interface SetBotUpdatesStatusArgs { + /** Number of pending updates */ + pendingUpdatesCount: int; + /** Error message, if present */ + message: string; + } + + /** Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only
*/ + export class SetBotUpdatesStatus extends Request,Bool> implements SetBotUpdatesStatusArgs { + CONSTRUCTOR_id: -333262899; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "help.SetBotUpdatesStatus"; + pendingUpdatesCount: int; + message: string; + fromReader(reader: Reader): SetBotUpdatesStatus; + } + + /** + * Get configuration for CDN file downloads.
+ * @link https://corefork.telegram.org/cdn + * @throws {{code:401,type:"AUTH_KEY_PERM_EMPTY"}} The temporary auth key must be binded to the permanent auth key to use these methods. + */ + export class GetCdnConfig extends Request,TypeCdnConfig> { + CONSTRUCTOR_id: 1375900482; + SUBCLASS_OF_ID: 3973724540; + classType: "request"; + className: "help.GetCdnConfig"; + fromReader(reader: Reader): GetCdnConfig; + } + + export interface GetRecentMeUrlsArgs { + /** Referer */ + referer: string; + } + + /** Get recently used t.me links
*/ + export class GetRecentMeUrls extends Request,help.TypeRecentMeUrls> implements GetRecentMeUrlsArgs { + CONSTRUCTOR_id: 1036054804; + SUBCLASS_OF_ID: 4067017847; + classType: "request"; + className: "help.GetRecentMeUrls"; + referer: string; + fromReader(reader: Reader): GetRecentMeUrls; + } + + /** Look for updates of telegram's terms of service
*/ + export class GetTermsOfServiceUpdate extends Request,help.TypeTermsOfServiceUpdate> { + CONSTRUCTOR_id: 749019089; + SUBCLASS_OF_ID: 691808631; + classType: "request"; + className: "help.GetTermsOfServiceUpdate"; + fromReader(reader: Reader): GetTermsOfServiceUpdate; + } + + export interface AcceptTermsOfServiceArgs { + /** ID of terms of service */ + id: TypeDataJSON; + } + + /** Accept the new terms of service
*/ + export class AcceptTermsOfService extends Request,Bool> implements AcceptTermsOfServiceArgs { + CONSTRUCTOR_id: -294455398; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "help.AcceptTermsOfService"; + id: TypeDataJSON; + fromReader(reader: Reader): AcceptTermsOfService; + } + + export interface GetDeepLinkInfoArgs { + /** Path in t.me/path */ + path: string; + } + + /** Get info about a t.me link
*/ + export class GetDeepLinkInfo extends Request,help.TypeDeepLinkInfo> implements GetDeepLinkInfoArgs { + CONSTRUCTOR_id: 1072547679; + SUBCLASS_OF_ID: 2555030584; + classType: "request"; + className: "help.GetDeepLinkInfo"; + path: string; + fromReader(reader: Reader): GetDeepLinkInfo; + } + + /** + * Get app-specific configuration, see client configuration for more info on the result.
+ * @link https://corefork.telegram.org/api/config + */ + export class GetAppConfig extends Request,TypeJSONValue> { + CONSTRUCTOR_id: -1735311088; + SUBCLASS_OF_ID: 3952707507; + classType: "request"; + className: "help.GetAppConfig"; + fromReader(reader: Reader): GetAppConfig; + } + + export interface SaveAppLogArgs { + /** List of input events */ + events: TypeInputAppEvent[]; + } + + /** Saves logs of application on the server.
*/ + export class SaveAppLog extends Request,Bool> implements SaveAppLogArgs { + CONSTRUCTOR_id: 1862465352; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "help.SaveAppLog"; + events: TypeInputAppEvent[]; + fromReader(reader: Reader): SaveAppLog; + } + + export interface GetPassportConfigArgs { + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get passport configuration
+ * @link https://corefork.telegram.org/api/offsets + * @link https://corefork.telegram.org/passport + */ + export class GetPassportConfig extends Request,help.TypePassportConfig> implements GetPassportConfigArgs { + CONSTRUCTOR_id: -966677240; + SUBCLASS_OF_ID: 3328622765; + classType: "request"; + className: "help.GetPassportConfig"; + hash: int; + fromReader(reader: Reader): GetPassportConfig; + } + + /** + * Get localized name of the telegram support user
+ * @throws {{code:403,type:"USER_INVALID"}} Invalid user provided. + */ + export class GetSupportName extends Request,help.TypeSupportName> { + CONSTRUCTOR_id: -748624084; + SUBCLASS_OF_ID: 2135996354; + classType: "request"; + className: "help.GetSupportName"; + fromReader(reader: Reader): GetSupportName; + } + + export interface GetUserInfoArgs { + /** User ID */ + userId: TypeInputUser; + } + + /** + * Internal use
+ * @throws {{code:403,type:"USER_INVALID"}} Invalid user provided. + */ + export class GetUserInfo extends Request,help.TypeUserInfo> implements GetUserInfoArgs { + CONSTRUCTOR_id: 59377875; + SUBCLASS_OF_ID: 1548998616; + classType: "request"; + className: "help.GetUserInfo"; + userId: TypeInputUser; + fromReader(reader: Reader): GetUserInfo; + } + + export interface EditUserInfoArgs { + /** User */ + userId: TypeInputUser; + /** Message */ + message: string; + /** Message entities for styled text */ + entities: TypeMessageEntity[]; + } + + /** + * Internal use
+ * @link https://corefork.telegram.org/api/entities + * @throws {{code:400,type:"USER_INVALID"}} Invalid user provided. + */ + export class EditUserInfo extends Request,help.TypeUserInfo> implements EditUserInfoArgs { + CONSTRUCTOR_id: 1723407216; + SUBCLASS_OF_ID: 1548998616; + classType: "request"; + className: "help.EditUserInfo"; + userId: TypeInputUser; + message: string; + entities: TypeMessageEntity[]; + fromReader(reader: Reader): EditUserInfo; + } + + /** Get MTProxy/Public Service Announcement information
*/ + export class GetPromoData extends Request,help.TypePromoData> { + CONSTRUCTOR_id: -1063816159; + SUBCLASS_OF_ID: 2639877442; + classType: "request"; + className: "help.GetPromoData"; + fromReader(reader: Reader): GetPromoData; + } + + export interface HidePromoDataArgs { + /** Peer to hide */ + peer: EntityLike; + } + + /** Hide MTProxy/Public Service Announcement information
*/ + export class HidePromoData extends Request,Bool> implements HidePromoDataArgs { + CONSTRUCTOR_id: 505748629; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "help.HidePromoData"; + peer: EntityLike; + fromReader(reader: Reader): HidePromoData; + } + + export interface DismissSuggestionArgs { + /** In the case of pending suggestions in channels, the channel ID. */ + peer: EntityLike; + /** Suggestion, see here for more info ». */ + suggestion: string; + } + + /** + * Dismiss a suggestion, see here for more info ».
+ * @link https://corefork.telegram.org/constructor/channelFull + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/config + */ + export class DismissSuggestion extends Request,Bool> implements DismissSuggestionArgs { + CONSTRUCTOR_id: -183649631; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "help.DismissSuggestion"; + peer: EntityLike; + suggestion: string; + fromReader(reader: Reader): DismissSuggestion; + } + + export interface GetCountriesListArgs { + /** Language code of the current user */ + langCode: string; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get name, ISO code, localized name and phone codes/patterns of all available countries
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetCountriesList extends Request,help.TypeCountriesList> implements GetCountriesListArgs { + CONSTRUCTOR_id: 1935116200; + SUBCLASS_OF_ID: 3929144968; + classType: "request"; + className: "help.GetCountriesList"; + langCode: string; + hash: int; + fromReader(reader: Reader): GetCountriesList; + } + + type TypeAppUpdate = AppUpdate | NoAppUpdate; + type TypeInviteText = InviteText; + type TypeSupport = Support; + type TypeTermsOfService = TermsOfService; + type TypeRecentMeUrls = RecentMeUrls; + type TypeTermsOfServiceUpdate = TermsOfServiceUpdateEmpty | TermsOfServiceUpdate; + type TypeDeepLinkInfo = DeepLinkInfoEmpty | DeepLinkInfo; + type TypePassportConfig = PassportConfigNotModified | PassportConfig; + type TypeSupportName = SupportName; + type TypeUserInfo = UserInfoEmpty | UserInfo; + type TypePromoData = PromoDataEmpty | PromoData; + type TypeCountryCode = CountryCode; + type TypeCountry = Country; + type TypeCountriesList = CountriesListNotModified | CountriesList; + } + + namespace account { + export interface PrivacyRulesArgs { + /** Privacy rules */ + rules: TypePrivacyRule[]; + /** Chats to which the rules apply */ + chats: TypeChat[]; + /** Users to which the rules apply */ + users: TypeUser[]; + } + + /** Privacy rules
*/ + export class PrivacyRules extends VirtualClass implements PrivacyRulesArgs { + CONSTRUCTOR_id: 1352683077; + SUBCLASS_OF_ID: 3042622082; + classType: "constructor"; + className: "account.PrivacyRules"; + rules: TypePrivacyRule[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): PrivacyRules; + } + + export interface AuthorizationsArgs { + /** Logged-in sessions */ + authorizations: TypeAuthorization[]; + } + + /** Logged-in sessions
*/ + export class Authorizations extends VirtualClass implements AuthorizationsArgs { + CONSTRUCTOR_id: 307276766; + SUBCLASS_OF_ID: 200663295; + classType: "constructor"; + className: "account.Authorizations"; + authorizations: TypeAuthorization[]; + fromReader(reader: Reader): Authorizations; + } + + export interface PasswordArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the user has a recovery method configured */ + hasRecovery?: true; + /** Whether telegram passport is enabled */ + hasSecureValues?: true; + /** Whether the user has a password */ + hasPassword?: true; + /** The KDF algorithm for SRP two-factor authentication of the current password */ + currentAlgo?: TypePasswordKdfAlgo; + /** Srp B param for SRP authorization */ + srpB?: bytes; + /** Srp ID param for SRP authorization */ + srpId?: long; + /** Text hint for the password */ + hint?: string; + /** A password recovery email with the specified pattern is still awaiting verification */ + emailUnconfirmedPattern?: string; + /** The KDF algorithm for SRP two-factor authentication to use when creating new passwords */ + newAlgo: TypePasswordKdfAlgo; + /** The KDF algorithm for telegram passport */ + newSecureAlgo: TypeSecurePasswordKdfAlgo; + /** Secure random string */ + secureRandom: bytes; + /** The 2FA password will be automatically removed at this date, unless the user cancels the operation */ + pendingResetDate?: int; + } + + /** + * Configuration for two-factor authorization
+ * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/api/srp + * @link https://corefork.telegram.org/api/pattern + */ + export class Password extends VirtualClass implements PasswordArgs { + CONSTRUCTOR_id: 408623183; + SUBCLASS_OF_ID: 1403130275; + classType: "constructor"; + className: "account.Password"; + flags: number; + hasRecovery?: true; + hasSecureValues?: true; + hasPassword?: true; + currentAlgo?: TypePasswordKdfAlgo; + srpB?: bytes; + srpId?: long; + hint?: string; + emailUnconfirmedPattern?: string; + newAlgo: TypePasswordKdfAlgo; + newSecureAlgo: TypeSecurePasswordKdfAlgo; + secureRandom: bytes; + pendingResetDate?: int; + fromReader(reader: Reader): Password; + } + + export interface PasswordSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** 2FA Recovery email */ + email?: string; + /** Telegram passport settings */ + secureSettings?: TypeSecureSecretSettings; + } + + /** + * Private info associated to the password info (recovery email, telegram passport info & so on)
+ * @link https://corefork.telegram.org/api/srp + * @link https://corefork.telegram.org/passport + */ + export class PasswordSettings extends VirtualClass implements PasswordSettingsArgs { + CONSTRUCTOR_id: -1705233435; + SUBCLASS_OF_ID: 3527389304; + classType: "constructor"; + className: "account.PasswordSettings"; + flags: number; + email?: string; + secureSettings?: TypeSecureSecretSettings; + fromReader(reader: Reader): PasswordSettings; + } + + export interface PasswordInputSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The SRP algorithm to use */ + newAlgo?: TypePasswordKdfAlgo; + /** The computed password hash */ + newPasswordHash?: bytes; + /** Text hint for the password */ + hint?: string; + /** Password recovery email */ + email?: string; + /** Telegram passport settings */ + newSecureSettings?: TypeSecureSecretSettings; + } + + /** + * Settings for setting up a new password
+ * @link https://corefork.telegram.org/api/srp + * @link https://corefork.telegram.org/passport + */ + export class PasswordInputSettings extends VirtualClass implements PasswordInputSettingsArgs { + CONSTRUCTOR_id: -1036572727; + SUBCLASS_OF_ID: 205679782; + classType: "constructor"; + className: "account.PasswordInputSettings"; + flags: number; + newAlgo?: TypePasswordKdfAlgo; + newPasswordHash?: bytes; + hint?: string; + email?: string; + newSecureSettings?: TypeSecureSecretSettings; + fromReader(reader: Reader): PasswordInputSettings; + } + + export interface TmpPasswordArgs { + /** Temporary password */ + tmpPassword: bytes; + /** Validity period */ + validUntil: int; + } + + /** Temporary payment password
*/ + export class TmpPassword extends VirtualClass implements TmpPasswordArgs { + CONSTRUCTOR_id: -614138572; + SUBCLASS_OF_ID: 2959382829; + classType: "constructor"; + className: "account.TmpPassword"; + tmpPassword: bytes; + validUntil: int; + fromReader(reader: Reader): TmpPassword; + } + + export interface WebAuthorizationsArgs { + /** Web authorization list */ + authorizations: TypeWebAuthorization[]; + /** Users */ + users: TypeUser[]; + } + + /** Web authorizations
*/ + export class WebAuthorizations extends VirtualClass implements WebAuthorizationsArgs { + CONSTRUCTOR_id: -313079300; + SUBCLASS_OF_ID: 2587253554; + classType: "constructor"; + className: "account.WebAuthorizations"; + authorizations: TypeWebAuthorization[]; + users: TypeUser[]; + fromReader(reader: Reader): WebAuthorizations; + } + + export interface AuthorizationFormArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Required Telegram Passport documents */ + requiredTypes: TypeSecureRequiredType[]; + /** Already submitted Telegram Passport documents */ + values: TypeSecureValue[]; + /** Telegram Passport errors */ + errors: TypeSecureValueError[]; + /** Info about the bot to which the form will be submitted */ + users: TypeUser[]; + /** URL of the service's privacy policy */ + privacyPolicyUrl?: string; + } + + /** + * Telegram Passport authorization form
+ * @link https://corefork.telegram.org/passport + */ + export class AuthorizationForm extends VirtualClass implements AuthorizationFormArgs { + CONSTRUCTOR_id: -1389486888; + SUBCLASS_OF_ID: 2013567636; + classType: "constructor"; + className: "account.AuthorizationForm"; + flags: number; + requiredTypes: TypeSecureRequiredType[]; + values: TypeSecureValue[]; + errors: TypeSecureValueError[]; + users: TypeUser[]; + privacyPolicyUrl?: string; + fromReader(reader: Reader): AuthorizationForm; + } + + export interface SentEmailCodeArgs { + /** The email (to which the code was sent) must match this pattern */ + emailPattern: string; + /** The length of the verification code */ + length: int; + } + + /** + * The sent email code
+ * @link https://corefork.telegram.org/api/pattern + */ + export class SentEmailCode extends VirtualClass implements SentEmailCodeArgs { + CONSTRUCTOR_id: -2128640689; + SUBCLASS_OF_ID: 1777582190; + classType: "constructor"; + className: "account.SentEmailCode"; + emailPattern: string; + length: int; + fromReader(reader: Reader): SentEmailCode; + } + + export interface TakeoutArgs { + /** Takeout ID */ + id: long; + } + + /** Takout info
*/ + export class Takeout extends VirtualClass implements TakeoutArgs { + CONSTRUCTOR_id: 1304052993; + SUBCLASS_OF_ID: 2218704517; + classType: "constructor"; + className: "account.Takeout"; + id: long; + fromReader(reader: Reader): Takeout; + } + + /** No new wallpapers were found
*/ + export class WallPapersNotModified extends VirtualClass { + CONSTRUCTOR_id: 471437699; + SUBCLASS_OF_ID: 2730838269; + classType: "constructor"; + className: "account.WallPapersNotModified"; + fromReader(reader: Reader): WallPapersNotModified; + } + + export interface WallPapersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + /** Wallpapers */ + wallpapers: TypeWallPaper[]; + } + + /** + * Installed wallpapers
+ * @link https://corefork.telegram.org/api/offsets + */ + export class WallPapers extends VirtualClass implements WallPapersArgs { + CONSTRUCTOR_id: 1881892265; + SUBCLASS_OF_ID: 2730838269; + classType: "constructor"; + className: "account.WallPapers"; + hash: int; + wallpapers: TypeWallPaper[]; + fromReader(reader: Reader): WallPapers; + } + + export interface AutoDownloadSettingsArgs { + /** Low data usage preset */ + low: TypeAutoDownloadSettings; + /** Medium data usage preset */ + medium: TypeAutoDownloadSettings; + /** High data usage preset */ + high: TypeAutoDownloadSettings; + } + + /** Media autodownload settings
*/ + export class AutoDownloadSettings extends VirtualClass implements AutoDownloadSettingsArgs { + CONSTRUCTOR_id: 1674235686; + SUBCLASS_OF_ID: 800610593; + classType: "constructor"; + className: "account.AutoDownloadSettings"; + low: TypeAutoDownloadSettings; + medium: TypeAutoDownloadSettings; + high: TypeAutoDownloadSettings; + fromReader(reader: Reader): AutoDownloadSettings; + } + + /** No new themes were installed
*/ + export class ThemesNotModified extends VirtualClass { + CONSTRUCTOR_id: -199313886; + SUBCLASS_OF_ID: 2143625732; + classType: "constructor"; + className: "account.ThemesNotModified"; + fromReader(reader: Reader): ThemesNotModified; + } + + export interface ThemesArgs { + /** Hash for pagination, for more info click here */ + hash: int; + /** Themes */ + themes: TypeTheme[]; + } + + /** + * Installed themes
+ * @link https://corefork.telegram.org/api/offsets + */ + export class Themes extends VirtualClass implements ThemesArgs { + CONSTRUCTOR_id: 2137482273; + SUBCLASS_OF_ID: 2143625732; + classType: "constructor"; + className: "account.Themes"; + hash: int; + themes: TypeTheme[]; + fromReader(reader: Reader): Themes; + } + + export interface ContentSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether viewing of sensitive (NSFW) content is enabled */ + sensitiveEnabled?: true; + /** Whether the current client can change the sensitive content settings to view NSFW content */ + sensitiveCanChange?: true; + } + + /** Sensitive content settings
*/ + export class ContentSettings extends VirtualClass implements ContentSettingsArgs { + CONSTRUCTOR_id: 1474462241; + SUBCLASS_OF_ID: 2923427985; + classType: "constructor"; + className: "account.ContentSettings"; + flags: number; + sensitiveEnabled?: true; + sensitiveCanChange?: true; + fromReader(reader: Reader): ContentSettings; + } + + export interface ResetPasswordFailedWaitArgs { + /** Wait until this date before requesting another reset. */ + retryDate: int; + } + + /** You recently requested a password reset that was canceled, please wait until the specified date before requesting another reset.
*/ + export class ResetPasswordFailedWait extends VirtualClass implements ResetPasswordFailedWaitArgs { + CONSTRUCTOR_id: -478701471; + SUBCLASS_OF_ID: 1230009366; + classType: "constructor"; + className: "account.ResetPasswordFailedWait"; + retryDate: int; + fromReader(reader: Reader): ResetPasswordFailedWait; + } + + export interface ResetPasswordRequestedWaitArgs { + /** Wait until this date before finalizing the reset. */ + untilDate: int; + } + + /** You successfully requested a password reset, please wait until the specified date before finalizing the reset.
*/ + export class ResetPasswordRequestedWait extends VirtualClass implements ResetPasswordRequestedWaitArgs { + CONSTRUCTOR_id: -370148227; + SUBCLASS_OF_ID: 1230009366; + classType: "constructor"; + className: "account.ResetPasswordRequestedWait"; + untilDate: int; + fromReader(reader: Reader): ResetPasswordRequestedWait; + } + + /** The 2FA password was reset successfully.
*/ + export class ResetPasswordOk extends VirtualClass { + CONSTRUCTOR_id: -383330754; + SUBCLASS_OF_ID: 1230009366; + classType: "constructor"; + className: "account.ResetPasswordOk"; + fromReader(reader: Reader): ResetPasswordOk; + } + + export interface RegisterDeviceArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Avoid receiving (silent and invisible background) notifications. Useful to save battery. */ + noMuted?: true; + /** Device token type.
Possible values:
1 - APNS (device token for apple push)
2 - FCM (firebase token for google firebase)
3 - MPNS (channel URI for microsoft push)
4 - Simple push (endpoint for firefox's simple push API)
5 - Ubuntu phone (token for ubuntu push)
6 - Blackberry (token for blackberry push)
7 - Unused
8 - WNS (windows push)
9 - APNS VoIP (token for apple push VoIP)
10 - Web push (web push, see below)
11 - MPNS VoIP (token for microsoft push VoIP)
12 - Tizen (token for tizen push)

For 10 web push, the token must be a JSON-encoded object containing the keys described in PUSH updates */ + tokenType: int; + /** Device token */ + token: string; + /** If (boolTrue) is transmitted, a sandbox-certificate will be used during transmission. */ + appSandbox: Bool; + /** For FCM and APNS VoIP, optional encryption key used to encrypt push notifications */ + secret: bytes; + /** List of user identifiers of other users currently using the client */ + otherUids: int[]; + } + + /** + * Register device to receive PUSH notifications
+ * @link https://corefork.telegram.org/api/push-updates + * @link https://corefork.telegram.org/constructor/boolTrue + * @throws {{code:400,type:"TOKEN_INVALID"}} The provided token is invalid. + * @throws {{code:400,type:"WEBPUSH_AUTH_INVALID"}} The specified web push authentication secret is invalid. + * @throws {{code:400,type:"WEBPUSH_KEY_INVALID"}} The specified web push elliptic curve Diffie-Hellman public key is invalid. + * @throws {{code:400,type:"WEBPUSH_TOKEN_INVALID"}} The specified web push token is invalid. + */ + export class RegisterDevice extends Request,Bool> implements RegisterDeviceArgs { + CONSTRUCTOR_id: 1754754159; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.RegisterDevice"; + flags: number; + noMuted?: true; + tokenType: int; + token: string; + appSandbox: Bool; + secret: bytes; + otherUids: int[]; + fromReader(reader: Reader): RegisterDevice; + } + + export interface UnregisterDeviceArgs { + /** Device token type.
Possible values:
1 - APNS (device token for apple push)
2 - FCM (firebase token for google firebase)
3 - MPNS (channel URI for microsoft push)
4 - Simple push (endpoint for firefox's simple push API)
5 - Ubuntu phone (token for ubuntu push)
6 - Blackberry (token for blackberry push)
7 - Unused
8 - WNS (windows push)
9 - APNS VoIP (token for apple push VoIP)
10 - Web push (web push, see below)
11 - MPNS VoIP (token for microsoft push VoIP)
12 - Tizen (token for tizen push)

For 10 web push, the token must be a JSON-encoded object containing the keys described in PUSH updates */ + tokenType: int; + /** Device token */ + token: string; + /** List of user identifiers of other users currently using the client */ + otherUids: int[]; + } + + /** + * Deletes a device by its token, stops sending PUSH-notifications to it.
+ * @link https://corefork.telegram.org/api/push-updates + * @throws {{code:400,type:"TOKEN_INVALID"}} The provided token is invalid. + */ + export class UnregisterDevice extends Request,Bool> implements UnregisterDeviceArgs { + CONSTRUCTOR_id: 813089983; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.UnregisterDevice"; + tokenType: int; + token: string; + otherUids: int[]; + fromReader(reader: Reader): UnregisterDevice; + } + + export interface UpdateNotifySettingsArgs { + /** Notification source */ + peer: TypeInputNotifyPeer; + /** Notification settings */ + settings: TypeInputPeerNotifySettings; + } + + /** + * Edits notification settings from a given user/group, from all users/all groups.
+ * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"SETTINGS_INVALID"}} Invalid settings were provided. + */ + export class UpdateNotifySettings extends Request,Bool> implements UpdateNotifySettingsArgs { + CONSTRUCTOR_id: -2067899501; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.UpdateNotifySettings"; + peer: TypeInputNotifyPeer; + settings: TypeInputPeerNotifySettings; + fromReader(reader: Reader): UpdateNotifySettings; + } + + export interface GetNotifySettingsArgs { + /** Notification source */ + peer: TypeInputNotifyPeer; + } + + /** + * Gets current notification settings for a given user/group, from all users/all groups.
+ * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class GetNotifySettings extends Request,TypePeerNotifySettings> implements GetNotifySettingsArgs { + CONSTRUCTOR_id: 313765169; + SUBCLASS_OF_ID: 3475030132; + classType: "request"; + className: "account.GetNotifySettings"; + peer: TypeInputNotifyPeer; + fromReader(reader: Reader): GetNotifySettings; + } + + /** Resets all notification settings from users and groups.
*/ + export class ResetNotifySettings extends Request,Bool> { + CONSTRUCTOR_id: -612493497; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.ResetNotifySettings"; + fromReader(reader: Reader): ResetNotifySettings; + } + + export interface UpdateProfileArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** New user first name */ + firstName?: string; + /** New user last name */ + lastName?: string; + /** New bio */ + about?: string; + } + + /** + * Updates user profile.
+ * @throws {{code:400,type:"ABOUT_TOO_LONG"}} About string too long. + * @throws {{code:400,type:"FIRSTNAME_INVALID"}} The first name is invalid. + */ + export class UpdateProfile extends Request,TypeUser> implements UpdateProfileArgs { + CONSTRUCTOR_id: 2018596725; + SUBCLASS_OF_ID: 765557111; + classType: "request"; + className: "account.UpdateProfile"; + flags: number; + firstName?: string; + lastName?: string; + about?: string; + fromReader(reader: Reader): UpdateProfile; + } + + export interface UpdateStatusArgs { + /** If (boolTrue) is transmitted, user status will change to (userStatusOffline). */ + offline: Bool; + } + + /** + * Updates online user status.
+ * @link https://corefork.telegram.org/constructor/boolTrue + * @link https://corefork.telegram.org/constructor/userStatusOffline + */ + export class UpdateStatus extends Request,Bool> implements UpdateStatusArgs { + CONSTRUCTOR_id: 1713919532; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.UpdateStatus"; + offline: Bool; + fromReader(reader: Reader): UpdateStatus; + } + + export interface GetWallPapersArgs { + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Returns a list of available wallpapers.
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetWallPapers extends Request,account.TypeWallPapers> implements GetWallPapersArgs { + CONSTRUCTOR_id: -1430579357; + SUBCLASS_OF_ID: 2730838269; + classType: "request"; + className: "account.GetWallPapers"; + hash: int; + fromReader(reader: Reader): GetWallPapers; + } + + export interface ReportPeerArgs { + /** The peer to report */ + peer: EntityLike; + /** The reason why this peer is being reported */ + reason: TypeReportReason; + /** Comment for report moderation */ + message: string; + } + + /** + * Report a peer for violation of telegram's Terms of Service
+ * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + */ + export class ReportPeer extends Request,Bool> implements ReportPeerArgs { + CONSTRUCTOR_id: -977650298; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.ReportPeer"; + peer: EntityLike; + reason: TypeReportReason; + message: string; + fromReader(reader: Reader): ReportPeer; + } + + export interface CheckUsernameArgs { + /** username
Accepted characters: A-z (case-insensitive), 0-9 and underscores.
Length: 5-32 characters. */ + username: string; + } + + /** + * Validates a username and checks availability.
+ * @throws {{code:400,type:"USERNAME_INVALID"}} Unacceptable username. + */ + export class CheckUsername extends Request,Bool> implements CheckUsernameArgs { + CONSTRUCTOR_id: 655677548; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.CheckUsername"; + username: string; + fromReader(reader: Reader): CheckUsername; + } + + export interface UpdateUsernameArgs { + /** username or empty string if username is to be removed
Accepted characters: a-z (case-insensitive), 0-9 and underscores.
Length: 5-32 characters. */ + username: string; + } + + /** + * Changes username for the current user.
+ * @throws {{code:401,type:"AUTH_KEY_PERM_EMPTY"}} The temporary auth key must be binded to the permanent auth key to use these methods. + * @throws {{code:400,type:"USERNAME_INVALID"}} Unacceptable username. + * @throws {{code:400,type:"USERNAME_NOT_MODIFIED"}} Username is not different from the current username. + * @throws {{code:400,type:"USERNAME_OCCUPIED"}} Username is taken. + */ + export class UpdateUsername extends Request,TypeUser> implements UpdateUsernameArgs { + CONSTRUCTOR_id: 1040964988; + SUBCLASS_OF_ID: 765557111; + classType: "request"; + className: "account.UpdateUsername"; + username: string; + fromReader(reader: Reader): UpdateUsername; + } + + export interface GetPrivacyArgs { + /** Peer category whose privacy settings should be fetched */ + key: TypeInputPrivacyKey; + } + + /** + * Get privacy settings of current account
+ * @throws {{code:400,type:"PRIVACY_KEY_INVALID"}} The privacy key is invalid. + */ + export class GetPrivacy extends Request,account.TypePrivacyRules> implements GetPrivacyArgs { + CONSTRUCTOR_id: -623130288; + SUBCLASS_OF_ID: 3042622082; + classType: "request"; + className: "account.GetPrivacy"; + key: TypeInputPrivacyKey; + fromReader(reader: Reader): GetPrivacy; + } + + export interface SetPrivacyArgs { + /** Peers to which the privacy rules apply */ + key: TypeInputPrivacyKey; + /** New privacy rules */ + rules: TypeInputPrivacyRule[]; + } + + /** + * Change privacy settings of current account
+ * @throws {{code:400,type:"PRIVACY_KEY_INVALID"}} The privacy key is invalid. + * @throws {{code:400,type:"PRIVACY_TOO_LONG"}} Too many privacy rules were specified, the current limit is 1000. + * @throws {{code:400,type:"PRIVACY_VALUE_INVALID"}} The specified privacy rule combination is invalid. + */ + export class SetPrivacy extends Request,account.TypePrivacyRules> implements SetPrivacyArgs { + CONSTRUCTOR_id: -906486552; + SUBCLASS_OF_ID: 3042622082; + classType: "request"; + className: "account.SetPrivacy"; + key: TypeInputPrivacyKey; + rules: TypeInputPrivacyRule[]; + fromReader(reader: Reader): SetPrivacy; + } + + export interface DeleteAccountArgs { + /** Why is the account being deleted, can be empty */ + reason: string; + } + + /** + * Delete the user's account from the telegram servers. Can be used, for example, to delete the account of a user that provided the login code, but forgot the 2FA password and no recovery method is configured.
+ * @link https://corefork.telegram.org/api/srp + * @throws {{code:420,type:"2FA_CONFIRM_WAIT_X"}} Since this account is active and protected by a 2FA password, we will delete it in 1 week for security purposes. You can cancel this process at any time, you'll be able to reset your account in X seconds. + */ + export class DeleteAccount extends Request,Bool> implements DeleteAccountArgs { + CONSTRUCTOR_id: 1099779595; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.DeleteAccount"; + reason: string; + fromReader(reader: Reader): DeleteAccount; + } + + /** Get days to live of account
*/ + export class GetAccountTTL extends Request,TypeAccountDaysTTL> { + CONSTRUCTOR_id: 150761757; + SUBCLASS_OF_ID: 3131284872; + classType: "request"; + className: "account.GetAccountTTL"; + fromReader(reader: Reader): GetAccountTTL; + } + + export interface SetAccountTTLArgs { + /** Time to live in days */ + ttl: TypeAccountDaysTTL; + } + + /** + * Set account self-destruction period
+ * @throws {{code:400,type:"TTL_DAYS_INVALID"}} The provided TTL is invalid. + */ + export class SetAccountTTL extends Request,Bool> implements SetAccountTTLArgs { + CONSTRUCTOR_id: 608323678; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.SetAccountTTL"; + ttl: TypeAccountDaysTTL; + fromReader(reader: Reader): SetAccountTTL; + } + + export interface SendChangePhoneCodeArgs { + /** New phone number */ + phoneNumber: string; + /** Phone code settings */ + settings: TypeCodeSettings; + } + + /** + * Verify a new phone number to associate to the current account
+ * @throws {{code:406,type:"FRESH_CHANGE_PHONE_FORBIDDEN"}} You can't change phone number right after logging in, please wait at least 24 hours. + * @throws {{code:400,type:"PHONE_NUMBER_BANNED"}} The provided phone number is banned from telegram. + * @throws {{code:400,type:"PHONE_NUMBER_INVALID"}} The phone number is invalid. + * @throws {{code:400,type:"PHONE_NUMBER_OCCUPIED"}} The phone number is already in use. + */ + export class SendChangePhoneCode extends Request,auth.TypeSentCode> implements SendChangePhoneCodeArgs { + CONSTRUCTOR_id: -2108208411; + SUBCLASS_OF_ID: 1827172481; + classType: "request"; + className: "account.SendChangePhoneCode"; + phoneNumber: string; + settings: TypeCodeSettings; + fromReader(reader: Reader): SendChangePhoneCode; + } + + export interface ChangePhoneArgs { + /** New phone number */ + phoneNumber: string; + /** Phone code hash received when calling account.sendChangePhoneCode */ + phoneCodeHash: string; + /** Phone code received when calling account.sendChangePhoneCode */ + phoneCode: string; + } + + /** + * Change the phone number of the current account
+ * @link https://corefork.telegram.org/method/account.sendChangePhoneCode + * @throws {{code:400,type:"PHONE_CODE_EMPTY"}} phone_code is missing. + * @throws {{code:400,type:"PHONE_NUMBER_INVALID"}} The phone number is invalid. + * @throws {{code:400,type:"PHONE_NUMBER_OCCUPIED"}} The phone number is already in use. + */ + export class ChangePhone extends Request,TypeUser> implements ChangePhoneArgs { + CONSTRUCTOR_id: 1891839707; + SUBCLASS_OF_ID: 765557111; + classType: "request"; + className: "account.ChangePhone"; + phoneNumber: string; + phoneCodeHash: string; + phoneCode: string; + fromReader(reader: Reader): ChangePhone; + } + + export interface UpdateDeviceLockedArgs { + /** Inactivity period after which to start hiding message texts in PUSH notifications. */ + period: int; + } + + /** + * When client-side passcode lock feature is enabled, will not show message texts in incoming PUSH notifications.
+ * @link https://corefork.telegram.org/api/push-updates + */ + export class UpdateDeviceLocked extends Request,Bool> implements UpdateDeviceLockedArgs { + CONSTRUCTOR_id: 954152242; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.UpdateDeviceLocked"; + period: int; + fromReader(reader: Reader): UpdateDeviceLocked; + } + + /** Get logged-in sessions
*/ + export class GetAuthorizations extends Request,account.TypeAuthorizations> { + CONSTRUCTOR_id: -484392616; + SUBCLASS_OF_ID: 200663295; + classType: "request"; + className: "account.GetAuthorizations"; + fromReader(reader: Reader): GetAuthorizations; + } + + export interface ResetAuthorizationArgs { + /** Session hash */ + hash: long; + } + + /** + * Log out an active authorized session by its hash
+ * @link https://corefork.telegram.org/api/auth + * @throws {{code:406,type:"FRESH_RESET_AUTHORISATION_FORBIDDEN"}} You can't logout other sessions if less than 24 hours have passed since you logged on the current session. + * @throws {{code:400,type:"HASH_INVALID"}} The provided hash is invalid. + */ + export class ResetAuthorization extends Request,Bool> implements ResetAuthorizationArgs { + CONSTRUCTOR_id: -545786948; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.ResetAuthorization"; + hash: long; + fromReader(reader: Reader): ResetAuthorization; + } + + /** Obtain configuration for two-factor authorization with password
*/ + export class GetPassword extends Request,account.TypePassword> { + CONSTRUCTOR_id: 1418342645; + SUBCLASS_OF_ID: 1403130275; + classType: "request"; + className: "account.GetPassword"; + fromReader(reader: Reader): GetPassword; + } + + export interface GetPasswordSettingsArgs { + /** The password (see SRP) */ + password: TypeInputCheckPasswordSRP; + } + + /** + * Get private info associated to the password info (recovery email, telegram passport info & so on)
+ * @link https://corefork.telegram.org/api/srp + * @link https://corefork.telegram.org/passport + * @throws {{code:400,type:"PASSWORD_HASH_INVALID"}} The provided password hash is invalid. + */ + export class GetPasswordSettings extends Request,account.TypePasswordSettings> implements GetPasswordSettingsArgs { + CONSTRUCTOR_id: -1663767815; + SUBCLASS_OF_ID: 3527389304; + classType: "request"; + className: "account.GetPasswordSettings"; + password: TypeInputCheckPasswordSRP; + fromReader(reader: Reader): GetPasswordSettings; + } + + export interface UpdatePasswordSettingsArgs { + /** The old password (see SRP) */ + password: TypeInputCheckPasswordSRP; + /** The new password (see SRP) */ + newSettings: account.TypePasswordInputSettings; + } + + /** + * Set a new 2FA password
+ * @link https://corefork.telegram.org/api/srp + * @link https://corefork.telegram.org/method/account.verifyEmail + * @link https://corefork.telegram.org/passport + * @throws {{code:400,type:"EMAIL_UNCONFIRMED"}} Email unconfirmed. + * @throws {{code:400,type:"EMAIL_UNCONFIRMED_X"}} The provided email isn't confirmed, X is the length of the verification code that was just sent to the email: use account.verifyEmail to enter the received verification code and enable the recovery email. + * @throws {{code:400,type:"NEW_SALT_INVALID"}} The new salt is invalid. + * @throws {{code:400,type:"NEW_SETTINGS_INVALID"}} The new password settings are invalid. + * @throws {{code:400,type:"PASSWORD_HASH_INVALID"}} The old password hash is invalid. + * @throws {{code:400,type:"SRP_ID_INVALID"}} Invalid SRP ID provided. + * @throws {{code:400,type:"SRP_PASSWORD_CHANGED"}} Password has changed. + */ + export class UpdatePasswordSettings extends Request,Bool> implements UpdatePasswordSettingsArgs { + CONSTRUCTOR_id: -1516564433; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.UpdatePasswordSettings"; + password: TypeInputCheckPasswordSRP; + newSettings: account.TypePasswordInputSettings; + fromReader(reader: Reader): UpdatePasswordSettings; + } + + export interface SendConfirmPhoneCodeArgs { + /** The hash from the service notification, for more info click here » */ + hash: string; + /** Phone code settings */ + settings: TypeCodeSettings; + } + + /** + * Send confirmation code to cancel account deletion, for more info click here »
+ * @link https://corefork.telegram.org/api/account-deletion + * @throws {{code:400,type:"HASH_INVALID"}} The provided hash is invalid. + */ + export class SendConfirmPhoneCode extends Request,auth.TypeSentCode> implements SendConfirmPhoneCodeArgs { + CONSTRUCTOR_id: 457157256; + SUBCLASS_OF_ID: 1827172481; + classType: "request"; + className: "account.SendConfirmPhoneCode"; + hash: string; + settings: TypeCodeSettings; + fromReader(reader: Reader): SendConfirmPhoneCode; + } + + export interface ConfirmPhoneArgs { + /** Phone code hash, for more info click here » */ + phoneCodeHash: string; + /** SMS code, for more info click here » */ + phoneCode: string; + } + + /** + * Confirm a phone number to cancel account deletion, for more info click here »
+ * @link https://corefork.telegram.org/api/account-deletion + * @throws {{code:400,type:"CODE_HASH_INVALID"}} Code hash invalid. + * @throws {{code:400,type:"PHONE_CODE_EMPTY"}} phone_code is missing. + */ + export class ConfirmPhone extends Request,Bool> implements ConfirmPhoneArgs { + CONSTRUCTOR_id: 1596029123; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.ConfirmPhone"; + phoneCodeHash: string; + phoneCode: string; + fromReader(reader: Reader): ConfirmPhone; + } + + export interface GetTmpPasswordArgs { + /** SRP password parameters */ + password: TypeInputCheckPasswordSRP; + /** Time during which the temporary password will be valid, in seconds; should be between 60 and 86400 */ + period: int; + } + + /** + * Get temporary payment password
+ * @throws {{code:400,type:"PASSWORD_HASH_INVALID"}} The provided password hash is invalid. + * @throws {{code:400,type:"TMP_PASSWORD_DISABLED"}} The temporary password is disabled. + */ + export class GetTmpPassword extends Request,account.TypeTmpPassword> implements GetTmpPasswordArgs { + CONSTRUCTOR_id: 1151208273; + SUBCLASS_OF_ID: 2959382829; + classType: "request"; + className: "account.GetTmpPassword"; + password: TypeInputCheckPasswordSRP; + period: int; + fromReader(reader: Reader): GetTmpPassword; + } + + /** + * Get web login widget authorizations
+ * @link https://corefork.telegram.org/widgets/login + */ + export class GetWebAuthorizations extends Request,account.TypeWebAuthorizations> { + CONSTRUCTOR_id: 405695855; + SUBCLASS_OF_ID: 2587253554; + classType: "request"; + className: "account.GetWebAuthorizations"; + fromReader(reader: Reader): GetWebAuthorizations; + } + + export interface ResetWebAuthorizationArgs { + /** Session hash */ + hash: long; + } + + /** + * Log out an active web telegram login session
+ * @link https://corefork.telegram.org/constructor/webAuthorization + * @link https://corefork.telegram.org/widgets/login + * @link https://corefork.telegram.org/widgets/login + * @throws {{code:400,type:"HASH_INVALID"}} The provided hash is invalid. + */ + export class ResetWebAuthorization extends Request,Bool> implements ResetWebAuthorizationArgs { + CONSTRUCTOR_id: 755087855; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.ResetWebAuthorization"; + hash: long; + fromReader(reader: Reader): ResetWebAuthorization; + } + + /** + * Reset all active web telegram login sessions
+ * @link https://corefork.telegram.org/widgets/login + */ + export class ResetWebAuthorizations extends Request,Bool> { + CONSTRUCTOR_id: 1747789204; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.ResetWebAuthorizations"; + fromReader(reader: Reader): ResetWebAuthorizations; + } + + /** + * Get all saved Telegram Passport documents, for more info see the passport docs »
+ * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport/encryption + */ + export class GetAllSecureValues extends Request,TypeSecureValue[]> { + CONSTRUCTOR_id: -1299661699; + SUBCLASS_OF_ID: 3895345441; + classType: "request"; + className: "account.GetAllSecureValues"; + fromReader(reader: Reader): GetAllSecureValues; + } + + export interface GetSecureValueArgs { + /** Requested value types */ + types: TypeSecureValueType[]; + } + + /** + * Get saved Telegram Passport document, for more info see the passport docs »
+ * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport/encryption + */ + export class GetSecureValue extends Request,TypeSecureValue[]> implements GetSecureValueArgs { + CONSTRUCTOR_id: 1936088002; + SUBCLASS_OF_ID: 3895345441; + classType: "request"; + className: "account.GetSecureValue"; + types: TypeSecureValueType[]; + fromReader(reader: Reader): GetSecureValue; + } + + export interface SaveSecureValueArgs { + /** Secure value, for more info see the passport docs » */ + value: TypeInputSecureValue; + /** Passport secret hash, for more info see the passport docs » */ + secureSecretId: long; + } + + /** + * Securely save Telegram Passport document, for more info see the passport docs »
+ * @link https://corefork.telegram.org/passport/encryption + * @link https://corefork.telegram.org/passport + * @throws {{code:400,type:"PASSWORD_REQUIRED"}} A 2FA password must be configured to use Telegram Passport. + */ + export class SaveSecureValue extends Request,TypeSecureValue> implements SaveSecureValueArgs { + CONSTRUCTOR_id: -1986010339; + SUBCLASS_OF_ID: 85014702; + classType: "request"; + className: "account.SaveSecureValue"; + value: TypeInputSecureValue; + secureSecretId: long; + fromReader(reader: Reader): SaveSecureValue; + } + + export interface DeleteSecureValueArgs { + /** Document types to delete */ + types: TypeSecureValueType[]; + } + + /** + * Delete stored Telegram Passport documents, for more info see the passport docs »
+ * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport/encryption + */ + export class DeleteSecureValue extends Request,Bool> implements DeleteSecureValueArgs { + CONSTRUCTOR_id: -1199522741; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.DeleteSecureValue"; + types: TypeSecureValueType[]; + fromReader(reader: Reader): DeleteSecureValue; + } + + export interface GetAuthorizationFormArgs { + /** User identifier of the service's bot */ + botId: int; + /** Telegram Passport element types requested by the service */ + scope: string; + /** Service's public key */ + publicKey: string; + } + + /** + * Returns a Telegram Passport authorization form for sharing data with a service
+ * @throws {{code:400,type:"PUBLIC_KEY_REQUIRED"}} A public key is required. + */ + export class GetAuthorizationForm extends Request,account.TypeAuthorizationForm> implements GetAuthorizationFormArgs { + CONSTRUCTOR_id: -1200903967; + SUBCLASS_OF_ID: 2013567636; + classType: "request"; + className: "account.GetAuthorizationForm"; + botId: int; + scope: string; + publicKey: string; + fromReader(reader: Reader): GetAuthorizationForm; + } + + export interface AcceptAuthorizationArgs { + /** Bot ID */ + botId: int; + /** Telegram Passport element types requested by the service */ + scope: string; + /** Service's public key */ + publicKey: string; + /** Types of values sent and their hashes */ + valueHashes: TypeSecureValueHash[]; + /** Encrypted values */ + credentials: TypeSecureCredentialsEncrypted; + } + + /** Sends a Telegram Passport authorization form, effectively sharing data with the service
*/ + export class AcceptAuthorization extends Request,Bool> implements AcceptAuthorizationArgs { + CONSTRUCTOR_id: -419267436; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.AcceptAuthorization"; + botId: int; + scope: string; + publicKey: string; + valueHashes: TypeSecureValueHash[]; + credentials: TypeSecureCredentialsEncrypted; + fromReader(reader: Reader): AcceptAuthorization; + } + + export interface SendVerifyPhoneCodeArgs { + /** The phone number to verify */ + phoneNumber: string; + /** Phone code settings */ + settings: TypeCodeSettings; + } + + /** + * Send the verification phone code for telegram passport.
+ * @link https://corefork.telegram.org/passport + * @throws {{code:400,type:"PHONE_NUMBER_INVALID"}} The phone number is invalid. + */ + export class SendVerifyPhoneCode extends Request,auth.TypeSentCode> implements SendVerifyPhoneCodeArgs { + CONSTRUCTOR_id: -1516022023; + SUBCLASS_OF_ID: 1827172481; + classType: "request"; + className: "account.SendVerifyPhoneCode"; + phoneNumber: string; + settings: TypeCodeSettings; + fromReader(reader: Reader): SendVerifyPhoneCode; + } + + export interface VerifyPhoneArgs { + /** Phone number */ + phoneNumber: string; + /** Phone code hash received from the call to account.sendVerifyPhoneCode */ + phoneCodeHash: string; + /** Code received after the call to account.sendVerifyPhoneCode */ + phoneCode: string; + } + + /** + * Verify a phone number for telegram passport.
+ * @link https://corefork.telegram.org/method/account.sendVerifyPhoneCode + * @link https://corefork.telegram.org/passport + * @link https://corefork.telegram.org/passport + * @throws {{code:400,type:"PHONE_CODE_EMPTY"}} phone_code is missing. + * @throws {{code:400,type:"PHONE_CODE_EXPIRED"}} The phone code you provided has expired, this may happen if it was sent to any chat on telegram (if the code is sent through a telegram chat (not the official account) to avoid it append or prepend to the code some chars). + * @throws {{code:400,type:"PHONE_NUMBER_INVALID"}} The phone number is invalid. + */ + export class VerifyPhone extends Request,Bool> implements VerifyPhoneArgs { + CONSTRUCTOR_id: 1305716726; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.VerifyPhone"; + phoneNumber: string; + phoneCodeHash: string; + phoneCode: string; + fromReader(reader: Reader): VerifyPhone; + } + + export interface SendVerifyEmailCodeArgs { + /** The email where to send the code */ + email: string; + } + + /** + * Send the verification email code for telegram passport.
+ * @link https://corefork.telegram.org/passport + * @throws {{code:400,type:"EMAIL_INVALID"}} The specified email is invalid. + */ + export class SendVerifyEmailCode extends Request,account.TypeSentEmailCode> implements SendVerifyEmailCodeArgs { + CONSTRUCTOR_id: 1880182943; + SUBCLASS_OF_ID: 1777582190; + classType: "request"; + className: "account.SendVerifyEmailCode"; + email: string; + fromReader(reader: Reader): SendVerifyEmailCode; + } + + export interface VerifyEmailArgs { + /** The email to verify */ + email: string; + /** The verification code that was received */ + code: string; + } + + /** + * Verify an email address for telegram passport.
+ * @link https://corefork.telegram.org/passport + * @throws {{code:400,type:"EMAIL_INVALID"}} The specified email is invalid. + * @throws {{code:400,type:"EMAIL_VERIFY_EXPIRED"}} The verification email has expired. + */ + export class VerifyEmail extends Request,Bool> implements VerifyEmailArgs { + CONSTRUCTOR_id: -323339813; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.VerifyEmail"; + email: string; + code: string; + fromReader(reader: Reader): VerifyEmail; + } + + export interface InitTakeoutSessionArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to export contacts */ + contacts?: true; + /** Whether to export messages in private chats */ + messageUsers?: true; + /** Whether to export messages in legacy groups */ + messageChats?: true; + /** Whether to export messages in supergroups */ + messageMegagroups?: true; + /** Whether to export messages in channels */ + messageChannels?: true; + /** Whether to export files */ + files?: true; + /** Maximum size of files to export */ + fileMaxSize?: int; + } + + /** + * Initialize account takeout session
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:420,type:"TAKEOUT_INIT_DELAY_X"}} Wait X seconds before initing takeout. + */ + export class InitTakeoutSession extends Request,account.TypeTakeout> implements InitTakeoutSessionArgs { + CONSTRUCTOR_id: -262453244; + SUBCLASS_OF_ID: 2218704517; + classType: "request"; + className: "account.InitTakeoutSession"; + flags: number; + contacts?: true; + messageUsers?: true; + messageChats?: true; + messageMegagroups?: true; + messageChannels?: true; + files?: true; + fileMaxSize?: int; + fromReader(reader: Reader): InitTakeoutSession; + } + + export interface FinishTakeoutSessionArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Data exported successfully */ + success?: true; + } + + /** + * Finish account takeout session
+ * @throws {{code:403,type:"TAKEOUT_REQUIRED"}} A takeout session has to be initialized, first. + */ + export class FinishTakeoutSession extends Request,Bool> implements FinishTakeoutSessionArgs { + CONSTRUCTOR_id: 489050862; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.FinishTakeoutSession"; + flags: number; + success?: true; + fromReader(reader: Reader): FinishTakeoutSession; + } + + export interface ConfirmPasswordEmailArgs { + /** The phone code that was received after setting a recovery email */ + code: string; + } + + /** + * Verify an email to use as 2FA recovery method.
+ * @link https://corefork.telegram.org/api/srp + * @throws {{code:400,type:"CODE_INVALID"}} Code invalid. + * @throws {{code:400,type:"EMAIL_HASH_EXPIRED"}} Email hash expired. + */ + export class ConfirmPasswordEmail extends Request,Bool> implements ConfirmPasswordEmailArgs { + CONSTRUCTOR_id: -1881204448; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.ConfirmPasswordEmail"; + code: string; + fromReader(reader: Reader): ConfirmPasswordEmail; + } + + /** + * Resend the code to verify an email to use as 2FA recovery method.
+ * @link https://corefork.telegram.org/api/srp + */ + export class ResendPasswordEmail extends Request,Bool> { + CONSTRUCTOR_id: 2055154197; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.ResendPasswordEmail"; + fromReader(reader: Reader): ResendPasswordEmail; + } + + /** + * Cancel the code that was sent to verify an email to use as 2FA recovery method.
+ * @link https://corefork.telegram.org/api/srp + */ + export class CancelPasswordEmail extends Request,Bool> { + CONSTRUCTOR_id: -1043606090; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.CancelPasswordEmail"; + fromReader(reader: Reader): CancelPasswordEmail; + } + + /** Whether the user will receive notifications when contacts sign up
*/ + export class GetContactSignUpNotification extends Request,Bool> { + CONSTRUCTOR_id: -1626880216; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.GetContactSignUpNotification"; + fromReader(reader: Reader): GetContactSignUpNotification; + } + + export interface SetContactSignUpNotificationArgs { + /** Whether to disable contact sign up notifications */ + silent: Bool; + } + + /** Toggle contact sign up notifications
*/ + export class SetContactSignUpNotification extends Request,Bool> implements SetContactSignUpNotificationArgs { + CONSTRUCTOR_id: -806076575; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.SetContactSignUpNotification"; + silent: Bool; + fromReader(reader: Reader): SetContactSignUpNotification; + } + + export interface GetNotifyExceptionsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If true, chats with non-default sound will also be returned */ + compareSound?: true; + /** If specified, only chats of the specified category will be returned */ + peer?: TypeInputNotifyPeer; + } + + /** Returns list of chats with non-default notification settings
*/ + export class GetNotifyExceptions extends Request,TypeUpdates> implements GetNotifyExceptionsArgs { + CONSTRUCTOR_id: 1398240377; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "account.GetNotifyExceptions"; + flags: number; + compareSound?: true; + peer?: TypeInputNotifyPeer; + fromReader(reader: Reader): GetNotifyExceptions; + } + + export interface GetWallPaperArgs { + /** The wallpaper to get info about */ + wallpaper: TypeInputWallPaper; + } + + /** + * Get info about a certain wallpaper
+ * @throws {{code:400,type:"WALLPAPER_INVALID"}} The specified wallpaper is invalid. + */ + export class GetWallPaper extends Request,TypeWallPaper> implements GetWallPaperArgs { + CONSTRUCTOR_id: -57811990; + SUBCLASS_OF_ID: 2527250827; + classType: "request"; + className: "account.GetWallPaper"; + wallpaper: TypeInputWallPaper; + fromReader(reader: Reader): GetWallPaper; + } + + export interface UploadWallPaperArgs { + /** The JPG/PNG wallpaper */ + file: TypeInputFile; + /** MIME type of uploaded wallpaper */ + mimeType: string; + /** Wallpaper settings */ + settings: TypeWallPaperSettings; + } + + /** + * Create and upload a new wallpaper
+ * @throws {{code:400,type:"WALLPAPER_FILE_INVALID"}} The specified wallpaper file is invalid. + * @throws {{code:400,type:"WALLPAPER_MIME_INVALID"}} The specified wallpaper MIME type is invalid. + */ + export class UploadWallPaper extends Request,TypeWallPaper> implements UploadWallPaperArgs { + CONSTRUCTOR_id: -578472351; + SUBCLASS_OF_ID: 2527250827; + classType: "request"; + className: "account.UploadWallPaper"; + file: TypeInputFile; + mimeType: string; + settings: TypeWallPaperSettings; + fromReader(reader: Reader): UploadWallPaper; + } + + export interface SaveWallPaperArgs { + /** Wallpaper to save */ + wallpaper: TypeInputWallPaper; + /** Uninstall wallpaper? */ + unsave: Bool; + /** Wallpaper settings */ + settings: TypeWallPaperSettings; + } + + /** + * Install/uninstall wallpaper
+ * @throws {{code:400,type:"WALLPAPER_INVALID"}} The specified wallpaper is invalid. + */ + export class SaveWallPaper extends Request,Bool> implements SaveWallPaperArgs { + CONSTRUCTOR_id: 1817860919; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.SaveWallPaper"; + wallpaper: TypeInputWallPaper; + unsave: Bool; + settings: TypeWallPaperSettings; + fromReader(reader: Reader): SaveWallPaper; + } + + export interface InstallWallPaperArgs { + /** Wallpaper to install */ + wallpaper: TypeInputWallPaper; + /** Wallpaper settings */ + settings: TypeWallPaperSettings; + } + + /** + * Install wallpaper
+ * @throws {{code:400,type:"WALLPAPER_INVALID"}} The specified wallpaper is invalid. + */ + export class InstallWallPaper extends Request,Bool> implements InstallWallPaperArgs { + CONSTRUCTOR_id: -18000023; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.InstallWallPaper"; + wallpaper: TypeInputWallPaper; + settings: TypeWallPaperSettings; + fromReader(reader: Reader): InstallWallPaper; + } + + /** Delete installed wallpapers
*/ + export class ResetWallPapers extends Request,Bool> { + CONSTRUCTOR_id: -1153722364; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.ResetWallPapers"; + fromReader(reader: Reader): ResetWallPapers; + } + + /** Get media autodownload settings
*/ + export class GetAutoDownloadSettings extends Request,account.TypeAutoDownloadSettings> { + CONSTRUCTOR_id: 1457130303; + SUBCLASS_OF_ID: 800610593; + classType: "request"; + className: "account.GetAutoDownloadSettings"; + fromReader(reader: Reader): GetAutoDownloadSettings; + } + + export interface SaveAutoDownloadSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to save settings in the low data usage preset */ + low?: true; + /** Whether to save settings in the high data usage preset */ + high?: true; + /** Media autodownload settings */ + settings: TypeAutoDownloadSettings; + } + + /** Change media autodownload settings
*/ + export class SaveAutoDownloadSettings extends Request,Bool> implements SaveAutoDownloadSettingsArgs { + CONSTRUCTOR_id: 1995661875; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.SaveAutoDownloadSettings"; + flags: number; + low?: true; + high?: true; + settings: TypeAutoDownloadSettings; + fromReader(reader: Reader): SaveAutoDownloadSettings; + } + + export interface UploadThemeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Theme file uploaded as described in files » */ + file: TypeInputFile; + /** Thumbnail */ + thumb?: TypeInputFile; + /** File name */ + fileName: string; + /** MIME type, must be application/x-tgtheme-{format}, where format depends on the client */ + mimeType: string; + } + + /** + * Upload theme
+ * @link https://corefork.telegram.org/api/files + * @throws {{code:400,type:"THEME_FILE_INVALID"}} Invalid theme file provided. + */ + export class UploadTheme extends Request,TypeDocument> implements UploadThemeArgs { + CONSTRUCTOR_id: 473805619; + SUBCLASS_OF_ID: 555739168; + classType: "request"; + className: "account.UploadTheme"; + flags: number; + file: TypeInputFile; + thumb?: TypeInputFile; + fileName: string; + mimeType: string; + fromReader(reader: Reader): UploadTheme; + } + + export interface CreateThemeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Unique theme ID */ + slug: string; + /** Theme name */ + title: string; + /** Theme file */ + document?: TypeInputDocument; + /** Theme settings */ + settings?: TypeInputThemeSettings; + } + + /** + * Create a theme
+ * @throws {{code:400,type:"THEME_MIME_INVALID"}} The theme's MIME type is invalid. + */ + export class CreateTheme extends Request,TypeTheme> implements CreateThemeArgs { + CONSTRUCTOR_id: -2077048289; + SUBCLASS_OF_ID: 1454688268; + classType: "request"; + className: "account.CreateTheme"; + flags: number; + slug: string; + title: string; + document?: TypeInputDocument; + settings?: TypeInputThemeSettings; + fromReader(reader: Reader): CreateTheme; + } + + export interface UpdateThemeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Theme format, a string that identifies the theming engines supported by the client */ + format: string; + /** Theme to update */ + theme: TypeInputTheme; + /** Unique theme ID */ + slug?: string; + /** Theme name */ + title?: string; + /** Theme file */ + document?: TypeInputDocument; + /** Theme settings */ + settings?: TypeInputThemeSettings; + } + + /** + * Update theme
+ * @throws {{code:400,type:"THEME_INVALID"}} Invalid theme provided. + */ + export class UpdateTheme extends Request,TypeTheme> implements UpdateThemeArgs { + CONSTRUCTOR_id: 1555261397; + SUBCLASS_OF_ID: 1454688268; + classType: "request"; + className: "account.UpdateTheme"; + flags: number; + format: string; + theme: TypeInputTheme; + slug?: string; + title?: string; + document?: TypeInputDocument; + settings?: TypeInputThemeSettings; + fromReader(reader: Reader): UpdateTheme; + } + + export interface SaveThemeArgs { + /** Theme to save */ + theme: TypeInputTheme; + /** Unsave */ + unsave: Bool; + } + + /** Save a theme
*/ + export class SaveTheme extends Request,Bool> implements SaveThemeArgs { + CONSTRUCTOR_id: -229175188; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.SaveTheme"; + theme: TypeInputTheme; + unsave: Bool; + fromReader(reader: Reader): SaveTheme; + } + + export interface InstallThemeArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to install the dark version */ + dark?: true; + /** Theme format, a string that identifies the theming engines supported by the client */ + format?: string; + /** Theme to install */ + theme?: TypeInputTheme; + } + + /** Install a theme
*/ + export class InstallTheme extends Request,Bool> implements InstallThemeArgs { + CONSTRUCTOR_id: 2061776695; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.InstallTheme"; + flags: number; + dark?: true; + format?: string; + theme?: TypeInputTheme; + fromReader(reader: Reader): InstallTheme; + } + + export interface GetThemeArgs { + /** Theme format, a string that identifies the theming engines supported by the client */ + format: string; + /** Theme */ + theme: TypeInputTheme; + /** Document ID */ + documentId: long; + } + + /** + * Get theme information
+ * @throws {{code:400,type:"THEME_FORMAT_INVALID"}} Invalid theme format provided. + * @throws {{code:400,type:"THEME_INVALID"}} Invalid theme provided. + */ + export class GetTheme extends Request,TypeTheme> implements GetThemeArgs { + CONSTRUCTOR_id: -1919060949; + SUBCLASS_OF_ID: 1454688268; + classType: "request"; + className: "account.GetTheme"; + format: string; + theme: TypeInputTheme; + documentId: long; + fromReader(reader: Reader): GetTheme; + } + + export interface GetThemesArgs { + /** Theme format, a string that identifies the theming engines supported by the client */ + format: string; + /** Hash for pagination, for more info click here */ + hash: int; + } + + /** + * Get installed themes
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetThemes extends Request,account.TypeThemes> implements GetThemesArgs { + CONSTRUCTOR_id: 676939512; + SUBCLASS_OF_ID: 2143625732; + classType: "request"; + className: "account.GetThemes"; + format: string; + hash: int; + fromReader(reader: Reader): GetThemes; + } + + export interface SetContentSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Enable NSFW content */ + sensitiveEnabled?: true; + } + + /** + * Set sensitive content settings (for viewing or hiding NSFW content)
+ * @throws {{code:403,type:"SENSITIVE_CHANGE_FORBIDDEN"}} You can't change your sensitive content settings. + */ + export class SetContentSettings extends Request,Bool> implements SetContentSettingsArgs { + CONSTRUCTOR_id: -1250643605; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.SetContentSettings"; + flags: number; + sensitiveEnabled?: true; + fromReader(reader: Reader): SetContentSettings; + } + + /** Get sensitive content settings
*/ + export class GetContentSettings extends Request,account.TypeContentSettings> { + CONSTRUCTOR_id: -1952756306; + SUBCLASS_OF_ID: 2923427985; + classType: "request"; + className: "account.GetContentSettings"; + fromReader(reader: Reader): GetContentSettings; + } + + export interface GetMultiWallPapersArgs { + /** Wallpapers to fetch info about */ + wallpapers: TypeInputWallPaper[]; + } + + /** Get info about multiple wallpapers
*/ + export class GetMultiWallPapers extends Request,TypeWallPaper[]> implements GetMultiWallPapersArgs { + CONSTRUCTOR_id: 1705865692; + SUBCLASS_OF_ID: 2395165315; + classType: "request"; + className: "account.GetMultiWallPapers"; + wallpapers: TypeInputWallPaper[]; + fromReader(reader: Reader): GetMultiWallPapers; + } + + /** Get global privacy settings
*/ + export class GetGlobalPrivacySettings extends Request,TypeGlobalPrivacySettings> { + CONSTRUCTOR_id: -349483786; + SUBCLASS_OF_ID: 3373160304; + classType: "request"; + className: "account.GetGlobalPrivacySettings"; + fromReader(reader: Reader): GetGlobalPrivacySettings; + } + + export interface SetGlobalPrivacySettingsArgs { + /** Global privacy settings */ + settings: TypeGlobalPrivacySettings; + } + + /** + * Set global privacy settings
+ * @throws {{code:400,type:"AUTOARCHIVE_NOT_AVAILABLE"}} The autoarchive setting is not available at this time: please check the value of the autoarchive_setting_available field in client config » before calling this method. + */ + export class SetGlobalPrivacySettings extends Request,TypeGlobalPrivacySettings> implements SetGlobalPrivacySettingsArgs { + CONSTRUCTOR_id: 517647042; + SUBCLASS_OF_ID: 3373160304; + classType: "request"; + className: "account.SetGlobalPrivacySettings"; + settings: TypeGlobalPrivacySettings; + fromReader(reader: Reader): SetGlobalPrivacySettings; + } + + export interface ReportProfilePhotoArgs { + /** The dialog */ + peer: EntityLike; + /** Dialog photo ID */ + photoId: TypeInputPhoto; + /** Report reason */ + reason: TypeReportReason; + /** Comment for report moderation */ + message: string; + } + + /** Report a profile photo of a dialog
*/ + export class ReportProfilePhoto extends Request,Bool> implements ReportProfilePhotoArgs { + CONSTRUCTOR_id: -91437323; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.ReportProfilePhoto"; + peer: EntityLike; + photoId: TypeInputPhoto; + reason: TypeReportReason; + message: string; + fromReader(reader: Reader): ReportProfilePhoto; + } + + /** + * Initiate a 2FA password reset: can only be used if the user is already logged-in, see here for more info »
+ * @link https://corefork.telegram.org/api/srp + */ + export class ResetPassword extends Request,account.TypeResetPasswordResult> { + CONSTRUCTOR_id: -1828139493; + SUBCLASS_OF_ID: 1230009366; + classType: "request"; + className: "account.ResetPassword"; + fromReader(reader: Reader): ResetPassword; + } + + /** + * Abort a pending 2FA password reset, see here for more info »
+ * @link https://corefork.telegram.org/api/srp + * @throws {{code:400,type:"RESET_REQUEST_MISSING"}} No password reset is in progress. + */ + export class DeclinePasswordReset extends Request,Bool> { + CONSTRUCTOR_id: 1284770294; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "account.DeclinePasswordReset"; + fromReader(reader: Reader): DeclinePasswordReset; + } + + type TypePrivacyRules = PrivacyRules; + type TypeAuthorizations = Authorizations; + type TypePassword = Password; + type TypePasswordSettings = PasswordSettings; + type TypePasswordInputSettings = PasswordInputSettings; + type TypeTmpPassword = TmpPassword; + type TypeWebAuthorizations = WebAuthorizations; + type TypeAuthorizationForm = AuthorizationForm; + type TypeSentEmailCode = SentEmailCode; + type TypeTakeout = Takeout; + type TypeWallPapers = WallPapersNotModified | WallPapers; + type TypeAutoDownloadSettings = AutoDownloadSettings; + type TypeThemes = ThemesNotModified | Themes; + type TypeContentSettings = ContentSettings; + type TypeResetPasswordResult = ResetPasswordFailedWait | ResetPasswordRequestedWait | ResetPasswordOk; + } + + namespace channels { + export interface ChannelParticipantsArgs { + /** Total number of participants that correspond to the given query */ + count: int; + /** Participants */ + participants: TypeChannelParticipant[]; + /** Mentioned chats */ + chats: TypeChat[]; + /** Users mentioned in participant info */ + users: TypeUser[]; + } + + /** Represents multiple channel participants
*/ + export class ChannelParticipants extends VirtualClass implements ChannelParticipantsArgs { + CONSTRUCTOR_id: -1699676497; + SUBCLASS_OF_ID: 3859443300; + classType: "constructor"; + className: "channels.ChannelParticipants"; + count: int; + participants: TypeChannelParticipant[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): ChannelParticipants; + } + + /** No new participant info could be found
*/ + export class ChannelParticipantsNotModified extends VirtualClass { + CONSTRUCTOR_id: -266911767; + SUBCLASS_OF_ID: 3859443300; + classType: "constructor"; + className: "channels.ChannelParticipantsNotModified"; + fromReader(reader: Reader): ChannelParticipantsNotModified; + } + + export interface ChannelParticipantArgs { + /** The channel participant */ + participant: TypeChannelParticipant; + /** Mentioned chats */ + chats: TypeChat[]; + /** Users */ + users: TypeUser[]; + } + + /** Represents a channel participant
*/ + export class ChannelParticipant extends VirtualClass implements ChannelParticipantArgs { + CONSTRUCTOR_id: -541588713; + SUBCLASS_OF_ID: 1717048602; + classType: "constructor"; + className: "channels.ChannelParticipant"; + participant: TypeChannelParticipant; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): ChannelParticipant; + } + + export interface AdminLogResultsArgs { + /** Admin log events */ + events: TypeChannelAdminLogEvent[]; + /** Chats mentioned in events */ + chats: TypeChat[]; + /** Users mentioned in events */ + users: TypeUser[]; + } + + /** Admin log events
*/ + export class AdminLogResults extends VirtualClass implements AdminLogResultsArgs { + CONSTRUCTOR_id: -309659827; + SUBCLASS_OF_ID: 1374713532; + classType: "constructor"; + className: "channels.AdminLogResults"; + events: TypeChannelAdminLogEvent[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): AdminLogResults; + } + + export interface ReadHistoryArgs { + /** Channel/supergroup */ + channel: TypeInputChannel; + /** ID of message up to which messages should be marked as read */ + maxId: int; + } + + /** + * Mark channel/supergroup history as read
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class ReadHistory extends Request,Bool> implements ReadHistoryArgs { + CONSTRUCTOR_id: -871347913; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "channels.ReadHistory"; + channel: TypeInputChannel; + maxId: int; + fromReader(reader: Reader): ReadHistory; + } + + export interface DeleteMessagesArgs { + /** Channel/supergroup */ + channel: TypeInputChannel; + /** IDs of messages to delete */ + id: int[]; + } + + /** + * Delete messages in a channel/supergroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:403,type:"MESSAGE_DELETE_FORBIDDEN"}} You can't delete one of the messages you tried to delete, most likely because it is a service message. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class DeleteMessages extends Request,messages.TypeAffectedMessages> implements DeleteMessagesArgs { + CONSTRUCTOR_id: -2067661490; + SUBCLASS_OF_ID: 3469983854; + classType: "request"; + className: "channels.DeleteMessages"; + channel: TypeInputChannel; + id: int[]; + fromReader(reader: Reader): DeleteMessages; + } + + export interface DeleteUserHistoryArgs { + /** Supergroup */ + channel: TypeInputChannel; + /** User whose messages should be deleted */ + userId: TypeInputUser; + } + + /** + * Delete all messages sent by a certain user in a supergroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class DeleteUserHistory extends Request,messages.TypeAffectedHistory> implements DeleteUserHistoryArgs { + CONSTRUCTOR_id: -787622117; + SUBCLASS_OF_ID: 743031062; + classType: "request"; + className: "channels.DeleteUserHistory"; + channel: TypeInputChannel; + userId: TypeInputUser; + fromReader(reader: Reader): DeleteUserHistory; + } + + export interface ReportSpamArgs { + /** Supergroup */ + channel: TypeInputChannel; + /** ID of the user that sent the spam messages */ + userId: TypeInputUser; + /** IDs of spam messages */ + id: int[]; + } + + /** + * Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup
+ * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class ReportSpam extends Request,Bool> implements ReportSpamArgs { + CONSTRUCTOR_id: -32999408; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "channels.ReportSpam"; + channel: TypeInputChannel; + userId: TypeInputUser; + id: int[]; + fromReader(reader: Reader): ReportSpam; + } + + export interface GetMessagesArgs { + /** Channel/supergroup */ + channel: TypeInputChannel; + /** IDs of messages to get */ + id: TypeInputMessage[]; + } + + /** + * Get channel/supergroup messages
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MESSAGE_IDS_EMPTY"}} No message ids were provided. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class GetMessages extends Request,messages.TypeMessages> implements GetMessagesArgs { + CONSTRUCTOR_id: -1383294429; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "channels.GetMessages"; + channel: TypeInputChannel; + id: TypeInputMessage[]; + fromReader(reader: Reader): GetMessages; + } + + export interface GetParticipantsArgs { + /** Channel */ + channel: TypeInputChannel; + /** Which participant types to fetch */ + filter: TypeChannelParticipantsFilter; + /** Offset */ + offset: int; + /** Limit */ + limit: int; + /** Hash */ + hash: int; + } + + /** + * Get the participants of a supergroup/channel
+ * @link https://corefork.telegram.org/api/offsets + * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + */ + export class GetParticipants extends Request,channels.TypeChannelParticipants> implements GetParticipantsArgs { + CONSTRUCTOR_id: 306054633; + SUBCLASS_OF_ID: 3859443300; + classType: "request"; + className: "channels.GetParticipants"; + channel: TypeInputChannel; + filter: TypeChannelParticipantsFilter; + offset: int; + limit: int; + hash: int; + fromReader(reader: Reader): GetParticipants; + } + + export interface GetParticipantArgs { + /** Channel/supergroup */ + channel: TypeInputChannel; + /** Participant to get info about */ + participant: EntityLike; + } + + /** + * Get info about a channel/supergroup participant
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PARTICIPANT_ID_INVALID"}} The specified participant ID is invalid. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + * @throws {{code:400,type:"USER_NOT_PARTICIPANT"}} You're not a member of this supergroup/channel. + */ + export class GetParticipant extends Request,channels.TypeChannelParticipant> implements GetParticipantArgs { + CONSTRUCTOR_id: -1599378234; + SUBCLASS_OF_ID: 1717048602; + classType: "request"; + className: "channels.GetParticipant"; + channel: TypeInputChannel; + participant: EntityLike; + fromReader(reader: Reader): GetParticipant; + } + + export interface GetChannelsArgs { + /** IDs of channels/supergroups to get info about */ + id: TypeInputChannel[]; + } + + /** + * Get info about channels/supergroups
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class GetChannels extends Request,messages.TypeChats> implements GetChannelsArgs { + CONSTRUCTOR_id: 176122811; + SUBCLASS_OF_ID: 2580925204; + classType: "request"; + className: "channels.GetChannels"; + id: TypeInputChannel[]; + fromReader(reader: Reader): GetChannels; + } + + export interface GetFullChannelArgs { + /** The channel to get info about */ + channel: TypeInputChannel; + } + + /** + * Get full info about a channel
+ * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:403,type:"CHANNEL_PUBLIC_GROUP_NA"}} channel/supergroup not available. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class GetFullChannel extends Request,messages.TypeChatFull> implements GetFullChannelArgs { + CONSTRUCTOR_id: 141781513; + SUBCLASS_OF_ID: 576344329; + classType: "request"; + className: "channels.GetFullChannel"; + channel: TypeInputChannel; + fromReader(reader: Reader): GetFullChannel; + } + + export interface CreateChannelArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to create a channel */ + broadcast?: true; + /** Whether to create a supergroup */ + megagroup?: true; + /** Whether the supergroup is being created to import messages from a foreign chat service using messages.initHistoryImport */ + forImport?: true; + /** Channel title */ + title: string; + /** Channel description */ + about: string; + /** Geogroup location */ + geoPoint?: TypeInputGeoPoint; + /** Geogroup address */ + address?: string; + } + + /** + * Create a supergroup/channel.
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/method/messages.initHistoryImport + * @link https://corefork.telegram.org/api/import + * @throws {{code:400,type:"CHANNELS_ADMIN_LOCATED_TOO_MUCH"}} The user has reached the limit of public geogroups. + * @throws {{code:400,type:"CHANNELS_TOO_MUCH"}} You have joined too many channels/supergroups. + * @throws {{code:400,type:"CHAT_ABOUT_TOO_LONG"}} Chat about too long. + * @throws {{code:400,type:"CHAT_TITLE_EMPTY"}} No chat title provided. + * @throws {{code:403,type:"USER_RESTRICTED"}} You're spamreported, you can't create channels or chats. + */ + export class CreateChannel extends Request,TypeUpdates> implements CreateChannelArgs { + CONSTRUCTOR_id: 1029681423; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.CreateChannel"; + flags: number; + broadcast?: true; + megagroup?: true; + forImport?: true; + title: string; + about: string; + geoPoint?: TypeInputGeoPoint; + address?: string; + fromReader(reader: Reader): CreateChannel; + } + + export interface EditAdminArgs { + /** The supergroup/channel. */ + channel: TypeInputChannel; + /** The ID of the user whose admin rights should be modified */ + userId: TypeInputUser; + /** The admin rights */ + adminRights: TypeChatAdminRights; + /** Indicates the role (rank) of the admin in the group: just an arbitrary string */ + rank: string; + } + + /** + * Modify the admin rights of a user in a supergroup/channel.
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"ADMINS_TOO_MUCH"}} There are too many admins. + * @throws {{code:400,type:"ADMIN_RANK_EMOJI_NOT_ALLOWED"}} An admin rank cannot contain emojis. + * @throws {{code:400,type:"ADMIN_RANK_INVALID"}} The specified admin rank is invalid. + * @throws {{code:400,type:"BOTS_TOO_MUCH"}} There are too many bots in this chat/channel. + * @throws {{code:400,type:"BOT_CHANNELS_NA"}} Bots can't edit admin privileges. + * @throws {{code:400,type:"BOT_GROUPS_BLOCKED"}} This bot can't be added to groups. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:403,type:"CHAT_ADMIN_INVITE_REQUIRED"}} You do not have the rights to do this. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:406,type:"FRESH_CHANGE_ADMINS_FORBIDDEN"}} You were just elected admin, you can't add or modify other admins yet. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:403,type:"RIGHT_FORBIDDEN"}} Your admin rights do not allow you to do this. + * @throws {{code:400,type:"USERS_TOO_MUCH"}} The maximum number of users has been exceeded (to create a chat, for example). + * @throws {{code:400,type:"USER_BLOCKED"}} User blocked. + * @throws {{code:403,type:"USER_CHANNELS_TOO_MUCH"}} One of the users you tried to add is already in too many channels/supergroups. + * @throws {{code:400,type:"USER_CREATOR"}} You can't leave this channel, because you're its creator. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + * @throws {{code:400,type:"USER_NOT_MUTUAL_CONTACT"}} The provided user is not a mutual contact. + * @throws {{code:403,type:"USER_PRIVACY_RESTRICTED"}} The user's privacy settings do not allow you to do this. + * @throws {{code:403,type:"USER_RESTRICTED"}} You're spamreported, you can't create channels or chats. + */ + export class EditAdmin extends Request,TypeUpdates> implements EditAdminArgs { + CONSTRUCTOR_id: -751007486; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.EditAdmin"; + channel: TypeInputChannel; + userId: TypeInputUser; + adminRights: TypeChatAdminRights; + rank: string; + fromReader(reader: Reader): EditAdmin; + } + + export interface EditTitleArgs { + /** Channel/supergroup */ + channel: TypeInputChannel; + /** New name */ + title: string; + } + + /** + * Edit the name of a channel/supergroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:400,type:"CHAT_TITLE_EMPTY"}} No chat title provided. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + */ + export class EditTitle extends Request,TypeUpdates> implements EditTitleArgs { + CONSTRUCTOR_id: 1450044624; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.EditTitle"; + channel: TypeInputChannel; + title: string; + fromReader(reader: Reader): EditTitle; + } + + export interface EditPhotoArgs { + /** Channel/supergroup whose photo should be edited */ + channel: TypeInputChannel; + /** New photo */ + photo: TypeInputChatPhoto; + } + + /** + * Change the photo of a channel/supergroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"FILE_REFERENCE_INVALID"}} The specified file reference is invalid. + * @throws {{code:400,type:"PHOTO_CROP_SIZE_SMALL"}} Photo is too small. + * @throws {{code:400,type:"PHOTO_EXT_INVALID"}} The extension of the photo is invalid. + * @throws {{code:400,type:"PHOTO_INVALID"}} Photo invalid. + */ + export class EditPhoto extends Request,TypeUpdates> implements EditPhotoArgs { + CONSTRUCTOR_id: -248621111; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.EditPhoto"; + channel: TypeInputChannel; + photo: TypeInputChatPhoto; + fromReader(reader: Reader): EditPhoto; + } + + export interface CheckUsernameArgs { + /** The channel/supergroup that will assigned the specified username */ + channel: TypeInputChannel; + /** The username to check */ + username: string; + } + + /** + * Check if a username is free and can be assigned to a channel/supergroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNELS_ADMIN_PUBLIC_TOO_MUCH"}} You're admin of too many public channels, make some channels private to change the username of this channel. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"USERNAME_INVALID"}} The provided username is not valid. + */ + export class CheckUsername extends Request,Bool> implements CheckUsernameArgs { + CONSTRUCTOR_id: 283557164; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "channels.CheckUsername"; + channel: TypeInputChannel; + username: string; + fromReader(reader: Reader): CheckUsername; + } + + export interface UpdateUsernameArgs { + /** Channel */ + channel: TypeInputChannel; + /** New username */ + username: string; + } + + /** + * Change the username of a supergroup/channel
+ * @throws {{code:400,type:"CHANNELS_ADMIN_PUBLIC_TOO_MUCH"}} You're admin of too many public channels, make some channels private to change the username of this channel. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"USERNAME_INVALID"}} The provided username is not valid. + * @throws {{code:400,type:"USERNAME_NOT_MODIFIED"}} The username was not modified. + * @throws {{code:400,type:"USERNAME_OCCUPIED"}} The provided username is already occupied. + */ + export class UpdateUsername extends Request,Bool> implements UpdateUsernameArgs { + CONSTRUCTOR_id: 890549214; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "channels.UpdateUsername"; + channel: TypeInputChannel; + username: string; + fromReader(reader: Reader): UpdateUsername; + } + + export interface JoinChannelArgs { + /** Channel/supergroup to join */ + channel: TypeInputChannel; + } + + /** + * Join a channel/supergroup
+ * @throws {{code:400,type:"CHANNELS_TOO_MUCH"}} You have joined too many channels/supergroups. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_INVALID"}} Invalid chat. + * @throws {{code:400,type:"INVITE_HASH_EMPTY"}} The invite hash is empty. + * @throws {{code:400,type:"INVITE_HASH_EXPIRED"}} The invite link has expired. + * @throws {{code:400,type:"INVITE_HASH_INVALID"}} The invite hash is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"USERS_TOO_MUCH"}} The maximum number of users has been exceeded (to create a chat, for example). + * @throws {{code:400,type:"USER_ALREADY_PARTICIPANT"}} The user is already in the group. + * @throws {{code:400,type:"USER_CHANNELS_TOO_MUCH"}} One of the users you tried to add is already in too many channels/supergroups. + */ + export class JoinChannel extends Request,TypeUpdates> implements JoinChannelArgs { + CONSTRUCTOR_id: 615851205; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.JoinChannel"; + channel: TypeInputChannel; + fromReader(reader: Reader): JoinChannel; + } + + export interface LeaveChannelArgs { + /** Channel/supergroup to leave */ + channel: TypeInputChannel; + } + + /** + * Leave a channel/supergroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:403,type:"CHANNEL_PUBLIC_GROUP_NA"}} channel/supergroup not available. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"USER_CREATOR"}} You can't leave this channel, because you're its creator. + * @throws {{code:400,type:"USER_NOT_PARTICIPANT"}} You're not a member of this supergroup/channel. + */ + export class LeaveChannel extends Request,TypeUpdates> implements LeaveChannelArgs { + CONSTRUCTOR_id: -130635115; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.LeaveChannel"; + channel: TypeInputChannel; + fromReader(reader: Reader): LeaveChannel; + } + + export interface InviteToChannelArgs { + /** Channel/supergroup */ + channel: TypeInputChannel; + /** Users to invite */ + users: TypeInputUser[]; + } + + /** + * Invite users to a channel/supergroup
+ * @throws {{code:400,type:"BOTS_TOO_MUCH"}} There are too many bots in this chat/channel. + * @throws {{code:400,type:"BOT_GROUPS_BLOCKED"}} This bot can't be added to groups. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_INVALID"}} Invalid chat. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"USERS_TOO_MUCH"}} The maximum number of users has been exceeded (to create a chat, for example). + * @throws {{code:400,type:"USER_BANNED_IN_CHANNEL"}} You're banned from sending messages in supergroups/channels. + * @throws {{code:400,type:"USER_BLOCKED"}} User blocked. + * @throws {{code:400,type:"USER_BOT"}} Bots can only be admins in channels. + * @throws {{code:403,type:"USER_CHANNELS_TOO_MUCH"}} One of the users you tried to add is already in too many channels/supergroups. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + * @throws {{code:400,type:"USER_KICKED"}} This user was kicked from this supergroup/channel. + * @throws {{code:400,type:"USER_NOT_MUTUAL_CONTACT"}} The provided user is not a mutual contact. + * @throws {{code:403,type:"USER_PRIVACY_RESTRICTED"}} The user's privacy settings do not allow you to do this. + */ + export class InviteToChannel extends Request,TypeUpdates> implements InviteToChannelArgs { + CONSTRUCTOR_id: 429865580; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.InviteToChannel"; + channel: TypeInputChannel; + users: TypeInputUser[]; + fromReader(reader: Reader): InviteToChannel; + } + + export interface DeleteChannelArgs { + /** Channel/supergroup to delete */ + channel: TypeInputChannel; + } + + /** + * Delete a channel/supergroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHANNEL_TOO_LARGE"}} Channel is too large to be deleted; this error is issued when trying to delete channels with more than 1000 members (subject to change). + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + */ + export class DeleteChannel extends Request,TypeUpdates> implements DeleteChannelArgs { + CONSTRUCTOR_id: -1072619549; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.DeleteChannel"; + channel: TypeInputChannel; + fromReader(reader: Reader): DeleteChannel; + } + + export interface ExportMessageLinkArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to include other grouped media (for albums) */ + grouped?: true; + /** Whether to also include a thread ID, if available, inside of the link */ + thread?: true; + /** Channel */ + channel: TypeInputChannel; + /** Message ID */ + id: int; + } + + /** + * Get link and embed info of a message in a channel/supergroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class ExportMessageLink extends Request,TypeExportedMessageLink> implements ExportMessageLinkArgs { + CONSTRUCTOR_id: -432034325; + SUBCLASS_OF_ID: 3739632844; + classType: "request"; + className: "channels.ExportMessageLink"; + flags: number; + grouped?: true; + thread?: true; + channel: TypeInputChannel; + id: int; + fromReader(reader: Reader): ExportMessageLink; + } + + export interface ToggleSignaturesArgs { + /** Channel */ + channel: TypeInputChannel; + /** Value */ + enabled: Bool; + } + + /** + * Enable/disable message signatures in channels
+ * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + */ + export class ToggleSignatures extends Request,TypeUpdates> implements ToggleSignaturesArgs { + CONSTRUCTOR_id: 527021574; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.ToggleSignatures"; + channel: TypeInputChannel; + enabled: Bool; + fromReader(reader: Reader): ToggleSignatures; + } + + export interface GetAdminedPublicChannelsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Get geogroups */ + byLocation?: true; + /** If set and the user has reached the limit of owned public channels/supergroups/geogroups, instead of returning the channel list one of the specified errors will be returned.
Useful to check if a new public channel can indeed be created, even before asking the user to enter a channel username to use in channels.checkUsername/channels.updateUsername. */ + checkLimit?: true; + } + + /** + * Get channels/supergroups/geogroups we're admin in. Usually called when the user exceeds the limit for owned public channels/supergroups/geogroups, and the user is given the choice to remove one of his channels/supergroups/geogroups.
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/method/channels.checkUsername + * @link https://corefork.telegram.org/method/channels.updateUsername + * @link https://corefork.telegram.org/constructor/config + * @throws {{code:400,type:"CHANNELS_ADMIN_LOCATED_TOO_MUCH"}} Returned if both the check_limit and the by_location flags are set and the user has reached the limit of public geogroups. + * @throws {{code:400,type:"CHANNELS_ADMIN_PUBLIC_TOO_MUCH"}} Returned if the check_limit flag is set and the user has reached the limit of public channels/supergroups. + */ + export class GetAdminedPublicChannels extends Request,messages.TypeChats> implements GetAdminedPublicChannelsArgs { + CONSTRUCTOR_id: -122669393; + SUBCLASS_OF_ID: 2580925204; + classType: "request"; + className: "channels.GetAdminedPublicChannels"; + flags: number; + byLocation?: true; + checkLimit?: true; + fromReader(reader: Reader): GetAdminedPublicChannels; + } + + export interface EditBannedArgs { + /** The supergroup/channel. */ + channel: TypeInputChannel; + /** Participant to ban */ + participant: EntityLike; + /** The banned rights */ + bannedRights: TypeChatBannedRights; + } + + /** + * Ban/unban/kick a user in a supergroup/channel.
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_ADD_INVALID"}} Internal error. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"INPUT_USER_DEACTIVATED"}} The specified user was deleted. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"PARTICIPANT_ID_INVALID"}} The specified participant ID is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"PINNED_DIALOGS_TOO_MUCH"}} Too many pinned dialogs. + * @throws {{code:400,type:"USER_ADMIN_INVALID"}} You're not an admin. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class EditBanned extends Request,TypeUpdates> implements EditBannedArgs { + CONSTRUCTOR_id: -1763259007; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.EditBanned"; + channel: TypeInputChannel; + participant: EntityLike; + bannedRights: TypeChatBannedRights; + fromReader(reader: Reader): EditBanned; + } + + export interface GetAdminLogArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Channel */ + channel: TypeInputChannel; + /** Search query, can be empty */ + q: string; + /** Event filter */ + eventsFilter?: TypeChannelAdminLogEventsFilter; + /** Only show events from these admins */ + admins?: TypeInputUser[]; + /** Maximum ID of message to return (see pagination) */ + maxId: long; + /** Minimum ID of message to return (see pagination) */ + minId: long; + /** Maximum number of results to return, see pagination */ + limit: int; + } + + /** + * Get the admin log of a channel/supergroup
+ * @link https://corefork.telegram.org/api/offsets + * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class GetAdminLog extends Request,channels.TypeAdminLogResults> implements GetAdminLogArgs { + CONSTRUCTOR_id: 870184064; + SUBCLASS_OF_ID: 1374713532; + classType: "request"; + className: "channels.GetAdminLog"; + flags: number; + channel: TypeInputChannel; + q: string; + eventsFilter?: TypeChannelAdminLogEventsFilter; + admins?: TypeInputUser[]; + maxId: long; + minId: long; + limit: int; + fromReader(reader: Reader): GetAdminLog; + } + + export interface SetStickersArgs { + /** Supergroup */ + channel: TypeInputChannel; + /** The stickerset to associate */ + stickerset: TypeInputStickerSet; + } + + /** + * Associate a stickerset to the supergroup
+ * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"PARTICIPANTS_TOO_FEW"}} Not enough participants. + * @throws {{code:406,type:"STICKERSET_OWNER_ANONYMOUS"}} Provided stickerset can't be installed as group stickerset to prevent admin deanonymisation. + */ + export class SetStickers extends Request,Bool> implements SetStickersArgs { + CONSTRUCTOR_id: -359881479; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "channels.SetStickers"; + channel: TypeInputChannel; + stickerset: TypeInputStickerSet; + fromReader(reader: Reader): SetStickers; + } + + export interface ReadMessageContentsArgs { + /** Channel/supergroup */ + channel: TypeInputChannel; + /** IDs of messages whose contents should be marked as read */ + id: int[]; + } + + /** + * Mark channel/supergroup message contents as read
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class ReadMessageContents extends Request,Bool> implements ReadMessageContentsArgs { + CONSTRUCTOR_id: -357180360; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "channels.ReadMessageContents"; + channel: TypeInputChannel; + id: int[]; + fromReader(reader: Reader): ReadMessageContents; + } + + export interface DeleteHistoryArgs { + /** Supergroup whose history must be deleted */ + channel: TypeInputChannel; + /** ID of message up to which the history must be deleted */ + maxId: int; + } + + /** + * Delete the history of a supergroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + */ + export class DeleteHistory extends Request,Bool> implements DeleteHistoryArgs { + CONSTRUCTOR_id: -1355375294; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "channels.DeleteHistory"; + channel: TypeInputChannel; + maxId: int; + fromReader(reader: Reader): DeleteHistory; + } + + export interface TogglePreHistoryHiddenArgs { + /** Channel/supergroup */ + channel: TypeInputChannel; + /** Hide/unhide */ + enabled: Bool; + } + + /** + * Hide/unhide message history for new channel/supergroup users
+ * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_ID_INVALID"}} The provided chat id is invalid. + * @throws {{code:400,type:"CHAT_LINK_EXISTS"}} The chat is public, you can't hide the history to new users. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + */ + export class TogglePreHistoryHidden extends Request,TypeUpdates> implements TogglePreHistoryHiddenArgs { + CONSTRUCTOR_id: -356796084; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.TogglePreHistoryHidden"; + channel: TypeInputChannel; + enabled: Bool; + fromReader(reader: Reader): TogglePreHistoryHidden; + } + + export interface GetLeftChannelsArgs { + /** Offset for pagination */ + offset: int; + } + + /** + * Get a list of channels/supergroups we left
+ * @link https://corefork.telegram.org/api/offsets + * @link https://corefork.telegram.org/api/channel + * @throws {{code:403,type:"TAKEOUT_REQUIRED"}} A takeout session has to be initialized, first. + */ + export class GetLeftChannels extends Request,messages.TypeChats> implements GetLeftChannelsArgs { + CONSTRUCTOR_id: -2092831552; + SUBCLASS_OF_ID: 2580925204; + classType: "request"; + className: "channels.GetLeftChannels"; + offset: int; + fromReader(reader: Reader): GetLeftChannels; + } + + /** + * Get all groups that can be used as discussion groups.
Returned legacy group chats must be first upgraded to supergroups before they can be set as a discussion group.
+ * To set a returned supergroup as a discussion group, access to its old messages must be enabled using channels.togglePreHistoryHidden, first.
+ * @link https://corefork.telegram.org/api/discussion + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://telegram.org/blog/privacy-discussions-web-bots + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/method/channels.togglePreHistoryHidden + */ + export class GetGroupsForDiscussion extends Request,messages.TypeChats> { + CONSTRUCTOR_id: -170208392; + SUBCLASS_OF_ID: 2580925204; + classType: "request"; + className: "channels.GetGroupsForDiscussion"; + fromReader(reader: Reader): GetGroupsForDiscussion; + } + + export interface SetDiscussionGroupArgs { + /** Channel */ + broadcast: TypeInputChannel; + /** Discussion group to associate to the channel */ + group: TypeInputChannel; + } + + /** + * Associate a group to a channel as discussion group for that channel
+ * @link https://corefork.telegram.org/api/discussion + * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/channel + * @link https://telegram.org/blog/privacy-discussions-web-bots + * @throws {{code:400,type:"BROADCAST_ID_INVALID"}} Broadcast ID invalid. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"LINK_NOT_MODIFIED"}} Discussion link not modified. + * @throws {{code:400,type:"MEGAGROUP_ID_INVALID"}} Invalid supergroup ID. + * @throws {{code:400,type:"MEGAGROUP_PREHISTORY_HIDDEN"}} Group with hidden history for new members can't be set as discussion groups. + */ + export class SetDiscussionGroup extends Request,Bool> implements SetDiscussionGroupArgs { + CONSTRUCTOR_id: 1079520178; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "channels.SetDiscussionGroup"; + broadcast: TypeInputChannel; + group: TypeInputChannel; + fromReader(reader: Reader): SetDiscussionGroup; + } + + export interface EditCreatorArgs { + /** Channel */ + channel: TypeInputChannel; + /** New channel owner */ + userId: TypeInputUser; + /** 2FA password of account */ + password: TypeInputCheckPasswordSRP; + } + + /** + * Transfer channel ownership
+ * @link https://corefork.telegram.org/api/srp + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:403,type:"CHAT_WRITE_FORBIDDEN"}} You can't write in this chat. + * @throws {{code:400,type:"PASSWORD_HASH_INVALID"}} The provided password hash is invalid. + * @throws {{code:400,type:"PASSWORD_MISSING"}} You must enable 2FA in order to transfer ownership of a channel. + * @throws {{code:400,type:"PASSWORD_TOO_FRESH_X"}} The password was modified less than 24 hours ago, try again in X seconds. + * @throws {{code:400,type:"SESSION_TOO_FRESH_X"}} This session was created less than 24 hours ago, try again in X seconds. + * @throws {{code:400,type:"SRP_ID_INVALID"}} Invalid SRP ID provided. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class EditCreator extends Request,TypeUpdates> implements EditCreatorArgs { + CONSTRUCTOR_id: -1892102881; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.EditCreator"; + channel: TypeInputChannel; + userId: TypeInputUser; + password: TypeInputCheckPasswordSRP; + fromReader(reader: Reader): EditCreator; + } + + export interface EditLocationArgs { + /** Geogroup */ + channel: TypeInputChannel; + /** New geolocation */ + geoPoint: TypeInputGeoPoint; + /** Address string */ + address: string; + } + + /** + * Edit location of geogroup
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"MEGAGROUP_REQUIRED"}} You can only use this method on a supergroup. + */ + export class EditLocation extends Request,Bool> implements EditLocationArgs { + CONSTRUCTOR_id: 1491484525; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "channels.EditLocation"; + channel: TypeInputChannel; + geoPoint: TypeInputGeoPoint; + address: string; + fromReader(reader: Reader): EditLocation; + } + + export interface ToggleSlowModeArgs { + /** The supergroup */ + channel: TypeInputChannel; + /** Users will only be able to send one message every seconds seconds, 0 to disable the limitation */ + seconds: int; + } + + /** + * Toggle supergroup slow mode: if enabled, users will only be able to send one message every seconds seconds
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"CHAT_NOT_MODIFIED"}} The pinned message wasn't modified. + * @throws {{code:400,type:"SECONDS_INVALID"}} Invalid duration provided. + */ + export class ToggleSlowMode extends Request,TypeUpdates> implements ToggleSlowModeArgs { + CONSTRUCTOR_id: -304832784; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.ToggleSlowMode"; + channel: TypeInputChannel; + seconds: int; + fromReader(reader: Reader): ToggleSlowMode; + } + + /** Get inactive channels and supergroups
*/ + export class GetInactiveChannels extends Request,messages.TypeInactiveChats> { + CONSTRUCTOR_id: 300429806; + SUBCLASS_OF_ID: 2348013524; + classType: "request"; + className: "channels.GetInactiveChannels"; + fromReader(reader: Reader): GetInactiveChannels; + } + + export interface ConvertToGigagroupArgs { + /** The supergroup to convert */ + channel: TypeInputChannel; + } + + /** + * Convert a supergroup to a gigagroup, when requested by channel suggestions.
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/config + * @throws {{code:400,type:"PARTICIPANTS_TOO_FEW"}} Not enough participants. + */ + export class ConvertToGigagroup extends Request,TypeUpdates> implements ConvertToGigagroupArgs { + CONSTRUCTOR_id: 187239529; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "channels.ConvertToGigagroup"; + channel: TypeInputChannel; + fromReader(reader: Reader): ConvertToGigagroup; + } + + type TypeChannelParticipants = ChannelParticipants | ChannelParticipantsNotModified; + type TypeChannelParticipant = ChannelParticipant; + type TypeAdminLogResults = AdminLogResults; + } + + namespace payments { + export interface PaymentFormArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the user can choose to save credentials. */ + canSaveCredentials?: true; + /** Indicates that the user can save payment credentials, but only after setting up a 2FA password (currently the account doesn't have a 2FA password) */ + passwordMissing?: true; + /** Form ID */ + formId: long; + /** Bot ID */ + botId: int; + /** Invoice */ + invoice: TypeInvoice; + /** Payment provider ID. */ + providerId: int; + /** Payment form URL */ + url: string; + /** Payment provider name.
One of the following:
- stripe */ + nativeProvider?: string; + /** Contains information about the payment provider, if available, to support it natively without the need for opening the URL.
A JSON object that can contain the following fields:

- apple_pay_merchant_id: Apple Pay merchant ID
- google_pay_public_key: Google Pay public key
- need_country: True, if the user country must be provided,
- need_zip: True, if the user ZIP/postal code must be provided,
- need_cardholder_name: True, if the cardholder name must be provided
*/ + nativeParams?: TypeDataJSON; + /** Saved server-side order information */ + savedInfo?: TypePaymentRequestedInfo; + /** Contains information about saved card credentials */ + savedCredentials?: TypePaymentSavedCredentials; + /** Users */ + users: TypeUser[]; + } + + /** + * Payment form
+ * @link https://corefork.telegram.org/api/srp + */ + export class PaymentForm extends VirtualClass implements PaymentFormArgs { + CONSTRUCTOR_id: -1928649707; + SUBCLASS_OF_ID: 2689089305; + classType: "constructor"; + className: "payments.PaymentForm"; + flags: number; + canSaveCredentials?: true; + passwordMissing?: true; + formId: long; + botId: int; + invoice: TypeInvoice; + providerId: int; + url: string; + nativeProvider?: string; + nativeParams?: TypeDataJSON; + savedInfo?: TypePaymentRequestedInfo; + savedCredentials?: TypePaymentSavedCredentials; + users: TypeUser[]; + fromReader(reader: Reader): PaymentForm; + } + + export interface ValidatedRequestedInfoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** ID */ + id?: string; + /** Shipping options */ + shippingOptions?: TypeShippingOption[]; + } + + /** Validated user-provided info
*/ + export class ValidatedRequestedInfo extends VirtualClass implements ValidatedRequestedInfoArgs { + CONSTRUCTOR_id: -784000893; + SUBCLASS_OF_ID: 2407548087; + classType: "constructor"; + className: "payments.ValidatedRequestedInfo"; + flags: number; + id?: string; + shippingOptions?: TypeShippingOption[]; + fromReader(reader: Reader): ValidatedRequestedInfo; + } + + export interface PaymentResultArgs { + /** Info about the payment */ + updates: TypeUpdates; + } + + /** Payment result
*/ + export class PaymentResult extends VirtualClass implements PaymentResultArgs { + CONSTRUCTOR_id: 1314881805; + SUBCLASS_OF_ID: 2330028701; + classType: "constructor"; + className: "payments.PaymentResult"; + updates: TypeUpdates; + fromReader(reader: Reader): PaymentResult; + } + + export interface PaymentVerificationNeededArgs { + /** URL for additional payment credentials verification */ + url: string; + } + + /** Payment was not successful, additional verification is needed
*/ + export class PaymentVerificationNeeded extends VirtualClass implements PaymentVerificationNeededArgs { + CONSTRUCTOR_id: -666824391; + SUBCLASS_OF_ID: 2330028701; + classType: "constructor"; + className: "payments.PaymentVerificationNeeded"; + url: string; + fromReader(reader: Reader): PaymentVerificationNeeded; + } + + export interface PaymentReceiptArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Date of generation */ + date: int; + /** Bot ID */ + botId: int; + /** Provider ID */ + providerId: int; + /** Title */ + title: string; + /** Description */ + description: string; + /** Photo */ + photo?: TypeWebDocument; + /** Invoice */ + invoice: TypeInvoice; + /** Info */ + info?: TypePaymentRequestedInfo; + /** Selected shipping option */ + shipping?: TypeShippingOption; + /** Tipped amount */ + tipAmount?: long; + /** Three-letter ISO 4217 currency code */ + currency: string; + /** Total amount in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ + totalAmount: long; + /** Payment credential name */ + credentialsTitle: string; + /** Users */ + users: TypeUser[]; + } + + /** + * Receipt
+ * @link https://corefork.telegram.org/bots/payments + */ + export class PaymentReceipt extends VirtualClass implements PaymentReceiptArgs { + CONSTRUCTOR_id: 280319440; + SUBCLASS_OF_ID: 1493210057; + classType: "constructor"; + className: "payments.PaymentReceipt"; + flags: number; + date: int; + botId: int; + providerId: int; + title: string; + description: string; + photo?: TypeWebDocument; + invoice: TypeInvoice; + info?: TypePaymentRequestedInfo; + shipping?: TypeShippingOption; + tipAmount?: long; + currency: string; + totalAmount: long; + credentialsTitle: string; + users: TypeUser[]; + fromReader(reader: Reader): PaymentReceipt; + } + + export interface SavedInfoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the user has some saved payment credentials */ + hasSavedCredentials?: true; + /** Saved server-side order information */ + savedInfo?: TypePaymentRequestedInfo; + } + + /** Saved server-side order information
*/ + export class SavedInfo extends VirtualClass implements SavedInfoArgs { + CONSTRUCTOR_id: -74456004; + SUBCLASS_OF_ID: 2906452294; + classType: "constructor"; + className: "payments.SavedInfo"; + flags: number; + hasSavedCredentials?: true; + savedInfo?: TypePaymentRequestedInfo; + fromReader(reader: Reader): SavedInfo; + } + + export interface BankCardDataArgs { + /** Credit card title */ + title: string; + /** Info URL(s) provided by the card's bank(s) */ + openUrls: TypeBankCardOpenUrl[]; + } + + /** Credit card info, provided by the card's bank(s)
*/ + export class BankCardData extends VirtualClass implements BankCardDataArgs { + CONSTRUCTOR_id: 1042605427; + SUBCLASS_OF_ID: 2356008587; + classType: "constructor"; + className: "payments.BankCardData"; + title: string; + openUrls: TypeBankCardOpenUrl[]; + fromReader(reader: Reader): BankCardData; + } + + export interface GetPaymentFormArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The peer where the payment form was sent */ + peer: EntityLike; + /** Message ID of payment form */ + msgId: MessageIDLike; + /** A JSON object with the following keys, containing color theme information (integers, RGB24) to pass to the payment provider, to apply in eventual verification pages:
bg_color - Background color
text_color - Text color
hint_color - Hint text color
link_color - Link color
button_color - Button color
button_text_color - Button text color */ + themeParams?: TypeDataJSON; + } + + /** + * Get a payment form
+ * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + */ + export class GetPaymentForm extends Request,payments.TypePaymentForm> implements GetPaymentFormArgs { + CONSTRUCTOR_id: -1976353651; + SUBCLASS_OF_ID: 2689089305; + classType: "request"; + className: "payments.GetPaymentForm"; + flags: number; + peer: EntityLike; + msgId: MessageIDLike; + themeParams?: TypeDataJSON; + fromReader(reader: Reader): GetPaymentForm; + } + + export interface GetPaymentReceiptArgs { + /** The peer where the payment receipt was sent */ + peer: EntityLike; + /** Message ID of receipt */ + msgId: MessageIDLike; + } + + /** + * Get payment receipt
+ * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + */ + export class GetPaymentReceipt extends Request,payments.TypePaymentReceipt> implements GetPaymentReceiptArgs { + CONSTRUCTOR_id: 611897804; + SUBCLASS_OF_ID: 1493210057; + classType: "request"; + className: "payments.GetPaymentReceipt"; + peer: EntityLike; + msgId: MessageIDLike; + fromReader(reader: Reader): GetPaymentReceipt; + } + + export interface ValidateRequestedInfoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Save order information to re-use it for future orders */ + save?: true; + /** Peer where the payment form was sent */ + peer: EntityLike; + /** Message ID of payment form */ + msgId: MessageIDLike; + /** Requested order information */ + info: TypePaymentRequestedInfo; + } + + /** + * Submit requested order information for validation
+ * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + */ + export class ValidateRequestedInfo extends Request,payments.TypeValidatedRequestedInfo> implements ValidateRequestedInfoArgs { + CONSTRUCTOR_id: -619695760; + SUBCLASS_OF_ID: 2407548087; + classType: "request"; + className: "payments.ValidateRequestedInfo"; + flags: number; + save?: true; + peer: EntityLike; + msgId: MessageIDLike; + info: TypePaymentRequestedInfo; + fromReader(reader: Reader): ValidateRequestedInfo; + } + + export interface SendPaymentFormArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Form ID */ + formId: long; + /** The peer where the payment form was sent */ + peer: EntityLike; + /** Message ID of form */ + msgId: MessageIDLike; + /** ID of saved and validated order info */ + requestedInfoId?: string; + /** Chosen shipping option ID */ + shippingOptionId?: string; + /** Payment credentials */ + credentials: TypeInputPaymentCredentials; + /** Tip, in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ + tipAmount?: long; + } + + /** + * Send compiled payment form
+ * @link https://corefork.telegram.org/constructor/payments.validatedRequestedInfo + * @link https://corefork.telegram.org/bots/payments + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + */ + export class SendPaymentForm extends Request,payments.TypePaymentResult> implements SendPaymentFormArgs { + CONSTRUCTOR_id: 818134173; + SUBCLASS_OF_ID: 2330028701; + classType: "request"; + className: "payments.SendPaymentForm"; + flags: number; + formId: long; + peer: EntityLike; + msgId: MessageIDLike; + requestedInfoId?: string; + shippingOptionId?: string; + credentials: TypeInputPaymentCredentials; + tipAmount?: long; + fromReader(reader: Reader): SendPaymentForm; + } + + /** Get saved payment information
*/ + export class GetSavedInfo extends Request,payments.TypeSavedInfo> { + CONSTRUCTOR_id: 578650699; + SUBCLASS_OF_ID: 2906452294; + classType: "request"; + className: "payments.GetSavedInfo"; + fromReader(reader: Reader): GetSavedInfo; + } + + export interface ClearSavedInfoArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Remove saved payment credentials */ + credentials?: true; + /** Clear the last order settings saved by the user */ + info?: true; + } + + /** Clear saved payment information
*/ + export class ClearSavedInfo extends Request,Bool> implements ClearSavedInfoArgs { + CONSTRUCTOR_id: -667062079; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "payments.ClearSavedInfo"; + flags: number; + credentials?: true; + info?: true; + fromReader(reader: Reader): ClearSavedInfo; + } + + export interface GetBankCardDataArgs { + /** Credit card number */ + number: string; + } + + /** + * Get info about a credit card
+ * @throws {{code:400,type:"BANK_CARD_NUMBER_INVALID"}} The specified card number is invalid. + */ + export class GetBankCardData extends Request,payments.TypeBankCardData> implements GetBankCardDataArgs { + CONSTRUCTOR_id: 779736953; + SUBCLASS_OF_ID: 2356008587; + classType: "request"; + className: "payments.GetBankCardData"; + number: string; + fromReader(reader: Reader): GetBankCardData; + } + + type TypePaymentForm = PaymentForm; + type TypeValidatedRequestedInfo = ValidatedRequestedInfo; + type TypePaymentResult = PaymentResult | PaymentVerificationNeeded; + type TypePaymentReceipt = PaymentReceipt; + type TypeSavedInfo = SavedInfo; + type TypeBankCardData = BankCardData; + } + + namespace phone { + export interface PhoneCallArgs { + /** The VoIP phone call */ + phoneCall: TypePhoneCall; + /** VoIP phone call participants */ + users: TypeUser[]; + } + + /** A VoIP phone call
*/ + export class PhoneCall extends VirtualClass implements PhoneCallArgs { + CONSTRUCTOR_id: -326966976; + SUBCLASS_OF_ID: 3565878863; + classType: "constructor"; + className: "phone.PhoneCall"; + phoneCall: TypePhoneCall; + users: TypeUser[]; + fromReader(reader: Reader): PhoneCall; + } + + export interface GroupCallArgs { + /** Info about the group call */ + call: TypeGroupCall; + /** A partial list of participants. */ + participants: TypeGroupCallParticipant[]; + /** Next offset to use when fetching the remaining participants using phone.getGroupParticipants */ + participantsNextOffset: string; + /** Chats mentioned in the participants vector */ + chats: TypeChat[]; + /** Users mentioned in the participants vector */ + users: TypeUser[]; + } + + /** + * Contains info about a group call, and partial info about its participants.
+ * @link https://corefork.telegram.org/method/phone.getGroupParticipants + */ + export class GroupCall extends VirtualClass implements GroupCallArgs { + CONSTRUCTOR_id: -1636664659; + SUBCLASS_OF_ID: 809572030; + classType: "constructor"; + className: "phone.GroupCall"; + call: TypeGroupCall; + participants: TypeGroupCallParticipant[]; + participantsNextOffset: string; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): GroupCall; + } + + export interface GroupParticipantsArgs { + /** Number of participants */ + count: int; + /** List of participants */ + participants: TypeGroupCallParticipant[]; + /** If not empty, the specified list of participants is partial, and more participants can be fetched specifying this parameter as offset in phone.getGroupParticipants. */ + nextOffset: string; + /** Mentioned chats */ + chats: TypeChat[]; + /** Mentioned users */ + users: TypeUser[]; + /** Version info */ + version: int; + } + + /** + * Info about the participants of a group call or livestream
+ * @link https://corefork.telegram.org/method/phone.getGroupParticipants + */ + export class GroupParticipants extends VirtualClass implements GroupParticipantsArgs { + CONSTRUCTOR_id: -193506890; + SUBCLASS_OF_ID: 1926431988; + classType: "constructor"; + className: "phone.GroupParticipants"; + count: int; + participants: TypeGroupCallParticipant[]; + nextOffset: string; + chats: TypeChat[]; + users: TypeUser[]; + version: int; + fromReader(reader: Reader): GroupParticipants; + } + + export interface JoinAsPeersArgs { + /** Peers */ + peers: TypePeer[]; + /** Chats mentioned in the peers vector */ + chats: TypeChat[]; + /** Users mentioned in the peers vector */ + users: TypeUser[]; + } + + /** A list of peers that can be used to join a group call, presenting yourself as a specific user/channel.
*/ + export class JoinAsPeers extends VirtualClass implements JoinAsPeersArgs { + CONSTRUCTOR_id: -1343921601; + SUBCLASS_OF_ID: 3031920891; + classType: "constructor"; + className: "phone.JoinAsPeers"; + peers: TypePeer[]; + chats: TypeChat[]; + users: TypeUser[]; + fromReader(reader: Reader): JoinAsPeers; + } + + export interface ExportedGroupCallInviteArgs { + /** Invite link */ + link: string; + } + + /** An invite to a group call or livestream
*/ + export class ExportedGroupCallInvite extends VirtualClass implements ExportedGroupCallInviteArgs { + CONSTRUCTOR_id: 541839704; + SUBCLASS_OF_ID: 993787535; + classType: "constructor"; + className: "phone.ExportedGroupCallInvite"; + link: string; + fromReader(reader: Reader): ExportedGroupCallInvite; + } + + /** Get phone call configuration to be passed to libtgvoip's shared config
*/ + export class GetCallConfig extends Request,TypeDataJSON> { + CONSTRUCTOR_id: 1430593449; + SUBCLASS_OF_ID: 2902676200; + classType: "request"; + className: "phone.GetCallConfig"; + fromReader(reader: Reader): GetCallConfig; + } + + export interface RequestCallArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to start a video call */ + video?: true; + /** Destination of the phone call */ + userId: TypeInputUser; + /** Random ID to avoid resending the same object */ + randomId: int; + /** Parameter for E2E encryption key exchange » */ + gAHash: bytes; + /** Phone call settings */ + protocol: TypePhoneCallProtocol; + } + + /** + * Start a telegram phone call
+ * @link https://corefork.telegram.org/api/end-to-end/voice-calls + * @throws {{code:400,type:"CALL_PROTOCOL_FLAGS_INVALID"}} Call protocol flags invalid. + * @throws {{code:400,type:"PARTICIPANT_VERSION_OUTDATED"}} The other participant does not use an up to date telegram client with support for calls. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + * @throws {{code:403,type:"USER_IS_BLOCKED"}} You were blocked by this user. + * @throws {{code:403,type:"USER_PRIVACY_RESTRICTED"}} The user's privacy settings do not allow you to do this. + */ + export class RequestCall extends Request,phone.TypePhoneCall> implements RequestCallArgs { + CONSTRUCTOR_id: 1124046573; + SUBCLASS_OF_ID: 3565878863; + classType: "request"; + className: "phone.RequestCall"; + flags: number; + video?: true; + userId: TypeInputUser; + randomId: int; + gAHash: bytes; + protocol: TypePhoneCallProtocol; + fromReader(reader: Reader): RequestCall; + } + + export interface AcceptCallArgs { + /** The call to accept */ + peer: TypeInputPhoneCall; + /** Parameter for E2E encryption key exchange » */ + gB: bytes; + /** Phone call settings */ + protocol: TypePhoneCallProtocol; + } + + /** + * Accept incoming call
+ * @link https://corefork.telegram.org/api/end-to-end/voice-calls + * @throws {{code:400,type:"CALL_ALREADY_ACCEPTED"}} The call was already accepted. + * @throws {{code:400,type:"CALL_ALREADY_DECLINED"}} The call was already declined. + * @throws {{code:400,type:"CALL_PEER_INVALID"}} The provided call peer object is invalid. + * @throws {{code:400,type:"CALL_PROTOCOL_FLAGS_INVALID"}} Call protocol flags invalid. + */ + export class AcceptCall extends Request,phone.TypePhoneCall> implements AcceptCallArgs { + CONSTRUCTOR_id: 1003664544; + SUBCLASS_OF_ID: 3565878863; + classType: "request"; + className: "phone.AcceptCall"; + peer: TypeInputPhoneCall; + gB: bytes; + protocol: TypePhoneCallProtocol; + fromReader(reader: Reader): AcceptCall; + } + + export interface ConfirmCallArgs { + /** The phone call */ + peer: TypeInputPhoneCall; + /** Parameter for E2E encryption key exchange » */ + gA: bytes; + /** Key fingerprint */ + keyFingerprint: long; + /** Phone call settings */ + protocol: TypePhoneCallProtocol; + } + + /** + * Complete phone call E2E encryption key exchange »
+ * @link https://corefork.telegram.org/api/end-to-end/voice-calls + * @throws {{code:400,type:"CALL_ALREADY_DECLINED"}} The call was already declined. + * @throws {{code:400,type:"CALL_PEER_INVALID"}} The provided call peer object is invalid. + */ + export class ConfirmCall extends Request,phone.TypePhoneCall> implements ConfirmCallArgs { + CONSTRUCTOR_id: 788404002; + SUBCLASS_OF_ID: 3565878863; + classType: "request"; + className: "phone.ConfirmCall"; + peer: TypeInputPhoneCall; + gA: bytes; + keyFingerprint: long; + protocol: TypePhoneCallProtocol; + fromReader(reader: Reader): ConfirmCall; + } + + export interface ReceivedCallArgs { + /** The phone call we're currently in */ + peer: TypeInputPhoneCall; + } + + /** + * Optional: notify the server that the user is currently busy in a call: this will automatically refuse all incoming phone calls until the current phone call is ended.
+ * @throws {{code:400,type:"CALL_ALREADY_DECLINED"}} The call was already declined. + * @throws {{code:400,type:"CALL_PEER_INVALID"}} The provided call peer object is invalid. + */ + export class ReceivedCall extends Request,Bool> implements ReceivedCallArgs { + CONSTRUCTOR_id: 399855457; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "phone.ReceivedCall"; + peer: TypeInputPhoneCall; + fromReader(reader: Reader): ReceivedCall; + } + + export interface DiscardCallArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is a video call */ + video?: true; + /** The phone call */ + peer: TypeInputPhoneCall; + /** Call duration */ + duration: int; + /** Why was the call discarded */ + reason: TypePhoneCallDiscardReason; + /** Preferred libtgvoip relay ID */ + connectionId: long; + } + + /** + * Refuse or end running call
+ * @throws {{code:400,type:"CALL_ALREADY_ACCEPTED"}} The call was already accepted. + * @throws {{code:400,type:"CALL_PEER_INVALID"}} The provided call peer object is invalid. + */ + export class DiscardCall extends Request,TypeUpdates> implements DiscardCallArgs { + CONSTRUCTOR_id: -1295269440; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.DiscardCall"; + flags: number; + video?: true; + peer: TypeInputPhoneCall; + duration: int; + reason: TypePhoneCallDiscardReason; + connectionId: long; + fromReader(reader: Reader): DiscardCall; + } + + export interface SetCallRatingArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether the user decided on their own initiative to rate the call */ + userInitiative?: true; + /** The call to rate */ + peer: TypeInputPhoneCall; + /** Rating in 1-5 stars */ + rating: int; + /** An additional comment */ + comment: string; + } + + /** + * Rate a call
+ * @throws {{code:400,type:"CALL_PEER_INVALID"}} The provided call peer object is invalid. + */ + export class SetCallRating extends Request,TypeUpdates> implements SetCallRatingArgs { + CONSTRUCTOR_id: 1508562471; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.SetCallRating"; + flags: number; + userInitiative?: true; + peer: TypeInputPhoneCall; + rating: int; + comment: string; + fromReader(reader: Reader): SetCallRating; + } + + export interface SaveCallDebugArgs { + /** Phone call */ + peer: TypeInputPhoneCall; + /** Debug statistics obtained from libtgvoip */ + debug: TypeDataJSON; + } + + /** + * Send phone call debug data to server
+ * @throws {{code:400,type:"CALL_PEER_INVALID"}} The provided call peer object is invalid. + * @throws {{code:400,type:"DATA_JSON_INVALID"}} The provided JSON data is invalid. + */ + export class SaveCallDebug extends Request,Bool> implements SaveCallDebugArgs { + CONSTRUCTOR_id: 662363518; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "phone.SaveCallDebug"; + peer: TypeInputPhoneCall; + debug: TypeDataJSON; + fromReader(reader: Reader): SaveCallDebug; + } + + export interface SendSignalingDataArgs { + /** Phone call */ + peer: TypeInputPhoneCall; + /** Signaling payload */ + data: bytes; + } + + /** Send VoIP signaling data
*/ + export class SendSignalingData extends Request,Bool> implements SendSignalingDataArgs { + CONSTRUCTOR_id: -8744061; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "phone.SendSignalingData"; + peer: TypeInputPhoneCall; + data: bytes; + fromReader(reader: Reader): SendSignalingData; + } + + export interface CreateGroupCallArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Associate the group call or livestream to the provided group/supergroup/channel */ + peer: EntityLike; + /** Unique client message ID required to prevent creation of duplicate group calls */ + randomId: int; + /** Call title */ + title?: string; + /** For scheduled group call or livestreams, the absolute date when the group call will start */ + scheduleDate?: int; + } + + /** + * Create a group call or livestream
+ * @link https://corefork.telegram.org/api/channel + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"SCHEDULE_DATE_INVALID"}} Invalid schedule date provided. + */ + export class CreateGroupCall extends Request,TypeUpdates> implements CreateGroupCallArgs { + CONSTRUCTOR_id: 1221445336; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.CreateGroupCall"; + flags: number; + peer: EntityLike; + randomId: int; + title?: string; + scheduleDate?: int; + fromReader(reader: Reader): CreateGroupCall; + } + + export interface JoinGroupCallArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** If set, the user will be muted by default upon joining. */ + muted?: true; + /** If set, the user's video will be disabled by default upon joining. */ + videoStopped?: true; + /** The group call */ + call: TypeInputGroupCall; + /** Join the group call, presenting yourself as the specified user/channel */ + joinAs: EntityLike; + /** The invitation hash from the invite link: https://t.me/username?voicechat=hash */ + inviteHash?: string; + /** WebRTC parameters */ + params: TypeDataJSON; + } + + /** + * Join a group call
+ * @throws {{code:400,type:"GROUPCALL_SSRC_DUPLICATE_MUCH"}} The app needs to retry joining the group call with a new SSRC value. + */ + export class JoinGroupCall extends Request,TypeUpdates> implements JoinGroupCallArgs { + CONSTRUCTOR_id: -1322057861; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.JoinGroupCall"; + flags: number; + muted?: true; + videoStopped?: true; + call: TypeInputGroupCall; + joinAs: EntityLike; + inviteHash?: string; + params: TypeDataJSON; + fromReader(reader: Reader): JoinGroupCall; + } + + export interface LeaveGroupCallArgs { + /** The group call */ + call: TypeInputGroupCall; + /** Your source ID */ + source: int; + } + + /** Leave a group call
*/ + export class LeaveGroupCall extends Request,TypeUpdates> implements LeaveGroupCallArgs { + CONSTRUCTOR_id: 1342404601; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.LeaveGroupCall"; + call: TypeInputGroupCall; + source: int; + fromReader(reader: Reader): LeaveGroupCall; + } + + export interface InviteToGroupCallArgs { + /** The group call */ + call: TypeInputGroupCall; + /** The users to invite. */ + users: TypeInputUser[]; + } + + /** + * Invite a set of users to a group call.
+ * @throws {{code:403,type:"GROUPCALL_FORBIDDEN"}} The group call has already ended. + */ + export class InviteToGroupCall extends Request,TypeUpdates> implements InviteToGroupCallArgs { + CONSTRUCTOR_id: 2067345760; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.InviteToGroupCall"; + call: TypeInputGroupCall; + users: TypeInputUser[]; + fromReader(reader: Reader): InviteToGroupCall; + } + + export interface DiscardGroupCallArgs { + /** The group call to terminate */ + call: TypeInputGroupCall; + } + + /** Terminate a group call
*/ + export class DiscardGroupCall extends Request,TypeUpdates> implements DiscardGroupCallArgs { + CONSTRUCTOR_id: 2054648117; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.DiscardGroupCall"; + call: TypeInputGroupCall; + fromReader(reader: Reader): DiscardGroupCall; + } + + export interface ToggleGroupCallSettingsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Invalidate existing invite links */ + resetInviteHash?: true; + /** Group call */ + call: TypeInputGroupCall; + /** Whether all users will bthat join this group calle muted by default upon joining the group call */ + joinMuted?: Bool; + } + + /** + * Change group call settings
+ * @throws {{code:400,type:"GROUPCALL_NOT_MODIFIED"}} Group call settings weren't modified. + */ + export class ToggleGroupCallSettings extends Request,TypeUpdates> implements ToggleGroupCallSettingsArgs { + CONSTRUCTOR_id: 1958458429; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.ToggleGroupCallSettings"; + flags: number; + resetInviteHash?: true; + call: TypeInputGroupCall; + joinMuted?: Bool; + fromReader(reader: Reader): ToggleGroupCallSettings; + } + + export interface GetGroupCallArgs { + /** The group call */ + call: TypeInputGroupCall; + } + + /** + * Get info about a group call
+ * @link https://corefork.telegram.org/api/offsets + */ + export class GetGroupCall extends Request,phone.TypeGroupCall> implements GetGroupCallArgs { + CONSTRUCTOR_id: 209498135; + SUBCLASS_OF_ID: 809572030; + classType: "request"; + className: "phone.GetGroupCall"; + call: TypeInputGroupCall; + fromReader(reader: Reader): GetGroupCall; + } + + export interface GetGroupParticipantsArgs { + /** Group call */ + call: TypeInputGroupCall; + /** If specified, will fetch group participant info about the specified peers */ + ids: EntityLike[]; + /** If specified, will fetch group participant info about the specified WebRTC source IDs */ + sources: int[]; + /** Offset for results, taken from the next_offset field of phone.groupParticipants, initially an empty string.
Note: if no more results are available, the method call will return an empty next_offset; thus, avoid providing the next_offset returned in phone.groupParticipants if it is empty, to avoid an infinite loop. */ + offset: string; + /** Maximum number of results to return, see pagination */ + limit: int; + } + + /** + * Get group call participants
+ * @link https://corefork.telegram.org/constructor/phone.groupParticipants + * @link https://corefork.telegram.org/api/offsets + */ + export class GetGroupParticipants extends Request,phone.TypeGroupParticipants> implements GetGroupParticipantsArgs { + CONSTRUCTOR_id: -984033109; + SUBCLASS_OF_ID: 1926431988; + classType: "request"; + className: "phone.GetGroupParticipants"; + call: TypeInputGroupCall; + ids: EntityLike[]; + sources: int[]; + offset: string; + limit: int; + fromReader(reader: Reader): GetGroupParticipants; + } + + export interface CheckGroupCallArgs { + /** Group call */ + call: TypeInputGroupCall; + /** Source IDs */ + sources: int[]; + } + + /** Check whether the group call Server Forwarding Unit is currently receiving the streams with the specified WebRTC source IDs
*/ + export class CheckGroupCall extends Request,int[]> implements CheckGroupCallArgs { + CONSTRUCTOR_id: -1248003721; + SUBCLASS_OF_ID: 1344696591; + classType: "request"; + className: "phone.CheckGroupCall"; + call: TypeInputGroupCall; + sources: int[]; + fromReader(reader: Reader): CheckGroupCall; + } + + export interface ToggleGroupCallRecordArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to start or stop recording */ + start?: true; + /** Whether to also record video streams */ + call: TypeInputGroupCall; + /** The group call or livestream */ + title?: string; + } + + /** Start or stop recording a group call: the recorded audio and video streams will be automatically sent to Saved messages (the chat with ourselves).
*/ + export class ToggleGroupCallRecord extends Request,TypeUpdates> implements ToggleGroupCallRecordArgs { + CONSTRUCTOR_id: -1070962985; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.ToggleGroupCallRecord"; + flags: number; + start?: true; + call: TypeInputGroupCall; + title?: string; + fromReader(reader: Reader): ToggleGroupCallRecord; + } + + export interface EditGroupCallParticipantArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** The group call */ + call: TypeInputGroupCall; + /** The group call participant (can also be the user itself) */ + participant: EntityLike; + /** Whether to mute or unmute the specified participant */ + muted?: Bool; + /** New volume */ + volume?: int; + /** Raise or lower hand */ + raiseHand?: Bool; + /** Start or stop the video stream */ + videoStopped?: Bool; + /** Pause or resume the video stream */ + videoPaused?: Bool; + /** Pause or resume the screen sharing stream */ + presentationPaused?: Bool; + } + + /** + * Edit information about a given group call participant
Note: flags.N?Bool parameters can have three possible values: + * @link https://corefork.telegram.org/type/Bool + * @link https://corefork.telegram.org/constructor/boolTrue + * @link https://corefork.telegram.org/constructor/boolFalse + * @throws {{code:400,type:"USER_VOLUME_INVALID"}} The specified user volume is invalid. + */ + export class EditGroupCallParticipant extends Request,TypeUpdates> implements EditGroupCallParticipantArgs { + CONSTRUCTOR_id: -1524155713; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.EditGroupCallParticipant"; + flags: number; + call: TypeInputGroupCall; + participant: EntityLike; + muted?: Bool; + volume?: int; + raiseHand?: Bool; + videoStopped?: Bool; + videoPaused?: Bool; + presentationPaused?: Bool; + fromReader(reader: Reader): EditGroupCallParticipant; + } + + export interface EditGroupCallTitleArgs { + /** Group call */ + call: TypeInputGroupCall; + /** New title */ + title: string; + } + + /** Edit the title of a group call or livestream
*/ + export class EditGroupCallTitle extends Request,TypeUpdates> implements EditGroupCallTitleArgs { + CONSTRUCTOR_id: 480685066; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.EditGroupCallTitle"; + call: TypeInputGroupCall; + title: string; + fromReader(reader: Reader): EditGroupCallTitle; + } + + export interface GetGroupCallJoinAsArgs { + /** The dialog whose group call or livestream we're trying to join */ + peer: EntityLike; + } + + /** Get a list of peers that can be used to join a group call, presenting yourself as a specific user/channel.
*/ + export class GetGroupCallJoinAs extends Request,phone.TypeJoinAsPeers> implements GetGroupCallJoinAsArgs { + CONSTRUCTOR_id: -277077702; + SUBCLASS_OF_ID: 3031920891; + classType: "request"; + className: "phone.GetGroupCallJoinAs"; + peer: EntityLike; + fromReader(reader: Reader): GetGroupCallJoinAs; + } + + export interface ExportGroupCallInviteArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** For livestreams, if set, users that join using this link will be able to speak without explicitly requesting permission by (for example by raising their hand). */ + canSelfUnmute?: true; + /** The group call */ + call: TypeInputGroupCall; + } + + /** Get an invite link for a group call or livestream
*/ + export class ExportGroupCallInvite extends Request,phone.TypeExportedGroupCallInvite> implements ExportGroupCallInviteArgs { + CONSTRUCTOR_id: -425040769; + SUBCLASS_OF_ID: 993787535; + classType: "request"; + className: "phone.ExportGroupCallInvite"; + flags: number; + canSelfUnmute?: true; + call: TypeInputGroupCall; + fromReader(reader: Reader): ExportGroupCallInvite; + } + + export interface ToggleGroupCallStartSubscriptionArgs { + /** Scheduled group call */ + call: TypeInputGroupCall; + /** Enable or disable subscription */ + subscribed: Bool; + } + + /** Subscribe or unsubscribe to a scheduled group call
*/ + export class ToggleGroupCallStartSubscription extends Request,TypeUpdates> implements ToggleGroupCallStartSubscriptionArgs { + CONSTRUCTOR_id: 563885286; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.ToggleGroupCallStartSubscription"; + call: TypeInputGroupCall; + subscribed: Bool; + fromReader(reader: Reader): ToggleGroupCallStartSubscription; + } + + export interface StartScheduledGroupCallArgs { + /** The scheduled group call */ + call: TypeInputGroupCall; + } + + /** Start a scheduled group call.
*/ + export class StartScheduledGroupCall extends Request,TypeUpdates> implements StartScheduledGroupCallArgs { + CONSTRUCTOR_id: 1451287362; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.StartScheduledGroupCall"; + call: TypeInputGroupCall; + fromReader(reader: Reader): StartScheduledGroupCall; + } + + export interface SaveDefaultGroupCallJoinAsArgs { + /** The dialog */ + peer: EntityLike; + /** The default peer that will be used to join group calls in this dialog, presenting yourself as a specific user/channel. */ + joinAs: EntityLike; + } + + /** Set the default peer that will be used to join a group call in a specific dialog.
*/ + export class SaveDefaultGroupCallJoinAs extends Request,Bool> implements SaveDefaultGroupCallJoinAsArgs { + CONSTRUCTOR_id: 1465786252; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "phone.SaveDefaultGroupCallJoinAs"; + peer: EntityLike; + joinAs: EntityLike; + fromReader(reader: Reader): SaveDefaultGroupCallJoinAs; + } + + export interface JoinGroupCallPresentationArgs { + /** The group call */ + call: TypeInputGroupCall; + /** WebRTC parameters */ + params: TypeDataJSON; + } + + /** + * Start screen sharing in a call
+ * @link https://corefork.telegram.org/method/phone.joinGroupCall + * @throws {{code:403,type:"PARTICIPANT_JOIN_MISSING"}} Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall. + */ + export class JoinGroupCallPresentation extends Request,TypeUpdates> implements JoinGroupCallPresentationArgs { + CONSTRUCTOR_id: -873829436; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.JoinGroupCallPresentation"; + call: TypeInputGroupCall; + params: TypeDataJSON; + fromReader(reader: Reader): JoinGroupCallPresentation; + } + + export interface LeaveGroupCallPresentationArgs { + /** The group call */ + call: TypeInputGroupCall; + } + + /** Stop screen sharing in a group call
*/ + export class LeaveGroupCallPresentation extends Request,TypeUpdates> implements LeaveGroupCallPresentationArgs { + CONSTRUCTOR_id: 475058500; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "phone.LeaveGroupCallPresentation"; + call: TypeInputGroupCall; + fromReader(reader: Reader): LeaveGroupCallPresentation; + } + + type TypePhoneCall = PhoneCall; + type TypeGroupCall = GroupCall; + type TypeGroupParticipants = GroupParticipants; + type TypeJoinAsPeers = JoinAsPeers; + type TypeExportedGroupCallInvite = ExportedGroupCallInvite; + } + + namespace stats { + export interface BroadcastStatsArgs { + /** Period in consideration */ + period: TypeStatsDateRangeDays; + /** Follower count change for period in consideration */ + followers: TypeStatsAbsValueAndPrev; + /** total_viewcount/postcount, for posts posted during the period in consideration (views_per_post).
Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date). */ + viewsPerPost: TypeStatsAbsValueAndPrev; + /** total_viewcount/postcount, for posts posted during the period in consideration (views_per_post).
Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date) */ + sharesPerPost: TypeStatsAbsValueAndPrev; + /** Percentage of subscribers with enabled notifications */ + enabledNotifications: TypeStatsPercentValue; + /** Channel growth graph (absolute subscriber count) */ + growthGraph: TypeStatsGraph; + /** Followers growth graph (relative subscriber count) */ + followersGraph: TypeStatsGraph; + /** Muted users graph (relative) */ + muteGraph: TypeStatsGraph; + /** Views per hour graph (absolute) */ + topHoursGraph: TypeStatsGraph; + /** Interactions graph (absolute) */ + interactionsGraph: TypeStatsGraph; + /** IV interactions graph (absolute) */ + ivInteractionsGraph: TypeStatsGraph; + /** Views by source graph (absolute) */ + viewsBySourceGraph: TypeStatsGraph; + /** New followers by source graph (absolute) */ + newFollowersBySourceGraph: TypeStatsGraph; + /** Subscriber language graph (piechart) */ + languagesGraph: TypeStatsGraph; + /** Recent message interactions */ + recentMessageInteractions: TypeMessageInteractionCounters[]; + } + + /** + * Channel statistics.
+ * @link https://corefork.telegram.org/api/stats + */ + export class BroadcastStats extends VirtualClass implements BroadcastStatsArgs { + CONSTRUCTOR_id: -1107852396; + SUBCLASS_OF_ID: 2146587688; + classType: "constructor"; + className: "stats.BroadcastStats"; + period: TypeStatsDateRangeDays; + followers: TypeStatsAbsValueAndPrev; + viewsPerPost: TypeStatsAbsValueAndPrev; + sharesPerPost: TypeStatsAbsValueAndPrev; + enabledNotifications: TypeStatsPercentValue; + growthGraph: TypeStatsGraph; + followersGraph: TypeStatsGraph; + muteGraph: TypeStatsGraph; + topHoursGraph: TypeStatsGraph; + interactionsGraph: TypeStatsGraph; + ivInteractionsGraph: TypeStatsGraph; + viewsBySourceGraph: TypeStatsGraph; + newFollowersBySourceGraph: TypeStatsGraph; + languagesGraph: TypeStatsGraph; + recentMessageInteractions: TypeMessageInteractionCounters[]; + fromReader(reader: Reader): BroadcastStats; + } + + export interface MegagroupStatsArgs { + /** Period in consideration */ + period: TypeStatsDateRangeDays; + /** Member count change for period in consideration */ + members: TypeStatsAbsValueAndPrev; + /** Message number change for period in consideration */ + messages: TypeStatsAbsValueAndPrev; + /** Number of users that viewed messages, for range in consideration */ + viewers: TypeStatsAbsValueAndPrev; + /** Number of users that posted messages, for range in consideration */ + posters: TypeStatsAbsValueAndPrev; + /** Supergroup growth graph (absolute subscriber count) */ + growthGraph: TypeStatsGraph; + /** Members growth (relative subscriber count) */ + membersGraph: TypeStatsGraph; + /** New members by source graph */ + newMembersBySourceGraph: TypeStatsGraph; + /** Subscriber language graph (piechart) */ + languagesGraph: TypeStatsGraph; + /** Message activity graph (stacked bar graph, message type) */ + messagesGraph: TypeStatsGraph; + /** Group activity graph (deleted, modified messages, blocked users) */ + actionsGraph: TypeStatsGraph; + /** Activity per hour graph (absolute) */ + topHoursGraph: TypeStatsGraph; + /** Activity per day of week graph (absolute) */ + weekdaysGraph: TypeStatsGraph; + /** Info about most active group members */ + topPosters: TypeStatsGroupTopPoster[]; + /** Info about most active group admins */ + topAdmins: TypeStatsGroupTopAdmin[]; + /** Info about most active group inviters */ + topInviters: TypeStatsGroupTopInviter[]; + /** Info about users mentioned in statistics */ + users: TypeUser[]; + } + + /** + * Supergroup statistics
+ * @link https://corefork.telegram.org/api/stats + */ + export class MegagroupStats extends VirtualClass implements MegagroupStatsArgs { + CONSTRUCTOR_id: -276825834; + SUBCLASS_OF_ID: 1532608141; + classType: "constructor"; + className: "stats.MegagroupStats"; + period: TypeStatsDateRangeDays; + members: TypeStatsAbsValueAndPrev; + messages: TypeStatsAbsValueAndPrev; + viewers: TypeStatsAbsValueAndPrev; + posters: TypeStatsAbsValueAndPrev; + growthGraph: TypeStatsGraph; + membersGraph: TypeStatsGraph; + newMembersBySourceGraph: TypeStatsGraph; + languagesGraph: TypeStatsGraph; + messagesGraph: TypeStatsGraph; + actionsGraph: TypeStatsGraph; + topHoursGraph: TypeStatsGraph; + weekdaysGraph: TypeStatsGraph; + topPosters: TypeStatsGroupTopPoster[]; + topAdmins: TypeStatsGroupTopAdmin[]; + topInviters: TypeStatsGroupTopInviter[]; + users: TypeUser[]; + fromReader(reader: Reader): MegagroupStats; + } + + export interface MessageStatsArgs { + /** Message view graph */ + viewsGraph: TypeStatsGraph; + } + + /** Message statistics
*/ + export class MessageStats extends VirtualClass implements MessageStatsArgs { + CONSTRUCTOR_id: -1986399595; + SUBCLASS_OF_ID: 2516886306; + classType: "constructor"; + className: "stats.MessageStats"; + viewsGraph: TypeStatsGraph; + fromReader(reader: Reader): MessageStats; + } + + export interface GetBroadcastStatsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to enable dark theme for graph colors */ + dark?: true; + /** The channel */ + channel: TypeInputChannel; + } + + /** + * Get channel statistics
+ * @link https://corefork.telegram.org/api/stats + * @throws {{code:400,type:"BROADCAST_REQUIRED"}} This method can only be called on a channel, please use stats.getMegagroupStats for supergroups. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + */ + export class GetBroadcastStats extends Request,stats.TypeBroadcastStats> implements GetBroadcastStatsArgs { + CONSTRUCTOR_id: -1421720550; + SUBCLASS_OF_ID: 2146587688; + classType: "request"; + className: "stats.GetBroadcastStats"; + flags: number; + dark?: true; + channel: TypeInputChannel; + fromReader(reader: Reader): GetBroadcastStats; + } + + export interface LoadAsyncGraphArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Graph token from statsGraphAsync constructor */ + token: string; + /** Zoom value, if required */ + x?: long; + } + + /** + * Load channel statistics graph asynchronously
+ * @link https://corefork.telegram.org/constructor/statsGraphAsync + * @link https://corefork.telegram.org/api/stats + * @link https://corefork.telegram.org/method/stats.loadAsyncGraph + * @link https://corefork.telegram.org/api/stats + * @throws {{code:400,type:"GRAPH_EXPIRED_RELOAD"}} This graph has expired, please obtain a new graph token. + * @throws {{code:400,type:"GRAPH_INVALID_RELOAD"}} Invalid graph token provided, please reload the stats and provide the updated token. + * @throws {{code:400,type:"GRAPH_OUTDATED_RELOAD"}} The graph is outdated, please get a new async token using stats.getBroadcastStats. + */ + export class LoadAsyncGraph extends Request,TypeStatsGraph> implements LoadAsyncGraphArgs { + CONSTRUCTOR_id: 1646092192; + SUBCLASS_OF_ID: 2609918291; + classType: "request"; + className: "stats.LoadAsyncGraph"; + flags: number; + token: string; + x?: long; + fromReader(reader: Reader): LoadAsyncGraph; + } + + export interface GetMegagroupStatsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to enable dark theme for graph colors */ + dark?: true; + /** Supergroup ID */ + channel: TypeInputChannel; + } + + /** + * Get supergroup statistics
+ * @link https://corefork.telegram.org/api/channel + * @link https://corefork.telegram.org/api/stats + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"MEGAGROUP_REQUIRED"}} You can only use this method on a supergroup. + */ + export class GetMegagroupStats extends Request,stats.TypeMegagroupStats> implements GetMegagroupStatsArgs { + CONSTRUCTOR_id: -589330937; + SUBCLASS_OF_ID: 1532608141; + classType: "request"; + className: "stats.GetMegagroupStats"; + flags: number; + dark?: true; + channel: TypeInputChannel; + fromReader(reader: Reader): GetMegagroupStats; + } + + export interface GetMessagePublicForwardsArgs { + /** Source channel */ + channel: TypeInputChannel; + /** Source message ID */ + msgId: MessageIDLike; + /** Initially 0, then set to the next_rate parameter of messages.messagesSlice */ + offsetRate: int; + /** Offsets for pagination, for more info click here */ + offsetPeer: EntityLike; + /** Offsets for pagination, for more info click here */ + offsetId: int; + /** Maximum number of results to return, see pagination */ + limit: int; + } + + /** + * Obtains a list of messages, indicating to which other public channels was a channel message forwarded.
+ * Will return a list of messages with peer_id equal to the public channel to which this message was forwarded.
+ * @link https://corefork.telegram.org/constructor/messages.messagesSlice + * @link https://corefork.telegram.org/api/offsets + * @link https://corefork.telegram.org/constructor/message + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + * @throws {{code:400,type:"MESSAGE_ID_INVALID"}} The provided message id is invalid. + */ + export class GetMessagePublicForwards extends Request,messages.TypeMessages> implements GetMessagePublicForwardsArgs { + CONSTRUCTOR_id: 1445996571; + SUBCLASS_OF_ID: 3568569182; + classType: "request"; + className: "stats.GetMessagePublicForwards"; + channel: TypeInputChannel; + msgId: MessageIDLike; + offsetRate: int; + offsetPeer: EntityLike; + offsetId: int; + limit: int; + fromReader(reader: Reader): GetMessagePublicForwards; + } + + export interface GetMessageStatsArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether to enable dark theme for graph colors */ + dark?: true; + /** Channel ID */ + channel: TypeInputChannel; + /** Message ID */ + msgId: MessageIDLike; + } + + /** + * Get message statistics
+ * @link https://corefork.telegram.org/api/stats + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHAT_ADMIN_REQUIRED"}} You must be an admin in this chat to do this. + */ + export class GetMessageStats extends Request,stats.TypeMessageStats> implements GetMessageStatsArgs { + CONSTRUCTOR_id: -1226791947; + SUBCLASS_OF_ID: 2516886306; + classType: "request"; + className: "stats.GetMessageStats"; + flags: number; + dark?: true; + channel: TypeInputChannel; + msgId: MessageIDLike; + fromReader(reader: Reader): GetMessageStats; + } + + type TypeBroadcastStats = BroadcastStats; + type TypeMegagroupStats = MegagroupStats; + type TypeMessageStats = MessageStats; + } + + namespace stickers { + export interface SuggestedShortNameArgs { + /** Suggested short name */ + shortName: string; + } + + /** A suggested short name for a stickerpack
*/ + export class SuggestedShortName extends VirtualClass implements SuggestedShortNameArgs { + CONSTRUCTOR_id: -2046910401; + SUBCLASS_OF_ID: 3293203233; + classType: "constructor"; + className: "stickers.SuggestedShortName"; + shortName: string; + fromReader(reader: Reader): SuggestedShortName; + } + + export interface CreateStickerSetArgs { + /** Flags, see TL conditional fields */ + flags: number; + /** Whether this is a mask stickerset */ + masks?: true; + /** Whether this is an animated stickerset */ + animated?: true; + /** Stickerset owner */ + userId: TypeInputUser; + /** Stickerset name, 1-64 chars */ + title: string; + /** Sticker set name. Can contain only English letters, digits and underscores. Must end with "by" ( is case insensitive); 1-64 characters */ + shortName: string; + /** Thumbnail */ + thumb?: TypeInputDocument; + /** Stickers */ + stickers: TypeInputStickerSetItem[]; + /** Used when importing stickers using the sticker import SDKs, specifies the name of the software that created the stickers */ + software?: string; + } + + /** + * Create a stickerset, bots only.
+ * @throws {{code:400,type:"BOT_MISSING"}} This method can only be run by a bot. + * @throws {{code:400,type:"PACK_SHORT_NAME_INVALID"}} Short pack name invalid. + * @throws {{code:400,type:"PACK_SHORT_NAME_OCCUPIED"}} A stickerpack with this name already exists. + * @throws {{code:400,type:"PACK_TITLE_INVALID"}} The stickerpack title is invalid. + * @throws {{code:400,type:"PEER_ID_INVALID"}} The provided peer id is invalid. + * @throws {{code:400,type:"SHORTNAME_OCCUPY_FAILED"}} An internal error occurred. + * @throws {{code:400,type:"STICKERS_EMPTY"}} No sticker provided. + * @throws {{code:400,type:"STICKER_EMOJI_INVALID"}} Sticker emoji invalid. + * @throws {{code:400,type:"STICKER_FILE_INVALID"}} Sticker file invalid. + * @throws {{code:400,type:"STICKER_PNG_DIMENSIONS"}} Sticker png dimensions invalid. + * @throws {{code:400,type:"STICKER_PNG_NOPNG"}} One of the specified stickers is not a valid PNG file. + * @throws {{code:400,type:"STICKER_TGS_NODOC"}} Incorrect document type for sticker. + * @throws {{code:400,type:"STICKER_TGS_NOTGS"}} Invalid TGS sticker provided. + * @throws {{code:400,type:"STICKER_THUMB_PNG_NOPNG"}} Incorrect stickerset thumb file provided, PNG / WEBP expected. + * @throws {{code:400,type:"STICKER_THUMB_TGS_NOTGS"}} Incorrect stickerset TGS thumb file provided. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class CreateStickerSet extends Request,messages.TypeStickerSet> implements CreateStickerSetArgs { + CONSTRUCTOR_id: -1876841625; + SUBCLASS_OF_ID: 2607827546; + classType: "request"; + className: "stickers.CreateStickerSet"; + flags: number; + masks?: true; + animated?: true; + userId: TypeInputUser; + title: string; + shortName: string; + thumb?: TypeInputDocument; + stickers: TypeInputStickerSetItem[]; + software?: string; + fromReader(reader: Reader): CreateStickerSet; + } + + export interface RemoveStickerFromSetArgs { + /** The sticker to remove */ + sticker: TypeInputDocument; + } + + /** + * Remove a sticker from the set where it belongs, bots only. The sticker set must have been created by the bot.
+ * @throws {{code:400,type:"BOT_MISSING"}} This method can only be run by a bot. + * @throws {{code:400,type:"STICKER_INVALID"}} The provided sticker is invalid. + */ + export class RemoveStickerFromSet extends Request,messages.TypeStickerSet> implements RemoveStickerFromSetArgs { + CONSTRUCTOR_id: -143257775; + SUBCLASS_OF_ID: 2607827546; + classType: "request"; + className: "stickers.RemoveStickerFromSet"; + sticker: TypeInputDocument; + fromReader(reader: Reader): RemoveStickerFromSet; + } + + export interface ChangeStickerPositionArgs { + /** The sticker */ + sticker: TypeInputDocument; + /** The new position of the sticker, zero-based */ + position: int; + } + + /** + * Changes the absolute position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot
+ * @throws {{code:400,type:"BOT_MISSING"}} This method can only be run by a bot. + * @throws {{code:400,type:"STICKER_INVALID"}} The provided sticker is invalid. + */ + export class ChangeStickerPosition extends Request,messages.TypeStickerSet> implements ChangeStickerPositionArgs { + CONSTRUCTOR_id: -4795190; + SUBCLASS_OF_ID: 2607827546; + classType: "request"; + className: "stickers.ChangeStickerPosition"; + sticker: TypeInputDocument; + position: int; + fromReader(reader: Reader): ChangeStickerPosition; + } + + export interface AddStickerToSetArgs { + /** The stickerset */ + stickerset: TypeInputStickerSet; + /** The sticker */ + sticker: TypeInputStickerSetItem; + } + + /** + * Add a sticker to a stickerset, bots only. The sticker set must have been created by the bot.
+ * @throws {{code:400,type:"BOT_MISSING"}} This method can only be run by a bot. + * @throws {{code:400,type:"STICKERSET_INVALID"}} The provided sticker set is invalid. + * @throws {{code:400,type:"STICKER_PNG_NOPNG"}} One of the specified stickers is not a valid PNG file. + * @throws {{code:400,type:"STICKER_TGS_NOTGS"}} Invalid TGS sticker provided. + */ + export class AddStickerToSet extends Request,messages.TypeStickerSet> implements AddStickerToSetArgs { + CONSTRUCTOR_id: -2041315650; + SUBCLASS_OF_ID: 2607827546; + classType: "request"; + className: "stickers.AddStickerToSet"; + stickerset: TypeInputStickerSet; + sticker: TypeInputStickerSetItem; + fromReader(reader: Reader): AddStickerToSet; + } + + export interface SetStickerSetThumbArgs { + /** Stickerset */ + stickerset: TypeInputStickerSet; + /** Thumbnail */ + thumb: TypeInputDocument; + } + + /** + * Set stickerset thumbnail
+ * @throws {{code:400,type:"STICKERSET_INVALID"}} The provided sticker set is invalid. + * @throws {{code:400,type:"STICKER_THUMB_PNG_NOPNG"}} Incorrect stickerset thumb file provided, PNG / WEBP expected. + * @throws {{code:400,type:"STICKER_THUMB_TGS_NOTGS"}} Incorrect stickerset TGS thumb file provided. + */ + export class SetStickerSetThumb extends Request,messages.TypeStickerSet> implements SetStickerSetThumbArgs { + CONSTRUCTOR_id: -1707717072; + SUBCLASS_OF_ID: 2607827546; + classType: "request"; + className: "stickers.SetStickerSetThumb"; + stickerset: TypeInputStickerSet; + thumb: TypeInputDocument; + fromReader(reader: Reader): SetStickerSetThumb; + } + + export interface CheckShortNameArgs { + /** Short name */ + shortName: string; + } + + /** + * Check whether the given short name is available
+ * @throws {{code:400,type:"SHORT_NAME_INVALID"}} The specified short name is invalid. + * @throws {{code:400,type:"SHORT_NAME_OCCUPIED"}} The specified short name is already in use. + */ + export class CheckShortName extends Request,Bool> implements CheckShortNameArgs { + CONSTRUCTOR_id: 676017721; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "stickers.CheckShortName"; + shortName: string; + fromReader(reader: Reader): CheckShortName; + } + + export interface SuggestShortNameArgs { + /** Sticker pack name */ + title: string; + } + + /** + * Suggests a short name for a given stickerpack name
+ * @throws {{code:400,type:"TITLE_INVALID"}} The specified stickerpack title is invalid. + */ + export class SuggestShortName extends Request,stickers.TypeSuggestedShortName> implements SuggestShortNameArgs { + CONSTRUCTOR_id: 1303364867; + SUBCLASS_OF_ID: 3293203233; + classType: "request"; + className: "stickers.SuggestShortName"; + title: string; + fromReader(reader: Reader): SuggestShortName; + } + + type TypeSuggestedShortName = SuggestedShortName; + } + + namespace users { + export interface GetUsersArgs { + /** List of user identifiers */ + id: TypeInputUser[]; + } + + /** + * Returns basic user info according to their identifiers.
+ * @throws {{code:401,type:"AUTH_KEY_PERM_EMPTY"}} The temporary auth key must be binded to the permanent auth key to use these methods. + * @throws {{code:400,type:"CHANNEL_INVALID"}} The provided channel is invalid. + * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"CONNECTION_NOT_INITED"}} Connection not initialized. + * @throws {{code:400,type:"INPUT_LAYER_INVALID"}} The provided layer is invalid. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + */ + export class GetUsers extends Request,TypeUser[]> implements GetUsersArgs { + CONSTRUCTOR_id: 227648840; + SUBCLASS_OF_ID: 67557965; + classType: "request"; + className: "users.GetUsers"; + id: TypeInputUser[]; + fromReader(reader: Reader): GetUsers; + } + + export interface GetFullUserArgs { + /** User ID */ + id: TypeInputUser; + } + + /** + * Returns extended user info by ID.
+ * @throws {{code:400,type:"CHANNEL_PRIVATE"}} You haven't joined this channel/supergroup. + * @throws {{code:400,type:"MSG_ID_INVALID"}} Invalid message ID provided. + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class GetFullUser extends Request,TypeUserFull> implements GetFullUserArgs { + CONSTRUCTOR_id: -902781519; + SUBCLASS_OF_ID: 524706233; + classType: "request"; + className: "users.GetFullUser"; + id: TypeInputUser; + fromReader(reader: Reader): GetFullUser; + } + + export interface SetSecureValueErrorsArgs { + /** The user */ + id: TypeInputUser; + /** Errors */ + errors: TypeSecureValueError[]; + } + + /** + * Notify the user that the sent passport data contains some errors The user will not be able to re-submit their Passport data to you until the errors are fixed (the contents of the field for which you returned the error must change).
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
+ * @link https://corefork.telegram.org/passport + * @throws {{code:400,type:"USER_ID_INVALID"}} The provided user ID is invalid. + */ + export class SetSecureValueErrors extends Request,Bool> implements SetSecureValueErrorsArgs { + CONSTRUCTOR_id: -1865902923; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "users.SetSecureValueErrors"; + id: TypeInputUser; + errors: TypeSecureValueError[]; + fromReader(reader: Reader): SetSecureValueErrors; + } + } + + namespace bots { + export interface SendCustomRequestArgs { + /** The method name */ + customMethod: string; + /** JSON-serialized method parameters */ + params: TypeDataJSON; + } + + /** + * Sends a custom request; for bots only
+ * @throws {{code:400,type:"METHOD_INVALID"}} The specified method is invalid. + * @throws {{code:400,type:"USER_BOT_INVALID"}} This method can only be called by a bot. + */ + export class SendCustomRequest extends Request,TypeDataJSON> implements SendCustomRequestArgs { + CONSTRUCTOR_id: -1440257555; + SUBCLASS_OF_ID: 2902676200; + classType: "request"; + className: "bots.SendCustomRequest"; + customMethod: string; + params: TypeDataJSON; + fromReader(reader: Reader): SendCustomRequest; + } + + export interface AnswerWebhookJSONQueryArgs { + /** Identifier of a custom query */ + queryId: long; + /** JSON-serialized answer to the query */ + data: TypeDataJSON; + } + + /** + * Answers a custom query; for bots only
+ * @throws {{code:400,type:"QUERY_ID_INVALID"}} The query ID is invalid. + * @throws {{code:400,type:"USER_BOT_INVALID"}} This method can only be called by a bot. + */ + export class AnswerWebhookJSONQuery extends Request,Bool> implements AnswerWebhookJSONQueryArgs { + CONSTRUCTOR_id: -434028723; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "bots.AnswerWebhookJSONQuery"; + queryId: long; + data: TypeDataJSON; + fromReader(reader: Reader): AnswerWebhookJSONQuery; + } + + export interface SetBotCommandsArgs { + /** Command scope */ + scope: TypeBotCommandScope; + /** Language code */ + langCode: string; + /** Bot commands */ + commands: TypeBotCommand[]; + } + + /** + * Set bot command list
+ * @throws {{code:400,type:"BOT_COMMAND_DESCRIPTION_INVALID"}} The specified command description is invalid. + * @throws {{code:400,type:"BOT_COMMAND_INVALID"}} The specified command is invalid. + * @throws {{code:400,type:"LANG_CODE_INVALID"}} The specified language code is invalid. + */ + export class SetBotCommands extends Request,Bool> implements SetBotCommandsArgs { + CONSTRUCTOR_id: 85399130; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "bots.SetBotCommands"; + scope: TypeBotCommandScope; + langCode: string; + commands: TypeBotCommand[]; + fromReader(reader: Reader): SetBotCommands; + } + + export interface ResetBotCommandsArgs { + /** Command scope */ + scope: TypeBotCommandScope; + /** Language code */ + langCode: string; + } + + /** Clear bot commands for the specified bot scope and language code
*/ + export class ResetBotCommands extends Request,Bool> implements ResetBotCommandsArgs { + CONSTRUCTOR_id: 1032708345; + SUBCLASS_OF_ID: 4122188204; + classType: "request"; + className: "bots.ResetBotCommands"; + scope: TypeBotCommandScope; + langCode: string; + fromReader(reader: Reader): ResetBotCommands; + } + + export interface GetBotCommandsArgs { + /** Command scope */ + scope: TypeBotCommandScope; + /** Language code */ + langCode: string; + } + + /** Obtain a list of bot commands for the specified bot scope and language code
*/ + export class GetBotCommands extends Request,TypeBotCommand[]> implements GetBotCommandsArgs { + CONSTRUCTOR_id: -481554986; + SUBCLASS_OF_ID: 4209579305; + classType: "request"; + className: "bots.GetBotCommands"; + scope: TypeBotCommandScope; + langCode: string; + fromReader(reader: Reader): GetBotCommands; + } + } + + namespace langpack { + export interface GetLangPackArgs { + /** Language pack name */ + langPack: string; + /** Language code */ + langCode: string; + } + + /** + * Get localization pack strings
+ * @throws {{code:400,type:"LANG_PACK_INVALID"}} The provided language pack is invalid. + */ + export class GetLangPack extends Request,TypeLangPackDifference> implements GetLangPackArgs { + CONSTRUCTOR_id: -219008246; + SUBCLASS_OF_ID: 1382427989; + classType: "request"; + className: "langpack.GetLangPack"; + langPack: string; + langCode: string; + fromReader(reader: Reader): GetLangPack; + } + + export interface GetStringsArgs { + /** Language pack name */ + langPack: string; + /** Language code */ + langCode: string; + /** Strings to get */ + keys: string[]; + } + + /** + * Get strings from a language pack
+ * @throws {{code:400,type:"LANG_PACK_INVALID"}} The provided language pack is invalid. + */ + export class GetStrings extends Request,TypeLangPackString[]> implements GetStringsArgs { + CONSTRUCTOR_id: -269862909; + SUBCLASS_OF_ID: 3350672701; + classType: "request"; + className: "langpack.GetStrings"; + langPack: string; + langCode: string; + keys: string[]; + fromReader(reader: Reader): GetStrings; + } + + export interface GetDifferenceArgs { + /** Language pack */ + langPack: string; + /** Language code */ + langCode: string; + /** Previous localization pack version */ + fromVersion: int; + } + + /** + * Get new strings in languagepack
+ * @throws {{code:400,type:"LANG_PACK_INVALID"}} The provided language pack is invalid. + */ + export class GetDifference extends Request,TypeLangPackDifference> implements GetDifferenceArgs { + CONSTRUCTOR_id: -845657435; + SUBCLASS_OF_ID: 1382427989; + classType: "request"; + className: "langpack.GetDifference"; + langPack: string; + langCode: string; + fromVersion: int; + fromReader(reader: Reader): GetDifference; + } + + export interface GetLanguagesArgs { + /** Language pack */ + langPack: string; + } + + /** + * Get information about all languages in a localization pack
+ * @throws {{code:400,type:"LANG_PACK_INVALID"}} The provided language pack is invalid. + */ + export class GetLanguages extends Request,TypeLangPackLanguage[]> implements GetLanguagesArgs { + CONSTRUCTOR_id: 1120311183; + SUBCLASS_OF_ID: 671683273; + classType: "request"; + className: "langpack.GetLanguages"; + langPack: string; + fromReader(reader: Reader): GetLanguages; + } + + export interface GetLanguageArgs { + /** Language pack name */ + langPack: string; + /** Language code */ + langCode: string; + } + + /** Get information about a language in a localization pack
*/ + export class GetLanguage extends Request,TypeLangPackLanguage> implements GetLanguageArgs { + CONSTRUCTOR_id: 1784243458; + SUBCLASS_OF_ID: 2880211383; + classType: "request"; + className: "langpack.GetLanguage"; + langPack: string; + langCode: string; + fromReader(reader: Reader): GetLanguage; + } + } + + namespace folders { + export interface EditPeerFoldersArgs { + /** New peer list */ + folderPeers: TypeInputFolderPeer[]; + } + + /** + * Edit peers in peer folder
+ * @link https://corefork.telegram.org/api/folders + * @throws {{code:400,type:"FOLDER_ID_INVALID"}} Invalid folder ID. + */ + export class EditPeerFolders extends Request,TypeUpdates> implements EditPeerFoldersArgs { + CONSTRUCTOR_id: 1749536939; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "folders.EditPeerFolders"; + folderPeers: TypeInputFolderPeer[]; + fromReader(reader: Reader): EditPeerFolders; + } + + export interface DeleteFolderArgs { + /** Peer folder ID, for more info click here */ + folderId: int; + } + + /** + * Delete a peer folder
+ * @link https://corefork.telegram.org/api/folders + * @throws {{code:400,type:"FOLDER_ID_EMPTY"}} An empty folder ID was specified. + */ + export class DeleteFolder extends Request,TypeUpdates> implements DeleteFolderArgs { + CONSTRUCTOR_id: 472471681; + SUBCLASS_OF_ID: 2331323052; + classType: "request"; + className: "folders.DeleteFolder"; + folderId: int; + fromReader(reader: Reader): DeleteFolder; + } + } +} diff --git a/gramjs/tl/types-generator/deno.lock b/gramjs/tl/types-generator/deno.lock new file mode 100644 index 00000000..a95bdc8e --- /dev/null +++ b/gramjs/tl/types-generator/deno.lock @@ -0,0 +1,43 @@ +{ + "https://cdn.esm.sh/v57/@types/ramda@0.27.47/index.d.ts": "ad0128d8c8f721ce18f5e8ba8c019e2916af98db9ad8c999d6ee02a44c31bab5", + "https://cdn.esm.sh/v57/@types/ramda@0.27.47/tools.d.ts": "9755e04f5281782c3bdd5db586c0070b98048e1caaa44f7e99eee8bf0cec0f6f", + "https://cdn.esm.sh/v57/ramda@0.27.1/deno/ramda.js": "ba0ce79d7bfc89a86eab7c885f0cd00413ed838fbfbb577b10909476cf1707fe", + "https://cdn.esm.sh/v57/ts-toolbelt@6.15.5/out/index.d.ts": "9df147746b0cbd11d022b564e6fdd43ac79b643dc579d2123317ee01cc4f0d70", + "https://deno.land/std@0.106.0/_util/assert.ts": "2f868145a042a11d5ad0a3c748dcf580add8a0dbc0e876eaa0026303a5488f58", + "https://deno.land/std@0.106.0/_util/os.ts": "dfb186cc4e968c770ab6cc3288bd65f4871be03b93beecae57d657232ecffcac", + "https://deno.land/std@0.106.0/fs/_util.ts": "f2ce811350236ea8c28450ed822a5f42a0892316515b1cd61321dec13569c56b", + "https://deno.land/std@0.106.0/fs/ensure_dir.ts": "b7c103dc41a3d1dbbb522bf183c519c37065fdc234831a4a0f7d671b1ed5fea7", + "https://deno.land/std@0.106.0/fs/expand_glob.ts": "73e7b13f01097b04ed782b3d63863379b718417417758ba622e282b1e5300b91", + "https://deno.land/std@0.106.0/fs/walk.ts": "b91c655c60d048035f9cae0e6177991ab3245e786e3ab7d20a5b60012edf2126", + "https://deno.land/std@0.106.0/path/_constants.ts": "1247fee4a79b70c89f23499691ef169b41b6ccf01887a0abd131009c5581b853", + "https://deno.land/std@0.106.0/path/_interface.ts": "1fa73b02aaa24867e481a48492b44f2598cd9dfa513c7b34001437007d3642e4", + "https://deno.land/std@0.106.0/path/_util.ts": "2e06a3b9e79beaf62687196bd4b60a4c391d862cfa007a20fc3a39f778ba073b", + "https://deno.land/std@0.106.0/path/common.ts": "eaf03d08b569e8a87e674e4e265e099f237472b6fd135b3cbeae5827035ea14a", + "https://deno.land/std@0.106.0/path/glob.ts": "3b84af55c53febacf6afe214c095624b22a56b6f57d7312157479cc783a0de65", + "https://deno.land/std@0.106.0/path/mod.ts": "4465dc494f271b02569edbb4a18d727063b5dbd6ed84283ff906260970a15d12", + "https://deno.land/std@0.106.0/path/posix.ts": "b81974c768d298f8dcd2c720229639b3803ca4a241fa9a355c762fa2bc5ef0c1", + "https://deno.land/std@0.106.0/path/separator.ts": "8fdcf289b1b76fd726a508f57d3370ca029ae6976fcde5044007f062e643ff1c", + "https://deno.land/std@0.106.0/path/win32.ts": "f4a3d4a3f2c9fe894da046d5eac48b5e789a0ebec5152b2c0985efe96a9f7ae1", + "https://deno.land/x/case@v2.1.0/camelCase.ts": "0808961e69e1883c6e94faf85e333196a464ceba46ddc76984d7b8ce9e26a43a", + "https://deno.land/x/case@v2.1.0/lowerCase.ts": "86d5533f9587ed60003181591e40e648838c23f371edfa79d00288153d113b16", + "https://deno.land/x/case@v2.1.0/normalCase.ts": "6a8b924da9ab0790d99233ae54bfcfc996d229cb91b2533639fe20972cc33dac", + "https://deno.land/x/case@v2.1.0/types.ts": "8e2bd6edaa27c0d1972c0d5b76698564740f37b4d3787d58d1fb5f48de611e61", + "https://deno.land/x/case@v2.1.0/upperCase.ts": "e6a1a3dea30e17013aa212ec237b35e2dd5c5c0b1501778c07db66ff0bbe4372", + "https://deno.land/x/case@v2.1.0/vendor/camelCaseRegexp.ts": "7d9ff02aad4ab6429eeab7c7353f7bcdd6cc5909a8bd3dda97918c8bbb7621ae", + "https://deno.land/x/case@v2.1.0/vendor/camelCaseUpperRegexp.ts": "292de54a698370f90adcdf95727993d09888b7f33d17f72f8e54ba75f7791787", + "https://deno.land/x/case@v2.1.0/vendor/nonWordRegexp.ts": "c1a052629a694144b48c66b0175a22a83f4d61cb40f4e45293fc5d6b123f927e", + "https://deno.land/x/code_block_writer@10.1.1/comment_char.ts": "87dd5858a04d3b017b19634e68f36bb7cd4157a044575a76b79c69ee9bd1cd75", + "https://deno.land/x/code_block_writer@10.1.1/mod.ts": "f43cf7cfc13bf502606ea5a5ebfb9eab0503958a4deb7d45ff1160500e94ad76", + "https://deno.land/x/code_block_writer@10.1.1/utils/string_utils.ts": "0f13ba52ed417ddbb90915f90b4ca9cef2242b7010cddca17f2e0c7c447dce61", + "https://deno.land/x/ts_morph@12.2.0/common/DenoRuntime.ts": "e3fa796be7de190f24f91ee6e04e9c78dff1952455b00fb1ff328a42faffc834", + "https://deno.land/x/ts_morph@12.2.0/common/data/libFiles.js": "d64cb559483d01728cb1c51e8768d4f53d4c5bda9dc5c8becaace2878a3d01a9", + "https://deno.land/x/ts_morph@12.2.0/common/mod.ts": "01985d2ee7da8d1caee318a9d07664774fbee4e31602bc2bb6bb62c3489555ed", + "https://deno.land/x/ts_morph@12.2.0/common/ts_morph_common.d.ts": "0b9286871b6216853e75fa7ea196a49abdb933c600c36a63aa868845bbd50b8f", + "https://deno.land/x/ts_morph@12.2.0/common/ts_morph_common.js": "0bbde4726e6110c4fa7e54121362cc5d9f27371ae2bdc59d10f9b71fbb8a56ef", + "https://deno.land/x/ts_morph@12.2.0/common/typescript.d.ts": "693bfecb024a122139eccd43e82633076d9bd7ee453600eb273fb521fe842d96", + "https://deno.land/x/ts_morph@12.2.0/common/typescript.js": "d33cf14ed82e7c3752db397ba302ba153d73a839be86619b3f799bc6020266bd", + "https://deno.land/x/ts_morph@12.2.0/mod.ts": "adba9b82f24865d15d2c78ef6074b9a7457011719056c9928c800f130a617c93", + "https://deno.land/x/ts_morph@12.2.0/ts_morph.d.ts": "655465b30fea8d5d20a31ba8f3de167e72f15ae1a8a6c6e4c7ab2761f4479478", + "https://deno.land/x/ts_morph@12.2.0/ts_morph.js": "ac01fbd56639d3b5ab561456ca8fb176fe238034a1bca8c88d103c829572a69b", + "https://esm.sh/ramda": "6bd4162cafeffc34bf5df57eaa2ba8ab594e2a0608f24480a8529de29776f3f1" +} \ No newline at end of file diff --git a/gramjs/tl/types-generator/docs/Parsers/ConstructPageParser.ts b/gramjs/tl/types-generator/docs/Parsers/ConstructPageParser.ts new file mode 100644 index 00000000..39e94b2e --- /dev/null +++ b/gramjs/tl/types-generator/docs/Parsers/ConstructPageParser.ts @@ -0,0 +1,27 @@ +import { ParseResult } from "./../../tl-parser/types.ts"; +import { ExtendedConstructorRepresentation } from "../types.ts"; +import { HTMLDocument } from "dom_parser"; +import { PageParser } from "./PageParser.ts"; + +export class ConstructorPageParser extends PageParser { + constructor( + readonly dom: HTMLDocument, + construct: ParseResult, + ) { + super(dom, construct); + } + + parse(): ExtendedConstructorRepresentation { + const mainDescription = this.getMainDescription(); + const parametersDescriptions = this.getParametersDescriptions(); + return { + ...this.construct, + description: mainDescription, + params: this.construct.params.map((p, i) => ({ + ...p, + description: parametersDescriptions[i], + })), + relatedLinks: this.getRelatedPages(), + }; + } +} diff --git a/gramjs/tl/types-generator/docs/Parsers/MethodPageParser.ts b/gramjs/tl/types-generator/docs/Parsers/MethodPageParser.ts new file mode 100644 index 00000000..9fe684ff --- /dev/null +++ b/gramjs/tl/types-generator/docs/Parsers/MethodPageParser.ts @@ -0,0 +1,51 @@ +import { ParseResult } from "./../../tl-parser/types.ts"; +import { ExtendedMethodRepresentation, PossibleError } from "../types.ts"; +import { Element, HTMLDocument } from "dom_parser"; +import { PageParser } from "./PageParser.ts"; + +export class MethodPageParser extends PageParser { + constructor( + dom: HTMLDocument, + method: ParseResult, + ) { + super(dom, method); + } + + private getPossibleErrors(): PossibleError[] { + const possibleErrors: PossibleError[] = []; + const titleElement = this.dom.getElementById("possible-errors") + ?.parentElement; + if (!titleElement) return []; + + const table = titleElement.nextElementSibling; + table?.querySelectorAll("tbody>tr").forEach((tr) => { + const td = (tr as Element).querySelector("td")!; + const code = td.textContent; + const type = td.nextElementSibling!.textContent; + const description = + td.nextElementSibling!.nextElementSibling!.textContent; + possibleErrors.push({ code, description, type }); + }); + return possibleErrors; + } + parse(): ExtendedMethodRepresentation { + const mainDescription = this.getMainDescription(); + const parametersDescriptions = this.getParametersDescriptions(); + return { + ...this.construct, + description: mainDescription, + params: this.construct.params.map((p, i) => ({ + ...p, + description: parametersDescriptions[i], + })), + relatedLinks: this.getRelatedPages(), + possibleErrors: this.getPossibleErrors(), + resultDescription: this.getResultDesc(), + }; + } + private getResultDesc(): string | null { + const resultTitle = this.dom.getElementById("result")?.parentElement; + if (!resultTitle) return null; + return resultTitle.nextElementSibling!.textContent; + } +} diff --git a/gramjs/tl/types-generator/docs/Parsers/PageParser.ts b/gramjs/tl/types-generator/docs/Parsers/PageParser.ts new file mode 100644 index 00000000..5151d297 --- /dev/null +++ b/gramjs/tl/types-generator/docs/Parsers/PageParser.ts @@ -0,0 +1,62 @@ +import { ParseResult } from "./../../tl-parser/types.ts"; +import { HTMLDocument } from "dom_parser"; +import { asElements } from "../utils.ts"; + +export abstract class PageParser { + constructor( + protected readonly dom: HTMLDocument, + protected construct: ParseResult, + ) { + } + protected getParametersDescriptions(): string[] { + if (this.construct.params.length === 0) { + return []; + } + const parametersTitleLink = this.dom.querySelector( + `a[href$="#parameters"],#parameters`, + )!; + const table = parametersTitleLink!.parentElement!.nextElementSibling!; + const rows = asElements(table.querySelectorAll("tbody>tr")); + return rows.map((r) => { + const cells = asElements(r.querySelectorAll("td")); + const description = cells[2].innerHTML; + return description; + }); + } + + protected getMainDescription() { + const pTag = this.dom.querySelector("#dev_page_content > p"); + + const pTags = []; + let current = pTag; + + while (current && current.tagName.toLowerCase() === "p") { + pTags.push(current); + current = current.nextElementSibling; + } + + return pTags.map((p) => p.innerHTML).join("
"); + } + + protected getRelatedPages(): string[] { + const relatedPageLink = this.dom.getElementById("related-pages"); + if (!relatedPageLink) { + return []; + } + const linksUrls: string[] = []; + + let currentLinkHolder = relatedPageLink.parentElement!.nextElementSibling; + while (currentLinkHolder) { + if (currentLinkHolder.querySelectorAll("a").length > 0) { + asElements(currentLinkHolder.querySelectorAll("a")) + .map((a) => a.getAttribute("href")!) + .filter((url) => !new URL(url).hash) + .forEach((url) => linksUrls.push(url!)); + } + currentLinkHolder = currentLinkHolder.nextElementSibling; + } + + return linksUrls; + } + abstract parse(): ParseResult; +} diff --git a/gramjs/tl/types-generator/docs/crawl.ts b/gramjs/tl/types-generator/docs/crawl.ts new file mode 100644 index 00000000..9de00b5c --- /dev/null +++ b/gramjs/tl/types-generator/docs/crawl.ts @@ -0,0 +1,116 @@ +import DataLoader from "dataloader"; +import { DOMParser, HTMLDocument } from "dom_parser"; +import * as R from "https://esm.sh/ramda"; +import { ParsedSchema, ParseResult } from "./../tl-parser/types.ts"; +import { ConstructorPageParser } from "./Parsers/ConstructPageParser.ts"; +import { MethodPageParser } from "./Parsers/MethodPageParser.ts"; +import { ExtendedSchema } from "./types.ts"; +import { asElements } from "./utils.ts"; + +const BATCH_SIZE = 150; + +export function extendSchema( + schema: ParsedSchema, + { DocsBasePath, language }: { DocsBasePath: string; language: string }, +): Promise { + const dataLoader = new DataLoader( + async (requests: ReadonlyArray) => { + const chunks: ReadonlyArray[] = R.splitEvery( + BATCH_SIZE, + requests, + ); + let result: string[] = []; + for (const chunk of chunks) { + const responses: string[] = await Promise.all( + chunk.map((req) => fetch(req).then((res) => res.text())), + ); + console.log("progress ..."); + result = result.concat(responses); + } + + return result; + }, + ); + const crawler = new DocumentCrawler( + schema, + dataLoader, + DocsBasePath, + language, + ); + return crawler.crawl(); +} + +class DocumentCrawler { + private readonly basePath: string; + private readonly language: string; + private readonly schema: ParsedSchema; + private fetcher: DataLoader; + + constructor( + schema: ParsedSchema, + fetcher: DataLoader, + basePath: string, + language: string, + ) { + this.basePath = basePath; + this.language = language; + this.schema = schema; + this.fetcher = fetcher; + } + + async crawl(): Promise { + return { + constructors: await Promise.all( + this.schema.constructors.map((c) => this.getExtendedConstruct(c)), + ), + methods: await Promise.all( + this.schema.methods.map((c) => this.getExtendedMethod(c)), + ), + layerNumber: this.schema.layerNumber, + }; + } + + private parseDom(htmlPage: string): HTMLDocument { + const parser = new DOMParser(); + return parser.parseFromString(htmlPage, "text/html")!; + } + + private absoluteLinks(dom: HTMLDocument, basePath: string) { + const links = asElements(dom.querySelectorAll("a")); + for (const link of links) { + const href = link.getAttribute("href"); + if (href) { + const absHref = new URL(href, basePath).href; + link.setAttribute("href", absHref); + } + } + } + + private async getUrl(url: string) { + const htmlPage = await this.fetcher.load( + new Request(url, { + headers: { + Cookie: + `stel_ln=${this.language}; stel_dev_layer=${this.schema.layerNumber}`, + }, + }), + ); + return this.parseDom(htmlPage); + } + + private async getExtendedMethod(method: ParseResult) { + const dom = await this.getUrl(`${this.basePath}/method/${method.name}`); + this.absoluteLinks(dom, this.basePath); + const pageParser = new MethodPageParser(dom, method); + return (pageParser.parse()); + } + + private async getExtendedConstruct(constructor: ParseResult) { + const dom = await this.getUrl( + `${this.basePath}/constructor/${constructor.name}`, + ); + this.absoluteLinks(dom, this.basePath); + const pageParser = new ConstructorPageParser(dom, constructor); + return pageParser.parse(); + } +} diff --git a/gramjs/tl/types-generator/docs/types.ts b/gramjs/tl/types-generator/docs/types.ts new file mode 100644 index 00000000..45118bfc --- /dev/null +++ b/gramjs/tl/types-generator/docs/types.ts @@ -0,0 +1,30 @@ +import { ParsedParam, ParseResult } from "./../tl-parser/types.ts"; + +export type test = ExtendedConstructorRepresentation["params"]; +export type BaseExtendedObject = { + params: ExtendedParam[]; + description: string; + relatedLinks: string[]; +} & ParseResult; +export type ExtendedConstructorRepresentation = BaseExtendedObject; + +export type PossibleError = { + code: string; + type: string; + description: string; +}; + +export type ExtendedParam = { + description: string; +} & ParsedParam; + +export type ExtendedMethodRepresentation = { + possibleErrors: PossibleError[]; + resultDescription: string | null; +} & BaseExtendedObject; + +export type ExtendedSchema = { + constructors: ExtendedConstructorRepresentation[]; + methods: ExtendedMethodRepresentation[]; + layerNumber: number; +}; diff --git a/gramjs/tl/types-generator/docs/utils.ts b/gramjs/tl/types-generator/docs/utils.ts new file mode 100644 index 00000000..d323d280 --- /dev/null +++ b/gramjs/tl/types-generator/docs/utils.ts @@ -0,0 +1,7 @@ +import * as Dom from "dom_parser"; + +export function asElements( + nodes: ReturnType, +): Dom.Element[] { + return Array.from(nodes) as Dom.Element[]; +} diff --git a/gramjs/tl/types-generator/generate.js b/gramjs/tl/types-generator/generate.js deleted file mode 100644 index 35f3c0fd..00000000 --- a/gramjs/tl/types-generator/generate.js +++ /dev/null @@ -1,98 +0,0 @@ -const path = require("path"); -const fs = require("fs"); - -const { parseTl } = require("../generationHelpers"); -const templateFn = require("./template"); - -const INPUT_FILE = path.resolve(__dirname, "../static/api.tl"); -const SCHEMA_FILE = path.resolve(__dirname, "../static/schema.tl"); - -const OUTPUT_FILE = path.resolve(__dirname, "../api.d.ts"); -const peersToPatch = [ - "InputPeer", - "Peer", - "InputUser", - "User", - "UserFull", - "Chat", - "ChatFull", - "InputChannel", -]; - -function patchMethods(methods) { - for (const method of methods) { - for (const arg in method["argsConfig"]) { - if (peersToPatch.includes(method["argsConfig"][arg]["type"])) { - method["argsConfig"][arg]["type"] = "EntityLike"; - } else if ( - method["argsConfig"][arg]["type"] && - arg.toLowerCase().includes("msgid") - ) { - if (method["argsConfig"][arg]["type"] !== "long") { - method["argsConfig"][arg]["type"] = "MessageIDLike"; - } - } - } - } -} - -function main() { - const tlContent = fs.readFileSync(INPUT_FILE, "utf-8"); - const apiConfig = extractParams(tlContent); - const schemeContent = fs.readFileSync(SCHEMA_FILE, "utf-8"); - const schemeConfig = extractParams(schemeContent); - const types = [...apiConfig.types, ...schemeConfig.types]; - const functions = [...apiConfig.functions, ...schemeConfig.functions]; - const constructors = [ - ...apiConfig.constructors, - ...schemeConfig.constructors, - ]; - // patching custom types - - patchMethods(functions); - const generated = templateFn({ - types: types, - functions: functions, - constructors: constructors, - }); - - fs.writeFileSync(OUTPUT_FILE, generated); -} - -function extractParams(fileContent) { - const defInterator = parseTl(fileContent, 109); - const types = {}; - const constructors = []; - const functions = []; - - for (const def of defInterator) { - if (def.isFunction) { - functions.push(def); - } else { - if (!types[def.result]) { - const [namespace, name] = def.result.includes(".") - ? def.result.split(".") - : [undefined, def.result]; - - types[def.result] = { - namespace, - name, - constructors: [], - }; - } - - types[def.result].constructors.push( - def.namespace ? `${def.namespace}.${def.name}` : def.name - ); - constructors.push(def); - } - } - - return { - types: Object.values(types), - constructors, - functions, - }; -} - -main(); diff --git a/gramjs/tl/types-generator/import_map.json b/gramjs/tl/types-generator/import_map.json new file mode 100644 index 00000000..c914c7c7 --- /dev/null +++ b/gramjs/tl/types-generator/import_map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "dom_parser": "https://deno.land/x/deno_dom@v0.1.17-alpha/deno-dom-wasm.ts", + "progress": "https://deno.land/x/progress@v1.1.4/mod.ts", + "dataloader": "https://esm.sh/dataloader" + } +} diff --git a/gramjs/tl/types-generator/main.ts b/gramjs/tl/types-generator/main.ts new file mode 100644 index 00000000..a1d152f4 --- /dev/null +++ b/gramjs/tl/types-generator/main.ts @@ -0,0 +1,23 @@ +import { TypeGenerator } from "./type-generator/type-gen.ts"; +import { getSchemaDefinition } from "./tl-parser/tl-parser.ts"; +import { extendSchema } from "./docs/crawl.ts"; + +console.log("getting schema"); +const schema = await fetch( + "https://raw.githubusercontent.com/telegramdesktop/tdesktop/5e2cdde2c8cd377063d051a24f5be649e4343b16/Telegram/Resources/tl/api.tl", +).then((r) => r.text()); +console.log("parsing schema"); +const parseSchema = getSchemaDefinition(schema); +console.log("fetching documentation"); +const extendedSchema = await extendSchema(parseSchema, { + DocsBasePath: "https://corefork.telegram.org/", + language: "en", +}); +console.log("generating dts"); +const dtsFile = new TypeGenerator().generate(extendedSchema); + +Deno.writeFileSync( + "../api.d.ts", + new TextEncoder().encode(dtsFile), +); +console.log("done"); diff --git a/gramjs/tl/types-generator/template.js b/gramjs/tl/types-generator/template.js deleted file mode 100644 index eb5ba615..00000000 --- a/gramjs/tl/types-generator/template.js +++ /dev/null @@ -1,323 +0,0 @@ -// Not sure what they are for. -const WEIRD_TYPES = new Set(["Bool", "X", "Type"]); - -module.exports = ({ types, constructors, functions }) => { - function groupByKey(collection, key) { - return collection.reduce((byKey, member) => { - const keyValue = member[key] || "_"; - - if (!byKey[keyValue]) { - byKey[keyValue] = [member]; - } else { - byKey[keyValue].push(member); - } - - return byKey; - }, {}); - } - - function getClassNameWithNameSpace(name, namespace) { - return namespace - ? namespace.toLowerCase() + "." + upperFirst(name) - : upperFirst(name); - } - - function renderTypes(types, indent) { - return types - .map(({ name, constructors }) => - ` - ${!constructors.length ? "// " : ""}export type Type${upperFirst( - name - )} = ${constructors.map((name) => name).join(" | ")}; - `.trim() - ) - .join(`\n${indent}`); - } - - function renderConstructors(constructors, indent) { - return constructors - .map((args) => { - // console.log(args); - const { - name, - namespace, - argsConfig, - constructorId, - subclassOfId, - } = args; - if (name === "Message") { - return `export class Message extends CustomMessage { -${indent}CONSTRUCTOR_ID: ${constructorId}; -${indent}SUBCLASS_OF_ID: ${subclassOfId}; -${indent}classType: "request"; -${indent}className: "${getClassNameWithNameSpace(name, namespace)}"; -${indent}static fromReader(reader: Reader): ${upperFirst(name)}; - }`; - } else if (name === "MessageService") { - return `export class MessageService extends CustomMessage { -${indent}CONSTRUCTOR_ID: ${constructorId}; -${indent}SUBCLASS_OF_ID: ${subclassOfId}; -${indent}classType: "request"; -${indent}className: "${getClassNameWithNameSpace(name, namespace)}"; -${indent}static fromReader(reader: Reader): ${upperFirst(name)}; - }`; - } - const argKeys = Object.keys(argsConfig); - // console.log(constructorId); - if (!argKeys.length) { - return `export class ${upperFirst( - name - )} extends VirtualClass { -${indent}CONSTRUCTOR_ID: ${constructorId}; -${indent}SUBCLASS_OF_ID: ${subclassOfId}; -${indent}classType: "constructor"; -${indent}className: "${getClassNameWithNameSpace(name, namespace)}"; -${indent}static fromReader(reader: Reader): ${upperFirst(name)}; -}`; - } - - const hasRequiredArgs = argKeys.some( - (argName) => - argName !== "flags" && !argsConfig[argName].isFlag - ); - - return ` - export class ${upperFirst(name)} extends VirtualClass<{ -${indent} ${Object.keys(argsConfig) - .map((argName) => - ` - ${renderArg(argName, argsConfig[argName])}; - `.trim() - ) - .join(`\n${indent} `)} -${indent}}${!hasRequiredArgs ? "" : ""}> { -${indent}CONSTRUCTOR_ID: ${constructorId}; -${indent}SUBCLASS_OF_ID: ${subclassOfId}; -${indent}classType: "constructor"; -${indent}className: "${getClassNameWithNameSpace(name, namespace)}"; -${indent}static fromReader(reader: Reader): ${upperFirst(name)}; -${indent} ${Object.keys(argsConfig) - .map((argName) => - ` - ${renderArg(argName, argsConfig[argName])}; - `.trim() - ) - .join(`\n${indent} `)} -${indent}}`.trim(); - }) - .join(`\n${indent}`); - } - - function renderRequests(requests, indent) { - return requests - .map((args) => { - const { - name, - argsConfig, - result, - constructorId, - namespace, - subclassOfId, - } = args; - const argKeys = Object.keys(argsConfig); - - if (!argKeys.length) { - return `export class ${upperFirst( - name - )} extends Request { -${indent}CONSTRUCTOR_ID: ${constructorId}; -${indent}SUBCLASS_OF_ID: ${subclassOfId}; -${indent}classType: "request"; -${indent}className: "${getClassNameWithNameSpace(name, namespace)}"; -${indent}static fromReader(reader: Reader): ${upperFirst(name)}; -}`; - } - - const hasRequiredArgs = argKeys.some( - (argName) => - argName !== "flags" && !argsConfig[argName].isFlag - ); - - return ` - export class ${upperFirst(name)} extends Request - ` - ${renderArg(argName, argsConfig[argName])}; - `.trim() - ) - .join(`\n${indent} `)} -${indent}}${!hasRequiredArgs ? "" : ""}>, ${renderResult(result)}> { -${indent}CONSTRUCTOR_ID: ${constructorId}; -${indent}SUBCLASS_OF_ID: ${subclassOfId}; -${indent}classType: "request"; -${indent}className: "${getClassNameWithNameSpace(name, namespace)}"; -${indent}static fromReader(reader: Reader): ${upperFirst(name)}; -${indent} ${argKeys - .map((argName) => - ` - - ${renderArg(argName, argsConfig[argName])}; - `.trim() - ) - .join(`\n${indent} `)} -${indent}}`.trim(); - }) - .join(`\n${indent}`); - } - - function renderResult(result) { - const vectorMatch = result.match(/[Vv]ector<([\w\d.]+)>/); - const isVector = Boolean(vectorMatch); - const scalarValue = isVector ? vectorMatch[1] : result; - const isTlType = - Boolean(scalarValue.match(/^[A-Z]/)) || scalarValue.includes("."); - - return renderValueType(scalarValue, isVector, isTlType); - } - - function renderArg(argName, argConfig) { - const { isVector, isFlag, skipConstructorId, type } = argConfig; - - const valueType = renderValueType(type, isVector, !skipConstructorId); - - return `${argName === "flags" ? "// " : ""}${argName}${ - isFlag ? "?" : "" - }: ${valueType}`; - } - - function renderValueType(type, isVector, isTlType) { - if (WEIRD_TYPES.has(type)) { - return type; - } - - let resType; - - if (typeof type === "string" && isTlType) { - resType = renderTypeName(type); - } else { - resType = type; - } - if (resType === "true") { - resType = "boolean"; - } - if (isVector) { - resType = `${resType}[]`; - } - - return resType; - } - - function renderTypeName(typeName) { - return typeName.includes(".") - ? typeName.replace(".", ".Type") - : `Api.Type${typeName}`; - } - - function upperFirst(str) { - return `${str[0].toUpperCase()}${str.slice(1)}`; - } - - function lowerFirst(str) { - return `${str[0].toLowerCase()}${str.slice(1)}`; - } - - const typesByNs = groupByKey(types, "namespace"); - const constructorsByNs = groupByKey(constructors, "namespace"); - const requestsByNs = groupByKey(functions, "namespace"); - - // language=TypeScript - return ` -// This file is autogenerated. All changes will be overwritten. -import { BigInteger } from 'big-integer'; -import {EntityLike,MessageIDLike} from "../define"; -import { CustomMessage } from "./custom/message"; - - -export namespace Api { - type AnyLiteral = Record | void; - type Reader = any; // To be defined. - type Client = any; // To be defined. - type Utils = any; // To be defined. - type X = unknown; - type Type = unknown; - type Bool = boolean; - type int = number; - type double = number; - type float = number; - type int128 = BigInteger; - type int256 = BigInteger; - type long = BigInteger; - type bytes = Buffer; - class VirtualClass { - static CONSTRUCTOR_ID: number; - static SUBCLASS_OF_ID: number; - static className: string; - static classType: 'constructor' | 'request'; - static serializeBytes(data: Buffer | string): Buffer; - static serializeDate(date: Date | number): Buffer; - getBytes():Buffer; - CONSTRUCTOR_ID: number; - SUBCLASS_OF_ID: number; - className: string; - classType: 'constructor' | 'request'; - constructor(args: Args); - originalArgs: Args; - toJSON(): Args; - } - class Request extends VirtualClass> { - static readResult(reader: Reader): Buffer; - resolve(client: Client, utils: Utils): Promise; - __response: Response; - } - ${renderConstructors(constructorsByNs._, " ")} - ${renderRequests(requestsByNs._, " ")} -// namespaces - ${Object.keys(constructorsByNs) - .map((namespace) => - namespace !== "_" - ? ` - export namespace ${namespace} { - ${renderConstructors(constructorsByNs[namespace], " ")} - }` - : "" - ) - .join("\n")} - ${Object.keys(typesByNs) - .map((namespace) => - namespace !== "_" - ? ` - export namespace ${namespace} { - ${renderTypes(typesByNs[namespace], " ")} - }` - : "" - ) - .join("\n")} - ${Object.keys(requestsByNs) - .map((namespace) => - namespace !== "_" - ? ` - export namespace ${namespace} { - ${renderRequests(requestsByNs[namespace], " ")} - }` - : "" - ) - .join("\n")} -// Types - export type TypeEntityLike = EntityLike; - ${renderTypes(typesByNs._, " ")} -// All requests - export type AnyRequest = ${requestsByNs._.map(({ name }) => - upperFirst(name) - ).join(" | ")} - | ${Object.keys(requestsByNs) - .filter((ns) => ns !== "_") - .map((ns) => - requestsByNs[ns] - .map(({ name }) => `${ns}.${upperFirst(name)}`) - .join(" | ") - ) - .join("\n | ")}; -} -`; -}; diff --git a/gramjs/tl/types-generator/tl-parser/parseRow.test.ts b/gramjs/tl/types-generator/tl-parser/parseRow.test.ts new file mode 100644 index 00000000..b060befa --- /dev/null +++ b/gramjs/tl/types-generator/tl-parser/parseRow.test.ts @@ -0,0 +1,69 @@ +import * as assert from "https://deno.land/std@0.114.0/testing/asserts.ts"; +import { parseRow } from "./parseRow.ts"; + +Deno.test("should return a valid result for vector", () => { + const a = parseRow("vector#1cb5c415 {t:Type} # [ t ] = Vector t;"); + + // asserts a should be {"name":"vector","id":481674261,"generic":{"genericDescriptor":[{"key":"t","type":"Type"}],"argsOrder":["t"]},"args":[]} key by key + assert.assertEquals(a.name, "vector"); + assert.assertEquals(a.id, 481674261); + assert.assertEquals(a.generic.genericDescriptor[0].key, "t"); + assert.assertEquals( + a.generic.genericDescriptor[0].type, + "Type", + ); + assert.assertEquals(a.generic.argsOrder![0], "t"); + assert.assertEquals(a.type, "Vector t"); + assert.assertEquals(a.params.length, 0); +}); + +Deno.test("should return a valid result for other generics", () => { + const a = parseRow( + "initConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;", + ); + assert.assertEquals(a, { + name: "initConnection", + id: -1043505495, + generic: { genericDescriptor: [{ key: "X", type: "Type" }] }, + params: [ + { name: "flags", type: "#", index: 0, isOptional: false }, + { name: "api_id", type: "int", index: 1, isOptional: false }, + { name: "device_model", type: "string", index: 2, isOptional: false }, + { name: "system_version", type: "string", index: 3, isOptional: false }, + { name: "app_version", type: "string", index: 4, isOptional: false }, + { name: "system_lang_code", type: "string", index: 5, isOptional: false }, + { name: "lang_pack", type: "string", index: 6, isOptional: false }, + { name: "lang_code", type: "string", index: 7, isOptional: false }, + { name: "proxy", type: "InputClientProxy", index: 8, isOptional: true }, + { name: "params", type: "JSONValue", index: 9, isOptional: true }, + { name: "query", type: "X", index: 10, isOptional: false }, + ], + type: "X", + subclassOfId: 3081909835, + }); +}); + +Deno.test("should return a valid result for non-generics", () => { + const a = parseRow( + "channels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:long = channels.ChannelParticipants;", + ); + assert.assertEquals(a, { + name: "channels.getParticipants", + id: 2010044880, + generic: {}, + params: [ + { name: "channel", type: "InputChannel", index: 0, isOptional: false }, + { + name: "filter", + type: "ChannelParticipantsFilter", + index: 1, + isOptional: false, + }, + { name: "offset", type: "int", index: 2, isOptional: false }, + { name: "limit", type: "int", index: 3, isOptional: false }, + { name: "hash", type: "long", index: 4, isOptional: false }, + ], + type: "channels.ChannelParticipants", + subclassOfId: 3859443300, + }); +}); diff --git a/gramjs/tl/types-generator/tl-parser/parseRow.ts b/gramjs/tl/types-generator/tl-parser/parseRow.ts new file mode 100644 index 00000000..4fa41219 --- /dev/null +++ b/gramjs/tl/types-generator/tl-parser/parseRow.ts @@ -0,0 +1,91 @@ +import { GenericParams, ParseResult } from "./types.ts"; +import { signedHexToInt } from "./utils.ts"; +import { crc32 } from "./utils.ts"; + +const genericPattern = /(\{((\w+):(\w+),?)+\}(\s#\s\[\s?((\w+),?\s?)+\])?)/; +const namePattern = /^([\w\.]+)#([\da-f]+)\s+/; +const typePattern = /=.*;$/; + +export function parseRow(row: string): ParseResult { + const type = extractType(row); + return { + name: extractName(row), + id: extractId(row), + generic: extractGeneric(row), + params: extractParams(row), + type, + subclassOfId: crc32(type), + }; +} +function extractName(row: string) { + try { + return row.match(namePattern)![1]; + } catch (err) { + throw err; + } +} +function extractId(row: string) { + return signedHexToInt(row.match(namePattern)![2]); +} + +function extractType(row: string) { + try { + const resultOnly = row.match(typePattern)![0]; + return resultOnly.replace(/=|;/g, "").trim(); + } catch (e) { + console.log(row); + throw e; + } +} + +function extractParams(row: string) { + const argsWithResult = removeGeneric(removeName(removeType(row))); + return argsWithResult + .split(" ") + .map((e) => e.trim()) + .filter(Boolean) + .map((e) => e.replace(/flags.\d+/g, "")) + .map((e) => e.split(":")) + .map(([name, type], i) => ({ + name, + type: type.replace(/^[\?\!]/, ""), + index: i, + isOptional: type.startsWith("?"), + })); +} + +function extractGeneric(row: string) { + const remaining = removeName(row); + const result: Partial = {}; + if (remaining.match(genericPattern)) { + result.genericDescriptor = []; + const genericString = remaining.match(genericPattern)![1]!; + + const [decleration, argsOrder] = genericString.split("#").map((e) => + e.trim() + ); + for ( + const [_, key, type] of decleration.matchAll(/(\w[\w0-9]*):(\w[\w0-9]*)/g) + ) { + result.genericDescriptor.push({ key, type }); + } + if (argsOrder) { + result.argsOrder = [...argsOrder.matchAll(/(\w[\w0-9]*)/g)].map(( + e, + ) => e[0]); + } + } + return result as GenericParams; +} + +function removeName(row: string) { + return row.replace(namePattern, ""); +} + +function removeGeneric(row: string) { + return row.replace(genericPattern, ""); +} + +function removeType(row: string) { + return row.replace(typePattern, ""); +} diff --git a/gramjs/tl/types-generator/tl-parser/tl-parser.ts b/gramjs/tl/types-generator/tl-parser/tl-parser.ts new file mode 100644 index 00000000..979ec493 --- /dev/null +++ b/gramjs/tl/types-generator/tl-parser/tl-parser.ts @@ -0,0 +1,46 @@ +import * as R from "https://esm.sh/ramda"; +import { ParseResult } from "./types.ts"; +import { parseRow } from "./parseRow.ts"; + +export type SchemaDefinition = { + constructors: ParseResult[]; + methods: ParseResult[]; + layerNumber: number; +}; + +export function getSchemaDefinition(schemaContent: string): SchemaDefinition { + const fileRows = schemaContent.split("\n").filter(Boolean); + const layerNumber = getLayerNumber(fileRows); + + const { constructors, methods } = getConstructsAndMethodsFromRows(fileRows); + + return { + constructors: constructors.map((row) => parseRow(row)), + methods: methods.map((row) => parseRow(row)), + layerNumber, + }; +} + +function getLayerNumber(rows: string[]) { + return +rows.find(e=>e.match(/LAYER \d+/))!.match(/\d+/)![1]; +} + +function getConstructsAndMethodsFromRows(rows: string[]) { + const fileRowsWithoutComments = rows + .filter((row) => !isComment(row)) + .map((row) => row.trim()); + + const [constructsRows, methodRows] = R.splitAt( + fileRowsWithoutComments.indexOf("---functions---"), + fileRowsWithoutComments, + ); + methodRows.shift(); + return { + constructors: constructsRows, + methods: methodRows, + }; +} + +function isComment(row: string) { + return row.startsWith("//"); +} diff --git a/gramjs/tl/types-generator/tl-parser/types.ts b/gramjs/tl/types-generator/tl-parser/types.ts new file mode 100644 index 00000000..f36aae53 --- /dev/null +++ b/gramjs/tl/types-generator/tl-parser/types.ts @@ -0,0 +1,26 @@ +export type GenericParams = { + genericDescriptor?: { key: string; type: string }[]; + argsOrder?: string[]; +}; + +export type ParsedParam = { + name: string; + type: string; + index: number; + isOptional: boolean; +}; + +export type ParseResult = { + name: string; + id: number; + generic?: GenericParams; + params: ParsedParam[]; + type: string; + subclassOfId: number; +}; + +export type ParsedSchema = { + constructors: ParseResult[]; + methods: ParseResult[]; + layerNumber: number; +}; diff --git a/gramjs/tl/types-generator/tl-parser/utils.ts b/gramjs/tl/types-generator/tl-parser/utils.ts new file mode 100644 index 00000000..e9a1e594 --- /dev/null +++ b/gramjs/tl/types-generator/tl-parser/utils.ts @@ -0,0 +1,43 @@ +export function signedHexToInt(hex: string) { + if (hex.length % 2 != 0) { + hex = "0" + hex; + } + let num = parseInt(hex, 16); + const maxVal = Math.pow(2, hex.length / 2 * 8); + if (num > maxVal / 2 - 1) { + num = num - maxVal; + } + return num; +} + +// Taken from https://stackoverflow.com/questions/18638900/javascript-crc32/18639999#18639999 +function makeCRCTable() { + let c; + const crcTable = []; + for (let n = 0; n < 256; n++) { + c = n; + for (let k = 0; k < 8; k++) { + c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1; + } + crcTable[n] = c; + } + return crcTable; +} + +let crcTable: number[] | undefined = undefined; + +export function crc32(buf: Uint8Array | string) { + if (!crcTable) { + crcTable = makeCRCTable(); + } + if (!(buf instanceof Uint8Array)) { + buf = new TextEncoder().encode(buf); + } + let crc = -1; + + for (let index = 0; index < buf.length; index++) { + const byte = buf[index]; + crc = crcTable[(crc ^ byte) & 0xff] ^ (crc >>> 8); + } + return (crc ^ -1) >>> 0; +} diff --git a/gramjs/tl/types-generator/type-generator/SchemaPreparer.test.ts b/gramjs/tl/types-generator/type-generator/SchemaPreparer.test.ts new file mode 100644 index 00000000..12e7f6ce --- /dev/null +++ b/gramjs/tl/types-generator/type-generator/SchemaPreparer.test.ts @@ -0,0 +1,148 @@ +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import { SchemaPreparer } from "./SchemaPreparer.ts"; + +Deno.test({ + name: "should return empty prepared if nothing passed", + fn: () => { + const p = new SchemaPreparer({ + constructors: [], + layerNumber: 1, + methods: [], + }).prepare(); + assertEquals(p, { + global: { constructs: [], types: [] }, + namespaces: [], + layerNumber: 1, + }); + }, +}); + +Deno.test("should attach classType to constructor for global constructor", () => { + const p = new SchemaPreparer({ + constructors: [{ + name: "Test", + params: [], + type: "Test", + description: "test", + generic: {}, + id: 4343, + relatedLinks: [], + subclassOfId: 100978, + }], + layerNumber: 1, + methods: [], + }).prepare(); + assertEquals(p.global.constructs[0].classType, "constructor"); +}); + +Deno.test("should attach classType to constructor for non-global constructor", () => { + const p = new SchemaPreparer({ + constructors: [{ + name: "test.Test", + params: [], + type: "Test", + description: "test", + generic: {}, + id: 4343, + relatedLinks: [], + subclassOfId: 100978, + }], + layerNumber: 1, + methods: [], + }).prepare(); + assertEquals(p.namespaces[0][1].constructs[0].classType, "constructor"); +}); + +Deno.test("should have the correct namespace name", () => { + const p = new SchemaPreparer({ + constructors: [{ + name: "test.Test", + params: [], + type: "Test", + description: "test", + generic: {}, + id: 4343, + relatedLinks: [], + subclassOfId: 100978, + }], + layerNumber: 1, + methods: [], + }).prepare(); + assertEquals(p.namespaces[0][0], "test"); +}); + +// should have the correct construct in namespace +Deno.test("should have the correct construct in namespace", () => { + const p = new SchemaPreparer({ + constructors: [{ + name: "test.Test", + params: [], + type: "Test", + description: "test", + generic: {}, + id: 4343, + relatedLinks: [], + subclassOfId: 100978, + }], + layerNumber: 1, + methods: [], + }).prepare(); + assertEquals(p.namespaces[0][1].constructs[0].name, "Test"); +}); +// should have the correct types +Deno.test("should have the correct types in namespace", () => { + const p = new SchemaPreparer({ + constructors: [{ + name: "test.Test", + params: [], + type: "Test1", + description: "test", + id: 4343, + relatedLinks: [], + subclassOfId: 100978, + }], + layerNumber: 1, + methods: [], + }).prepare(); + + assertEquals(p.namespaces[0][1].types[0].name, "TypeTest1"); + assertEquals(p.namespaces[0][1].types[0].unionElements, ["Test"]); +}); + +Deno.test("should only set constructor in namespace", () => { + const p = new SchemaPreparer({ + constructors: [{ + name: "test.Test", + params: [], + type: "Test1", + description: "test", + id: 4343, + relatedLinks: [], + subclassOfId: 100978, + }], + layerNumber: 1, + methods: [], + }).prepare(); + assertEquals(p.global.constructs.length, 0); +}); + +Deno.test("should set the type properly in other namespaces", () => { + const p = new SchemaPreparer({ + constructors: [{ + name: "namespace1.constructName1", + params: [], + type: "Test1", + description: "test", + id: 4343, + relatedLinks: [], + subclassOfId: 100978, + }, { + name: "namespace2.constructName2", + }], + + layerNumber: 1, + methods: [], + }).prepare(); + assertEquals(p.namespaces[0][1].types[0].name, "TypeTest1"); + assertEquals(p.namespaces[0][1].types[0].unionElements, ["Test"]); +}); diff --git a/gramjs/tl/types-generator/type-generator/SchemaPreparer.ts b/gramjs/tl/types-generator/type-generator/SchemaPreparer.ts new file mode 100644 index 00000000..b8bafe78 --- /dev/null +++ b/gramjs/tl/types-generator/type-generator/SchemaPreparer.ts @@ -0,0 +1,165 @@ +import * as R from "https://esm.sh/ramda"; +import { + ExtendedConstructorRepresentation, + ExtendedMethodRepresentation, + ExtendedSchema, +} from "./../docs/types.ts"; +export type Method = ExtendedMethodRepresentation & { + classType: "request"; +}; + +export type Constructor = ExtendedConstructorRepresentation & { + classType: "constructor"; +}; + +export type Construct = (Method | Constructor) & { + namespace: string | null; + hasParams: boolean; + interfaceName: string; +}; + +export type Namespace = { + constructs: Construct[]; + types: { + name: string; + unionElements: string[]; + }[]; +}; +export type PreparedSchema = { + global: Namespace; + namespaces: [string, Namespace][]; + layerNumber: number; +}; + +const excludedConstructs = [ + -1132882121, // boolFalse + -1720552011, // boolTrue + 1072550713, // true + 481674261, // vector + -994444869, // error + 1450380236, // null +]; +const excludedConstructsNames = [ + "Utils", + "X", + "Type", + "Bool", + "int", + "double", + "float", + "int128", + "int256", + "long", + "bytes", + "string", + "true", +]; +export class SchemaPreparer { + private constructs: Construct[]; + constructor(private schema: ExtendedSchema) { + this.constructs = SchemaPreparer.generateConstructs(schema); + } + public prepare(): PreparedSchema { + return { + global: this.getGlobalNamespace(), + namespaces: this.getNamespaces(), + layerNumber: this.schema.layerNumber, + }; + } + private getNamespaces() { + const groupedNamespaces = R.toPairs(R.groupBy( + (e) => e.namespace!, + this.constructs.filter((e) => e.namespace !== null), + )); + const namespaces: [string, Namespace][] = groupedNamespaces.map(( + [name, constructs], + ) => [name, { + constructs: constructs, + types: this.getTypes(constructs), + }]); + return namespaces; + } + + private getGlobalNamespace(): Namespace { + + const constructs = this.constructs.filter((e) => !e.namespace); + const types = this.getTypes(constructs); + return { + constructs, + types, + }; + } + + private getTypes(constructs: Construct[]) { + const groupedConstructors = R.toPairs( + R.groupBy( + (e) => e.type, + constructs.filter((e) => e.classType === "constructor"), + ), + ); + const types = groupedConstructors + .map(([name, constructors]) => ({ + name: upperFirst(name.includes(".") ? name.split(".")[1] : name), + unionElements: constructors.map((e) => e.name), + })); + return types; + } + + private static generateConstructs(schema: ExtendedSchema): Construct[] { + const constructors: Constructor[] = schema.constructors + .map((e) => ({ ...e, classType: "constructor" })); + const methods: Method[] = schema.methods + .map((e) => ({ ...e, classType: "request" })); + return [...constructors, ...methods] + .filter((e) => !excludedConstructs.includes(e.id)) + .map((e) => + e.name.includes(".") + ? { + ...e, + namespace: e.name.split(".")[0], + name: e.name.split(".")[1], + } + : { ...e, namespace: null } + ).map((e) => ({ ...e, name: upperFirst(e.name) })) + .map((e) => ({ + ...e, + type: SchemaPreparer.transformType(e.type), + params: [...e.params.map((p) => ({ + ...p, + type: SchemaPreparer.transformType(p.type), + }))], + })) + .map((e) => ({ + ...e, + hasParams: e.params.length > 0, + interfaceName: e.name + "Args", + })); + } + + private static transformType(e: string): string { + if (isExcludedType(e)) { + return e; + } + let result = e; + if (result === "#") { + return "number"; + } + if (result.startsWith("Vector")) { + result = result.replace(/Vector<(.*)>/, "$1[]"); + } + if (!isExcludedType(result)) { + result = result.includes(".") + ? result.split(".")[0] + ".Type" + result.split(".")[1] + : "Type" + result; + } + return result; + } +} + +function isExcludedType(type: string) { + return excludedConstructsNames.some((e) => type.startsWith(e)); +} + +function upperFirst(str: string) { + return str.charAt(0).toUpperCase() + str.slice(1); +} diff --git a/gramjs/tl/types-generator/type-generator/type-gen.ts b/gramjs/tl/types-generator/type-generator/type-gen.ts new file mode 100644 index 00000000..e7833f70 --- /dev/null +++ b/gramjs/tl/types-generator/type-generator/type-gen.ts @@ -0,0 +1,311 @@ +import { + ClassDeclarationStructure, + FileSystemHost, + InterfaceDeclarationStructure, + MethodDeclarationStructure, + ModuleDeclaration, + ModuleDeclarationKind, + Project, + PropertyDeclarationStructure, + SourceFile, + StructureKind, +} from "https://deno.land/x/ts_morph@12.2.0/mod.ts"; +import * as R from "https://esm.sh/ramda"; +import camelCase from "https://deno.land/x/case@v2.1.0/camelCase.ts"; +import { ExtendedSchema } from "./../docs/types.ts"; +import { + Construct, + Namespace, + PreparedSchema, + SchemaPreparer, +} from "./SchemaPreparer.ts"; + +export class TypeGenerator { + private project: Project; + private file: SourceFile; + private fs: FileSystemHost; + private namespace: ModuleDeclaration; + constructor() { + this.project = new Project({ + useInMemoryFileSystem: true, + }); + this.fs = this.project.getFileSystem(); + this.file = this.project.createSourceFile("./api.d.ts"); + this.namespace = this.file.addModule({ + declarationKind: ModuleDeclarationKind.Namespace, + name: "Api", + isExported: true, + }); + } + generate(schema: ExtendedSchema): string { + const preparedSchema = this.prepareSchema(schema); + + this.addImports(); + this.addBasicTypes(); + this.addVirtualClass(); + this.addRequestConstructor(); + this.fill(preparedSchema); + return this.file.getText(); + } + fill(preparedSchema: PreparedSchema) { + const global = preparedSchema.global; + this.attachNamespace(this.namespace, global); + preparedSchema.namespaces.forEach(([name, ns]) => { + const namespaceDeclaration = this.namespace.addModule({ + statements: [], + declarationKind: ModuleDeclarationKind.Namespace, + name: name, + }); + this.attachNamespace(namespaceDeclaration, ns); + }); + } + private attachNamespace( + namespace: ModuleDeclaration, + namespaceDeclarations: Namespace, + ) { + namespace.addStatements( + [ + ...R.flatten( + namespaceDeclarations.constructs.map((d) => + d.hasParams + ? [ + this.getInterfaceDecelerationFromConstruct(d), + this.getClassDecelerationFromConstruct(d), + ] + : [this.getClassDecelerationFromConstruct(d)] + ), + ), + ...namespaceDeclarations.types.map((t) => ({ + name: t.name, + type: t.unionElements.join(" | "), + kind: StructureKind.TypeAlias, + })), + ], + ); + } + private getInterfaceDecelerationFromConstruct( + c: Construct, + ): InterfaceDeclarationStructure { + return { + kind: StructureKind.Interface, + name: c.interfaceName, + isExported: true, + properties: c.params.map((p) => ({ + name: camelCase(p.name), + type: p.name.includes("msg_id") + ? p.type.replace("int", "MessageIDLike") + : c.classType === "request" + ? p.type.replace(/^TypeInputPeer(\[\])?$/, "EntityLike$1") + : p.type, + hasQuestionToken: p.isOptional, + docs: [{ description: p.description }], + })), + }; + } + private getClassDecelerationFromConstruct( + c: Construct, + ): ClassDeclarationStructure { + return { + kind: StructureKind.Class, + name: c.name, + extends: this.getExtends(c), + isExported: true, + docs: [{ + description: c.description, + tags: [ + ...c.relatedLinks.map((l) => ({ tagName: "link", text: l })), + ..."possibleErrors" in c + ? c.possibleErrors.map((e) => ({ + tagName: "throws", + text: `{{code:${e.code},type:"${e.type}"}} ${e.description}`, + })) + : [], + ], + }], + properties: [ + ...this.getInitialProperties(c), + ...c.params.map((p) => ({ + name: camelCase(p.name), + type: p.name.includes("msg_id") + ? p.type.replace("int", "MessageIDLike") + : c.classType === "request" + ? p.type.replace(/^TypeInputPeer(\[\])?$/, "EntityLike$1") + : p.type, + hasQuestionToken: p.isOptional, + })), + ], + methods: this.getInitialMethods(c), + implements: c.hasParams ? [c.interfaceName] : undefined, + }; + } + private getInitialProperties(c: Construct): PropertyDeclarationStructure[] { + return [ { + name: "classType", + type: `"${c.classType}"`, + kind: StructureKind.Property, + }, { + name: "className", + type: `"${c.namespace ? c.namespace + "." : ""}${c.name}"`, + kind: StructureKind.Property, + }]; + } + private getInitialMethods(c: Construct): MethodDeclarationStructure[] { + return [{ + name: "fromReader", + kind: StructureKind.Method, + parameters: [{ name: "reader", type: "Reader" }], + returnType: c.name, + }]; + } + private getExtends(c: Construct) { + return c.classType === "constructor" + ? `VirtualClass<${c.hasParams ? c.interfaceName : "void"}>` + : `Request,${c.type}>`; + } + prepareSchema(schema: ExtendedSchema): PreparedSchema { + return new SchemaPreparer(schema).prepare(); + } + private addRequestConstructor() { + this.namespace.addClass({ + name: "Request", + extends: "VirtualClass>", + isAbstract: true, + typeParameters: [{ name: "Args" }, { name: "Response" }], + + properties: [{ name: "__response", type: "Response" }], + methods: [{ + name: "readResult", + isStatic: true, + parameters: [{ name: "reader", type: "Reader" }], + returnType: "Buffer", + }, { + name: "resolve", + parameters: [{ name: "client", type: "Client" }, { + name: "utils", + type: "Utils", + }], + returnType: "Promise", + }], + }); + } + private addVirtualClass() { + this.namespace.addClass({ + name: "VirtualClass", + isAbstract: true, + typeParameters: [{ name: "Args", constraint: "AnyLiteral" }], + properties: [ + { + isStatic: true, + name: "CONSTRUCTOR_ID", + type: "number", + }, + { + isStatic: true, + name: "SUBCLASS_OF_ID", + type: "number", + }, + { + isStatic: true, + name: "className", + type: "string", + }, + { + isStatic: true, + name: "classType", + type: `"constructor"|"request"`, + }, + { + name: "CONSTRUCTOR_ID", + type: "number", + }, + { + name: "SUBCLASS_OF_ID", + type: "number", + }, + { + name: "className", + type: "string", + }, + { + name: "classType", + type: `"constructor"|"request"`, + }, + { + name: "originalArgs", + type: "Args", + }, + ], + methods: [ + { + name: "serializeBytes", + isStatic: true, + parameters: [ + { + name: "data", + type: "Buffer|string", + }, + ], + returnType: "Buffer", + }, + { + name: "serializeDate", + isStatic: true, + parameters: [ + { + name: "date", + type: "Date|number", + }, + ], + returnType: "Buffer", + }, + { + name: "getBytes", + returnType: "Buffer", + }, + { + name: "toJSON", + returnType: "Args", + }, + ], + ctors: [{ parameters: [{ name: "args", type: "Args" }] }], + }); + } + + private addBasicTypes() { + this.namespace.addTypeAliases([ + { name: "AnyLiteral", type: "Record | void" }, + { name: "Reader", type: "any" }, + { name: "Client", type: "any" }, + { name: "Utils", type: "any" }, + { name: "X", type: "unknown" }, + { name: "Type", type: "unknown" }, + { name: "Bool", type: "boolean" }, + { name: "int", type: "number" }, + { name: "double", type: "number" }, + { name: "float", type: "number" }, + { name: "int128", type: "BigInteger" }, + { name: "int256", type: "BigInteger" }, + { name: "long", type: "BigInteger" }, + { name: "bytes", type: "Buffer" }, + ]); + } + + private addImports() { + this.file.addImportDeclarations([ + { + moduleSpecifier: "big-integer", + namedImports: ["BigInteger"], + }, + { + moduleSpecifier: "../define", + namedImports: ["EntityLike", "MessageIDLike"], + }, + { + moduleSpecifier: "./custom/message", + namedImports: ["CustomMessage"], + }, + ]); + } + + +} diff --git a/package.json b/package.json index ac4cd1da..45b7f4c9 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "index.js", "types": "index.d.ts", "scripts": { + "generate-types":"deno run --allow-all --import-map=./gramjs/tl/types-generator/import_map.json ./gramjs/tl/types-generator/main.ts", "test": "jest" }, "repository": {