Add Client.emojis to get all emojis.
This removes the older get_all_emojis generator.
This commit is contained in:
parent
ae36008279
commit
0dac5e3139
@ -173,6 +173,11 @@ class Client:
|
||||
"""List[:class:`Guild`]: The guilds that the connected client is a member of."""
|
||||
return self.connection.guilds
|
||||
|
||||
@property
|
||||
def emojis(self):
|
||||
"""List[:class:`Emoji`]: The emojis that the connected client has."""
|
||||
return self.connection.emojis
|
||||
|
||||
@property
|
||||
def private_channels(self):
|
||||
"""List[:class:`abc.PrivateChannel`]: The private channels that the connected client is participating on."""
|
||||
@ -478,12 +483,6 @@ class Client:
|
||||
"""Returns a :class:`User` with the given ID. If not found, returns None."""
|
||||
return self.connection.get_user(id)
|
||||
|
||||
def get_all_emojis(self):
|
||||
"""Returns a generator with every :class:`Emoji` the client can see."""
|
||||
for guild in self.guilds:
|
||||
for emoji in guild.emojis:
|
||||
yield emoji
|
||||
|
||||
def get_all_channels(self):
|
||||
"""A generator that retrieves every :class:`Channel` the client can 'access'.
|
||||
|
||||
|
@ -160,6 +160,10 @@ class ConnectionState:
|
||||
def _remove_guild(self, guild):
|
||||
self._guilds.pop(guild.id, None)
|
||||
|
||||
@property
|
||||
def emojis(self):
|
||||
return list(self._emojis)
|
||||
|
||||
@property
|
||||
def private_channels(self):
|
||||
return list(self._private_channels.values())
|
||||
|
Loading…
x
Reference in New Issue
Block a user