mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-24 07:51:44 +00:00
Add inline_bots example
This commit is contained in:
parent
536efa5f4a
commit
5c753d8c77
15
examples/inline_bots.py
Normal file
15
examples/inline_bots.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from pyrogram import Client
|
||||||
|
|
||||||
|
# Create a new Client
|
||||||
|
client = Client("example")
|
||||||
|
|
||||||
|
# Start the Client
|
||||||
|
client.start()
|
||||||
|
|
||||||
|
# Get bot results for "Fuzz Universe" from the inline bot @vid
|
||||||
|
bot_results = client.get_inline_bot_results("vid", "Fuzz Universe")
|
||||||
|
# Send the first result (bot_results.results[0]) to your own chat (Saved Messages)
|
||||||
|
client.send_inline_bot_result("me", bot_results.query_id, bot_results.results[0].id)
|
||||||
|
|
||||||
|
# Stop the client
|
||||||
|
client.stop()
|
Loading…
Reference in New Issue
Block a user