Skip to content

Commit 565b41b

Browse files
committed
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.
1 parent 835432d commit 565b41b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discord/embeds.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from __future__ import annotations
2626

2727
import datetime
28-
from typing import Any, Dict, Final, List, Protocol, TYPE_CHECKING, Type, TypeVar, Union
28+
from typing import Any, Dict, Final, List, Mapping, Protocol, TYPE_CHECKING, Type, TypeVar, Union
2929

3030
from . import utils
3131
from .colour import Colour
@@ -205,7 +205,7 @@ def __init__(
205205
self.timestamp = timestamp
206206

207207
@classmethod
208-
def from_dict(cls: Type[E], data: EmbedData) -> E:
208+
def from_dict(cls: Type[E], data: Mapping[str, Any]) -> E:
209209
"""Converts a :class:`dict` to a :class:`Embed` provided it is in the
210210
format that Discord expects it to be in.
211211

0 commit comments

Comments
 (0)