Telegram Bot API
🌐 Türkçe

replaceStickerInSet

Kategori: Çıkartmalar · Bot API 10.3 · Resmi dokümantasyon

Paketteki bir çıkartmayı değiştirir.

Dönüş değeri: Başarılı olduğunda True döndürür.

Parametreler

ParametreTürZorunluAçıklama
user_idIntegerEvetKullanıcı ID'si
nameStringEvetÇıkartma paketi adı
old_stickerStringEvetDeğiştirilecek çıkartmanın dosya ID'si
stickerInputStickerEvetJSON InputSticker nesnesi

Parametre açıklamaları kısa özetlerdir; tam metin için resmi dokümantasyona bakın.

Örnek istek

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());

Adım adım rehber: Telegram bot nasıl yapılır? BotFather ile adım adım bot oluşturma