Skip to content

Commit

Permalink
Switch to using Discord's twemoji repo for emoji images (#1568)
Browse files Browse the repository at this point in the history
  • Loading branch information
FasterSpeeding authored Apr 1, 2023
1 parent 231432f commit 24a2824
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changes/1568.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switch to using <https://github.com/discord/twemoji> for emoji images.
4 changes: 2 additions & 2 deletions hikari/emojis.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from hikari import traits
from hikari import users

_TWEMOJI_PNG_BASE_URL: typing.Final[str] = "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/"
_TWEMOJI_PNG_BASE_URL: typing.Final[str] = "https://raw.githubusercontent.com/discord/twemoji/master/assets/72x72/"
_CUSTOM_EMOJI_REGEX: typing.Final[typing.Pattern[str]] = re.compile(r"<(?P<flags>[^:]*):(?P<name>[^:]*):(?P<id>\d+)>")


Expand Down Expand Up @@ -182,7 +182,7 @@ def url(self) -> str:
>>> emoji = hikari.UnicodeEmoji("\N{OK HAND SIGN}")
>>> emoji.url
'https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f44c.png'
'https://raw.githubusercontent.com/discord/twemoji/master/assets/72x72/1f44c.png'
"""
return _TWEMOJI_PNG_BASE_URL + self.filename

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/test_twemoji_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

from hikari import emojis

TWEMOJI_REPO_BASE_URL = "https://github.com/twitter/twemoji.git"
TWEMOJI_REPO_BASE_URL = "https://github.com/discord/twemoji.git"
DISCORD_EMOJI_MAPPING_URL = "https://emzi0767.gl-pages.emzi0767.dev/discord-emoji/discordEmojiMap-canary.min.json"

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/hikari/test_emojis.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_filename_property(self, codepoints, expected_filename):
assert emoji.filename == f"{expected_filename}.png"

def test_url_property(self, emoji):
assert emoji.url == "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f44c.png"
assert emoji.url == "https://raw.githubusercontent.com/discord/twemoji/master/assets/72x72/1f44c.png"

def test_unicode_escape_property(self, emoji):
assert emoji.unicode_escape == "\\U0001f44c"
Expand Down

0 comments on commit 24a2824

Please sign in to comment.