2828from typing import Any , Dict , List , Optional , TYPE_CHECKING , Union , overload
2929
3030from .asset import Asset
31- from .enums import ActivityType , try_enum
31+ from .enums import ActivityType , StatusDisplayType , try_enum
3232from .colour import Colour
3333from .partial_emoji import PartialEmoji
3434from .utils import _get_as_snowflake
@@ -180,8 +180,10 @@ class Activity(BaseActivity):
180180
181181 - ``large_image``: A string representing the ID for the large image asset.
182182 - ``large_text``: A string representing the text when hovering over the large image asset.
183+ - ``large_url``: A string representing the URL of the large image asset.
183184 - ``small_image``: A string representing the ID for the small image asset.
184185 - ``small_text``: A string representing the text when hovering over the small image asset.
186+ - ``small_url``: A string representing the URL of the small image asset.
185187
186188 party: :class:`dict`
187189 A dictionary representing the activity party. It contains the following optional keys:
@@ -195,6 +197,19 @@ class Activity(BaseActivity):
195197
196198 emoji: Optional[:class:`PartialEmoji`]
197199 The emoji that belongs to this activity.
200+ details_url: Optional[:class:`str`]
201+ A URL that is linked to when clicking on the details text of the activity.
202+
203+ ... versionadded:: 2.6
204+ state_url: Optional[:class:`str`]
205+ A URL that is linked to when clicking on the state text of the activity.
206+
207+ ... versionadded:: 2.6
208+ status_display_type: Optional[:class:`StatusDisplayType`]
209+ Determines which field from the user's status text is displayed
210+ in the members list.
211+
212+ .. versionadded:: 2.6
198213 """
199214
200215 __slots__ = (
@@ -213,6 +228,9 @@ class Activity(BaseActivity):
213228 'application_id' ,
214229 'emoji' ,
215230 'buttons' ,
231+ 'state_url' ,
232+ 'details_url' ,
233+ 'status_display_type' ,
216234 )
217235
218236 def __init__ (self , ** kwargs : Any ) -> None :
@@ -239,6 +257,16 @@ def __init__(self, **kwargs: Any) -> None:
239257 emoji = kwargs .pop ('emoji' , None )
240258 self .emoji : Optional [PartialEmoji ] = PartialEmoji .from_dict (emoji ) if emoji is not None else None
241259
260+ self .state_url : Optional [str ] = kwargs .pop ('state_url' )
261+ self .details_url : Optional [str ] = kwargs .pop ('details_url' )
262+
263+ status_display_type = kwargs .pop ('status_display_type' , None )
264+ self .status_display_type : Optional [StatusDisplayType ] = (
265+ status_display_type
266+ if isinstance (status_display_type , StatusDisplayType )
267+ else try_enum (StatusDisplayType , status_display_type )
268+ )
269+
242270 def __repr__ (self ) -> str :
243271 attrs = (
244272 ('type' , self .type ),
@@ -255,11 +283,15 @@ def __repr__(self) -> str:
255283
256284 def to_dict (self ) -> Dict [str , Any ]:
257285 ret : Dict [str , Any ] = {}
286+ enums = ('status_display_type' ,)
258287 for attr in self .__slots__ :
259288 value = getattr (self , attr , None )
260289 if value is None :
261290 continue
262291
292+ if attr in enums :
293+ value = int (value .value )
294+
263295 if isinstance (value , dict ) and len (value ) == 0 :
264296 continue
265297
0 commit comments