setMySettings
Changes bot settings: inline mode, privacy, groups, topics, callback query mode (Bot API 10.5).
Returns: On success, returns True.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
supports_inline_queries | Boolean | Optional | Enable (true) or disable (false) inline mode |
inline_query_placeholder | String | Optional | Inline query placeholder shown in the input field (empty string = default) |
needs_inline_query_location | Boolean | Optional | Request the user location with every inline query |
inline_feedback_share_denominator | Integer | Optional | Share of chosen inline results received: 1 of N (1, 10, 100, 1000; 0 = none) |
can_join_groups | Boolean | Optional | Allow adding the bot to groups |
can_read_all_group_messages | Boolean | Optional | true = disable privacy mode (read all group messages) |
can_connect_to_business | Boolean | Optional | Allow connecting the bot to business accounts |
can_manage_bots | Boolean | Optional | Allow the bot to create managed bots |
supports_guest_queries | Boolean | Optional | Allow guest queries from chats the bot is not a member of |
supports_join_request_queries | Boolean | Optional | Allow assigning the bot to process join request queries |
has_topics_enabled | Boolean | Optional | Enable forum topic mode in private chats with the bot |
allows_users_to_create_topics | Boolean | Optional | Allow users to create and delete topics in private chats |
has_topic_sidebar | Boolean | Optional | Show private chat topics in a sidebar (Bot API 10.5) |
can_communicate_with_bots | Boolean | Optional | Allow the bot to communicate with other bots |
callback_query_mode | String | Optional | Callback query mode: default, auto or inline (inline_message_id instead of message) |
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
Related methods
getMeReturns bot information (BotFullInfo since Bot API 10.5).getMyCommandsReturns the current list of bot commands.setMyCommandsSets the list of bot commands.deleteMyCommandsDeletes bot commands.getMyNameReturns the bot's name.setMyNameSets the bot's name.getMyDescriptionReturns the bot's description.setMyDescriptionSets the bot's description.getMyShortDescriptionReturns the bot's short description.setMyShortDescriptionSets the bot's short description.setMyProfilePhotoSets the bot's profile photo.removeMyProfilePhotoRemoves the bot's profile photo.