Search code examples
pythontimerpython-telegram-bot

Updated time from user in hh mm sec format using telegram bot


I tried to get response time of user replay from the telegram bot API, but it is not working. update.message response time suggests the better way to get time.


Solution

  • There is only a date attribute in the message object in Telegram's Bot API. You can use update.effective_message.date to retrieve it, it is internally turned to a datetime object by the python-telegram-bot library.