invoke()¶
- async Client.invoke()¶
Invoke raw Telegram functions.
This method makes it possible to manually call every single Telegram API method in a low-level manner. Available functions are listed in the
functionspackage and may accept compound data types fromtypesas well as bare types such asint,str, etc…Note
This is a utility method intended to be used only when working with raw
functions(i.e: a Telegram API method you wish to use which is not available yet in the Client class as an easy-to-use method).Usable by Users Bots- Parameters:
query (
RawFunction) – The API Schema function filled with proper arguments.retries (
int, optional) – Number of retries in case of a failure.timeout (
float, optional) – Timeout in seconds.sleep_threshold (
float, optional) – Sleep threshold in seconds. Defaults to the client’s sleep_threshold.business_connection_id (
str, optional) – Unique identifier of the business connection on behalf of which the query is sent.
- Returns:
RawType– The raw type answer generated by the server.- Raises:
ConnectionError – In case you try to invoke a function without a connected client.
Example
from wzgram import raw await app.invoke(raw.functions.help.GetConfig())