### start Source: https://ref.teleproto.dev/classes/client.updates.UpdateManager.html Starts the update manager. ```APIDOC ## start ### Description Starts the update manager. ### Method start ### Signature start(): void ### Returns void ``` -------------------------------- ### Install teleproto with npm Source: https://ref.teleproto.dev/ Install teleproto using npm. Pure JavaScript, no native build step, installs cleanly on Alpine, ARM, and serverless runtimes. ```bash % npm install teleproto ``` -------------------------------- ### on() example: subscribing to updates Source: https://ref.teleproto.dev/classes/client.updates.ClientUpdates.html Shows how to use the on() method to handle updates by raw names or event builders. Includes examples with single names, arrays, middleware arrays, options, and event builders. ```typescript client.updates.on("newChannelMessage", (update) => console.log(update.message.id)); client.updates.on(["newMessage", "newChannelMessage"], handler); client.updates.on("botCallbackQuery", [checkAuth, handleClick]); client.updates.on("newChannelMessage", handler, { chats: ["durov"] }); client.updates.on(new NewMessage({}), (event) => event.message.reply({ message: "hi" })); Copy ``` -------------------------------- ### game(text, options?) Source: https://ref.teleproto.dev/classes/InlineKeyboard.html Starts the game attached to the message. ```APIDOC ## Method: game(text, options?) ### Description Starts the game attached to the message. ### Parameters - **text** (string) - Required - The button text. - **options** (ButtonOptions) - Optional - Options for the button. Defaults to {}. ### Returns - **this** - The keyboard instance for chaining. ``` -------------------------------- ### ClientUpdates usage example Source: https://ref.teleproto.dev/classes/client.updates.ClientUpdates.html Shows how to use the update pipeline: use for middleware, on for event handlers, and watch to keep receiving updates for specific chats. The example logs timing, handles new channel messages, replies to new messages matching a pattern, and watches a chat. ```typescript client.updates.use(async (update, next) => { const started = Date.now(); await next(); console.log(`${update.className} handled in ${Date.now() - started}ms`); }); client.updates.on("newChannelMessage", (update) => { console.log(update.message.id); }, { chats: ["durov"] }); client.updates.on(new NewMessage({ pattern: /^/start/ }), (event) => event.message.reply({ message: "hi" })); const stop = client.updates.watch("obitoscasino", (update) => console.log(update.message.id)); ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.WallPaperSettings.html Creates a new WallPaperSettings instance with optional wallpaper settings. ```APIDOC ## constructor ### Description Creates a new WallPaperSettings instance with optional wallpaper settings. ### Method constructor ### Signature new WallPaperSettings(args: { backgroundColor?: number; blur?: boolean; emoticon?: string; fourthBackgroundColor?: number; intensity?: number; motion?: boolean; rotation?: number; secondBackgroundColor?: number; thirdBackgroundColor?: number; }): WallPaperSettings ### Parameters - **args** (object) - Required - An object containing optional wallpaper settings: - **backgroundColor** (number) - Optional - Background color. - **blur** (boolean) - Optional - Whether to apply blur. - **emoticon** (string) - Optional - Emoticon string. - **fourthBackgroundColor** (number) - Optional - Fourth background color. - **intensity** (number) - Optional - Intensity value. - **motion** (boolean) - Optional - Whether motion is enabled. - **rotation** (number) - Optional - Rotation value. - **secondBackgroundColor** (number) - Optional - Second background color. - **thirdBackgroundColor** (number) - Optional - Third background color. ### Returns - **WallPaperSettings** - A new WallPaperSettings instance. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.bots.AddPreviewMedia.html Creates a new AddPreviewMedia instance with the provided arguments. ```APIDOC ## constructor ### Description Creates a new AddPreviewMedia instance with the provided arguments. ### Method constructor ### Signature new AddPreviewMedia(args: Args): AddPreviewMedia ### Parameters - **args** (Args) - Required - The arguments for the request. ### Returns AddPreviewMedia ``` -------------------------------- ### get logLevel(): LogLevel Source: https://ref.teleproto.dev/classes/Logger.html Gets the current log level of the Logger instance. ```APIDOC ## get logLevel(): LogLevel ### Description Gets the current log level of the Logger instance. ### Returns - **LogLevel** - The current log level. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.QuickReply.html Creates a new QuickReply instance with the specified arguments. ```APIDOC ## constructor ### Description Creates a new QuickReply instance with the specified arguments. ### Method constructor ### Parameters #### args - **args** (object) - Required - An object containing the following properties: - **count** (number) - Required - The count value. - **shortcut** (string) - Required - The shortcut string. - **shortcutId** (number) - Required - The shortcut ID. - **topMessage** (number) - Required - The top message ID. ### Returns - **QuickReply** - The newly created QuickReply instance. ``` -------------------------------- ### Example usage of CallbackQuery event Source: https://ref.teleproto.dev/classes/events.CallbackQuery.html Example of an async function that handles a NewCallbackQueryEvent. The function is currently a placeholder with a TODO comment. ```typescript async function printQuery(event: NewCallbackQueryEvent) { // TODO } ``` -------------------------------- ### Run print_updates example with npx ts-node Source: https://ref.teleproto.dev/ Command to run the print_updates.ts example using npx ts-node with transpile-only flag. Requires setting credentials at the top of the script. ```bash % npx ts-node --transpile-only teleproto_examples/print_updates.ts ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.InputMediaPhoto.html Creates a new InputMediaPhoto instance with the given arguments. ```APIDOC ## Constructor ### Description Creates a new InputMediaPhoto instance. ### Signature `new InputMediaPhoto(args: { id: TypeInputPhoto; livePhoto?: boolean; spoiler?: boolean; ttlSeconds?: number; video?: TypeInputDocument; }): InputMediaPhoto` ### Parameters - **args** (object) - Required - The arguments for the media photo. - **id** (TypeInputPhoto) - Required - The photo identifier. - **livePhoto** (boolean) - Optional - Indicates if it's a live photo. - **spoiler** (boolean) - Optional - Indicates if the photo has a spoiler. - **ttlSeconds** (number) - Optional - Time-to-live in seconds. - **video** (TypeInputDocument) - Optional - Associated video document. ### Returns - **InputMediaPhoto** - The created instance. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.BotAppSettings.html Creates a new BotAppSettings instance with optional settings. ```APIDOC ## constructor ### Description Creates a new BotAppSettings instance with optional settings. ### Method constructor ### Parameters - **args** (object) - Required - An object containing optional settings: - **backgroundColor** (number) - Optional - Background color. - **backgroundDarkColor** (number) - Optional - Background dark color. - **headerColor** (number) - Optional - Header color. - **headerDarkColor** (number) - Optional - Header dark color. - **placeholderPath** (bytes) - Optional - Placeholder path. ### Returns - **BotAppSettings** - The new instance. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.account.WallPapers.html Creates a new WallPapers instance with the given arguments. ```APIDOC ## constructor ### Description Creates a new WallPapers instance with the given arguments. ### Method constructor ### Parameters #### args - **args** (object) - Required - An object containing the hash and wallpapers. - **hash** (BigInteger) - Required - The hash of the wallpapers. - **wallpapers** (TypeWallPaper[]) - Required - The list of wallpapers. ### Returns - **WallPapers** - The new WallPapers instance. ``` -------------------------------- ### getInputChat Source: https://ref.teleproto.dev/classes/Api.MessageService.html Gets the input chat. ```APIDOC ## getInputChat ### Description Gets the input chat. ### Method getInputChat ### Endpoint getInputChat(): Promise ### Returns Promise ``` -------------------------------- ### getChat Source: https://ref.teleproto.dev/classes/Api.MessageService.html Gets the chat entity. ```APIDOC ## getChat ### Description Gets the chat entity. ### Method getChat ### Endpoint getChat(): Promise ### Returns Promise ``` -------------------------------- ### _finishInit Source: https://ref.teleproto.dev/classes/Api.MessageService.html Finishes initialization of the message service. ```APIDOC ## _finishInit ### Description Finishes initialization of the message service. ### Method _finishInit ### Endpoint _finishInit(client: TelegramClient, entities: Map, inputChat?: EntityLike): void ### Parameters #### Path Parameters - **client** (TelegramClient) - Required - The Telegram client. - **entities** (Map) - Required - Map of entities. - **inputChat** (EntityLike) - Optional - The input chat. ### Returns void ``` -------------------------------- ### Message.getSender Source: https://ref.teleproto.dev/classes/Api.Message.html Gets the sender of the message. ```APIDOC ## Message.getSender ### Description Gets the sender of the message. ### Method getSender ### Parameters - No parameters documented. ### Request Example ```typescript const sender = await message.getSender(); ``` ### Response No response body. ``` -------------------------------- ### new BotVerifierSettings() Source: https://ref.teleproto.dev/classes/Api.BotVerifierSettings.html Creates a new BotVerifierSettings instance with the given arguments. ```APIDOC ## Constructor ### new BotVerifierSettings(args) #### Parameters - **args**: object - The arguments object. - **canModifyCustomDescription** (optional): boolean - Whether custom description can be modified. - **company**: string - The company name. - **customDescription** (optional): string - Custom description. - **icon**: BigInteger - The icon identifier. #### Returns - **BotVerifierSettings** - A new instance of BotVerifierSettings. ``` -------------------------------- ### Message.getReplyMessage Source: https://ref.teleproto.dev/classes/Api.Message.html Gets the reply message. ```APIDOC ## Message.getReplyMessage ### Description Gets the reply message. ### Method getReplyMessage ### Parameters - No parameters documented. ### Request Example ```typescript const reply = await message.getReplyMessage(); ``` ### Response No response body. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.upload.WebFile.html Creates a new WebFile instance with the specified arguments. ```APIDOC ## constructor ### Description Creates a new WebFile instance with the specified arguments. ### Method constructor ### Parameters #### args - **args** (object) - Required - An object containing the following fields: - **bytes** (bytes) - Required - The file content as bytes. - **fileType** (TypeFileType) - Required - The type of the file. - **mimeType** (string) - Required - The MIME type of the file. - **mtime** (number) - Required - The modification time as a number. - **size** (number) - Required - The size of the file. ### Returns - **WebFile** - The newly created WebFile instance. ``` -------------------------------- ### Message.getReactions Source: https://ref.teleproto.dev/classes/Api.Message.html Gets reactions from the message. ```APIDOC ## Message.getReactions ### Description Gets reactions from the message. ### Method getReactions ### Parameters - No parameters documented. ### Request Example ```typescript const reactions = message.getReactions(); ``` ### Response No response body. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.InputQuickReplyShortcut.html Creates a new InputQuickReplyShortcut instance with the given shortcut string. ```APIDOC ## constructor ### Description Creates a new InputQuickReplyShortcut instance with the given shortcut string. ### Method constructor ### Parameters #### args - **args** (object) - Required - An object containing the shortcut string. - **shortcut** (string) - Required - The shortcut string. ### Returns - **InputQuickReplyShortcut** - The newly created instance. ``` -------------------------------- ### new WebBrowserSettings(args) Source: https://ref.teleproto.dev/classes/Api.account.WebBrowserSettings.html Constructor for creating a WebBrowserSettings instance. ```APIDOC ## Constructor ### new WebBrowserSettings(args) #### Description Creates a new WebBrowserSettings instance with the specified configuration. #### Parameters - **args** (object) - Required - An object containing the settings: - `displayCloseButton` (boolean) - Optional - Whether to display a close button. - `externalExceptions` (WebDomainException[]) - Required - List of external domain exceptions. - `hash` (BigInteger) - Required - Hash value. - `inappExceptions` (WebDomainException[]) - Required - List of in-app domain exceptions. - `openExternalBrowser` (boolean) - Optional - Whether to open external browser. #### Returns - **WebBrowserSettings** - The created instance. ``` -------------------------------- ### Message.getInputSender Source: https://ref.teleproto.dev/classes/Api.Message.html Gets the input sender. ```APIDOC ## Message.getInputSender ### Description Gets the input sender. ### Method getInputSender ### Parameters - No parameters documented. ### Request Example ```typescript const inputSender = message.getInputSender(); ``` ### Response No response body. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.PhotoSize.html Creates a new PhotoSize instance with the specified arguments. ```APIDOC ## constructor ### Description Creates a new PhotoSize instance with the specified arguments. ### Method constructor ### Parameters #### args - **args** (object) - Required - The arguments for the PhotoSize, containing h, size, type, and w. ### Returns PhotoSize ``` -------------------------------- ### Message.getInputChat Source: https://ref.teleproto.dev/classes/Api.Message.html Gets the input chat. ```APIDOC ## Message.getInputChat ### Description Gets the input chat. ### Method getInputChat ### Parameters - No parameters documented. ### Request Example ```typescript const inputChat = message.getInputChat(); ``` ### Response No response body. ``` -------------------------------- ### Creating an InlineKeyboard with callback and URL buttons Source: https://ref.teleproto.dev/classes/InlineKeyboard.html This example demonstrates how to create an InlineKeyboard with two callback buttons and a URL button, then send it with a message using client.sendMessage. ```javascript const keyboard = new InlineKeyboard() .callback("Yes", "yes", { style: { color: "success" } }) .callback("No", "no", { style: { color: "danger" } }) .row() .url("Open", "https://t.me/durov"); await client.sendMessage(chat, { message: "Well?", buttons: keyboard }); ``` -------------------------------- ### Message.getChat Source: https://ref.teleproto.dev/classes/Api.Message.html Gets the chat of the message. ```APIDOC ## Message.getChat ### Description Gets the chat of the message. ### Method getChat ### Parameters - No parameters documented. ### Request Example ```typescript const chat = await message.getChat(); ``` ### Response No response body. ``` -------------------------------- ### new InputMediaPaidMedia(args) Source: https://ref.teleproto.dev/classes/Api.InputMediaPaidMedia.html Creates a new InputMediaPaidMedia instance with the provided arguments. ```APIDOC ## new InputMediaPaidMedia(args) ### Description Creates a new InputMediaPaidMedia instance with the provided arguments. ### Method constructor ### Parameters - **args** (object) - Required - An object containing the following fields: - **extendedMedia** (TypeInputMedia[]) - Required - The extended media array. - **payload** (string) - Optional - The payload string. - **starsAmount** (BigInteger) - Required - The amount of stars. ### Returns InputMediaPaidMedia ``` -------------------------------- ### Message.getButtons Source: https://ref.teleproto.dev/classes/Api.Message.html Gets buttons from the message. ```APIDOC ## Message.getButtons ### Description Gets buttons from the message. ### Method getButtons ### Parameters - No parameters documented. ### Request Example ```typescript const buttons = message.getButtons(); ``` ### Response No response body. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.SuggestedPost.html Creates a new SuggestedPost instance with optional parameters for accepted, price, rejected, and scheduleDate. ```APIDOC ## constructor ### Description Creates a new SuggestedPost instance with optional parameters. ### Method constructor ### Parameters #### args (object) - Required - **accepted** (boolean) - Optional - Indicates if the post is accepted. - **price** (TypeStarsAmount) - Optional - The price associated with the post. - **rejected** (boolean) - Optional - Indicates if the post is rejected. - **scheduleDate** (number) - Optional - The scheduled date for the post. ### Returns - **SuggestedPost** - The newly created instance. ``` -------------------------------- ### StatsGetPollStatsParams Source: https://ref.teleproto.dev/interfaces/Api.StatsGetPollStatsParams.html Interface for getting poll statistics. ```APIDOC ## Interface StatsGetPollStatsParams ### Description Interface for getting poll statistics. ### Properties - **dark** (boolean) - Optional - Dark mode flag. - **msgId** (MessageIDLike) - Required - The message ID of the poll. - **peer** (EntityLike) - Required - The peer (chat or user) where the poll is located. ``` -------------------------------- ### Message.getEntitiesText Source: https://ref.teleproto.dev/classes/Api.Message.html Gets entities text from the message. ```APIDOC ## Message.getEntitiesText ### Description Gets entities text from the message. ### Method getEntitiesText ### Parameters - No parameters documented. ### Request Example ```typescript const text = message.getEntitiesText(); ``` ### Response No response body. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.BotBusinessConnection.html Creates a new BotBusinessConnection instance with the given arguments. ```APIDOC ## constructor ### Description Creates a new BotBusinessConnection instance with the specified properties. ### Method constructor ### Parameters - **args** (object) - Required - An object containing the following fields: - **connectionId** (string) - Required - The connection ID. - **date** (number) - Required - The date of the connection. - **dcId** (number) - Required - The data center ID. - **disabled** (boolean) - Optional - Whether the connection is disabled. - **rights** (BusinessBotRights) - Optional - The business bot rights. - **userId** (BigInteger) - Required - The user ID. ### Returns - **BotBusinessConnection** - The newly created instance. ``` -------------------------------- ### AccountInstallWallPaperParams Source: https://ref.teleproto.dev/interfaces/Api.AccountInstallWallPaperParams.html Interface defining the parameters for installing a wallpaper. ```APIDOC ## Interface: AccountInstallWallPaperParams ### Description Defines the parameters required to install a wallpaper. ### Properties #### settings - Type: `WallPaperSettingsIn` - Required: Yes - Description: Wallpaper settings #### wallpaper - Type: `TypeInputWallPaperIn` - Required: Yes - Description: Wallpaper to install ``` -------------------------------- ### MessagesGetEmojiStickersParams Source: https://ref.teleproto.dev/interfaces/Api.MessagesGetEmojiStickersParams.html Interface for parameters to get emoji stickers. ```APIDOC ## Interface MessagesGetEmojiStickersParams ### Description Interface representing parameters for getting emoji stickers. ### Properties - **hash** (BigInteger) - Hash used for caching, for more info click here. ``` -------------------------------- ### new InitPasskeyLogin(args: Args): InitPasskeyLogin Source: https://ref.teleproto.dev/classes/Api.auth.InitPasskeyLogin.html Creates a new instance of InitPasskeyLogin with the provided arguments. ```APIDOC ## new InitPasskeyLogin(args: Args): InitPasskeyLogin ### Description Creates a new InitPasskeyLogin request instance. ### Method constructor ### Parameters - **args** (Args) - Required - The arguments for the request, including apiHash and apiId. ### Returns InitPasskeyLogin ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.InputMediaDocument.html Creates a new InputMediaDocument instance with the provided arguments. ```APIDOC ## constructor ### Description Creates a new InputMediaDocument instance. ### Method constructor ### Parameters - **args** (object) - Required - An object containing the following fields: - **id** (TypeInputDocument) - Required - The document ID. - **query** (string) - Optional - Query string. - **spoiler** (boolean) - Optional - Whether the media is a spoiler. - **ttlSeconds** (number) - Optional - Time-to-live in seconds. - **videoCover** (TypeInputPhoto) - Optional - Video cover photo. - **videoTimestamp** (number) - Optional - Video timestamp. ### Returns - **InputMediaDocument** - The created instance. ``` -------------------------------- ### MessagesGetCommonChatsParams Source: https://ref.teleproto.dev/interfaces/Api.MessagesGetCommonChatsParams.html Parameters for getting common chats with a user. ```APIDOC ## MessagesGetCommonChatsParams ### Description Parameters for getting common chats with a user. ### Properties - **limit** (number) - Maximum number of results to return, see pagination - **maxId** (BigInteger) - Maximum ID of chat to return (see pagination) - **userId** (EntityLike) - User ID ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.BotCommandScopeDefault.html Creates a new BotCommandScopeDefault instance. ```APIDOC ## constructor ### Description Creates a new BotCommandScopeDefault instance. ### Method constructor ### Signature new BotCommandScopeDefault(args: void): BotCommandScopeDefault ### Parameters - **args** (void) - Required - The arguments for the constructor. ### Returns BotCommandScopeDefault ``` -------------------------------- ### get port Source: https://ref.teleproto.dev/classes/sessions.StringSession.html Returns the port to which the library should connect to. ```APIDOC ## get port ### Description Returns the port to which the library should connect to. ### Method GET ### Returns - **number** - The port number. ### Example ```typescript const port = session.port; ``` ``` -------------------------------- ### getMessage Source: https://ref.teleproto.dev/classes/events.CallbackQueryEvent.html Gets the message associated with the callback query. ```APIDOC ## getMessage ### Description Retrieves the message associated with the callback query. ### Method getMessage ### Endpoint getMessage() ### Parameters None ### Returns Promise ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.help.UserInfo.html Creates a new UserInfo instance with the specified arguments. ```APIDOC ## constructor ### Description Creates a new UserInfo instance with the specified arguments. ### Method constructor ### Parameters - **args** (object) - Required - An object containing the following fields: - **author** (string) - Required - The author of the message. - **date** (number) - Required - The date of the message. - **entities** (TypeMessageEntity[]) - Required - The entities in the message. - **message** (string) - Required - The message content. ### Returns - **UserInfo** - The newly created UserInfo instance. ``` -------------------------------- ### new InputStickeredMediaPhoto(args) Source: https://ref.teleproto.dev/classes/Api.InputStickeredMediaPhoto.html Creates a new InputStickeredMediaPhoto instance with the given arguments. ```APIDOC ## Constructor: new InputStickeredMediaPhoto(args) ### Description Creates a new InputStickeredMediaPhoto instance. ### Parameters - **args** (object) - Required - An object containing the `id` property of type `TypeInputPhoto`. ### Returns - **InputStickeredMediaPhoto** - The newly created instance. ### Example ```typescript const instance = new InputStickeredMediaPhoto({ id: someInputPhoto }); ``` ``` -------------------------------- ### get size() Source: https://ref.teleproto.dev/classes/InlineKeyboard.html How many buttons the keyboard holds. ```APIDOC ## Accessor: get size() ### Description How many buttons the keyboard holds. ### Returns - **number** - The number of buttons. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.account.GetWebBrowserSettings.html Creates a new GetWebBrowserSettings instance with the provided arguments. ```APIDOC ## constructor ### Description Creates a new GetWebBrowserSettings instance. ### Method constructor ### Parameters - **args** (Args) - Required - The arguments for the request. ### Returns GetWebBrowserSettings ``` -------------------------------- ### getBytes Source: https://ref.teleproto.dev/classes/Api.updates.DifferenceSlice.html Instance method to get the bytes of the DifferenceSlice. ```APIDOC ## getBytes ### Description Instance method to get the bytes of the DifferenceSlice. ### Method getBytes ### Returns - **Buffer** - The bytes. ``` -------------------------------- ### getBytes Source: https://ref.teleproto.dev/classes/Api.TextSpoiler.html Method to get the byte representation of the TextSpoiler. ```APIDOC ## getBytes(): Buffer ### Description Returns the byte representation of the TextSpoiler instance. ### Returns - **Buffer** - The byte buffer. ``` -------------------------------- ### _finishInit(client: TelegramClient, entities: Map, inputChat?: EntityLike): void Source: https://ref.teleproto.dev/classes/Api.Message.html Finishes initialization of the message. ```APIDOC ## _finishInit(client: TelegramClient, entities: Map, inputChat?: EntityLike): void ### Description Finishes initialization of the message. ### Method _finishInit ### Parameters - **client** (TelegramClient) - Required - The Telegram client. - **entities** (Map) - Required - A map of entities. - **inputChat** (EntityLike) - Optional - The input chat entity. ### Returns - **void** - No return value. ``` -------------------------------- ### getBytes() Source: https://ref.teleproto.dev/classes/Api.SecureValue.html Method to get the byte representation of the SecureValue. ```APIDOC ## getBytes() ### Description Returns the byte representation of the SecureValue. ### Method getBytes ### Returns Buffer ``` -------------------------------- ### new InitFirebasePnvLogin(args: Args): InitFirebasePnvLogin Source: https://ref.teleproto.dev/classes/Api.auth.InitFirebasePnvLogin.html Creates a new instance of InitFirebasePnvLogin with the provided arguments. ```APIDOC ## Constructor: new InitFirebasePnvLogin(args: Args) ### Description Creates a new InitFirebasePnvLogin request object with the given arguments. ### Parameters - **args** (Args) - Required - The arguments for the request, containing optional `apiHash` (string) and `apiId` (number). ### Returns - **InitFirebasePnvLogin** - The new instance. ``` -------------------------------- ### getEntitiesText(cls?: Function): any Source: https://ref.teleproto.dev/classes/Api.Message.html Gets the entities text. ```APIDOC ## getEntitiesText(cls?: Function): any ### Description Gets the entities text. ### Method getEntitiesText ### Parameters - **cls** (Function) - Optional - The class to filter entities. ### Returns - **any** - The entities text. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.ReqPq.html Creates a new ReqPq instance with the given arguments. ```APIDOC ## constructor ### Description Creates a new ReqPq instance with the given arguments. ### Method constructor ### Signature new ReqPq(args: Args): ReqPq ### Parameters - **args** (Args) - Required - The arguments for the request. ### Returns - **ReqPq** - The new ReqPq instance. ``` -------------------------------- ### MessageReportOption.getBytes() Source: https://ref.teleproto.dev/classes/Api.MessageReportOption.html Instance method to get the bytes of the MessageReportOption. ```APIDOC ## MessageReportOption.getBytes() ### Description Instance method to get the bytes of the MessageReportOption. ### Method getBytes ### Parameters None ### Returns Buffer ``` -------------------------------- ### new GetPremiumPromo(args: void): GetPremiumPromo Source: https://ref.teleproto.dev/classes/Api.help.GetPremiumPromo.html Creates a new GetPremiumPromo instance. The constructor takes no arguments and returns a new instance of the class. ```APIDOC ## new GetPremiumPromo(args: void): GetPremiumPromo ### Description Creates a new GetPremiumPromo instance. ### Parameters - **args** (void) - Required - No arguments. ### Returns - **GetPremiumPromo** - A new instance of the class. ``` -------------------------------- ### getBytes Source: https://ref.teleproto.dev/classes/Api.InputUser.html Method to get the byte representation of the InputUser. ```APIDOC ## getBytes(): Buffer ### Description Returns the byte representation of the InputUser instance. ### Returns - **Buffer** - The byte representation. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.account.GetBusinessChatLinks.html Creates a new GetBusinessChatLinks instance. ```APIDOC ## constructor ### Description Creates a new GetBusinessChatLinks instance. ### Method constructor ### Signature new GetBusinessChatLinks(args: void): GetBusinessChatLinks ### Parameters - **args** (void) - Required - Arguments for the constructor. ### Returns GetBusinessChatLinks ``` -------------------------------- ### getBytes Source: https://ref.teleproto.dev/classes/Api.EncryptedFile.html Method to get the serialized bytes of the EncryptedFile. ```APIDOC ## getBytes() ### Description Returns the serialized bytes of the EncryptedFile. ### Returns - **Buffer** - The serialized bytes. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.InputWebFileLocation.html Creates a new InputWebFileLocation instance with the given arguments. ```APIDOC ## Constructor ### Description Creates a new InputWebFileLocation instance. ### Signature `new InputWebFileLocation(args: { accessHash: BigInteger; url: string }): InputWebFileLocation` ### Parameters - **args** (object) - Required - An object containing the access hash and URL. - **accessHash** (BigInteger) - Required - The access hash of the file. - **url** (string) - Required - The URL of the file. ### Returns - **InputWebFileLocation** - The newly created instance. ``` -------------------------------- ### fromReader Source: https://ref.teleproto.dev/classes/Api.WallPaperSettings.html Static method to create a WallPaperSettings instance from a reader. ```APIDOC ## fromReader ### Description Static method to create a WallPaperSettings instance from a reader. ### Method fromReader ### Signature static fromReader(reader: any): WallPaperSettings ### Parameters - **reader** (any) - Required - The reader object. ### Returns - **WallPaperSettings** - A new WallPaperSettings instance. ``` -------------------------------- ### getBytes Source: https://ref.teleproto.dev/classes/Api.FileHash.html Instance method to get the bytes of the FileHash. ```APIDOC ## getBytes(): Buffer ### Description Returns the byte representation of the FileHash. ### Returns - **Buffer** - The byte representation. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.MessageMediaWebPage.html Creates a new MessageMediaWebPage instance with the given arguments. ```APIDOC ## constructor ### Description Creates a new MessageMediaWebPage instance. ### Method constructor ### Parameters #### args (object) - Required - **forceLargeMedia** (boolean) - Optional - Force large media. - **forceSmallMedia** (boolean) - Optional - Force small media. - **manual** (boolean) - Optional - Manual flag. - **safe** (boolean) - Optional - Safe flag. - **webpage** (Api.TypeWebPage) - Required - The webpage object. ### Returns MessageMediaWebPage ``` -------------------------------- ### getBytes Source: https://ref.teleproto.dev/classes/Api.Dialog.html Method to get the serialized bytes of the Dialog. ```APIDOC ## getBytes(): Buffer ### Description Returns the serialized bytes of the Dialog instance. ### Returns - **Buffer** - The serialized bytes. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.InputMediaDocumentExternal.html Creates a new InputMediaDocumentExternal instance with the given arguments. ```APIDOC ## constructor ### Description Creates a new InputMediaDocumentExternal instance. ### Method constructor ### Parameters #### args - **spoiler** (boolean) - Optional - Whether the media is a spoiler. - **ttlSeconds** (number) - Optional - Time-to-live in seconds. - **url** (string) - Required - The URL of the external document. - **videoCover** (TypeInputPhoto) - Optional - Video cover photo. - **videoTimestamp** (number) - Optional - Timestamp in the video. ### Returns InputMediaDocumentExternal ``` -------------------------------- ### getBytes() Source: https://ref.teleproto.dev/classes/Api.CommunityPeer.html Method to get the byte representation of the CommunityPeer. ```APIDOC ## getBytes(): Buffer ### Description Returns the byte representation of the CommunityPeer instance. ### Returns - **Buffer** - The byte representation. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.messages.GetWebPage.html Creates a new GetWebPage instance with the provided arguments. ```APIDOC ## constructor ### Description Creates a new GetWebPage instance. ### Signature `new GetWebPage(args: Args): GetWebPage` ### Parameters - **args** (Args) - Required - The arguments for the request. ### Returns - **GetWebPage** - The new instance. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.MessageMediaPhoto.html Creates a new MessageMediaPhoto instance with optional parameters for live photo, photo, spoiler, ttlSeconds, and video. ```APIDOC ## constructor ### Description Creates a new MessageMediaPhoto instance. ### Method constructor ### Parameters - **args** (object) - Required - An object with optional properties: - `livePhoto` (boolean) - Optional - Indicates if the photo is a live photo. - `photo` (Api.TypePhoto) - Optional - The photo object. - `spoiler` (boolean) - Optional - Indicates if the photo is a spoiler. - `ttlSeconds` (number) - Optional - Time-to-live in seconds. - `video` (TypeDocument) - Optional - The video document. ### Returns - **MessageMediaPhoto** - The new instance. ``` -------------------------------- ### MessagesInstallStickerSetParams Source: https://ref.teleproto.dev/interfaces/Api.MessagesInstallStickerSetParams.html Interface representing parameters for installing a sticker set. ```APIDOC ## MessagesInstallStickerSetParams ### Description Interface representing parameters for installing a sticker set. ### Properties - **archived** (boolean) - Whether to archive stickerset - **stickerset** (TypeInputStickerSetIn) - Stickerset to install ``` -------------------------------- ### StatsGetBroadcastStatsParams Source: https://ref.teleproto.dev/interfaces/Api.StatsGetBroadcastStatsParams.html Interface defining parameters for getting broadcast stats. ```APIDOC ## Interface StatsGetBroadcastStatsParams ### Description Parameters for retrieving broadcast statistics. ### Properties - **channel** (EntityLike) - Required - The channel. - **dark** (boolean) - Optional - Whether to enable dark theme for graph colors. ``` -------------------------------- ### MessagesGetRecentStickersParams Source: https://ref.teleproto.dev/interfaces/Api.MessagesGetRecentStickersParams.html Interface defining parameters for getting recent stickers. ```APIDOC ## Interface MessagesGetRecentStickersParams ### Description Parameters for retrieving recent stickers. ### Properties #### attached (optional) - **Type**: boolean - **Description**: Get stickers recently attached to photo or video files. #### hash - **Type**: BigInteger - **Description**: Hash used for caching, for more info click here. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.account.CreateBusinessChatLink.html Creates a new CreateBusinessChatLink instance with the given arguments. ```APIDOC ## constructor ### Description Creates a new CreateBusinessChatLink instance with the given arguments. ### Method constructor ### Signature new CreateBusinessChatLink(args: Args): CreateBusinessChatLink ### Parameters - **args** (Args) - Required - The arguments for the request. ### Returns CreateBusinessChatLink ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.BotMenuButton.html Creates a new BotMenuButton instance with the given text and URL. ```APIDOC ## constructor ### Description Creates a new BotMenuButton instance. ### Method constructor ### Parameters - **args** (object) - Required - An object containing the text and url properties. - **text** (string) - Required - The text of the button. - **url** (string) - Required - The URL of the button. ### Returns - **BotMenuButton** - The newly created instance. ``` -------------------------------- ### MessagesGetAvailableEffectsParams Source: https://ref.teleproto.dev/interfaces/Api.MessagesGetAvailableEffectsParams.html Interface representing parameters for getting available effects. ```APIDOC ## Interface: MessagesGetAvailableEffectsParams ### Description Interface representing parameters for getting available effects. ### Properties #### hash - Type: number - Required: Yes - Description: Hash used for caching, for more info click here. ### Example ```typescript interface MessagesGetAvailableEffectsParams { hash: number; } ``` ``` -------------------------------- ### LangpackGetLanguageParams Source: https://ref.teleproto.dev/interfaces/Api.LangpackGetLanguageParams.html Interface representing parameters for getting a language pack. ```APIDOC ## LangpackGetLanguageParams ### Description Interface representing parameters for getting a language pack. ### Properties - **langCode** (string) - Either an ISO 639-1 language code or a language pack name obtained from a language pack link. - **langPack** (string) - Platform identifier (i.e. android, tdesktop, etc). ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.help.GetUserInfo.html Creates a new GetUserInfo instance with the given arguments. ```APIDOC ## constructor ### Description Creates a new GetUserInfo instance with the given arguments. ### Method constructor ### Parameters - **args** (Args) - Required - The arguments for the request. ### Returns GetUserInfo ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.UpdateStory.html Creates a new UpdateStory instance with the given arguments. ```APIDOC ## constructor ### Description Creates a new UpdateStory instance. ### Method constructor ### Parameters - **args** (object) - Required - The arguments object containing peer and story. - **peer** (TypePeer) - Required - The peer associated with the story update. - **story** (TypeStoryItem) - Required - The story item data. ### Returns UpdateStory ``` -------------------------------- ### BotsGetBotInfoParams Source: https://ref.teleproto.dev/interfaces/Api.BotsGetBotInfoParams.html Interface defining the parameters for getting bot information. ```APIDOC ## Interface BotsGetBotInfoParams ### Description Interface for parameters used when getting information about a bot. ### Properties #### bot (Optional) - Type: EntityLike - Description: If called by a user, must contain the peer of a bot we own. #### langCode (Required) - Type: string - Description: Language code, if left empty this method will return the fallback about text and description. ### Example ```typescript interface BotsGetBotInfoParams { bot?: EntityLike; langCode: string; } ``` ``` -------------------------------- ### new InputMediaEmpty(args: void): InputMediaEmpty Source: https://ref.teleproto.dev/classes/Api.InputMediaEmpty.html Creates a new InputMediaEmpty instance. The constructor takes no arguments and returns an InputMediaEmpty object. ```APIDOC ## Constructor: new InputMediaEmpty(args: void): InputMediaEmpty ### Description Creates a new InputMediaEmpty instance. ### Parameters - **args** (void) - Required - No arguments. ### Returns - **InputMediaEmpty** - The new instance. ``` -------------------------------- ### get testServers Source: https://ref.teleproto.dev/classes/sessions.StringSession.html Returns whether test servers are being used. ```APIDOC ## get testServers ### Description Returns whether test servers are being used. ### Method GET ### Returns - **boolean** - True if using test servers, false otherwise. ### Example ```typescript const isTest = session.testServers; ``` ``` -------------------------------- ### use() example: adding middleware Source: https://ref.teleproto.dev/classes/client.updates.ClientUpdates.html Shows how to add a middleware to the chain using the use() method. The middleware runs for every update and can perform async operations before calling next(). ```typescript client.updates.use(async (update, next) => { update.state.user = await db.findUser(update); await next(); }); Copy ``` -------------------------------- ### get takeoutId Source: https://ref.teleproto.dev/classes/sessions.StringSession.html Returns the takeout ID (always undefined). ```APIDOC ## get takeoutId ### Description Returns the takeout ID (always undefined). ### Method GET ### Returns - **undefined** - Always undefined. ### Example ```typescript const id = session.takeoutId; ``` ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.payments.GiveawayInfo.html Creates a new GiveawayInfo instance with the specified arguments. ```APIDOC ## constructor ### Description Creates a new GiveawayInfo instance with the specified arguments. ### Method constructor ### Signature new GiveawayInfo(args: { adminDisallowedChatId?: BigInteger; disallowedCountry?: string; joinedTooEarlyDate?: number; participating?: boolean; preparingResults?: boolean; startDate: number; }): GiveawayInfo ### Parameters - **args** (object) - Required - An object containing the following fields: - **adminDisallowedChatId** (BigInteger) - Optional - The chat ID where admin disallowed the giveaway. - **disallowedCountry** (string) - Optional - The country that is disallowed. - **joinedTooEarlyDate** (number) - Optional - The date when the user joined too early. - **participating** (boolean) - Optional - Whether the user is participating. - **preparingResults** (boolean) - Optional - Whether results are being prepared. - **startDate** (number) - Required - The start date of the giveaway. ### Returns - **GiveawayInfo** - The newly created instance. ``` -------------------------------- ### get serverAddress Source: https://ref.teleproto.dev/classes/sessions.StringSession.html Returns the server address where the library should connect to. ```APIDOC ## get serverAddress ### Description Returns the server address where the library should connect to. ### Method GET ### Returns - **string** - The server address. ### Example ```typescript const address = session.serverAddress; ``` ``` -------------------------------- ### new FinishFirebasePnvLogin(args: Args): FinishFirebasePnvLogin Source: https://ref.teleproto.dev/classes/Api.auth.FinishFirebasePnvLogin.html Creates a new FinishFirebasePnvLogin instance with the provided arguments. ```APIDOC ## Constructor: new FinishFirebasePnvLogin(args: Args) ### Description Creates a new FinishFirebasePnvLogin instance with the provided arguments. ### Parameters - **args** (Args) - Required - The arguments for the request. ### Returns - **FinishFirebasePnvLogin** - The new instance. ``` -------------------------------- ### get dcId Source: https://ref.teleproto.dev/classes/sessions.StringSession.html Returns the currently-used data center ID. ```APIDOC ## get dcId ### Description Returns the currently-used data center ID. ### Method GET ### Returns - **number** - The data center ID. ### Example ```typescript const id = session.dcId; ``` ``` -------------------------------- ### AccountGetThemesParams Source: https://ref.teleproto.dev/interfaces/Api.AccountGetThemesParams.html Interface defining parameters for getting account themes. ```APIDOC ## Interface AccountGetThemesParams ### Description Defines the parameters for retrieving account themes. ### Properties - **format** (string) - Theme format, a string that identifies the theming engines supported by the client - **hash** (BigInteger) - Hash used for caching, for more info click here . ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.messages.ToggleBotInAttachMenu.html Creates a new ToggleBotInAttachMenu instance with the given arguments. ```APIDOC ## constructor ### Description Creates a new ToggleBotInAttachMenu instance. ### Method constructor ### Parameters - **args** (Args) - Required - The arguments for the request. ### Returns ToggleBotInAttachMenu ``` -------------------------------- ### AccountGetNotifySettingsParams Source: https://ref.teleproto.dev/interfaces/Api.AccountGetNotifySettingsParams.html Interface for parameters to get notification settings for a peer. ```APIDOC ## Interface AccountGetNotifySettingsParams ### Description Interface representing parameters for retrieving notification settings for a peer. ### Properties - **peer** (EntityLike) - Required - Notification source ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.messages.GetEmojiGameInfo.html Creates a new GetEmojiGameInfo instance. ```APIDOC ## [CONSTRUCTOR] GetEmojiGameInfo ### Description Creates a new GetEmojiGameInfo instance. ### Method constructor ### Endpoint new GetEmojiGameInfo(args: void): GetEmojiGameInfo ### Parameters #### Path Parameters - **args** (void) - Required - The arguments for the constructor. ### Response #### Success Response (200) - **GetEmojiGameInfo** (GetEmojiGameInfo) - The created instance. #### Response Example { "className": "messages.GetEmojiGameInfo", "classType": "request", "CONSTRUCTOR_ID": 4219374759, "SUBCLASS_OF_ID": 105590818 } ``` -------------------------------- ### AccountGetBotBusinessConnectionParams Source: https://ref.teleproto.dev/interfaces/Api.AccountGetBotBusinessConnectionParams.html Interface for parameters to get a bot business connection. ```APIDOC ## Interface AccountGetBotBusinessConnectionParams ### Description Interface representing parameters for getting a bot business connection. ### Properties - **connectionId** (string) - Required - Business connection ID. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.InputPasskeyCredentialPublicKey.html Creates a new InputPasskeyCredentialPublicKey instance with the provided arguments. ```APIDOC ## constructor ### Description Creates a new InputPasskeyCredentialPublicKey instance. ### Method constructor ### Signature new InputPasskeyCredentialPublicKey(args: { id: string; rawId: string; response: TypeInputPasskeyResponse }): InputPasskeyCredentialPublicKey ### Parameters - **args** (object) - Required - The arguments for the credential, containing id, rawId, and response. ### Returns InputPasskeyCredentialPublicKey ``` -------------------------------- ### get isChannel(): boolean Source: https://ref.teleproto.dev/classes/events.AlbumEvent.html Indicates whether the chat is a channel. ```APIDOC ## [ACCESSOR] get isChannel(): boolean ### Description Checks if the chat is a channel. ### Returns - **boolean** - True if the chat is a channel, false otherwise. ``` -------------------------------- ### getBytes Source: https://ref.teleproto.dev/classes/Api.messages.StickerSet.html Instance method to get the byte representation of the StickerSet. ```APIDOC ## getBytes ### Description Instance method to get the byte representation of the StickerSet. ### Method getBytes ### Returns - **Buffer** - The byte representation. ``` -------------------------------- ### constructor Source: https://ref.teleproto.dev/classes/Api.TextMath.html Creates a new TextMath instance with the given source string. ```APIDOC ## constructor ### Description Creates a new TextMath instance with the given source string. ### Method constructor ### Parameters - **args** (object) - Required - An object containing the source string. - **source** (string) - Required - The source text of the mathematical expression. ### Returns - **TextMath** - The newly created TextMath instance. ``` -------------------------------- ### getBytes() Source: https://ref.teleproto.dev/classes/Api.messages.InvitedUsers.html Method to get the serialized bytes of the InvitedUsers instance. ```APIDOC ## getBytes(): Buffer ### Description Returns the serialized bytes of the InvitedUsers instance. ### Returns - **Buffer** - The serialized bytes. ```