mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
send.rs had grown back into the shape handlers.rs was split out of: payload types, error classification, the download-and-reupload fallback, the senders and the whole post-send/queue shell in one file. Split by concern, leaving call sites (`crate::send::x`) unchanged: - `send/input_media.rs`: payload → `InputFile`/`InputMedia` selection and `build_media_group` (with its caption-on-first-item rule). - `send/upload.rs`: the fallback pipeline (download with the upload cap, photo downscale handoff, smaller-URL fallback, multipart upload). - `send/post_send.rs`: link-cache write, the `KEEP_ALIVE` registry for locally produced media, `settle_task`, the post-send actions and the queue entry points; the parts other modules call are re-exported. - `send/mod.rs`: payloads, error classification, classification helpers and the senders themselves, plus the test module. No behaviour change: 128 + 1326 + 366 + 345 lines, 70 tests still pass. AGENTS.md updated for the new layout and for `ctx.rs`.