2929from collections .abc import ItemsView , KeysView , ValuesView
3030from typing import TYPE_CHECKING , Any
3131
32+ from typing_extensions import deprecated
33+
3234from . import utils
3335from .automod import AutoModAction , AutoModTriggerType
3436from .enums import (
@@ -820,18 +822,14 @@ def __init__(self, data: MessagePollVoteEvent, added: bool) -> None:
820822class _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