diff --git a/telethon/events/inlinequery.py b/telethon/events/inlinequery.py index 6c4e0d3b..8e476584 100644 --- a/telethon/events/inlinequery.py +++ b/telethon/events/inlinequery.py @@ -145,6 +145,12 @@ class InlineQuery(EventBuilder): r2 = builder.article('Be bad', text="I don't like you") await inline.answer([r1, r2]) + You can send up to 50 results as documented in + https://core.telegram.org/bots/api#answerinlinequery. + Sending more will raise ``ResultsTooMuchError``, + and you should consider using `next_offset` to + paginate them. + cache_time (`int`, optional): For how long this result should be cached on the user's client. Defaults to 0 for no cache. diff --git a/telethon/tl/custom/inlinebuilder.py b/telethon/tl/custom/inlinebuilder.py index 05816f2c..93a7930e 100644 --- a/telethon/tl/custom/inlinebuilder.py +++ b/telethon/tl/custom/inlinebuilder.py @@ -43,8 +43,15 @@ class InlineBuilder: id (`str`, optional): The string ID to use for this result. If not present, it will be the SHA256 hexadecimal digest of converting the - request with empty ID to ``bytes()``, so that the ID will - be deterministic for the same input. + created :tl:`InputBotInlineResult` with empty ID to ``bytes()``, + so that the ID will be deterministic for the same input. + + .. note:: + + If two inputs are exactly the same, their IDs will be the same + too. If you send two articles with the same ID, it will raise + ``ResultIdDuplicateError``. Consider giving them an explicit + ID if you need to send two results that are the same. """ def __init__(self, client): self._client = client diff --git a/telethon_generator/data/errors.csv b/telethon_generator/data/errors.csv index 6ccd4667..cd8d81bf 100644 --- a/telethon_generator/data/errors.csv +++ b/telethon_generator/data/errors.csv @@ -187,7 +187,9 @@ RANGES_INVALID,400,Invalid range provided REG_ID_GENERATE_FAILED,500,Failure while generating registration ID REPLY_MARKUP_INVALID,400,The provided reply markup is invalid REPLY_MARKUP_TOO_LONG,400,The data embedded in the reply markup buttons was too much +RESULT_ID_DUPLICATE,400,Duplicated IDs on the sent results. Make sure to use unique IDs. RESULT_TYPE_INVALID,400,Result type invalid +RESULTS_TOO_MUCH,400,You sent too many results. See https://core.telegram.org/bots/api#answerinlinequery for the current limit. RIGHT_FORBIDDEN,403,Your admin rights do not allow you to do this RPC_CALL_FAIL,,"Telegram is having internal issues, please try again later." RPC_MCGET_FAIL,,"Telegram is having internal issues, please try again later."