Optional
abortAbort signal
Optional
botBot token to use. Ignored if phone
is supplied.
Optional
code?: MaybeDynamic<string>Code sent to the phone (either sms, call, flash call or other).
Ignored if botToken
is supplied, must be present if phone
is supplied.
Optional
codeCustom method that is called when a code is sent. Can be used to show a GUI alert of some kind.
This method is called before start.params.code.
Optional
codeAdditional code settings to pass to the server
Optional
forceWhether to force code delivery through SMS
Optional
futureSaved future auth tokens, if any
Optional
invalidIf passed, this function will be called if provided code or 2FA password was invalid. New code/password will be requested later.
If provided code
/password
is a constant string, providing an
invalid one will interrupt authorization flow.
Optional
password?: MaybeDynamic<string>2FA password. Ignored if botToken
is supplied
Optional
phone?: MaybeDynamic<string>Phone number of the account. If account does not exist, it will be created
Optional
qrWhen passed, QR login flow will be used instead of the regular login flow.
This function will be called whenever the login URL is changed, and the app is expected to display it as a QR code to the user.
Optional
session?: string | StringSessionDataString session exported using TelegramClient.exportSession.
This simply calls TelegramClient.importSession before anything else.
Note that passed session will be ignored in case storage already contains authorization.
Optional
sessionWhether to overwrite existing session.
Start the client in an interactive and declarative manner, by providing callbacks for authorization details.
This method handles both login and sign up, and also handles 2FV
All parameters are
MaybeDynamic<T>
, meaning you can either supplyT
, or a function that returnsMaybePromise<T>
This method is intended for simple and fast use in automated scripts and bots. If you are developing a custom client, you'll probably need to use other auth methods.