
    cjh>h                    ^   d Z ddlmZ ddlZddlmZmZmZmZ ddl	m
Z
 ddlmZ ddlmZmZ dd	lmZ dd
lmZ dZ	 erddlmZ ddlmZmZmZ  G d d      Z G d de      Z G d de      Z G d de      Z G d d      Z G d de      Zeeeeeef   Z edd       Z!edd       Z!ddZ!y) ae  
The MIT License (MIT)

Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Pycord Development

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
    )annotationsN)TYPE_CHECKINGAnyUnionoverload   )AssetColour)ActivityTypetry_enum)PartialEmoji)_get_as_snowflake)BaseActivityActivity	StreamingGameSpotifyCustomActivity)r   )ActivityAssetsActivityPartyActivityTimestampsc                  4    e Zd ZdZdZd Zedd       ZddZy)	r   a  The base activity that all user-settable activities inherit from.
    A user-settable activity is one that can be used in :meth:`Client.change_presence`.

    The following types currently count as user-settable:

    - :class:`Activity`
    - :class:`Game`
    - :class:`Streaming`
    - :class:`CustomActivity`

    Note that although these types are considered user-settable by the library,
    Discord typically ignores certain combinations of activity depending on
    what is currently set. This behaviour may change in the future so there are
    no guarantees on whether Discord will actually let you set these types.

    .. versionadded:: 1.3
    )_created_atc                2    |j                  dd       | _        y )N
created_at)popr   )selfkwargss     C/var/www/html/venv/lib/python3.12/site-packages/discord/activity.py__init__zBaseActivity.__init__z   s    )/L$)G    c                    | j                   Ft        j                  j                  | j                   dz  t        j                  j                        S y)zYWhen the user started doing this activity in UTC.

        .. versionadded:: 1.3
        N  tzr   datetimefromtimestamptimezoneutcr   s    r    r   zBaseActivity.created_at}   O     '$$22  4'H,=,=,A,A 3   (r"   c                    t         N)NotImplementedErrorr,   s    r    to_dictzBaseActivity.to_dict   s    !!r"   Nreturnzdatetime.datetime | None)r3   ActivityPayload)	__name__
__module____qualname____doc__	__slots__r!   propertyr   r1    r"   r    r   r   e   s-    $ !IH  "r"   r   c                       e Zd ZdZdZ fdZddZddZedd       Z	edd       Z
edd       Zedd	       Zedd
       Zedd       Z xZS )r   a
  Represents an activity in Discord.

    This could be an activity such as streaming, playing, listening
    or watching.

    For memory optimisation purposes, some activities are offered in slimmed
    down versions:

    - :class:`Game`
    - :class:`Streaming`

    Attributes
    ----------
    application_id: Optional[:class:`int`]
        The application ID of the game.
    name: Optional[:class:`str`]
        The name of the activity.
    url: Optional[:class:`str`]
        A stream URL that the activity could be doing.
    type: :class:`ActivityType`
        The type of activity currently being done.
    state: Optional[:class:`str`]
        The user's current party status or text used for a custom status.
    details: Optional[:class:`str`]
        The detail of the user's current activity.
    timestamps: Dict[:class:`str`, :class:`int`]
        A dictionary of timestamps. It contains the following optional keys:

        - ``start``: Corresponds to when the user started doing the
          activity in milliseconds since Unix epoch.
        - ``end``: Corresponds to when the user will finish doing the
          activity in milliseconds since Unix epoch.

    assets: Dict[:class:`str`, :class:`str`]
        A dictionary representing the images and their hover text of an activity.
        It contains the following optional keys:

        - ``large_image``: A string representing the ID for the large image asset.
        - ``large_text``: A string representing the text when hovering over the large image asset.
        - ``small_image``: A string representing the ID for the small image asset.
        - ``small_text``: A string representing the text when hovering over the small image asset.

    party: Dict[:class:`str`, Union[:class:`str`, List[:class:`int`]]]
        A dictionary representing the activity party. It contains the following optional keys:

        - ``id``: A string representing the party ID.
        - ``size``: A list of up to two integer elements denoting (current_size, maximum_size).
    buttons: Union[List[Dict[:class:`str`, :class:`str`]], List[:class:`str`]]
        A list of dictionaries representing custom buttons shown in a rich presence.
        Each dictionary contains the following keys:

        - ``label``: A string representing the text shown on the button.
        - ``url``: A string representing the URL opened upon clicking the button.

        .. note::

            Bots cannot access a user's activity button URLs. Therefore, the type of this attribute
            will be List[:class:`str`] when received through the gateway.

        .. versionadded:: 2.0

    emoji: Optional[:class:`PartialEmoji`]
        The emoji that belongs to this activity.
    )statedetailsr   
timestampsassetspartyflagssync_id
session_idtypenameurlapplication_idemojibuttonsc                \   t        |   di | |j                  dd       | _        |j                  dd       | _        |j                  di       | _        |j                  di       | _        |j                  di       | _        t        |d      | _	        |j                  dd       | _
        |j                  dd	      | _        |j                  d
d       | _        |j                  dd       | _        |j                  dg       | _        |j                  dd      }t        |t               r|nt#        t         |      | _        |j                  d| j$                  t         j&                  k(  rdnd       | _        |j                  dd       }|t+        j,                  |      | _        y d | _        y )Nr=   r>   r?   r@   rA   rH   rG   rB   r   rC   rD   rJ   rE   rF   Custom StatusrI   r;   )superr!   r   r=   r>   r?   r@   rA   r   rH   rG   rB   rC   rD   rJ   
isinstancer   r   rE   customrF   r   	from_dictrI   )r   r   activity_typerI   	__class__s       r    r!   zActivity.__init__   si   "6"!'GT!:
#)::i#>.4jjr.J&,jj2&>$*JJw$;
*;FDT*U%zz%6 **Wa0
#)::i#>&,jjt&D"(**Y";

62. -6 ,6 		
 !'

tyyL4G4G'GOT!
	 

7D)-2->L""5) 	
DH 	
r"   c           	        d| j                   fd| j                  fd| j                  fd| j                  fd| j                  fd| j
                  fd| j                  fd| j                  ff}d	j                  d
 |D              }d| dS )NrE   rF   r=   rG   r>   rH   rD   rI    c              3  &   K   | ]	  }d |z    yw)z%s=%rNr;   ).0ts     r    	<genexpr>z$Activity.__repr__.<locals>.<genexpr>  s     414s   z
<Activity >)	rE   rF   r=   rG   r>   rH   rD   rI   join)r   attrsinners      r    __repr__zActivity.__repr__   s    TYYTYYdjj!DHH%t2234??+djj!	
 4e44E7!$$r"   c                   i }| j                   D ]6  }t        | |d       }|t        |t              rt	        |      dk(  r2|||<   8 t        | j                        |d<   | j                  r| j                  j                         |d<   |S )Nr   rE   rI   )	r9   getattrrO   dictlenintrE   rI   r1   )r   retattrvalues       r    r1   zActivity.to_dict  s     NN 	DD$-E}%&3u:?CI	 $))nF::::--/CL
r"   c                    	 | j                   d   dz  }t        j                  j                  |t        j                  j                        S # t
        $ r Y yw xY w)z@When the user started doing this activity in UTC, if applicable.startr$   r%   Nr?   r(   r)   r*   r+   KeyErrorr   	timestamps     r    rh   zActivity.start  sY    	X047I $$229ARARAVAV2WW  		   A 	AAc                    	 | j                   d   dz  }t        j                  j                  |t        j                  j                        S # t
        $ r Y yw xY w)zBWhen the user will stop doing this activity in UTC, if applicable.endr$   r%   Nri   rk   s     r    ro   zActivity.end%  sY    	X.5I $$229ARARAVAV2WW  		rm   c                    | j                   y	 | j                  d   }t        j                   d| j                    d| dS # t        $ r Y yw xY w)zOReturns a URL pointing to the large image asset of this activity if applicable.Nlarge_image/app-assets//.pngrH   r@   r	   BASErj   )r   rq   s     r    large_image_urlzActivity.large_image_url/  b     &	V++m4K jj\d.A.A-B!K=PTUU  		   A 	AAc                    | j                   y	 | j                  d   }t        j                   d| j                    d| dS # t        $ r Y yw xY w)zOReturns a URL pointing to the small image asset of this activity if applicable.Nsmall_imagerr   rs   rt   ru   )r   r{   s     r    small_image_urlzActivity.small_image_url<  rx   ry   c                :    | j                   j                  dd      S )zHReturns the large image asset hover text of this activity if applicable.
large_textNr@   getr,   s    r    large_image_textzActivity.large_image_textI       {{|T22r"   c                :    | j                   j                  dd      S )zHReturns the small image asset hover text of this activity if applicable.
small_textNr   r,   s    r    small_image_textzActivity.small_image_textN  r   r"   r3   strr3   zdict[str, Any]r2   r3   
str | None)r5   r6   r7   r8   r9   r!   r^   r1   r:   rh   ro   rw   r|   r   r   __classcell__rS   s   @r    r   r      s    ?BI$
:%  X X X X 
V 
V 
V 
V 3 3 3 3r"   r   c                       e Zd ZdZdZd fdZedd       Zedd       Zedd       Z	ddZ
ddZdd	Zdd
ZddZ xZS )r   a  A slimmed down version of :class:`Activity` that represents a Discord game.

    This is typically displayed via **Playing** on the official Discord client.

    .. container:: operations

        .. describe:: x == y

            Checks if two games are equal.

        .. describe:: x != y

            Checks if two games are not equal.

        .. describe:: hash(x)

            Returns the game's hash.

        .. describe:: str(x)

            Returns the game's name.

    Parameters
    ----------
    name: :class:`str`
        The game's name.

    Attributes
    ----------
    name: :class:`str`
        The game's name.
    )rF   _end_startc                    t        |   di | || _        	 |d   }|j                  dd      | _        |j                  dd      | _        y # t        $ r d| _        d| _        Y y w xY w)Nr?   rh   r   ro   r;   )rN   r!   rF   r   r   r   rj   )r   rF   extrar?   rS   s       r    r!   zGame.__init__x  sn    !5!		1-2<-@J
 %..!4DK"ua0DI  	DKDI	s   A A'&A'c                "    t         j                  S )zReturns the game's type. This is for compatibility with :class:`Activity`.

        It always returns :attr:`ActivityType.playing`.
        )r   playingr,   s    r    rE   z	Game.type  s     ###r"   c                    | j                   rFt        j                  j                  | j                   dz  t        j                  j                        S y)z>When the user started playing this game in UTC, if applicable.r$   r%   N)r   r(   r)   r*   r+   r,   s    r    rh   z
Game.start  sH     ;;$$22d"x'8'8'<'< 3   r"   c                    | j                   rFt        j                  j                  | j                   dz  t        j                  j                        S y)z@When the user will stop playing this game in UTC, if applicable.r$   r%   N)r   r(   r)   r*   r+   r,   s    r    ro   zGame.end  sH     99$$22		D X%6%6%:%: 3   r"   c                ,    t        | j                        S r/   r   rF   r,   s    r    __str__zGame.__str__      499~r"   c                "    d| j                   dS )Nz<Game name=rZ   rF   r,   s    r    r^   zGame.__repr__  s    TYYM++r"   c                    i }| j                   r| j                   |d<   | j                  r| j                  |d<   t        j                  j                  t        | j                        |dS )Nrh   ro   )rE   rF   r?   )r   r   r   r   rf   r   rF   )r   r?   s     r    r1   zGame.to_dict  sZ    %'
;;"&++Jw99 $		Ju !((..		N$
 	
r"   c                X    t        |t              xr |j                  | j                  k(  S r/   )rO   r   rF   r   others     r    __eq__zGame.__eq__  s!    %&B5::+BBr"   c                ,    t        | j                        S r/   hashrF   r,   s    r    __hash__zGame.__hash__      DIIr"   )rF   r   r3   r   r2   r   r   r   r   r3   boolr3   rc   )r5   r6   r7   r8   r9   r!   r:   rE   rh   ro   r   r^   r1   r   r   r   r   s   @r    r   r   T  sk    B +I1 $ $    ,
Cr"   r   c                  t     e Zd ZdZdZd fdZedd       ZddZddZ	edd       Z
ddZdd	Zdd
Z xZS )r   a2  A slimmed down version of :class:`Activity` that represents a Discord streaming status.

    This is typically displayed via **Streaming** on the official Discord client.

    .. container:: operations

        .. describe:: x == y

            Checks if two streams are equal.

        .. describe:: x != y

            Checks if two streams are not equal.

        .. describe:: hash(x)

            Returns the stream's hash.

        .. describe:: str(x)

            Returns the stream's name.

    Attributes
    ----------
    platform: Optional[:class:`str`]
        Where the user is streaming from (ie. YouTube, Twitch).

        .. versionadded:: 1.3

    name: Optional[:class:`str`]
        The stream's name.
    details: Optional[:class:`str`]
        An alias for :attr:`name`
    game: Optional[:class:`str`]
        The game being streamed.

        .. versionadded:: 1.3

    url: :class:`str`
        The stream's URL.
    assets: Dict[:class:`str`, :class:`str`]
        A dictionary comprised of similar keys than those in :attr:`Activity.assets`.
    )platformrF   gamerG   r>   r@   c                  t        |   di | || _        |j                  d|      | _        |j                  dd       | _        || _        |j                  d| j                        | _        |j                  di       | _        y )Nr>   r=   r@   r;   )	rN   r!   r   r   rF   r   rG   r>   r@   )r   rF   rG   r   rS   s       r    r!   zStreaming.__init__  sm    !5!$( %		)T :	 %		'4 8	#(99Y		#B&+ii"&=r"   c                "    t         j                  S )zReturns the game's type. This is for compatibility with :class:`Activity`.

        It always returns :attr:`ActivityType.streaming`.
        )r   	streamingr,   s    r    rE   zStreaming.type       %%%r"   c                ,    t        | j                        S r/   r   r,   s    r    r   zStreaming.__str__  r   r"   c                "    d| j                   dS )Nz<Streaming name=rZ   r   r,   s    r    r^   zStreaming.__repr__  s    !$))a00r"   c                ^    	 | j                   d   }|dd dk(  r|dd S dS # t        $ r Y yw xY w)zIf provided, the twitch name of the user streaming.

        This corresponds to the ``large_image`` key of the :attr:`Streaming.assets`
        dictionary if it starts with ``twitch:``. Typically this is set by the Discord client.
        rq   N   ztwitch:)r@   rj   )r   rF   s     r    twitch_namezStreaming.twitch_name   sI    	?;;}-D  $BQx9448>$>  		s     	,,c                    t         j                  j                  t        | j                        t        | j
                        | j                  d}| j                  r| j                  |d<   |S )N)rE   rF   rG   r@   r>   )r   r   rf   r   rF   rG   r@   r>   )r   rd   s     r    r1   zStreaming.to_dict  sP     **00		Ntxx=kk	
 <<!\\C	N
r"   c                    t        |t              xr4 |j                  | j                  k(  xr |j                  | j                  k(  S r/   )rO   r   rF   rG   r   s     r    r   zStreaming.__eq__  s;    ui( &

dii'&		TXX%	
r"   c                ,    t        | j                        S r/   r   r,   s    r    r   zStreaming.__hash__!  r   r"   )rF   r   rG   r   r   r   r   r   r   r   r   r   )r5   r6   r7   r8   r9   r!   r:   rE   r   r^   r   r1   r   r   r   r   s   @r    r   r     sW    *X II> & &1 ? ?	
r"   r   c                  b   e Zd ZdZdZd Zedd       Zedd       Zedd       Z	edd       Z
ddZedd	       Zdd
Zd dZddZddZedd       Zed!d       Zedd       Zedd       Zedd       Zedd       Zedd       Zed"d       Zed"d       Zed#d       Zedd       Zy)$r   a  Represents a Spotify listening activity from Discord. This is a special case of
    :class:`Activity` that makes it easier to work with the Spotify integration.

    .. container:: operations

        .. describe:: x == y

            Checks if two activities are equal.

        .. describe:: x != y

            Checks if two activities are not equal.

        .. describe:: hash(x)

            Returns the activity's hash.

        .. describe:: str(x)

            Returns the string 'Spotify'.
    )_state_details_timestamps_assets_party_sync_id_session_idr   c                p   |j                  dd      | _        |j                  dd      | _        |j                  di       | _        |j                  di       | _        |j                  di       | _        |j                  d      | _        |j                  d      | _        |j                  d	d       | _        y )
Nr=    r>   r?   r@   rA   rC   rD   r   )	r   r   r   r   r   r   r   r   r   )r   datas     r    r!   zSpotify.__init__G  s    88GR0!XXi4+/88L"+E'+xx"'=%)XXgr%:!XXi0 $ 6)-,)Er"   c                "    t         j                  S )zReturns the activity's type. This is for compatibility with :class:`Activity`.

        It always returns :attr:`ActivityType.listening`.
        )r   	listeningr,   s    r    rE   zSpotify.typeQ  r   r"   c                    | j                   Ft        j                  j                  | j                   dz  t        j                  j                        S y)zOWhen the user started listening in UTC.

        .. versionadded:: 1.3
        Nr$   r%   r'   r,   s    r    r   zSpotify.created_atY  r-   r"   c                    t        d      S )z~Returns the Spotify integration colour, as a :class:`Colour`.

        There is an alias for this named :attr:`color`
        iT r
   r,   s    r    colourzSpotify.colourd  s     hr"   c                    | j                   S )zReturns the Spotify integration colour, as a :class:`Colour`.

        There is an alias for this named :attr:`colour`
        )r   r,   s    r    colorzSpotify.colorl  s     {{r"   c           
         dd| j                   | j                  | j                  | j                  | j                  | j
                  | j                  d	S )N0   r   )	rB   rF   r@   rA   rC   rD   r?   r>   r=   )r   r   r   r   r   r   r   r,   s    r    r1   zSpotify.to_dictt  sG    ll[[}}****}}[[

 
	
r"   c                     y)z7The activity's name. This will always return "Spotify".r   r;   r,   s    r    rF   zSpotify.name  s     r"   c                    t        |t              xrO |j                  | j                  k(  xr4 |j                  | j                  k(  xr |j                  | j                  k(  S r/   )rO   r   r   r   rh   r   s     r    r   zSpotify.__eq__  sV    ug& *!!T%5%55*$--/* tzz)		
r"   c                ,    t        | j                        S r/   )r   r   r,   s    r    r   zSpotify.__hash__  s    D$$%%r"   c                     y)Nr   r;   r,   s    r    r   zSpotify.__str__  s    r"   c                V    d| j                   d| j                  d| j                  dS )Nz<Spotify title=z artist=z
 track_id=rZ   )titleartisttrack_idr,   s    r    r^   zSpotify.__repr__  s3    jj^8DKK?*T]]DUUVX	
r"   c                    | j                   S )z#The title of the song being played.)r   r,   s    r    r   zSpotify.title       }}r"   c                8    | j                   j                  d      S )z%The artists of the song being played.z; )r   splitr,   s    r    artistszSpotify.artists  s     {{  &&r"   c                    | j                   S )zThe artist of the song being played.

        This does not attempt to split the artist information into
        multiple artists. Useful if there's only a single artist.
        )r   r,   s    r    r   zSpotify.artist  s     {{r"   c                :    | j                   j                  dd      S )z0The album that the song being played belongs to.r~   r   r   r   r,   s    r    albumzSpotify.album  s     ||b11r"   c                `    | j                   j                  dd      }|dd dk7  ry|dd }d| S )z-The album cover image URL from Spotify's CDN.rq   r   N   zspotify:zhttps://i.scdn.co/image/r   )r   rq   album_image_ids      r    album_cover_urlzSpotify.album_cover_url  sD     ll&&}b9r?j($QR).)9::r"   c                    | j                   S )z3The track ID used by Spotify to identify this song.)r   r,   s    r    r   zSpotify.track_id  r   r"   c                     d| j                    S )zKThe track URL to listen on Spotify.

        .. versionadded:: 2.0
        zhttps://open.spotify.com/track/)r   r,   s    r    	track_urlzSpotify.track_url  s     1@@r"   c                    t         j                   j                  | j                  d   dz  t         j                  j                        S )z/When the user started playing this song in UTC.rh   r$   r%   r(   r)   r   r*   r+   r,   s    r    rh   zSpotify.start  sC       ..W%,1B1B1F1F / 
 	
r"   c                    t         j                   j                  | j                  d   dz  t         j                  j                        S )z1When the user will stop playing this song in UTC.ro   r$   r%   r   r,   s    r    ro   zSpotify.end  sC       ..U#d*x/@/@/D/D / 
 	
r"   c                4    | j                   | j                  z
  S )z&The duration of the song being played.)ro   rh   r,   s    r    durationzSpotify.duration  s     xx$**$$r"   c                :    | j                   j                  dd      S )z$The party ID of the listening party.idr   )r   r   r,   s    r    party_idzSpotify.party_id  s     {{tR((r"   Nr   r2   )r3   r   r   r   r   r   )r3   z	list[str])r3   zdatetime.datetime)r3   zdatetime.timedelta)r5   r6   r7   r8   r9   r!   r:   rE   r   r   r   r1   rF   r   r   r   r^   r   r   r   r   r   r   r   rh   ro   r   r   r;   r"   r    r   r   %  so   ,	IF & &        
  
&
   ' '   2 2 ; ;   A A 
 
 
 
 % % ) )r"   r   c                  r     e Zd ZdZdZdd	 	 	 	 	 d fdZedd       ZddZddZ	dd	Z
dd
ZddZ xZS )r   a  Represents a Custom activity from Discord.

    .. container:: operations

        .. describe:: x == y

            Checks if two activities are equal.

        .. describe:: x != y

            Checks if two activities are not equal.

        .. describe:: hash(x)

            Returns the activity's hash.

        .. describe:: str(x)

            Returns the custom status text.

    .. versionadded:: 1.3

    Attributes
    ----------
    name: Optional[:class:`str`]
        The custom activity's name.
    emoji: Optional[:class:`PartialEmoji`]
        The emoji to pass to the activity, if any.
    state: Optional[:class:`str`]
        The text used for the custom activity.
    )rF   rI   r=   N)rI   c                  t        |   di | || _        |j                  d|      | _        | j                  dk(  r| j                  | _        |  ||| _        y t        |t              rt        j                  |      | _        y t        |t              rt        |      | _        y t        |t              r|| _        y t        dt        |      d      )Nr=   rM   r   z.Expected str, PartialEmoji, or None, received z	 instead.r;   )rN   r!   rF   r   r=   rI   rO   ra   r   rQ   r   	TypeErrorrE   )r   rF   rI   r   rS   s       r    r!   zCustomActivity.__init__  s     	!5! $	!&7D!9
99'

DI=DJt$%//6DJs#%51DJ|,DJK?)- r"   c                "    t         j                  S )zReturns the activity's type. This is for compatibility with :class:`Activity`.

        It always returns :attr:`ActivityType.custom`.
        )r   rP   r,   s    r    rE   zCustomActivity.type  s     """r"   c                *   | j                   | j                  k(  r)t        j                  j                  | j                   dd}n't        j                  j                  | j                   d}| j
                  r| j
                  j                         |d<   |S )NrM   )rE   r=   rF   )rE   rF   rI   )rF   r=   r   rP   rf   rI   r1   )r   os     r    r1   zCustomActivity.to_dict$  su    99

"$++11'A %++11		A
 ::++-AgJr"   c                    t        |t              xr4 |j                  | j                  k(  xr |j                  | j                  k(  S r/   )rO   r   rF   rI   r   s     r    r   zCustomActivity.__eq__5  s;    un- *

dii'*tzz)	
r"   c                V    t        | j                  t        | j                        f      S r/   )r   rF   r   rI   r,   s    r    r   zCustomActivity.__hash__<  s    TYYDJJ011r"   c                    | j                   st        | j                        S | j                  r| j                    d| j                   S t        | j                         S )NrU   )rI   r   rF   r,   s    r    r   zCustomActivity.__str__?  sE    zztyy>!99jj\499+..4::r"   c                <    d| j                   d| j                  dS )Nz<CustomActivity name=z emoji=rZ   )rF   rI   r,   s    r    r^   zCustomActivity.__repr__F  s    &tyym74::.JJr"   )rF   r   rI   zPartialEmoji | Noner   r   r   r   r   r   r   )r5   r6   r7   r8   r9   r!   r:   rE   r1   r   r   r   r^   r   r   s   @r    r   r     sb    @ +I AE*=OR0 # #"
2Kr"   r   c                     y r/   r;   r   s    r    create_activityr   M  s    =@r"   c                     y r/   r;   r   s    r    r   r   Q  s    ),r"   c                   | sy t        t        | j                  dd            }|t        j                  u rd| v sd| v rt	        di | S t        di | S |t        j                  u r	 | j                  d      }t        dd|i| S |t        j                  u rd| v rt        di | S t	        di | S |t        j                  u rd| v rd| v rt        di | S t	        di | S # t        $ r t	        di | cY S w xY w)	NrE   rL   rH   rD   rF   rG   rC   r;   )r   r   r   r   r   r   rP   r   r   rj   r   r   r   r   )r   	game_typerF   s      r    r   r   U  s   txx';<IL(((t#|t';#d##|d|	l))	)	588F#D
 "4t4t44	l,,	,D=$t$$$\+++D d!  	$#d##	$s   'C! !C87C8)r   r4   r3   ActivityTypes)r   Noner3   r   )r   zActivityPayload | Noner3   zActivityTypes | None)"r8   
__future__r   r(   typingr   r   r   r   assetr	   r   r   enumsr   r   partial_emojir   utilsr   __all__types.activityr   r4   r   r   r   r   r   r   r   r   r   r   r;   r"   r    <module>r     s   2 #  6 6   ) ' $0d ;QQ$" $"NE3| E3Pc< cLh hVy) y)xfK\ fKR hniHI 
 @ 
 @ 
 , 
 ,r"   