Readonly
appReadonly
cryptoReadonly
logLogger for the client
Readonly
mtReadonly
onEmitted when the connection state changes
Emitted when an error occurs
Readonly
onEmitted when an update is received from the server. Requires updates loop to be running
Readonly
onEmitted when a low-level Updates
updates is received
Readonly
paramsReadonly
platformPlatform used by the client
Readonly
storageStorage manager
Readonly
timersTimers manager
Optional
Readonly
updatesSignal that will be aborted when the client is destroyed
Make an RPC call
This method is still quite low-level and you shouldn't use this
when using high-level API provided by @mtcute/client
.
RPC method to call
Optional
params: RpcCallOptionsAdditional call parameters
Compute new password hash for the given algorithm and password
Compute SRP parameters for the given password
Initialize the connection to the primary DC.
You shouldn't usually call this method directly as it is called implicitly the first time you call call.
Export current session to a single LONG string, containing all the needed information.
Warning! Anyone with this string will be able to authorize as you and do anything. Treat this as your password, and never give it away!
In case you have accidentally leaked this string, make sure to revoke this session in account settings: "Privacy & Security" > "Active sessions" > find the one containing
mtcute
> Revoke, or, in case this is a bot, revoke bot token with @BotFather
Get the number of connections of the given kind
Optional
dcId: numberHandle an update sent by the server in response to an RPC call
Updates to handle
Optional
noDispatch: booleanWhether the updates inside should not be dispatched as events
Import the session from the given session string.
Note that the session will only be imported in case
the storage is missing authorization (i.e. does not contain
auth key for the primary DC), otherwise it will be ignored (unless force
).
Session string to import
Whether to overwrite existing session
Notify the client that the user has logged in
ADVANCED
Do all the preparations, but don't connect just yet. Useful when you want to do some preparations before connecting, like setting up session.
Call connect to actually connect.
App config manager