I am trying to make a conversation telegram bot in python. I am trying to get the reply of the user and want my bot to reply him. but the bot is not reading the new message except it keep send the previous text which is the bot command.
This is the function I am using:
def start(bot, update):
username = update['message']['chat']['first_name']
chat_id = get_chat_id(update)
message = f"Hi {username} my name is Xeniour_Bot...\nHow are you?"
message_id = update['message']['message_id']
bot.send_message(chat_id, message, reply_to_message_id=update.message.message_id)
time.sleep(5)
reply = update.message.text
bot.send_message(chat_id, reply, reply_to_message_id=update.message.message_id)
This is my main function:
def main():
updater = Updater(botToken)
dp = updater.dispatcher
dp.add_handler(CommandHandler('start', start))
updater.start_polling()
updater.idle()
if __name__ == '__main__':
main()
This is the Output I am getting:
