send_custom_request()

async Client.send_custom_request()

Send a custom request (for bots).

Usable by Users Bots
Parameters:
  • custom_method (str) – The custom method name.

  • params (str | DataJSON) – JSON-serialized method parameters or a DataJSON object.

Returns:

DataJSON – JSON-serialized response from Telegram.

Example

res = await bot.send_custom_request("myCustomMethod", '{"foo": "bar"}')