Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for inline queries #17

Open
pietroalbini opened this issue Jan 1, 2016 · 3 comments
Open

Add support for inline queries #17

pietroalbini opened this issue Jan 1, 2016 · 3 comments

Comments

@pietroalbini
Copy link
Contributor

Telegram bots now supports inline queries, which allows the bot to provide information even if it isn't in that specific group. I plan to implement the feature with the following API:

@bot.inline(cache=60, private=True, paginate=10)
def process_inline(user, query):
    if not query:
        return False  # do not send the replies
    i = 1
    while True:
        # Send an article with `i` as the title and "A number" as the content
        yield botogram.inline_article(str(i), "A number")
        i += 1

Because it's implemented as a generator, it's possible to implement pagination framework-side without processing every item you might send. In the example above, most of the times you will process only the first 10-20 numbers, but the user is able to scroll down how much he wants.

@liz7124
Copy link

liz7124 commented Jan 5, 2016

how to implement this new feature in php?

@pietroalbini
Copy link
Contributor Author

@liz7124 please refer to the Telegram documentation. Also, this is completly off-topic on this repository, botogram is written in Python :)

@liz7124
Copy link

liz7124 commented Jan 6, 2016

Oohh,i see.. Thank you :)

@pietroalbini pietroalbini modified the milestones: botogram 1.0, botogram 1.0b1 Feb 4, 2016
@pietroalbini pietroalbini removed their assignment Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants