Skip to content

Commit f073663

Browse files
committed
Merge branch 'channel' of https://github.com/Lumabots/pycord into channel
2 parents 7970680 + 6c8b79e commit f073663

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ These changes are available on the `master` branch, but have not yet been releas
5656
- Added the ability to pass a `datetime.time` object to `format_dt`.
5757
([#2747](https://github.com/Pycord-Development/pycord/pull/2747))
5858
- Added various missing channel parameters and allow `default_reaction_emoji` to be
59-
`None`. ([#2772])(https://github.com/Pycord-Development/pycord/pull/2772)
59+
`None`. ([#2772](https://github.com/Pycord-Development/pycord/pull/2772))
6060
- Added `discord.Interaction.created_at`.
6161
([#2801](https://github.com/Pycord-Development/pycord/pull/2801))
6262

@@ -108,15 +108,13 @@ These changes are available on the `master` branch, but have not yet been releas
108108
- Fixed `ForumChannel.edit` allowing `default_reaction_emoji` to be `None`.
109109
([#2739](https://github.com/Pycord-Development/pycord/pull/2739))
110110
- Fixed missing `None` type hints in `Select.__init__`.
111-
([#2746])(https://github.com/Pycord-Development/pycord/pull/2746)
111+
([#2746](https://github.com/Pycord-Development/pycord/pull/2746))
112112
- Fixed `TypeError` when using `Flag` with Python 3.11+.
113113
([#2759](https://github.com/Pycord-Development/pycord/pull/2759))
114114
- Fixed `TypeError` when specifying `thread_name` in `Webhook.send`.
115115
([#2761](https://github.com/Pycord-Development/pycord/pull/2761))
116116
- Updated `valid_locales` to support `in` and `es-419`.
117117
([#2767](https://github.com/Pycord-Development/pycord/pull/2767))
118-
- Fixed support emoji aliases like `:smile:` in PartialEmoji.from_str.
119-
([#2774](https://github.com/Pycord-Development/pycord/pull/2774))
120118
- Fixed `Webhook.edit` not working with `attachments=[]`.
121119
([#2779](https://github.com/Pycord-Development/pycord/pull/2779))
122120
- Fixed GIF-based `Sticker` returning the wrong `url`.

discord/emojis.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

discord/partial_emoji.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,13 @@
2525

2626
from __future__ import annotations
2727

28-
import importlib.resources
29-
import json
3028
import re
3129
from typing import TYPE_CHECKING, Any, TypedDict, TypeVar
3230

3331
from . import utils
3432
from .asset import Asset, AssetMixin
3533
from .errors import InvalidArgument
3634

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-
4435
__all__ = ("PartialEmoji",)
4536

4637
if TYPE_CHECKING:
@@ -136,7 +127,7 @@ def from_str(cls: type[PE], value: str) -> PE:
136127
- ``name:id``
137128
- ``<:name:id>``
138129
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.
140131
141132
.. versionadded:: 2.0
142133
@@ -150,12 +141,6 @@ def from_str(cls: type[PE], value: str) -> PE:
150141
:class:`PartialEmoji`
151142
The partial emoji from this string.
152143
"""
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-
159144
match = cls._CUSTOM_EMOJI_RE.match(value)
160145
if match is not None:
161146
groups = match.groupdict()

0 commit comments

Comments
 (0)