Telegram Bot API

setMySettings

Kategori: Bot bilgisi · Bot API 10.5 · Resmi dokümantasyon

Sürüm geçmişi: Bot API 10.5 sürümünde eklendi

Bot ayarlarını değiştirir: satır içi mod, gizlilik, gruplar, konular, callback sorgu modu (Bot API 10.5).

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

Parametreler

ParametreTürZorunluAçıklama
supports_inline_queriesBooleanİsteğe bağlıSatır içi modu etkinleştirir (true) veya devre dışı bırakır (false)
inline_query_placeholderStringİsteğe bağlıGiriş alanında gösterilen satır içi sorgu yer tutucusu (boş dize = default)
needs_inline_query_locationBooleanİsteğe bağlıHer satır içi sorguda kullanıcının konumunu iste
inline_feedback_share_denominatorIntegerİsteğe bağlıAlınan seçilmiş satır içi sonuç oranı: N'de 1 (1, 10, 100, 1000; 0 = hiç)
can_join_groupsBooleanİsteğe bağlıBotun gruplara eklenmesine izin ver
can_read_all_group_messagesBooleanİsteğe bağlıtrue = gizlilik modunu kapat (tüm grup mesajlarını oku)
can_connect_to_businessBooleanİsteğe bağlıBotun işletme hesaplarına bağlanmasına izin ver
can_manage_botsBooleanİsteğe bağlıBotun yönetilen botlar oluşturmasına izin ver
supports_guest_queriesBooleanİsteğe bağlıBotun üyesi olmadığı sohbetlerden misafir sorgularına izin ver
supports_join_request_queriesBooleanİsteğe bağlıBotun katılma isteklerini işlemek üzere atanmasına izin ver
has_topics_enabledBooleanİsteğe bağlıBotla özel sohbetlerde forum konusu modunu etkinleştir
allows_users_to_create_topicsBooleanİsteğe bağlıKullanıcıların özel sohbetlerde konu oluşturup silmesine izin ver
has_topic_sidebarBooleanİsteğe bağlıÖzel sohbet konularını kenar çubuğunda göster (Bot API 10.5)
can_communicate_with_botsBooleanİsteğe bağlıBotun diğer botlarla iletişim kurmasına izin ver
callback_query_modeStringİsteğe bağlıCallback sorgu modu: default, auto veya inline (message yerine inline_message_id)

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/setMySettings" \
  -H "Content-Type: application/json" \
  -d '{
  "supports_inline_queries": true,
  "can_read_all_group_messages": false,
  "callback_query_mode": "auto"
}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/setMySettings",
    json={
        "supports_inline_queries": True,
        "can_read_all_group_messages": False,
        "callback_query_mode": "auto"
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/setMySettings`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "supports_inline_queries": true,
    "can_read_all_group_messages": false,
    "callback_query_mode": "auto"
  }),
});
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