Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/grammy_types/mod.ts>ApiResponse

Type declarations of the Telegram Bot API.
Latest
type alias ApiResponse
import { type ApiResponse } from "https://deno.land/x/grammy_types@v3.16.0/mod.ts";

The response contains an object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals true, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.

All methods in the Bot API are case-insensitive. All queries must be made using UTF-8.