SetBotCallbackAnswerRequest
Both users and bots can use this request. See code examples.
---functions--- messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool
Returns
| Bool |
This type has no instances available.
Parameters
| query_id | long | |
| cache_time | int | |
| alert | flag | This argument defaults to None and can be omitted. |
| message | string | This argument defaults to None and can be omitted. |
| url | string | This argument defaults to None and can be omitted. |
Known RPC errors
This request can cause 2 known errors:
QueryIdInvalidError | The query ID is invalid. |
UrlInvalidError | The URL used was invalid (e.g. when answering a callback with a URL that's not t.me/yourbot or your game's URL). |
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.SetBotCallbackAnswerRequest(
query_id=-12398745604826,
cache_time=42,
alert=True,
message='Hello there!',
url='some string here'
))
print(result)