Stickers

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.

parameters

parametertyperequireddescription
user_idnumberrequiredUser identifier of sticker file owner
stickerInputFilerequiredA 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 »
sticker_format"static" | "animated" | "video"requiredFormat of the sticker, must be one of “static”, “animated”, “video”

returns

File

usage in yaebal

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

bot.ts
import { media } from "@yaebal/core";
import type { File, UploadStickerFileParams } from "@yaebal/types";

await bot.api.call<File>("uploadStickerFile", {
  user_id: 123456789,
  sticker: {} /* InputFile */,
  sticker_format: "static",
} satisfies UploadStickerFileParams);

context shortcut

also available as ctx.uploadStickerFile() on 16 context types — see @yaebal/contexts.

context shortcut
/** Use this method to upload a file with a sticker for later use in the [createNewStickerSet](https://core.telegram.org/bots/api/#createnewstickerset), [addStickerToSet](https://core.telegram.org/bots/api/#addstickertoset), or [replaceStickerInSet](https://core.telegram.org/bots/api/#replacestickerinset) methods (the file can be used multiple times). Returns the uploaded [File](https://core.telegram.org/bots/api/#file) on success. */
ctx.uploadStickerFile(params: Omit<UploadStickerFileParams, "user_id">)