Skip to content

Commit

Permalink
Update bigmoji to display animated emojis
Browse files Browse the repository at this point in the history
  • Loading branch information
aikaterna committed Dec 27, 2017
1 parent a48a926 commit 09187bc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions bigmoji/bigmoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ async def bigmoji(self, ctx, emoji):
if emoji[0] == '<':
convert = False
name = emoji.split(':')[1]
emoji = emoji.split(':')[2][:-1]
url = 'https://cdn.discordapp.com/emojis/' + emoji + '.png'
emoji_name = emoji.split(':')[2][:-1]
anim = emoji.split(':')[0]
if anim == '<a':
url = 'https://cdn.discordapp.com/emojis/' + emoji_name + '.gif'
else:
url = 'https://cdn.discordapp.com/emojis/' + emoji_name + '.png'
else:
chars = []
name = []
Expand Down Expand Up @@ -69,7 +73,10 @@ async def bigmoji(self, ctx, emoji):
await self.bot.say("Image creation timed out.")
return

await self.bot.send_file(channel, img, filename=name + '.png')
if emoji.split(':')[0] == '<a':
await self.bot.send_file(channel, img, filename=name + '.gif')
else:
await self.bot.send_file(channel, img, filename=name + '.png')

@staticmethod
def generate(img, convert, **kwargs):
Expand Down

0 comments on commit 09187bc

Please sign in to comment.