Skip to content

Commit e6afae1

Browse files
authored
Make authorization confirmations cleaner (#193)
1 parent e0ddd84 commit e6afae1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

pyrogram/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,9 @@ async def authorize(self) -> User:
450450
if not value:
451451
continue
452452

453-
confirm = (await ainput(f'Is "{value}" correct? (y/N): ', loop=self.loop)).lower()
453+
confirm = await ainput(f'Is "{value}" correct? (y/N): ', loop=self.loop)
454454

455-
if confirm == "y":
455+
if confirm.lower() == "y":
456456
break
457457

458458
if ":" in value:
@@ -500,9 +500,9 @@ async def authorize(self) -> User:
500500

501501
try:
502502
if not self.password:
503-
confirm = await ainput("Confirm password recovery (y/n): ", loop=self.loop)
503+
confirm = await ainput("Confirm password recovery (y/N): ", loop=self.loop)
504504

505-
if confirm == "y":
505+
if confirm.lower() == "y":
506506
email_pattern = await self.send_recovery_code()
507507
print(f"The recovery code has been sent to {email_pattern}")
508508

@@ -958,9 +958,9 @@ async def load_session(self):
958958
print("Invalid value")
959959
continue
960960

961-
confirm = (await ainput(f'Is "{value}" correct? (y/N): ', loop=self.loop)).lower()
961+
confirm = await ainput(f'Is "{value}" correct? (y/N): ', loop=self.loop)
962962

963-
if confirm == "y":
963+
if confirm.lower() == "y":
964964
await self.storage.api_id(value)
965965
break
966966
except Exception as e:

0 commit comments

Comments
 (0)