Skip to content

Commit 379170e

Browse files
committed
fix: Use warnings.deprecated instead of utils.deprecated
1 parent 5001ff6 commit 379170e

1 file changed

Lines changed: 12 additions & 20 deletions

File tree

discord/raw_models.py

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
from collections.abc import ItemsView, KeysView, ValuesView
3030
from typing import TYPE_CHECKING, Any
3131

32+
from typing_extensions import deprecated
33+
3234
from . import utils
3335
from .automod import AutoModAction, AutoModTriggerType
3436
from .enums import (
@@ -820,18 +822,14 @@ def __init__(self, data: MessagePollVoteEvent, added: bool) -> None:
820822
class _PayloadLike(_RawReprMixin):
821823
_raw_data: dict[str, Any]
822824

823-
@utils.deprecated(
824-
"the attributes",
825-
"2.7",
826-
"3.0",
825+
@deprecated(
826+
"The attributes are deprecated since version 2.7 and will be removed in version 3.0",
827827
)
828828
def __getitem__(self, key: str) -> Any:
829829
return self._raw_data[key]
830830

831-
@utils.deprecated(
832-
"the attributes",
833-
"2.7",
834-
"3.0",
831+
@deprecated(
832+
"The attributes are deprecated since version 2.7 and will be removed in version 3.0",
835833
)
836834
def get(self, key: str, default: Any = None) -> Any:
837835
"""Gets an item from this raw event, and returns its value or ``default``.
@@ -841,10 +839,8 @@ def get(self, key: str, default: Any = None) -> Any:
841839
"""
842840
return self._raw_data.get(key, default)
843841

844-
@utils.deprecated(
845-
"the attributes",
846-
"2.7",
847-
"3.0",
842+
@deprecated(
843+
"The attributes are deprecated since version 2.7 and will be removed in version 3.0",
848844
)
849845
def items(self) -> ItemsView:
850846
"""Returns the (key, value) pairs of this raw event.
@@ -854,10 +850,8 @@ def items(self) -> ItemsView:
854850
"""
855851
return self._raw_data.items()
856852

857-
@utils.deprecated(
858-
"the attributes",
859-
"2.7",
860-
"3.0",
853+
@deprecated(
854+
"The attributes are deprecated since version 2.7 and will be removed in version 3.0",
861855
)
862856
def values(self) -> ValuesView:
863857
"""Returns the values of this raw event.
@@ -867,10 +861,8 @@ def values(self) -> ValuesView:
867861
"""
868862
return self._raw_data.values()
869863

870-
@utils.deprecated(
871-
"the attributes",
872-
"2.7",
873-
"3.0",
864+
@deprecated(
865+
"The attributes are deprecated since version 2.7 and will be removed in version 3.0",
874866
)
875867
def keys(self) -> KeysView:
876868
"""Returns the keys of this raw event.

0 commit comments

Comments
 (0)