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:
| UpdateShort | UpdateShortChatMessage |
| UpdateShortMessage | UpdateShortSentMessage |
| Updates | UpdatesCombined |
| UpdatesTooLong |
Parameters
| peer | InputPeer | Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.). |
| query_id | long | |
| id | string | |
| silent | flag | This argument defaults to None and can be omitted. |
| background | flag | This argument defaults to None and can be omitted. |
| clear_draft | flag | This argument defaults to None and can be omitted. |
| hide_via | flag | This argument defaults to None and can be omitted. |
| reply_to_msg_id | int | This argument defaults to None and can be omitted. |
| top_msg_id | int | This argument defaults to None and can be omitted. |
| random_id | long | If left unspecified, it will be inferred automatically. |
| schedule_date | date | This argument defaults to None and can be omitted. |
| send_as | InputPeer | This 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:
ChatSendInlineForbiddenError | You cannot send inline results in this chat. |
ChatWriteForbiddenError | You can't write in this chat. |
InlineResultExpiredError | The inline query expired. |
PeerIdInvalidError | An invalid Peer was used. Make sure to pass the right peer type and that the value is valid (for instance, bots cannot start conversations). |
QueryIdEmptyError | The query ID is empty. |
ScheduleDateTooLateError | The date you tried to schedule is too far in the future (last known limit of 1 year and a few hours). |
ScheduleTooMuchError | You cannot schedule more messages in this chat (last known limit of 100 per chat). |
WebpageCurlFailedError | Failure while fetching the webpage with cURL. |
WebpageMediaEmptyError | Webpage 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())