Skip to content Skip to sidebar Skip to footer

How To Get A User Object From A Message In Group At Telegram Bot

Recently I was working on a simple Telegram bot written in python (with the python-telegram-bot library). In this bot I can get the last message object using following command : bo

Solution 1:

Since it was clarified that you're using the library, the solution is simple. The author of the library renamed the Python-incompatible from attribute to from_user. So just do:

user = bot.getUpdates()[-1].from_user

Post a Comment for "How To Get A User Object From A Message In Group At Telegram Bot"