export Class
Client ​
extends ​
The main hub for interacting with the Telegram API.
Constructor ​
ts
new Client( options )
Parameter | Type | Description |
---|---|---|
options | ClientOptions | The 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 ) ​
Parameter | Type | Description |
---|---|---|
file_id | string | The id of the file to fetch. |
file? | boolean | Wether to return the class File or an object. |
Returns:
Promise
<false
|File
>
asyncintialize( token, provider_token ) ​
Parameter | Type | Description |
---|---|---|
token = ... | string | Your token for authorization, or see EnvironmentVariables . |
provider_token = ... | string | Your token provided by your payment provider, or see EnvironmentVariables . |
Intializes your client and the poll manager, also updating the me manager.
Returns:
Promise
<void
>