Class representing a telegram bot.

Constructors

Properties

api: URL

The telegram api URL

commands: Record<string, ((ctx) => Promise<Response>)> = {}

The telegram commands record map

Type declaration

currentContext: TelegramExecutionContext

The current bot context

token: string

The telegram token

update: TelegramUpdate = ...

The telegram update object

webhook: Webhook = ...

The telegram webhook object

Methods

  • Handle a request on a given bot

    Parameters

    • request: Request<unknown, CfProperties<unknown>>

      the request to handle

    Returns Promise<Response>