Skip to content

Commit f16ed40

Browse files
committed
Update examples
1 parent d48f18b commit f16ed40

8 files changed

Lines changed: 23 additions & 27 deletions

File tree

examples/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Example | Description
1212
---: | :---
1313
[**hello_world**](hello_world.py) | Demonstration of basic API usage
1414
[**echobot**](echobot.py) | Echo every private text message
15-
[**welcome**](welcome.py) | The Welcome Bot in [@PyrogramChat](https://t.me/pyrogramchat)
16-
[**history**](history.py) | Get the full message history of a chat
17-
[**chat_members**](chat_members.py) | Get all the members of a chat
18-
[**dialogs**](dialogs.py) | Get all of your dialog chats
19-
[**using_inline_bots**](using_inline_bots.py) | Query an inline bot (as user) and send a result to a chat
20-
[**keyboards**](keyboards.py) | Send normal and inline keyboards using regular bots
21-
[**callback_queries**](callback_queries.py) | Handle queries coming from inline button presses
22-
[**inline_queries**](inline_queries.py) | Handle inline queries
15+
[**welcomebot**](welcomebot.py) | The Welcome Bot in [@PyrogramChat](https://t.me/pyrogramchat)
16+
[**get_history**](get_history.py) | Get the full message history of a chat
17+
[**get_chat_members**](get_chat_members.py) | Get all the members of a chat
18+
[**get_dialogs**](get_dialogs.py) | Get all of your dialog chats
19+
[**callback_queries**](callback_queries.py) | Handle callback queries (as bot) coming from inline button presses
20+
[**inline_queries**](inline_queries.py) | Handle inline queries (as bot) and answer with results
21+
[**use_inline_bots**](use_inline_bots.py) | Query an inline bot (as user) and send a result to a chat
22+
[**bot_keyboards**](bot_keyboards.py) | Send normal and inline keyboards using regular bots
2323
[**raw_updates**](raw_updates.py) | Handle raw updates (old, should be avoided)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""This example will show you how to send normal and inline keyboards.
1+
"""This example will show you how to send normal and inline keyboards (as bot).
22
33
You must log-in as a regular bot in order to send keyboards (use the token from @BotFather).
44
Any attempt in sending keyboards with a user account will be simply ignored by the server.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""This example shows how to get the full dialogs list of a user."""
1+
"""This example shows how to get the full dialogs list (as user)."""
22

33
from pyrogram import Client
44

examples/use_inline_bots.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""This example shows how to query an inline bot (as user)"""
2+
3+
from pyrogram import Client
4+
5+
# Create a new Client
6+
app = Client("my_account")
7+
8+
with app:
9+
# Get bot results for "Fuzz Universe" from the inline bot @vid
10+
bot_results = app.get_inline_bot_results("vid", "Fuzz Universe")
11+
12+
# Send the first result (bot_results.results[0]) to your own chat (Saved Messages)
13+
app.send_inline_bot_result("me", bot_results.query_id, bot_results.results[0].id)

examples/using_inline_bots.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)