I'm trying to make a simple bot that mutes users but I'm having some issues with retrieving the user id of a replied message.
I can't access to user_id because the library is using the from
key like:
def mute_user(update, context):
bot = context.bot
print(update.message.reply_to_message.from.id)
I cannot use the "from" key because it is reserved so it gives me an error.
If i remove the .from.id
, the output will be like this:
[...] 'from': {'is_bot': False, 'username': '*****', 'first_name': '*****', 'id': 150*****}}
How can I access to that id?
I resolved this problem reading the python-telegram-bot documentation
I used update.message.reply_to_message.from_user
instead of update.message.reply_to_message.from