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."""
|
"""Returns a list of :class:`Relationship` that the user has."""
|
||||||
return list(self._relationships.values())
|
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
|
@asyncio.coroutine
|
||||||
def edit(self, **fields):
|
def edit(self, **fields):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user