Telegram Bot API

setMySettings

Category: Bot Info · Bot API 10.5 · Official documentation

Version history: Added in Bot API 10.5

Changes bot settings: inline mode, privacy, groups, topics, callback query mode (Bot API 10.5).

Returns: On success, returns True.

Parameters

ParameterTypeRequiredDescription
supports_inline_queriesBooleanOptionalEnable (true) or disable (false) inline mode
inline_query_placeholderStringOptionalInline query placeholder shown in the input field (empty string = default)
needs_inline_query_locationBooleanOptionalRequest the user location with every inline query
inline_feedback_share_denominatorIntegerOptionalShare of chosen inline results received: 1 of N (1, 10, 100, 1000; 0 = none)
can_join_groupsBooleanOptionalAllow adding the bot to groups
can_read_all_group_messagesBooleanOptionaltrue = disable privacy mode (read all group messages)
can_connect_to_businessBooleanOptionalAllow connecting the bot to business accounts
can_manage_botsBooleanOptionalAllow the bot to create managed bots
supports_guest_queriesBooleanOptionalAllow guest queries from chats the bot is not a member of
supports_join_request_queriesBooleanOptionalAllow assigning the bot to process join request queries
has_topics_enabledBooleanOptionalEnable forum topic mode in private chats with the bot
allows_users_to_create_topicsBooleanOptionalAllow users to create and delete topics in private chats
has_topic_sidebarBooleanOptionalShow private chat topics in a sidebar (Bot API 10.5)
can_communicate_with_botsBooleanOptionalAllow the bot to communicate with other bots
callback_query_modeStringOptionalCallback query mode: default, auto or inline (inline_message_id instead of message)

Parameter descriptions are concise summaries; see the official documentation for the full text.

Example request

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

Step-by-step guide: Telegram Bot API 10.0–10.5: Bot Settings, Widgets, Rich Messages, Ephemeral Messages, Guest Mode and More