Skip to main content
Module

x/grammy_files/plugin.ts>FilesPluginOptions

Handle and download received media files.
Latest
interface FilesPluginOptions
import { type FilesPluginOptions } from "https://deno.land/x/grammy_files@v1.1.0/plugin.ts";

Options to pass to the files plugin. They are mainly useful if you are working with a local Bot API server, and you need to adjust from where to download files.

Properties

optional
apiRoot: string

Root URL of the Telegram Bot API server. Used when downloading files. Should be the same as for your bot object. Default: https://api.telegram.org

optional
environment: "prod" | "test"

Specifies whether to use the test environment. Can be either "prod" (default) or "test".

The testing infrastructure is separate from the regular production infrastructure. No chats, accounts, or other data is shared between them. If you set this option to "test", you will need to make your Telegram client connect to the testing data centers of Telegram, register your phone number again, open a new chat with @BotFather, and create a separate bot.

optional
buildFileUrl: (
root: string,
token: string,
method: string,
env: "prod" | "test",
) => string | URL

URL builder function for downloading files. Can be used to modify which API server should be called when downloading files.