Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using Discord's twemoji repo for emoji images #1568

Merged
merged 2 commits into from Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/1568.bugfix.md
@@ -0,0 +1 @@
Switch to using <https://github.com/discord/twemoji> for emoji images.
4 changes: 2 additions & 2 deletions hikari/emojis.py
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
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
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