pyrofork/docs/source/start/examples/use_inline_bots.rst
wulan17 d91b933715
PyroFork: Bring back docs
Signed-off-by: wulan17 <galihgustip@gmail.com>
2023-01-02 15:04:23 +07:00

25 lines
No EOL
620 B
ReStructuredText

use_inline_bots
===============
This example shows how to query an inline bot (as user).
.. code-block:: python
from pyrogram import Client
# Create a new Client
app = Client("my_account")
async def main():
async with app:
# Get bot results for "hello" from the inline bot @vid
bot_results = await app.get_inline_bot_results("vid", "hello")
# Send the first result to your own chat (Saved Messages)
await app.send_inline_bot_result(
"me", bot_results.query_id,
bot_results.results[0].id)
app.run(main())