Client
classextends TypedEmitter<ClientEvents>
The main entry point of the library. Wraps the transport, emits typed events for incoming updates, and exposes the full Bot API via .
Declaration
declare class Client extends TypedEmitter<ClientEvents> Properties
readonly polling: PollingClient;get uptime(): number | null;Milliseconds since the client became ready, or null if not ready.
readonly webhook: WebhookClient;Methods
constructor(options?: ClientOptions);Constructs a new instance of the Client class
login(token?: string | null): Promise<ClientUser>;| Parameter | Type |
|---|---|
| token? | string | null |
Returns Promise<ClientUser>
Authenticate the bot, fetch its own account via getMe, and emit ready. Does not start receiving updates — call or set up a webhook for that.
startPolling(options?: PollingOptions): Promise<ClientUser>;| Parameter | Type |
|---|---|
| options? | PollingOptions |
Returns Promise<ClientUser>
Log in and immediately start long polling for updates.