Browse Source

Add GuildMember.name property, returning nickname or username

feature/docs
Andrei 8 years ago
parent
commit
835242c241
  1. 8
      disco/types/guild.py

8
disco/types/guild.py

@ -147,6 +147,13 @@ class GuildMember(SlottedModel):
def __str__(self):
return self.user.__str__()
@property
def name(self):
"""
The nickname of this user if set, otherwise their username
"""
return self.nick or self.user.username
def get_voice_state(self):
"""
Returns
@ -408,4 +415,3 @@ class Guild(SlottedModel, Permissible):
def create_channel(self, *args, **kwargs):
return self.client.api.guilds_channels_create(self.id, *args, **kwargs)

Loading…
Cancel
Save