Browse Source

improves string creation

pull/74/head
Sebastian Winkler 8 years ago
parent
commit
2e50bf9ace
No known key found for this signature in database GPG Key ID: 6E5F12DD21107C1D
  1. 8
      disco/types/guild.py

8
disco/types/guild.py

@ -66,9 +66,7 @@ class GuildEmoji(Emoji):
animated = Field(bool)
def __str__(self):
if self.animated:
return u'<a:{}:{}>'.format(self.name, self.id)
return u'<:{}:{}>'.format(self.name, self.id)
return u'<{}:{}:{}>'.format('a' if self.animated else '', self.name, self.id)
def update(self, **kwargs):
return self.client.api.guilds_emojis_modify(self.guild_id, self.id, **kwargs)
@ -78,9 +76,7 @@ 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)
return 'https://discordapp.com/api/emojis/{}.{}'.format(self.id, 'gif' if self.animated else 'png')
@cached_property
def guild(self):

Loading…
Cancel
Save