Skip to content

Commit

Permalink
Fix Embed.from_dict typing being too strict for a public function
Browse files Browse the repository at this point in the history
The Embed TypedDict is not publicly accessible so would always lead
to type errors upon usage.
  • Loading branch information
Rapptz committed Aug 24, 2021
1 parent 835432d commit 565b41b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/embeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
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
Expand Down Expand Up @@ -205,7 +205,7 @@ def __init__(
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.
Expand Down

0 comments on commit 565b41b

Please sign in to comment.