Skip to content

Add support for inline queries #17

Open

Description

@emilyalbini

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.

Activity

  1. added this to the botogram 1.0 milestone on Jan 1, 2016
  2. self-assigned this
    on Jan 1, 2016
  3. liz7124 commented on Jan 5, 2016

    @liz7124

    how to implement this new feature in php?

  4. emilyalbini commented on Jan 5, 2016

    @emilyalbini
    ContributorAuthor

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

  5. liz7124 commented on Jan 6, 2016

    @liz7124

    Oohh,i see.. Thank you :)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions