Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

fix: handle regional indicator emoji #702

Merged
merged 1 commit into from
Oct 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions naff/models/discord/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ def from_str(cls, emoji_str: str, *, language: str = "alias") -> Optional["Parti
_emoji_list = emoji.distinct_emoji_list(emoji_str)
if _emoji_list:
return cls(name=_emoji_list[0])
if len(emoji_str) == 1:
# likely a regional indicator
return cls(name=emoji_str)
return None

def __str__(self) -> str:
Expand Down