-
-
Notifications
You must be signed in to change notification settings - Fork 477
feat: Added support for emoji aliases like :smile:
in PartialEmoji.from_str (redo)
#2815
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
base: master
Are you sure you want to change the base?
Changes from all commits
fa24b73
e69a7bd
ee29419
80a7ade
ce07e86
3143637
293c5ed
b5379da
1d7c2a6
8c47596
cbf51fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
import collections.abc | ||
import datetime | ||
import functools | ||
import importlib.resources | ||
import itertools | ||
import json | ||
import re | ||
|
@@ -97,10 +98,21 @@ | |
"generate_snowflake", | ||
"basic_autocomplete", | ||
"filter_params", | ||
"EMOJIS_MAP", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we consider documenting these as public utils ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dont see why it would not be a good idea There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because we would then have to maintain that and also would not be able to remove them without it being breaking. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Then let's not put it public ;) |
||
"UNICODE_EMOJIS", | ||
) | ||
|
||
DISCORD_EPOCH = 1420070400000 | ||
|
||
with ( | ||
importlib.resources.files(__package__) | ||
.joinpath("emojis.json") | ||
.open(encoding="utf-8") as f | ||
): | ||
EMOJIS_MAP = json.load(f) | ||
|
||
UNICODE_EMOJIS = set(EMOJIS_MAP.values()) | ||
|
||
|
||
class _MissingSentinel: | ||
def __eq__(self, other) -> bool: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to mention it was also added to
PartialEmojiConverter
or add a second line or smth.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll do that soon