mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
Every item was skipped — `needs_media_headers` for pixiv's pximg.net, or a local ugoira/bsky MP4 that does not parse as a URL — and the function fell through to `Ok(false)`, which the debounce reads as "retry this query". The client got no answer at all (a spinner with nothing behind it) and every keystroke re-ran the fetch, while an unsatisfiable link is the *permanent* truth for that query: Telegram fetches inline result URLs itself and never sends a Referer. It now answers the empty result set with a 300 s window, so the client stops spinning and the same query is served from Telegram's cache and from the debounce (which only releases on a failure). A *failed* fetch still releases, so a retry is not answered from a stale empty answer. Verified with a real pixiv link through a real `Bot` against the stand-in API: `AnswerInlineQuery` with `results: []` and `cache_time: 300` (and `Ok(true)`, so no release). `cargo fmt --check`, `cargo clippy --workspace --all-targets --locked -- -D warnings` and `cargo test --workspace --locked` clean.