diff options
| author | Rapptz <[email protected]> | 2021-07-03 11:52:38 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-07-03 11:52:38 -0400 |
| commit | 93cc1bdd79683330805308d9524e20e68302a7e9 (patch) | |
| tree | 6aed80b1497d70a99a16bca49619770a76c156ba /discord | |
| parent | Document TextChannel.start_thread return type (diff) | |
| download | discord.py-93cc1bdd79683330805308d9524e20e68302a7e9.tar.xz discord.py-93cc1bdd79683330805308d9524e20e68302a7e9.zip | |
Fix typing errors in PartialEmoji
Diffstat (limited to 'discord')
| -rw-r--r-- | discord/partial_emoji.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/discord/partial_emoji.py b/discord/partial_emoji.py index 52fca121..e2c689e2 100644 --- a/discord/partial_emoji.py +++ b/discord/partial_emoji.py @@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations -from typing import Any, Dict, Optional, TYPE_CHECKING, Type, TypeVar +from typing import Any, Dict, Optional, TYPE_CHECKING, Type, TypeVar, Union import re from .asset import Asset, AssetMixin @@ -104,11 +104,11 @@ class PartialEmoji(_EmojiTag, AssetMixin): self._state: Optional[ConnectionState] = None @classmethod - def from_dict(cls: Type[PE], data: Dict[str, Any]) -> PE: + def from_dict(cls: Type[PE], data: Union[PartialEmojiPayload, Dict[str, Any]]) -> PE: return cls( animated=data.get('animated', False), id=utils._get_as_snowflake(data, 'id'), - name=data.get('name', ''), + name=data.get('name') or '', ) @classmethod |