简体   繁体   中英

Get the username and discrim of a member from a member object discord.py

How would I get the username and discriminator (tag) of a member from a member object in discord.py?

They're in the objects attributes.

member.name
member.discriminator

If you want the name as displayed in the server there is also member.nick and member.display_name

https://discordpy.readthedocs.io/en/latest/api.html?highlight=member#discord.Member

member.name => returns the name of member
member.discriminator => returns the tag
str(member) => returns name and tag like "Name#0000"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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