Seek to start before sending incidents export files
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user