FileApi
This file is generated from spec/openapi.json (Bot API 10.3) by tools/generate.php.
Do not edit it by hand - run composer spec:build instead.
Locating and uploading files.
Mixed into Telegram through Methods. Every method is named exactly as the Bot API names it, takes exactly the fields the Bot API documents (use named arguments for the optional ones), and resolves with the hydrated result.
Tags
Table of Contents
Methods
- getFile() : PromiseInterface<string|int, File>
- Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned.
- uploadStickerFile() : PromiseInterface<string|int, File>
- Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.
Methods
getFile()
Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned.
public
getFile(string $file_id) : PromiseInterface<string|int, File>
The file can then be downloaded via the link
https://api.telegram.org/file/bot
Parameters
- $file_id : string
-
File identifier to get information about
Tags
Return values
PromiseInterface<string|int, File>uploadStickerFile()
Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.
public
uploadStickerFile(int $user_id, InputFile $sticker, string $sticker_format) : PromiseInterface<string|int, File>
Parameters
- $user_id : int
-
User identifier of sticker file owner
- $sticker : InputFile
-
A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $sticker_format : string
-
Format of the sticker, must be one of "static", "animated", "video"