debug-load-messages
All checks were successful
deploy / deploy (push) Successful in 1m9s

This commit is contained in:
Untone 2023-10-16 23:00:07 +03:00
parent c06dc5ebe7
commit ca3ed334a9

View File

@ -34,11 +34,11 @@ async def load_messages(chat_id: str, limit: int = 5, offset: int = 0, ids: Opti
replies = [] replies = []
for m in messages: for m in messages:
if m: if m:
rt = json.loads(m).get("replyTo") reply_to = json.loads(m).get("replyTo")
if rt: if reply_to:
rt = int(rt) reply_to = int(reply_to)
if rt not in message_ids: if reply_to not in message_ids:
replies.append(rt) replies.append(reply_to)
if replies: if replies:
messages += await load_messages(chat_id, offset, limit, replies) messages += await load_messages(chat_id, offset, limit, replies)
except Exception as e: except Exception as e: