B
B
bubaley2019-02-05 11:10:37
Bots
bubaley, 2019-02-05 11:10:37

Telegram Bot API. How to solve the issue of getting information from a message?

Hello
I am developing bots in python with the pyTelegramBotAPI library
How can I get information about a message, knowing:
1. User_id and Message_id
2. inline_message_id (the message that is sent in Inline mode)
The task itself is to send a message to a person in inline mode, get the result pressing the call-back button and view the text of the message, because it contains key information. Then this information is processed and a record is created in the database.
You can do it differently (it will be super perfect):
When I just type the @moy_super_puper_bot query, the check
pops up InlineQueryResultArticle, but every time I change the text it is rebuilt (so writing to the database is not an option at this stage).
How can I catch to whom this InlineQueryResult is being sent and when exactly it is sent (so that at the moment of clicking, I know to whom I am sending and what I am sending so that I can immediately write it to the database)?
Both the first option and the second will do.
And a small one. Is there a switch_inline_query button , can I catch from it which dialog I switched to?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
photozoom, 2019-04-14
@bubaley

Perhaps not relevant anymore, but it might be useful to someone...
When someone types @moy_super_puper_bot Request, the script should get an 'inline_query' array in the update, which has the "query" key with the value 'Request'. The script should prepare the answer and send it with the 'answerInlineQuer' method. The response should be some 'InlineQueryResult' array of results, which are also arrays (there are several types of results like 'InlineQueryResultArticle', 'InlineQueryResultContact', etc.). And so each result should be with unique id.
When the user clicks on one of the query results, the script can update the 'chosen_inline_result' array, which will contain the same unique result id '
But in order to receive 'chosen_inline_result' with the update, you need to configure the bot by sending the /setinlinefeedback command to BotFather.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question