SendCustomRequestRequest
Only bots can use this request. See code examples.
---functions--- bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON
Returns
| DataJSON |
This type can only be an instance of:
| DataJSON |
Parameters
| custom_method | string | |
| params | DataJSON |
Known RPC errors
This request can cause 1 known error:
UserBotInvalidError | This method can only be called by a bot. |
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.bots.SendCustomRequestRequest(
custom_method='some string here',
params=types.DataJSON(
data='some string here'
)
))
print(result.stringify())