SendInlineBotResultRequest

Only users can use this method. See code examples.

---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?date send_as:flags.13?InputPeer = Updates

Returns

Updates

This type can be an instance of either:

UpdateShortUpdateShortChatMessage
UpdateShortMessageUpdateShortSentMessage
UpdatesUpdatesCombined
UpdatesTooLong

Parameters

peerInputPeerAnything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.).
query_idlong
idstring
silentflagThis argument defaults to None and can be omitted.
backgroundflagThis argument defaults to None and can be omitted.
clear_draftflagThis argument defaults to None and can be omitted.
hide_viaflagThis argument defaults to None and can be omitted.
reply_to_msg_idintThis argument defaults to None and can be omitted.
top_msg_idintThis argument defaults to None and can be omitted.
random_idlongIf left unspecified, it will be inferred automatically.
schedule_datedateThis argument defaults to None and can be omitted.
send_asInputPeerThis argument defaults to None and can be omitted. Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.).

Known RPC errors

This request can cause 9 known errors:

ChatSendInlineForbiddenErrorYou cannot send inline results in this chat.
ChatWriteForbiddenErrorYou can't write in this chat.
InlineResultExpiredErrorThe inline query expired.
PeerIdInvalidErrorAn invalid Peer was used. Make sure to pass the right peer type and that the value is valid (for instance, bots cannot start conversations).
QueryIdEmptyErrorThe query ID is empty.
ScheduleDateTooLateErrorThe date you tried to schedule is too far in the future (last known limit of 1 year and a few hours).
ScheduleTooMuchErrorYou cannot schedule more messages in this chat (last known limit of 100 per chat).
WebpageCurlFailedErrorFailure while fetching the webpage with cURL.
WebpageMediaEmptyErrorWebpage media empty.

You can import these from telethon.errors.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.messages.SendInlineBotResultRequest(
        peer='username',
        query_id=-12398745604826,
        id='some string here',
        hide_via=True,
        top_msg_id=42,
        schedule_date=datetime.datetime(2018, 6, 25),
        send_as='username'
    ))
    print(result.stringify())