pytdbot.tdjson
- class pytdbot.tdjson.TdJson(lib_path=None, verbosity=2)[source]
Bases:
object
- Parameters:
lib_path (str)
verbosity (int)
- __init__(lib_path=None, verbosity=2)[source]
TdJson client
- Parameters:
lib_path (
str
, optional) – Path to shared library; ifNone
then [tdjson](https://github.com/AYMENJD/tdjson) binding will be used. Default isNone
verbosity (
int
, optional) – TDLib verbosity level. Default is2
- Raises:
ValueError – If library not found
- Return type:
None
- execute(data)[source]
Executes a TDLib request
- Parameters:
data (
dict
) – The request to be executed- Returns:
The result of the request
- Return type:
:py:class:
dict
- receive(timeout=2.0)[source]
Receives incoming updates and results from TDLib
- Parameters:
timeout (
float
, optional) – The maximum number of seconds allowed to wait for new data. Default is2.0
- Returns:
An incoming update or result to a request. If no data is received,
None
is returned- Return type:
:py:class:
dict