pub struct AnswerInlineQuery {
    pub inline_query_id: String,
    pub results: Vec<InlineQueryResult, Global>,
    pub cache_time: Option<u32>,
    pub is_personal: Option<bool>,
    pub next_offset: Option<String>,
    pub switch_pm_text: Option<String>,
    pub switch_pm_parameter: Option<String>,
}
Expand description

Use this method to send answers to an inline query. On success, True is returned. No more than 50 results per query are allowed.

Fields§

§inline_query_id: String

Unique identifier for the answered query

§results: Vec<InlineQueryResult, Global>

A JSON-serialized array of results for the inline query

§cache_time: Option<u32>

The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.

§is_personal: Option<bool>

Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query

§next_offset: Option<String>

Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don’t support pagination. Offset length can’t exceed 64 bytes.

§switch_pm_text: Option<String>

If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter

§switch_pm_parameter: Option<String>

Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.

Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a ‘Connect your YouTube account’ button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an oauth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot’s inline capabilities.

Implementations§

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
The return type of a Telegram method. Read more
Name of a Telegram method. Read more
If this payload may take long time to execute (e.g. GetUpdates with big timeout), the minimum timeout that should be used.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Setter for inline_query_id field.
Setter for results field.
Setter for cache_time field.
Setter for is_personal field.
Setter for next_offset field.
Setter for switch_pm_text field.
Setter for switch_pm_parameter field.
Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Unerase this erased pointer. Read more
Available on non-enforce_1_1_0_semantics only.
Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Turn this erasable pointer into an erased pointer. Read more

Returns the argument unchanged.

Converts to this type from a reference to the input type.
The type of the payload contained.
Gain mutable access to the underlying payload.
Gain immutable access to the underlying payload.
Update payload with a function
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more