MTPyroger/examples/query_inline_bots.py
Dan fd306c383d Remove LGPLv3 license notices from example files
Examples are licensed under the terms of CC0 1.0 Universal License
2018-10-09 15:21:36 +02:00

18 lines
487 B
Python

from pyrogram import Client
"""This example shows how to query an inline bot"""
# Create a new Client
app = Client("my_account")
# Start the Client
app.start()
# 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)
# Stop the client
app.stop()