Files
nanobot/nanobot
Lengshuang 17684ca5c4 fix(napcat): keep a message whose image declares a non-numeric size
Napcat reports an image segment's file_size as a string that is not
always numeric, so int() raises ValueError. The upfront size guard only
caught TypeError and KeyError, the ValueError escaped _download_image
into _on_message, and the whole inbound message was dropped — text
included — with only a background-handler warning left behind.

Handle ValueError as the guard already handles a missing size: skip the
upfront check and let the streamed download enforce max_image_bytes.
Log it, since a declared size we cannot read is worth knowing about.
2026-10-18 18:56:28 +08:00
..
2026-07-13 13:11:46 +08:00