Sebastian Winkler
8 years ago
No known key found for this signature in database
GPG Key ID: 6E5F12DD21107C1D
2 changed files with
10 additions and
0 deletions
-
disco/types/guild.py
-
disco/types/message.py
|
|
@ -54,6 +54,8 @@ class GuildEmoji(Emoji): |
|
|
|
Whether this emoji is managed by an integration. |
|
|
|
roles : list(snowflake) |
|
|
|
Roles this emoji is attached to. |
|
|
|
animated : bool |
|
|
|
Whether this emoji is animated. |
|
|
|
""" |
|
|
|
id = Field(snowflake) |
|
|
|
guild_id = Field(snowflake) |
|
|
@ -61,8 +63,11 @@ class GuildEmoji(Emoji): |
|
|
|
require_colons = Field(bool) |
|
|
|
managed = Field(bool) |
|
|
|
roles = ListField(snowflake) |
|
|
|
animated = Field(bool) |
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
if self.animated: |
|
|
|
return u'<a:{}:{}>'.format(self.name, self.id) |
|
|
|
return u'<:{}:{}>'.format(self.name, self.id) |
|
|
|
|
|
|
|
def update(self, **kwargs): |
|
|
@ -73,6 +78,8 @@ class GuildEmoji(Emoji): |
|
|
|
|
|
|
|
@property |
|
|
|
def url(self): |
|
|
|
if self.animated: |
|
|
|
return 'https://discordapp.com/api/emojis/{}.gif'.format(self.id) |
|
|
|
return 'https://discordapp.com/api/emojis/{}.png'.format(self.id) |
|
|
|
|
|
|
|
@cached_property |
|
|
|
|
|
@ -37,9 +37,12 @@ class Emoji(SlottedModel): |
|
|
|
The emoji ID (will be none if this is not a custom emoji). |
|
|
|
name : str |
|
|
|
The name of this emoji. |
|
|
|
animated : bool |
|
|
|
Whether this emoji is animated. |
|
|
|
""" |
|
|
|
id = Field(snowflake) |
|
|
|
name = Field(text) |
|
|
|
animated = Field(bool) |
|
|
|
|
|
|
|
@cached_property |
|
|
|
def custom(self): |
|
|
|