mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-22 08:44:10 +00:00
Add ClientUser.friends and ClientUser.blocked
This commit is contained in:
parent
12c1cd9b14
commit
1cf7b0e2c8
@ -213,6 +213,16 @@ class ClientUser(BaseUser):
|
||||
"""Returns a list of :class:`Relationship` that the user has."""
|
||||
return list(self._relationships.values())
|
||||
|
||||
@property
|
||||
def friends(self):
|
||||
"""Returns a list of :class:`User`\s that the user is friends with."""
|
||||
return [r.user for r in self._relationships.values() if r.type is RelationshipType.friend]
|
||||
|
||||
@property
|
||||
def blocked(self):
|
||||
"""Returns a list of :class:`User`\s that the user has blocked."""
|
||||
return [r.user for r in self._relationships.values() if r.type is RelationshipType.blocked]
|
||||
|
||||
@asyncio.coroutine
|
||||
def edit(self, **fields):
|
||||
"""|coro|
|
||||
|
Loading…
x
Reference in New Issue
Block a user