简体   繁体   English

Telethon 获取 msg 发件人姓名

[英]Telethon get msg sender name

I'm using Telethon in my python project to get msg from a specific group:我在我的 python 项目中使用 Telethon 从特定组获取 msg:

full_msg_list = self.client.get_messages(GROUP_ID, limit=200)

When I iterate the full_msg_list every msg object as sender_id that is a number but i want to get the username of the sender and not his id.当我迭代full_msg_list每个 msg 对象作为sender_id这是一个数字时,但我想获取发件人的用户名而不是他的 ID。

Any suggestions on how to get the user name?关于如何获取用户名的任何建议?

result = (await message.get_sender()).username

其中messagefull_msg_list迭代返回的消息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM