mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-12 12:00:37 +00:00
Document InlineBuilder
This commit is contained in:
@@ -435,6 +435,9 @@ where you want to send it to:
|
||||
|
||||
Sending messages through inline bots lets you use buttons as a normal user.
|
||||
|
||||
It can look a bit strange at first, but you can make inline queries in no
|
||||
chat in particular, and then click a *result* to send it to some chat.
|
||||
|
||||
Clicking Buttons
|
||||
****************
|
||||
|
||||
@@ -449,6 +452,28 @@ This will click the first button in the message. You could also
|
||||
``click(row, column)``, using some text such as ``click(text='👍')``
|
||||
or even the data directly ``click(data=b'payload')``.
|
||||
|
||||
Answering Inline Queries
|
||||
************************
|
||||
|
||||
As a bot, you can answer to inline queries with `events.InlineQuery
|
||||
<telethon.events.inlinequery.InlineQuery>`. You should make use of the
|
||||
`builder <telethon.tl.custom.inlinebuilder.InlineBuilder>` property
|
||||
to conveniently build the list of results to show to the user. Remember
|
||||
to check the properties of the `InlineQuery.Event
|
||||
<telethon.events.inlinequery.InlineQuery.Event>`:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@bot.on(events.InlineQuery)
|
||||
async def handler(event):
|
||||
builder = event.builder
|
||||
|
||||
rev_text = event.text[::-1]
|
||||
await event.answer([
|
||||
builder.article('Reverse text', text=rev_text),
|
||||
builder.photo('/path/to/photo.jpg')
|
||||
])
|
||||
|
||||
Conversations: Waiting for Messages or Replies
|
||||
**********************************************
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ telethon\.tl\.custom\.draft module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
|
||||
telethon\.tl\.custom\.dialog module
|
||||
-----------------------------------
|
||||
|
||||
@@ -20,7 +18,6 @@ telethon\.tl\.custom\.dialog module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
telethon\.tl\.custom\.message module
|
||||
------------------------------------
|
||||
|
||||
@@ -29,7 +26,6 @@ telethon\.tl\.custom\.message module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
telethon\.tl\.custom\.messagebutton module
|
||||
------------------------------------------
|
||||
|
||||
@@ -54,6 +50,14 @@ telethon\.tl\.custom\.button module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
telethon\.tl\.custom\.inlinebuilder module
|
||||
------------------------------------------
|
||||
|
||||
.. automodule:: telethon.tl.custom.inlinebuilder
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
telethon\.tl\.custom\.inlineresult module
|
||||
-----------------------------------------
|
||||
|
||||
@@ -62,6 +66,14 @@ telethon\.tl\.custom\.inlineresult module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
telethon\.tl\.custom\.inlineresults module
|
||||
------------------------------------------
|
||||
|
||||
.. automodule:: telethon.tl.custom.inlineresults
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
telethon\.tl\.custom\.chatgetter module
|
||||
---------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user