From 040a6c96e46b43b152f9398969f03f5eee6bab13 Mon Sep 17 00:00:00 2001 From: benya Date: Mon, 9 Feb 2026 02:30:17 +0300 Subject: [PATCH] Seek to start before sending incidents export files --- handlers/system.py | 1 + 1 file changed, 1 insertion(+) diff --git a/handlers/system.py b/handlers/system.py index 7d2dc0d..f20629d 100644 --- a/handlers/system.py +++ b/handlers/system.py @@ -438,6 +438,7 @@ async def incidents_export(msg: Message): writer.writerow(row) bio = io.BytesIO(sio.getvalue().encode("utf-8")) bio.name = f"incidents_{hours}h.csv" + bio.seek(0) summary = f"📤 Incidents export ({hours}h): {len(data)} rows, format {fmt}" await msg.answer(summary) await msg.answer_document(document=InputFile(bio, filename=bio.name))