Class representing the context of execution

Constructors

Properties

api: TelegramApi = ...

reference to TelegramApi class

an instance of the telegram bot

an instance of the telegram update

update_type: string = ''

string representing the type of update that was sent

Methods

  • Get File from telegram file_id

    Parameters

    • file_id: string

      telegram file_id

    Returns Promise<Response>

  • Reply to the last message with text

    Parameters

    • message: string

      text to reply with

    • parse_mode: string = ''

      one of HTML, MarkdownV2, Markdown, or an empty string for ascii

    • options: Record<string, string | number | boolean> = {}

      any additional options to pass to sendMessage

    Returns Promise<undefined | Response>

  • Reply to the last message with a photo

    Parameters

    • photo: string

      url or file_id to photo

    • caption: string = ''

      photo caption

    • options: Record<string, string | number | boolean> = {}

      any additional options to pass to sendPhoto

    Returns Promise<undefined | Response>

  • Reply to the last message with a video

    Parameters

    • video: string

      string to a video on the internet or a file_id on telegram

    • options: Record<string, string | number | boolean> = {}

      any additional options to pass to sendVideo

    Returns Promise<undefined | Response>