0

My telegram bot is an admin in a channel.

I'm listening to message using on_message handler.

I want to get the username/userid of the user of that message. How can I do that in pyrogram or another python telegram bot library?

nexgen
  • 47
  • 4

2 Answers2

2

Telegram doesn't expose the username or their ID for messages in a channel. Not even to other admins.

The only indication you get is Message.author_signature as a string, which contains the "Signature of the post author for messages in channels, or the custom title of an anonymous group administrator."

See https://docs.pyrogram.org/api/types/Message

ColinShark
  • 1,047
  • 2
  • 10
  • 18
1

Using the update.message.from_user from this python library , you can get pretty much all the user info

CacheZero1
  • 11
  • 4