test(e2e): correctly handle PHONE_NUMBER_FLOOD

This commit is contained in:
alina 🌸 2024-06-13 14:04:51 +03:00
parent 78285d4815
commit bbb8d4b908
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
2 changed files with 2 additions and 2 deletions

View file

@ -49,7 +49,7 @@ async function authorizeInDc(dc: number, base: BaseTelegramClient) {
user = new User(auth.user)
} catch (e) {
if (tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') || tl.RpcError.is('PHONE_NUMBER_FLOOD')) {
if (tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') || tl.RpcError.is(e, 'PHONE_NUMBER_FLOOD')) {
// retry with another number
await tg.close()
continue

View file

@ -50,7 +50,7 @@ async function authorizeInDc(dc: number, base: BaseTelegramClient) {
user = new User(auth.user)
} catch (e) {
if (tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') || tl.RpcError.is('PHONE_NUMBER_FLOOD')) {
if (tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') || tl.RpcError.is(e, 'PHONE_NUMBER_FLOOD')) {
// retry with another number
await tg.close()
continue