diff options
| author | Rapptz <[email protected]> | 2017-01-27 00:25:04 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-01-27 00:25:04 -0500 |
| commit | 1cf7b0e2c8234f35a4ce0e30f7c3e395a37cc75c (patch) | |
| tree | 9331a6f3e5c5f2d58b7eacf7cd2adc3332ee00de /discord/user.py | |
| parent | [commands] Add cog local checks via __local_check (diff) | |
| download | discord.py-1cf7b0e2c8234f35a4ce0e30f7c3e395a37cc75c.tar.xz discord.py-1cf7b0e2c8234f35a4ce0e30f7c3e395a37cc75c.zip | |
Add ClientUser.friends and ClientUser.blocked
Diffstat (limited to 'discord/user.py')
| -rw-r--r-- | discord/user.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/discord/user.py b/discord/user.py index 683c525c..47cebde5 100644 --- a/discord/user.py +++ b/discord/user.py @@ -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| |