export Class
Client ​
extends ​
BaseClient
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 ​
actions : ActionsManager
​
api : APIManager
​
chats : ChatsManager
​
commands : CommandsManager
​
invoices : InvoicesManager
​
logger : Logger
​
me : MeManager
​
options : ClientOptions
​
The options provided to the client.
payments : PaymentsManager
​
poll : PollManager
​
polls : PollsManager
​
registries : RegistryManager
​
readonly token? : string
​
The token provided by Telegram for your client.
users : UsersManager
​
webhook? : WebhookManager
​
Methods ​
asyncintialize( token, provider_token ) ​
Intializes your client and the poll manager, also updating the me manager.
Parameter | Type | Description |
---|---|---|
token = ... | string | Your token for authorization, or stored in process.env as 'TELEGRAM_TOKEN'. |
provider_token = ... | string | Your token provided by your payment provider, or stored in process.env as 'PAYMENT_PROVIDER_TOKEN'. |
Returns: Promise
<boolean
>
asyncupdate( ) ​
Updates the me manager of the client.
Returns: Promise
<void
>