Module

x/grammy/core/payload.ts

The Telegram Bot Framework.
Very Popular
Go to Latest
import * as mod from "https://dotland.deno.dev/x/grammy@v1.12.0/core/payload.ts";

Functions

Turns a payload into an options object that can be passed to a fetch call by setting the necessary headers and method. Note that this method creates a multipart/form-data stream under the hood. If possible, a JSON payload should be created instead for performance reasons.

Turns a payload into an options object that can be passed to a fetch call by setting the necessary headers and method. May only be called for payloads P that let requiresFormDataUpload(P) return false.

Determines for a given payload if it may be sent as JSON, or if it has to be uploaded via multipart/form-data. Returns true in the latter case and false in the former.