Add support for Guild.bots and Guild.humans

This commit is contained in:
iDutchy 2020-09-13 01:17:35 +00:00
parent ddc4ad24f4
commit 1791b72f45

View File

@ -511,6 +511,16 @@ class Guild(Hashable):
"""List[:class:`Member`]: A list of members that belong to this guild."""
return list(self._members.values())
@property
def bots(self):
"""List[:class:`Member`]: A list of bots that belong to this guild."""
return list(m for m in self._members.values() if m.bot)
@property
def humans(self):
"""List[:class:`Member`]: A list of humans that belong to this guild."""
return list(m for m in self._members.values() if not m.bot)
def get_member(self, user_id):
"""Returns a member with the given ID.