Answer the question
In order to leave comments, you need to log in
How to put just sent message into variable (pyTelegramBotAPI)?
if message.text == 'Оставить отзыв':
bot.send_message(message.chat.id, 'Пиши')
time.sleep(10)
otziv = message.text
bot.send_message('my_id', 'Вам оставили отзыв!')
bot.send_message('my_id', otziv)
Answer the question
In order to leave comments, you need to log in
Use next_step_handler
https://github.com/eternnoir/pyTelegramBotAPI/blob...
if message.text == 'Оставить отзыв':
msg = bot.send_message(message.chat.id, 'Пиши')
time.sleep(10)
otziv = message.text
bot.send_message('my_id', 'Вам оставили отзыв!')
bot.send_message('my_id', otziv)
bot.register_next_step_handler(msg, text_step)
# ...
def text_step(message):
print(message)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question