mirror of
https://github.com/brandons209/Red-bot-Cogs.git
synced 2024-05-16 10:23:57 +12:00
better emoji parsing
This commit is contained in:
parent
4a071702d1
commit
6bf6645fca
|
@ -41,7 +41,7 @@ class EveryoneEmoji(commands.Cog):
|
|||
await ctx.message.delete()
|
||||
except:
|
||||
pass
|
||||
if emoji[0] == "<":
|
||||
if (emoji[0:2] == "<:" or emoji[0:2] == "<a") and emoji[-1] == ">":
|
||||
# custom Emoji
|
||||
name = emoji.split(":")[1]
|
||||
emoji_name = emoji.split(":")[2][:-1]
|
||||
|
@ -52,6 +52,7 @@ class EveryoneEmoji(commands.Cog):
|
|||
else:
|
||||
url = "https://cdn.discordapp.com/emojis/" + emoji_name + ".png"
|
||||
name += ".png"
|
||||
|
||||
elif emoji[0] == ":" and emoji[-1] == ":":
|
||||
name = emoji.strip(":")
|
||||
emoji = discord.utils.get(ctx.guild.emojis, name=name)
|
||||
|
@ -64,6 +65,7 @@ class EveryoneEmoji(commands.Cog):
|
|||
name += ".png"
|
||||
else:
|
||||
url = None
|
||||
|
||||
elif emoji.isnumeric():
|
||||
name = ("none.gif", "none.png")
|
||||
# could be animated or regular, check both
|
||||
|
|
Loading…
Reference in a new issue