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

x/grammy/core/payload.ts

The Telegram Bot Framework.
Very Popular
Latest
import * as grammy from "https://deno.land/x/grammy@v1.32.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.