replaceStickerInSet
Reemplaza un sticker en un paquete.
Devuelve: Si la llamada tiene éxito, devuelve True.
Parámetros
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
user_id | Integer | Sí | ID del usuario |
name | String | Sí | Nombre del paquete de stickers |
old_sticker | String | Sí | ID del archivo del sticker a reemplazar |
sticker | InputSticker | Sí | Objeto JSON InputSticker |
Ejemplo de solicitud
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/replaceStickerInSet" \
-H "Content-Type: application/json" \
-d '{
"user_id": 123456789,
"name": "example_by_your_bot",
"old_sticker": "FILE_ID",
"sticker": "FILE_ID"
}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/replaceStickerInSet",
json={
"user_id": 123456789,
"name": "example_by_your_bot",
"old_sticker": "FILE_ID",
"sticker": "FILE_ID"
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/replaceStickerInSet`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"user_id": 123456789,
"name": "example_by_your_bot",
"old_sticker": "FILE_ID",
"sticker": "FILE_ID"
}),
});
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.uploadStickerFileSube un archivo de sticker.createNewStickerSetCrea un nuevo paquete de stickers.addStickerToSetAgrega un sticker a 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.