mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-23 11:26:51 +00:00
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.
This commit is contained in:
parent
835432d161
commit
565b41b0b2
@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import datetime
|
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 . import utils
|
||||||
from .colour import Colour
|
from .colour import Colour
|
||||||
@ -205,7 +205,7 @@ class Embed:
|
|||||||
self.timestamp = timestamp
|
self.timestamp = timestamp
|
||||||
|
|
||||||
@classmethod
|
@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
|
"""Converts a :class:`dict` to a :class:`Embed` provided it is in the
|
||||||
format that Discord expects it to be in.
|
format that Discord expects it to be in.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user