Improve QR login instructions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user