25
25
26
26
from __future__ import annotations
27
27
28
- import importlib .resources
29
- import json
30
28
import re
31
29
from typing import TYPE_CHECKING , Any , TypedDict , TypeVar
32
30
33
31
from . import utils
34
32
from .asset import Asset , AssetMixin
35
33
from .errors import InvalidArgument
36
34
37
- with (
38
- importlib .resources .files (__package__ )
39
- .joinpath ("emojis.json" )
40
- .open (encoding = "utf-8" ) as f
41
- ):
42
- EMOJIS_MAP = json .load (f )
43
-
44
35
__all__ = ("PartialEmoji" ,)
45
36
46
37
if TYPE_CHECKING :
@@ -136,7 +127,7 @@ def from_str(cls: type[PE], value: str) -> PE:
136
127
- ``name:id``
137
128
- ``<:name:id>``
138
129
139
- If the format does not match then it is assumed to be a unicode emoji, either as Unicode characters or as a Discord alias (``:smile:``) .
130
+ If the format does not match then it is assumed to be a unicode emoji.
140
131
141
132
.. versionadded:: 2.0
142
133
@@ -150,12 +141,6 @@ def from_str(cls: type[PE], value: str) -> PE:
150
141
:class:`PartialEmoji`
151
142
The partial emoji from this string.
152
143
"""
153
- if value .startswith (":" ) and value .endswith (":" ):
154
- name = value [1 :- 1 ]
155
- unicode_emoji = EMOJIS_MAP .get (name )
156
- if unicode_emoji :
157
- return cls (name = unicode_emoji , id = None , animated = False )
158
-
159
144
match = cls ._CUSTOM_EMOJI_RE .match (value )
160
145
if match is not None :
161
146
groups = match .groupdict ()
0 commit comments