Answer the question
In order to leave comments, you need to log in
How to request input from user in TG bot?
How can I implement input from a user of type input in python? I need the user to send data to the bot, click on the button and this data is sent to the database. I tried a lot of things but nothing worked (
Answer the question
In order to leave comments, you need to log in
So just read the content of the message that comes to the bot from the user in the chat. Why not input?
Here is an example of an echo bot . See how the incoming message is processed there:
@bot.message_handler(content_types=["text"])
def repeat_all_messages(message): # Название функции не играет никакой роли, в принципе
bot.send_message(message.chat.id, message.text) #message.text - это сообщение, которое получает сервер. Его и обрабатывай
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question