fix(node): do not add handlers if bot token is passed
This commit is contained in:
parent
b4716f321b
commit
08517810fc
1 changed files with 5 additions and 3 deletions
|
@ -87,9 +87,11 @@ export class NodeTelegramClient extends TelegramClient {
|
||||||
params: Parameters<TelegramClient['start']>[0],
|
params: Parameters<TelegramClient['start']>[0],
|
||||||
then?: (user: User) => void | Promise<void>
|
then?: (user: User) => void | Promise<void>
|
||||||
): void {
|
): void {
|
||||||
|
if (!params.botToken) {
|
||||||
if (!params.phone) params.phone = () => input('Phone > ')
|
if (!params.phone) params.phone = () => input('Phone > ')
|
||||||
if (!params.code) params.code = () => input('Code > ')
|
if (!params.code) params.code = () => input('Code > ')
|
||||||
if (!params.password) params.password = () => input('2FA password > ')
|
if (!params.password) params.password = () => input('2FA password > ')
|
||||||
|
}
|
||||||
|
|
||||||
return super.run(params, then)
|
return super.run(params, then)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue