I'm using telegram.ext.Updater to build a bot just like the example echobot2.
In the echo function, I want to reply message, and tried piece of code found in README as followed.
>>> chat_id = bot.getUpdates()[-1].message.chat_id
But it went wrong. Then I found that bot.getUpdates() in the echo function is an empty list.
Is that a bug? Or reply message is not supported in telegram.ext.Updater?
If you are using the Updater, you don't have to use getUpdates. The update object is already passed to the echo function, so you can just use update.message.chat_id
@jh0ker Thanks for your answer.
But when I use update.message.chat_id, the bot just 'send' the message directly, instead of 'reply' the message I just sent.
The reply function is what I really want to do. Could it be done in any way?
I see. Use sendMessage(..., reply_to_message_id=update.message.message_id)
Most helpful comment
I see. Use
sendMessage(..., reply_to_message_id=update.message.message_id)