uploadStickerFile
Sube un archivo de sticker.
Devuelve: Si la llamada tiene éxito, devuelve File.
Parámetros
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
user_id | Integer | Sí | ID del usuario |
sticker | InputFile | Sí | Archivo del sticker (InputFile o file_id) |
sticker_format | String | Sí | Formato del sticker: static, animated o video |
Ejemplo de solicitud
curl
curl -s "https://api.telegram.org/bot$TOKEN/uploadStickerFile" \
-F user_id=123456789 \
-F sticker_format=static \
-F sticker=@sticker.png
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/uploadStickerFile",
data={
"user_id": 123456789,
"sticker_format": "static"
},
files={"sticker": open("sticker.png", "rb")},
timeout=30,
)
print(resp.json())
JavaScript
import { readFile } from "node:fs/promises";
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const form = new FormData();
form.append("user_id", "123456789");
form.append("sticker_format", "static");
form.append("sticker", new Blob([await readFile("sticker.png")]), "sticker.png");
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/uploadStickerFile`, { method: "POST", body: form });
console.log(await res.json());
Guía paso a paso: Cómo crear un bot en Telegram paso a paso: de BotFather a tu primer mensaje
Métodos relacionados
getStickerSetDevuelve un paquete de stickers.createNewStickerSetCrea un nuevo paquete de stickers.addStickerToSetAgrega un sticker a un paquete.replaceStickerInSetReemplaza un sticker en un paquete.setStickerPositionInSetMueve un sticker dentro de un paquete.deleteStickerFromSetElimina un sticker de un paquete.setStickerSetTitleEstablece el título de un paquete de stickers.setStickerSetThumbnailEstablece la miniatura de un paquete de stickers.setCustomEmojiStickerSetThumbnailEstablece la miniatura de un paquete de emojis personalizados.deleteStickerSetElimina un paquete de stickers.setStickerEmojiListCambia la lista de emojis de un sticker.setStickerKeywordsCambia las palabras clave de un sticker.