WebhookClient
classReceives updates from Telegram via webhook (incoming HTTP POST requests).
Declaration
declare class WebhookClient Properties
Methods
constructor(client: Client);Constructs a new instance of the WebhookClient class
callback(options?: WebhookServerOptions): (req: IncomingMessage, res: ServerResponse) => void;| Parameter | Type |
|---|---|
| options? | WebhookServerOptions |
Returns (req: IncomingMessage, res: ServerResponse) => void
Build a Node http request handler suitable for mounting on an existing server or passing to .
createServer(url: string, port: number, options?: WebhookServerOptions): Promise<Server>;| Parameter | Type |
|---|---|
| url | string |
| port | number |
| options? | WebhookServerOptions |
Returns Promise<Server>
Register the webhook with Telegram and start a built-in HTTP server to receive updates.