Skip to content

export Class

Client ​

extends ​

BaseClient

The main hub for interacting with the Telegram API.

Constructor ​

ts
 new Client( options )
ParameterTypeDescription
optionsClientOptionsThe options for your client.

Client Events ​

The ClientEvent contains the events that the client emits and what their parameters.

Properties ​

get defaults : Function ​

get isJson : Function ​

get nest : Function ​

actions : ActionsManager ​

chats : ChatsManager ​

commands : CommandsManager ​

database? : any ​

An extension activated property.

endpoint : EndpointManager ​

extensions : ExtensionsManager ​

invoices : InvoicesManager ​

logger : Logger ​

options : ClientOptions ​

The options provided to the client.

payments : PaymentsManager ​

polls : PollsManager ​

rest : Rest ​

user : ClientUser ​

users : UsersManager ​

webhook : WebhookManager ​

Methods ​

asyncfetchFile( file_id, file ) ​

ParameterTypeDescription
file_idstringThe id of the file to fetch.
file?booleanWether to return the class File or an object.

Returns: Promise<false | File>

asyncintialize( token, provider_token ) ​

ParameterTypeDescription
token = ...stringYour token for authorization, or see EnvironmentVariables .
provider_token = ...stringYour token provided by your payment provider, or see EnvironmentVariables .

Intializes your client and the poll manager, also updating the me manager.

Returns: Promise<void>

A modern, powerful library for building your Telegram bots, with seamless support for both JavaScript and Typescript.