fix: updated api endpoint so its not going to a dead cdn

This commit is contained in:
Seaswimmer 2023-08-08 16:55:55 -04:00
parent 3e469a8054
commit 80a627de21
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -496,7 +496,7 @@ class Info(commands.Cog):
await ctx.send(embed=data) await ctx.send(embed=data)
async def fetch_twemoji_url(self, unicode_emoji): async def fetch_twemoji_url(self, unicode_emoji):
base_url = "https://twemoji.maxcdn.com/v/latest/72x72/" base_url = "https://cdn.jsdelivr.net/gh/jdecked/twemoji@latest/assets/72x72/"
emoji_codepoint = "-".join([hex(ord(char))[2:] for char in unicode_emoji]) emoji_codepoint = "-".join([hex(ord(char))[2:] for char in unicode_emoji])
emoji_url = f"{base_url}{emoji_codepoint}.png" emoji_url = f"{base_url}{emoji_codepoint}.png"
@ -516,7 +516,7 @@ class Info(commands.Cog):
if isinstance(icon, discord.Asset): if isinstance(icon, discord.Asset):
icon_url = icon.url icon_url = icon.url
elif isinstance(icon, str): elif isinstance(icon, str):
icon_url = await self.fetch_twemoji_url(unicode_emoji=ord(icon)) icon_url = await self.fetch_twemoji_url(unicode_emoji=icon)
permissions = role.permissions permissions = role.permissions
if role.color.value == 0: if role.color.value == 0:
colorint = 10070709 colorint = 10070709