support threaded groups

This commit is contained in:
Crystal
2025-12-01 09:57:03 +01:00
parent 1e2f715ff3
commit fd62653dce
3 changed files with 15 additions and 4 deletions

View File

@@ -6,12 +6,15 @@ def _wb_telegram_send_alert(message: str):
users= _bot_syms.USERS
for user in users:
u= user[0]
thread_id= user[1]
print(f"wb_alert_bot _wb_telegram_send_alert: sending message to {user}...")
payload = {
'chat_id': user,
'chat_id': u,
'text': message,
'parse_mode': 'Markdown'
'parse_mode': 'Markdown',
}
if thread_id: payload['message_thread_id']= thread_id
try:
res = _rqsts.post(_bot_syms.TELEGRAM_API_URL, data=payload, timeout=3)