diff options
| author | Rapptz <[email protected]> | 2021-08-24 03:15:06 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-08-24 03:15:06 -0400 |
| commit | 565b41b0b2ae78bfce7e7a2301f65f9fabb76f95 (patch) | |
| tree | d9d2f452601673fdc68a5e4d569f75e2a05f0f32 | |
| parent | Allow enums to be compared (diff) | |
| download | discord.py-565b41b0b2ae78bfce7e7a2301f65f9fabb76f95.tar.xz discord.py-565b41b0b2ae78bfce7e7a2301f65f9fabb76f95.zip | |
Fix Embed.from_dict typing being too strict for a public function
The Embed TypedDict is not publicly accessible so would always lead
to type errors upon usage.
| -rw-r--r-- | discord/embeds.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/embeds.py b/discord/embeds.py index f57943f7..7033a10e 100644 --- a/discord/embeds.py +++ b/discord/embeds.py @@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations import datetime -from typing import Any, Dict, Final, List, Protocol, TYPE_CHECKING, Type, TypeVar, Union +from typing import Any, Dict, Final, List, Mapping, Protocol, TYPE_CHECKING, Type, TypeVar, Union from . import utils from .colour import Colour @@ -205,7 +205,7 @@ class Embed: self.timestamp = timestamp @classmethod - def from_dict(cls: Type[E], data: EmbedData) -> E: + def from_dict(cls: Type[E], data: Mapping[str, Any]) -> E: """Converts a :class:`dict` to a :class:`Embed` provided it is in the format that Discord expects it to be in. |