Telethon icon indicating copy to clipboard operation
Telethon copied to clipboard

Support InlineQueryResultCached* results for inline bots

Open stha opened this issue 5 years ago • 1 comments

Please add support for all the InlineQueryResultCached* results for media objects stored on telegram servers.

A possible use case could look like this:

async def inline_query_event_handler(self, event: InlineQuery) -> None:
   await event.answer([
            event.builder.cached_photo(
                Path('testpicture_pixeled.jpg'),
                ....
            )
       ])

https://core.telegram.org/bots/api#inlinequeryresult

InlineQueryResultCachedAudio
InlineQueryResultCachedDocument
InlineQueryResultCachedGif
InlineQueryResultCachedMpeg4Gif
InlineQueryResultCachedPhoto
InlineQueryResultCachedSticker
InlineQueryResultCachedVideo
InlineQueryResultCachedVoice

stha avatar Jan 03 '20 13:01 stha

Can I know, why there is a path in use case?

InlineQueryResultCached* of Bot api takes file id.

And you can use Photo and Document (media types) (or from message.media) in event.builder.document for media objects already on telegram servers.

New-dev0 avatar Feb 04 '22 16:02 New-dev0

This is unlikely to happen in the near future so I will be closing the issue. We can reopen it if there's still interest once the time is right.

Lonami avatar Apr 06 '23 12:04 Lonami