feat: Telegram QR-Code Invite-Link + WhatsApp Empfang-Fix
Telegram:
- /start <contact_id> Deep-Link Handler: verknüpft Kontakt automatisch mit chat_id
- QR-Code Endpunkt GET /api/v1/contacts/{id}/telegram-qr (PNG)
- TUI: Taste T öffnet QR-Code im Browser (HTML mit eingebettetem PNG)
- config.py + .env.example: TELEGRAM_BOT_USERNAME=mcm_bot
- qrcode[pil] zu requirements.txt hinzugefügt
WhatsApp:
- receiveTimeout 5→3s, HTTP-Timeout 8s → verhindert Polling-Overlap
This commit is contained in:
@@ -101,6 +101,16 @@ class MCMApiClient:
|
||||
async def get_contacts(self) -> list[dict[str, Any]]:
|
||||
return await self._get("/contacts")
|
||||
|
||||
async def get_telegram_qr(self, contact_id: str) -> bytes:
|
||||
"""QR-Code PNG-Bytes für einen Kontakt abrufen."""
|
||||
async with httpx.AsyncClient(timeout=10.0, follow_redirects=True) as client:
|
||||
resp = await client.get(
|
||||
self._base + f"/contacts/{contact_id}/telegram-qr",
|
||||
headers=self._headers,
|
||||
)
|
||||
resp.raise_for_status()
|
||||
return resp.content
|
||||
|
||||
# ── Status ─────────────────────────────────────────────────────────────────
|
||||
|
||||
async def get_channel_status(self) -> dict[str, Any]:
|
||||
|
||||
Reference in New Issue
Block a user