telebot-ts API Documentation - v1.0.0
    Preparing search index...

    Type Alias ApiErrorHookFn

    ApiErrorHookFn: (method: string, error: TelegramApiError) => void

    Observer hook invoked whenever a Bot API request finally fails with a TelegramApiError.

    Hooks run in registration order right before the error is thrown (after retry exhaustion for 429/5xx/network errors, or immediately for non-retryable failures). Throwing inside a hook is swallowed so observers cannot mask the original error.

    Type Declaration

      • (method: string, error: TelegramApiError): void
      • Parameters

        • method: string

          The Bot API method name that failed.

        • error: TelegramApiError

          The final typed error about to be thrown.

        Returns void