savePreparedInlineMessage
Hazırlanmış satır içi mesajı kaydeder.
Dönüş değeri: Başarılı olduğunda PreparedInlineMessage döndürür.
Parametreler
| Parametre | Tür | Zorunlu | Açıklama |
|---|---|---|---|
user_id | Integer | Evet | Kullanıcı ID'si |
result | InlineQueryResult | Evet | JSON InlineQueryResult nesnesi |
allow_user_chats | Boolean | İsteğe bağlı | Kullanıcı sohbetlerine izin ver |
allow_bot_chats | Boolean | İsteğe bağlı | Bot sohbetlerine izin ver |
allow_group_chats | Boolean | İsteğe bağlı | Grup sohbetlerine izin ver |
allow_channel_chats | Boolean | İsteğe bağlı | Kanallara izin ver |
Örnek istek
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/savePreparedInlineMessage" \
-H "Content-Type: application/json" \
-d '{
"user_id": 123456789,
"result": {
"type": "article",
"id": "1",
"title": "Hello",
"input_message_content": {
"message_text": "Hello!"
}
}
}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/savePreparedInlineMessage",
json={
"user_id": 123456789,
"result": {
"type": "article",
"id": "1",
"title": "Hello",
"input_message_content": {
"message_text": "Hello!"
}
}
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/savePreparedInlineMessage`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"user_id": 123456789,
"result": {
"type": "article",
"id": "1",
"title": "Hello",
"input_message_content": {
"message_text": "Hello!"
}
}
}),
});
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
getCustomEmojiStickersÖzel emoji çıkartmalarının bilgilerini döndürür.getUserChatBoostsKullanıcının sohbet takviyelerini döndürür.getBusinessConnectionİşletme bağlantısı bilgilerini alır.verifyUserBir kuruluş adına kullanıcıyı doğrular.verifyChatBir kuruluş adına sohbeti doğrular.removeUserVerificationKullanıcı doğrulamasını kaldırır.removeChatVerificationSohbet doğrulamasını kaldırır.setUserEmojiStatusKullanıcının emoji durumunu ayarlar.savePreparedKeyboardButtonMini App'ler için klavye düğmesini kaydeder.setPassportDataErrorsKullanıcıyı Telegram Passport hataları hakkında bilgilendirir.