FilesPluginOptions
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
apiRoot
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://
environment
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.
buildFileUrl
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.