stopPoll
Anketi durdurur.
Dönüş değeri: Başarılı olduğunda Poll döndürür.
Parametreler
| Parametre | Tür | Zorunlu | Açıklama |
|---|---|---|---|
business_connection_id | String | İsteğe bağlı | İşletme bağlantısı ID'si |
chat_id | Integer or String | Evet | Sohbet ID'si veya @username |
message_id | Integer | Evet | Anketi içeren mesajın ID'si |
reply_markup | InlineKeyboardMarkup | İsteğe bağlı | JSON: InlineKeyboardMarkup |
Örnek istek
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/stopPoll" \
-H "Content-Type: application/json" \
-d '{"chat_id":123456789,"message_id":42}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/stopPoll",
json={
"chat_id": 123456789,
"message_id": 42
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/stopPoll`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"message_id": 42
}),
});
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
İlgili metotlar
sendPollAnket gönderir.