I would like to have a little Telegram bot in python where a command is issued by the user, the bot asks a question and reacts depending on the answer. The official Telegram API mentions that this is possible using ForceReply(), e.g. for creating polls step by step, see here Official Telegram API # ForceReply.
I wrote the following code:
def test_function(update: Update, context: CallbackContext) -> None:
msg = context.bot.send_message(chat_id=update.message.chat_id,
text="Please enter some text.",
reply_markup=telegram.ForceReply(True))
if __name__ == '__main__':
dispatcher.add_handler(CommandHandler("test", test_function))
updater.start_polling()
updater.idle()
So when /test is issued by the user, he is asked to enter some text and due to the ForceReply(True), the user is forced to reply to the message. But how do I get the result of this reply, i.e. the text replied by the user? There is no hint in the API docs and I also spent some time searching on the internet and on SO but didn't find anything. Therefore, most likely the answer is simple and clear but I just don't get it at the moment.
Any kind of help is appreciated.
