CF Workers Telegram Bot - v11.2.1
    Preparing search index...

    Class TelegramApi

    Class representing the Telegram API and all its methods

    Index

    Constructors

    Methods

    • Send a callback response to a given botApi

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: AnswerCallbackParams

        data to append to the request

      Returns Promise<Response>

      Promise with the API response

    • Send a guest response to a given botApi

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: AnswerGuestParams

        data to append to the request

      Returns Promise<Response>

      Promise with the API response

    • Send an inline response to a given botApi

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: AnswerInlineParams

        data to append to the request

      Returns Promise<Response>

      Promise with the API response

    • Answer a pre-checkout query

      Parameters

      Returns Promise<Response>

      Promise with the API response

    • Delete a message

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: { chat_id: string | number; message_id: number }

        data to append to the request

      Returns Promise<Response>

      Promise with the API response

    • Edit a message text

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: {
            chat_id?: string | number;
            disable_web_page_preview?: boolean;
            inline_message_id?: string;
            message_id?: number;
            parse_mode?: string;
            reply_markup?: object;
            text: string;
        }

        data to append to the request

      Returns Promise<Response>

      Promise with the API response

    • Get the API URL for a given bot API and slug

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • slug: string

        slug to append to the API URL

      • data: TelegramApiParams

        data to append to the request

      Returns Request

      Request object with the full URL and parameters

    • Get a file with a given file_id

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: { file_id: string } & Record<string, string | number | boolean>

        data to append to the request

      • token: string

        bot token

      Returns Promise<Response>

      Promise with the file response

    • Send a chat action to indicate the bot is doing something

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: SendChatActionParams

        data to append to the request

      Returns Promise<Response>

      Promise with the API response

    • Send an invoice to a user

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: SendInvoiceParams

        invoice parameters

      Returns Promise<Response>

      Promise with the API response

    • Send a message to a given botApi

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: SendMessageParams

        data to append to the request

      Returns Promise<Response>

      Promise with the API response

    • Send a photo message to a given botApi

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: SendPhotoParams

        data to append to the request

      Returns Promise<Response>

      Promise with the API response

    • Send a video message to a given botApi

      Parameters

      • botApi: string

        full URL to the telegram API without slug

      • data: SendVideoParams

        data to append to the request

      Returns Promise<Response>

      Promise with the API response