From 66621bfc661b20f52ce98ffe1e27ff9715c2f3c3 Mon Sep 17 00:00:00 2001 From: overspend1 Date: Sun, 21 Dec 2025 17:35:57 +0100 Subject: [PATCH] Improve QR login instructions --- README.md | 1 + core/client.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c68f90b..b0b58d2 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ OverUB is a modular Telegram userbot built around a plugin-first architecture. ## Quick Start 1. Install dependencies: `pip install -r requirements.txt` + - Optional for QR display: `pip install qrcode` 2. Edit `config/config.yml` 3. Run: `python -m __main__` 4. Optional: set `bot.login_mode` to `qr` for QR login diff --git a/core/client.py b/core/client.py index 1f330bc..971624a 100644 --- a/core/client.py +++ b/core/client.py @@ -120,7 +120,18 @@ class ClientWrapper: await self.client.disconnected def _print_qr(self, url: str) -> None: - logger.info("Scan this QR login URL with Telegram: %s", url) + logger.info("QR login URL: %s", url) + print("Telegram app -> Settings -> Devices -> Scan QR") + print(f"If you cannot scan, try opening this URL on your phone: {url}") + try: + import qrcode + + qr = qrcode.QRCode(border=1) + qr.add_data(url) + qr.make(fit=True) + qr.print_ascii(invert=True) + except Exception: + return async def _prompt(self, prompt: str) -> str: loop = asyncio.get_event_loop()