Very Popular
Go to Latest
interface ReqResHandler
import { type ReqResHandler } from "https://dotland.deno.dev/x/grammy@v1.15.2/convenience/frameworks.ts";

Abstraction over a request-response cycle, providing access to the update, as well as a mechanism for responding to the request and to end it.

Properties

update: Promise<Update>

The update object sent from Telegram, usually resolves the request's JSON body

optional
header: string

X-Telegram-Bot-Api-Secret-Token header of the request, or undefined if not present

optional
end: () => void

Ends the request immediately without body, called after every request unless a webhook reply was performed

respond: (json: string) => unknown | Promise<unknown>

Sends the specified JSON as a payload in the body, used for webhook replies

unauthorized: () => unknown | Promise<unknown>

Responds that the request is unauthorized due to mismatching X-Telegram-Bot-Api-Secret-Token headers

optional
handlerReturn: any

Some frameworks (e.g. Deno's std/http listenAndServe) assume that handler returns something