gets auth key for a dc
sets auth key for a dc
Called on client disconnection. Should be used to free any used resources. Can be left empty if none.
Called upon client.log_out(). Should delete the stored information from disk since it's not valid anymore.
Processes the input TLObject
or list
and saves
whatever information is relevant (e.g., ID or access hash).
Turns the given key into an InputPeer
(e.g. InputPeerUser
).
The library uses this method whenever an InputPeer
is needed
to suit several purposes (e.g. user only provided its ID or wishes
to use a cached username to avoid extra RPC).
Called before using the session
called whenever important properties change. It should make persist the relevant session information to disk.
This session file can be easily saved and loaded as a string. According to the initial design, it contains only the data that is necessary for successful connection and authentication, so takeout ID is not stored.
It is thought to be used where you don't want to create any on-disk files but would still like to be able to save and load existing sessions by other means.
You can use custom encode
and decode
functions, if present:
encode
definition must be function encode(value: Buffer) -> string:
.
decode
definition must be function decode(value: string) -> Buffer:
.
Generated using TypeDoc
Sets the information of the data center address and port that the library should connect to, as well as the data center ID, which is currently unused.