aboutsummaryrefslogtreecommitdiff
path: root/discord/emoji.py
diff options
context:
space:
mode:
authorNCPlayz <[email protected]>2019-03-25 22:31:03 +0000
committerRapptz <[email protected]>2019-04-06 19:19:47 -0400
commit1d701f32b611f421bdd404f2ef523b0c876af1ce (patch)
treee1d8e1de5c231d934a681d0220b13148f6eb78b2 /discord/emoji.py
parentRedesign bulk delete events (diff)
downloaddiscord.py-1d701f32b611f421bdd404f2ef523b0c876af1ce.tar.xz
discord.py-1d701f32b611f421bdd404f2ef523b0c876af1ce.zip
Add fetch custom emoji, all custom emojis; Add user property to Emoji
Diffstat (limited to 'discord/emoji.py')
-rw-r--r--discord/emoji.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/discord/emoji.py b/discord/emoji.py
index 5a31f418..d0cd15d4 100644
--- a/discord/emoji.py
+++ b/discord/emoji.py
@@ -26,6 +26,7 @@ DEALINGS IN THE SOFTWARE.
from .asset import Asset
from . import utils
+from .user import User
class PartialEmoji:
"""Represents a "partial" emoji.
@@ -164,8 +165,11 @@ class Emoji:
If this emoji is managed by a Twitch integration.
guild_id: :class:`int`
The guild ID the emoji belongs to.
+ user: Optional[:class:`User`]
+ The user that created the emoji. This can only be retrieved using :meth:`Guild.fetch_emoji`.
"""
- __slots__ = ('require_colons', 'animated', 'managed', 'id', 'name', '_roles', 'guild_id', '_state')
+ __slots__ = ('require_colons', 'animated', 'managed', 'id', 'name', '_roles', 'guild_id',
+ '_state', 'user')
def __init__(self, *, guild, state, data):
self.guild_id = guild.id
@@ -179,6 +183,8 @@ class Emoji:
self.name = emoji['name']
self.animated = emoji.get('animated', False)
self._roles = utils.SnowflakeList(map(int, emoji.get('roles', [])))
+ user = emoji.get('user')
+ self.user = User(state=self._state, data=user) if user else None
def _iterator(self):
for attr in self.__slots__: