diff --git a/data/web/corefork.telegram.org/api/bots/inline.html b/data/web/corefork.telegram.org/api/bots/inline.html index 2ac458c3c8..4732d768bc 100644 --- a/data/web/corefork.telegram.org/api/bots/inline.html +++ b/data/web/corefork.telegram.org/api/bots/inline.html @@ -47,7 +47,7 @@

Users can interact with your bot via inline queries, straight from the text input field in any chat.
This article describes the full inline bot flow, using the MTProto API.

For a simplified description using the HTTP bot API, see here ».

-

Making an inline query

+

1. Making an inline query

messages.botResults#e021f2f6 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM switch_webview:flags.3?InlineBotWebView results:Vector<BotInlineResult> cache_time:int users:Vector<User> = messages.BotResults;
 
 ---functions---
@@ -67,7 +67,7 @@ This article describes the full inline bot flow, using the MTProto API.  

-

Answering to an inline query

+

2. Answering to an inline query

inputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
 inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
 inputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
@@ -87,8 +87,8 @@ This article describes the full inline bot flow, using the MTProto API.  

messages.setInlineBotResults#bb12a419 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector<InputBotInlineResult> cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM switch_webview:flags.4?InlineBotWebView = Bool;

Bots can answer to incoming updateBotInlineQuery updates using messages.setInlineBotResults.
Just like its bot API counterpart, the method can be used to send a set of inline results to the user; see the constructor page for more info on the MTProto method parameters ».

-

In general, the method accepts a vector of InputBotInlineResult constructors, that when chosen, generates a message with optionally attached media, and even inline buttons.

-

Sending the inline query result

+

In general, the method accepts a vector of InputBotInlineResult constructors, that when chosen, generates a message with optionally attached media, and even inline buttons.

+

3. Sending the inline query result

botInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
 botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
 botInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
@@ -103,8 +103,9 @@ Just like its bot API counterpart, the
 ---functions---
 
 messages.sendInlineBotResult#d3fbdccb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int top_msg_id:flags.9?int random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;
-

The user client should display the results obtained during querying in a list, making sure to handle eventual bot timeouts in the form of a BOT_RESPONSE_TIMEOUT RPC error, by simply not displaying anything.

-

If the user then chooses a specific BotInlineResult, the messages.sendInlineBotResult method should be invoked, passing:

+

The user client should display the messages.botResults.results obtained during querying in a list, making sure to handle eventual bot timeouts in the form of a BOT_RESPONSE_TIMEOUT RPC error, by simply not displaying anything.

+

If either the messages.botResults.switch_pm or messages.botResults.switch_webview flags are populated, a button should be displayed on top of the result list, that when clicked, instead of sending an inline result to the chat, switches the user to a private chat with the bot (switch_pm) or to a bot web app (switch_webview),.

+

If the user instead chooses a specific BotInlineResult from the normal results list, the messages.sendInlineBotResult method should be invoked, passing:

The resulting message will have the via_bot_id field set, to indicate that the result was generated by the bot that generated the inline result.
Graphical clients should display the bot @username in the header of the message, allowing the user to click on it, automatically starting an inline query by inserting @username in the text bar.

-

Inline feedback

+

4. Inline feedback

inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;
 
 updateBotInlineSend#12f12a07 flags:# user_id:long query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;
-

If feedback collection is enabled, the bot may receive an updateBotInlineSend when the user chooses and sends an inline result.

+

If feedback collection is enabled, the bot may receive an updateBotInlineSend when the user chooses and sends an inline result.

Even if the probability setting is set to 100%, not all inline results may be reported due to caching (see the cache_time parameter in Answering a callback query).
Feedback collection can also create load issues for popular bots, so adjust the probability setting to a lower value in such cases.

Either way, feedback collection should only be used for statistical purposes rather than functional.

@@ -128,7 +129,7 @@ Graphical clients should display the bot @username in the header of
  • query - The query string that was used to obtain the result
  • geo - For bots requiring location-based inline results, the user's location
  • -

    Editing sent inline messages

    +

    5. Editing sent inline messages

    updateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
     
     inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;
    diff --git a/data/web/corefork.telegram.org/methods.html b/data/web/corefork.telegram.org/methods.html
    index 3e5bbaf4d7..3592125aea 100644
    --- a/data/web/corefork.telegram.org/methods.html
    +++ b/data/web/corefork.telegram.org/methods.html
    @@ -2814,7 +2814,7 @@
     
     
     channels.updateUsername
    -Change the username of a supergroup/channel
    +Change or remove the username of a supergroup/channel
     
     
     account.updateUsername
    diff --git a/data/web/corefork.telegram.org/type/Bool.html b/data/web/corefork.telegram.org/type/Bool.html
    index c96218134a..b62a1e1c12 100644
    --- a/data/web/corefork.telegram.org/type/Bool.html
    +++ b/data/web/corefork.telegram.org/type/Bool.html
    @@ -361,7 +361,7 @@
     
     
     channels.updateUsername
    -Change the username of a supergroup/channel
    +Change or remove the username of a supergroup/channel
     
     
     messages.editChatAdmin