feat: geo location as Google Maps link in Telegram notifications
When signal has geo, show clickable Google Maps link instead of raw coordinates. Without geo, show "Гео нету". Added parse_mode=HTML to send_message for link rendering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
04f7bd79e2
commit
47b89ded8d
4 changed files with 8 additions and 8 deletions
|
|
@ -50,7 +50,7 @@ async def send_message(text: str) -> None:
|
|||
url = _TELEGRAM_API.format(token=config.BOT_TOKEN, method="sendMessage")
|
||||
async with httpx.AsyncClient(timeout=10) as client:
|
||||
for attempt in range(3):
|
||||
resp = await client.post(url, json={"chat_id": config.CHAT_ID, "text": text})
|
||||
resp = await client.post(url, json={"chat_id": config.CHAT_ID, "text": text, "parse_mode": "HTML"})
|
||||
if resp.status_code == 429:
|
||||
retry_after = resp.json().get("parameters", {}).get("retry_after", 30)
|
||||
sleep = retry_after * (attempt + 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue