I'm trying to read a book name from a user after asking the question: What book are you looking for? How can I save the user's response in a variable for use in my algorithms?
def bookinfo(bot, update):
chat_id = update.message.chat_id
bot.send_message(chat_id=chat_id, text='What book are you looking for?????')
dp.add_handler(MessageHandler(Filters.text))
BOOK_NAME = update.message.text
BOOK_NAME = str.lower(BOOK)
answer = 'You have wrote me ' + BOOK_NAME
bot.send_message(answer)
updater = Updater('TOKEN')
dp = updater.dispatcher
dp.add_handler(CommandHandler('bookinfo', bookinfo))
updater.start_polling()
updater.idle()
The question is asked, but the bot does not respond by sending the message with the name of the book... Many thanks in advance!