From 67020975e1eae48168dacea3b8335b9fc13e8093 Mon Sep 17 00:00:00 2001 From: Lonami Date: Mon, 25 Jun 2018 09:32:55 +0200 Subject: [PATCH] Destroyed Talking to inline bots (markdown) --- Talking-to-inline-bots.md | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 Talking-to-inline-bots.md diff --git a/Talking-to-inline-bots.md b/Talking-to-inline-bots.md deleted file mode 100644 index a4654df..0000000 --- a/Talking-to-inline-bots.md +++ /dev/null @@ -1,37 +0,0 @@ -You can query an inline bot, such as [@VoteBot](https://t.me/vote) (note, *query*, not *interact* with a voting message), by making use of the [`GetInlineBotResultsRequest`](https://lonamiwebs.github.io/Telethon/methods/messages/get_inline_bot_results.html) request: - -```python -from telethon.tl.functions.messages import GetInlineBotResultsRequest - -bot_results = client(GetInlineBotResultsRequest( - bot, user_or_chat, 'query', '' -)) -``` - -And you can select any of their results by using [`SendInlineBotResultRequest`](https://lonamiwebs.github.io/Telethon/methods/messages/send_inline_bot_result.html): - -```python -from telethon.tl.functions.messages import SendInlineBotResultRequest - -client(SendInlineBotResultRequest( - get_input_peer(user_or_chat), - obtained_query_id, - obtained_str_id -)) -``` - ---- - -To interact with a message that has a special reply markup, such as [@VoteBot](https://t.me/vote)'s polls, you would use [`GetBotCallbackAnswerRequest`](https://lonamiwebs.github.io/Telethon/methods/messages/get_bot_callback_answer.html): - -```python -from telethon.tl.functions.messages import GetBotCallbackAnswerRequest - -client(GetBotCallbackAnswerRequest( - user_or_chat, - msg.id, - data=msg.reply_markup.rows[wanted_row].buttons[wanted_button].data -)) -``` - -It's a bit verbose, but it has all the information you would need to show it visually (button rows, and buttons within each row, each with its own data). \ No newline at end of file