3

I cannot understand what parameter offset did in this function and what's kind of values accept? I try use integers but there is no effect.

from pyrogram import Client, filters
import time


app = Client(
    "my_account",
    api_id=api_id, api_hash=api_hash,
)


async def main():
    async with app:
        bot_results = await app.get_inline_bot_results(
            "some_bot_name",
            query="some_query",
            offset="???"
        )


app.run(main())

2 Answers2

1

The documentation states:

offset (str, optional) – Offset of the results to be returned.

Which is not super helpful but from the Telegram Docs shows that it is used for pagination:

offset - If the user scrolls past the first len(results) results, and next_offset field is set, the inline query should be repeated with this offset.

Checking the string documentation and [this] GitHub issue, it seems that the offset should be a string of an int like: "0" or "100". Make sure the returned results' length is more than 1 and set the offset to "1".

doneforaiur
  • 1,308
  • 7
  • 14
  • 21
0

Solution of my problem was not at offset parameter but in content of query one.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 10 '23 at 04:27