mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-25 23:52:04 +00:00
Inline results were URL-only: Telegram fetches an inline result's URL itself and cannot send site headers, so every pixiv item (and every locally encoded ugoira/bsky MP4) was skipped and such a query answered empty. A post that is already in the link cache now answers with InlineQueryResultCached* built from its Telegram file ids — no fetch, no upload, and the hotlink-protected case simply works. A degraded entry (file ids gone) falls back to URLs, and there a video with no poster is skipped (Telegram would try to render the mp4 as its own thumbnail). The answer call moves onto MediaSender (answer_inline_query, mirroring the other user-flow methods), which is what makes the path testable at all: the two new tests drive the cache answer and the degraded/empty answer through TestStores + MockSender, which recorded nothing about inline before. The result builders are shared by both paths now (url_result/cached_result + inline_kind), so the fetch path's behaviour is unchanged.