Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
delivrance committed May 10, 2019
1 parent d48f18b commit f16ed40
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 27 deletions.
16 changes: 8 additions & 8 deletions examples/README.md
Expand Up @@ -12,12 +12,12 @@ Example | Description
---: | :---
[**hello_world**](hello_world.py) | Demonstration of basic API usage
[**echobot**](echobot.py) | Echo every private text message
[**welcome**](welcome.py) | The Welcome Bot in [@PyrogramChat](https://t.me/pyrogramchat)
[**history**](history.py) | Get the full message history of a chat
[**chat_members**](chat_members.py) | Get all the members of a chat
[**dialogs**](dialogs.py) | Get all of your dialog chats
[**using_inline_bots**](using_inline_bots.py) | Query an inline bot (as user) and send a result to a chat
[**keyboards**](keyboards.py) | Send normal and inline keyboards using regular bots
[**callback_queries**](callback_queries.py) | Handle queries coming from inline button presses
[**inline_queries**](inline_queries.py) | Handle inline queries
[**welcomebot**](welcomebot.py) | The Welcome Bot in [@PyrogramChat](https://t.me/pyrogramchat)
[**get_history**](get_history.py) | Get the full message history of a chat
[**get_chat_members**](get_chat_members.py) | Get all the members of a chat
[**get_dialogs**](get_dialogs.py) | Get all of your dialog chats
[**callback_queries**](callback_queries.py) | Handle callback queries (as bot) coming from inline button presses
[**inline_queries**](inline_queries.py) | Handle inline queries (as bot) and answer with results
[**use_inline_bots**](use_inline_bots.py) | Query an inline bot (as user) and send a result to a chat
[**bot_keyboards**](bot_keyboards.py) | Send normal and inline keyboards using regular bots
[**raw_updates**](raw_updates.py) | Handle raw updates (old, should be avoided)
2 changes: 1 addition & 1 deletion examples/keyboards.py → examples/bot_keyboards.py
@@ -1,4 +1,4 @@
"""This example will show you how to send normal and inline keyboards.
"""This example will show you how to send normal and inline keyboards (as bot).
You must log-in as a regular bot in order to send keyboards (use the token from @BotFather).
Any attempt in sending keyboards with a user account will be simply ignored by the server.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/dialogs.py → examples/get_dialogs.py
@@ -1,4 +1,4 @@
"""This example shows how to get the full dialogs list of a user."""
"""This example shows how to get the full dialogs list (as user)."""

from pyrogram import Client

Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions examples/use_inline_bots.py
@@ -0,0 +1,13 @@
"""This example shows how to query an inline bot (as user)"""

from pyrogram import Client

# Create a new Client
app = Client("my_account")

with app:
# Get bot results for "Fuzz Universe" from the inline bot @vid
bot_results = app.get_inline_bot_results("vid", "Fuzz Universe")

# Send the first result (bot_results.results[0]) to your own chat (Saved Messages)
app.send_inline_bot_result("me", bot_results.query_id, bot_results.results[0].id)
17 changes: 0 additions & 17 deletions examples/using_inline_bots.py

This file was deleted.

File renamed without changes.

0 comments on commit f16ed40

Please sign in to comment.