update sign up notifications
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 9s

This commit is contained in:
2026-08-02 14:54:00 +05:00
parent 1f5e60dbb4
commit 1ea2f9f4c2
3 changed files with 88 additions and 16 deletions
+20
View File
@@ -70,6 +70,26 @@ async def send_telegram_alert(markdown_message: str):
)
async def send_telegram_photo(photo, markdown_caption: str):
"""Send a photo. `photo` may be raw bytes / a file-like object (uploaded
directly to Telegram) or a public URL string."""
logger.info("[TELEGRAM] Preparing to send photo...")
kwargs = {}
if TOPIC_ID:
kwargs["message_thread_id"] = int(TOPIC_ID)
await bot.send_photo(
chat_id=str(CHAT_ID),
photo=photo,
caption=markdown_caption,
parse_mode=ParseMode.MARKDOWN_V2,
# Uploading media is slower than a text send; the defaults (5s) time out.
connect_timeout=15,
read_timeout=30,
write_timeout=60,
**kwargs,
)
def escape_markdown_v2(text: str) -> str:
escape_chars = r"_~`>#+-=|{}.!\\"
return re.sub(f"([{re.escape(escape_chars)}])", r"\\\1", text)