
    i                        d Z ddlmZ ddlmZmZmZ ddlmZ ddl	m
Z
mZ ddlmZmZmZ er ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZmZ dZ G d d          Z G d de          ZdS )a:  
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

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.
    )annotations)TYPE_CHECKINGOptionalTuple   create_activity)Statustry_enum)MISSING_get_as_snowflake_RawReprMixin)Self)ActivityTypes)Guild)ConnectionState)ClientStatusPartialPresenceUpdate)RawPresenceUpdateEventr   c                      e Zd ZdZdZeed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ddZdS )r   zRepresents the :ddocs:`Client Status Object <events/gateway-events#client-status-object>` from Discord,
    which holds information about the status of the user on various clients/platforms, with additional helpers.

    .. versionadded:: 2.5
    )_statusdesktopmobilewebstatusdatar   strr   ClientStatusPayloadreturnNonec                   |pd| _         |pi }|                    d          | _        |                    d          | _        |                    d          | _        d S )Noffliner   r   r   r   getr   r   r   selfr   r   s      X/home/ubuntu/.hermes/hermes-agent/venv/lib/python3.11/site-packages/discord/presences.py__init__zClientStatus.__init__9   sR    "/izr&*hhy&9&9%)XXh%7%7"&((5//    c                    d| j         fd| j        fd| j        fd| j        fg}d                    d |D                       }d| j        j         d| dS )	Nr   r   r   r    c              3      K   | ]	}d |z  V  
dS )z%s=%rN ).0ts     r(   	<genexpr>z(ClientStatus.__repr__.<locals>.<genexpr>H   s&      441444444r*   <>)r   r   r   r   join	__class____name__)r'   attrsinners      r(   __repr__zClientStatus.__repr__A   sq    %%t{#DH	
 44e4444454>*55U5555r*   c                   || _         |                    d          | _        |                    d          | _        |                    d          | _        d S )Nr   r   r   r$   r&   s      r(   _updatezClientStatus._updateK   sD    xx	**hhx((88E??r*   client_statusr   c                   |                      |           }|j        |_        |j        |_        |j        |_        |j        |_        |S N)__new__r   r   r   r   )clsr<   r'   s      r(   _copyzClientStatus._copyR   s@    {{3$,$,#* $r*   r
   c                6    t          t          | j                  S )zl:class:`Status`: The user's overall status. If the value is unknown, then it will be a :class:`str` instead.)r   r
   r   r'   s    r(   r   zClientStatus.status^   s     ---r*   c                    | j         S )z::class:`str`: The user's overall status as a string value.)r   rC   s    r(   
raw_statuszClientStatus.raw_statusc   s     |r*   c                :    t          t          | j        pd          S )zE:class:`Status`: The user's status on a mobile device, if applicable.r#   )r   r
   r   rC   s    r(   mobile_statuszClientStatus.mobile_statush   s      8y999r*   c                :    t          t          | j        pd          S )zH:class:`Status`: The user's status on the desktop client, if applicable.r#   )r   r
   r   rC   s    r(   desktop_statuszClientStatus.desktop_statusm   s      9	:::r*   c                :    t          t          | j        pd          S )zD:class:`Status`: The user's status on the web client, if applicable.r#   )r   r
   r   rC   s    r(   
web_statuszClientStatus.web_statusr   s      5I666r*   boolc                    | j         duS )zX:class:`bool`: A helper function that determines if a user is active on a mobile device.N)r   rC   s    r(   is_on_mobilezClientStatus.is_on_mobilew   s    {$&&r*   N)r   r   r   r   r    r!   )r    r   )r<   r   r    r   )r    r
   )r    rL   )r6   
__module____qualname____doc__	__slots__r   r)   r9   r;   classmethodrA   propertyr   rE   rG   rI   rK   rN   r.   r*   r(   r   r   0   sD         8I(/W 2 2 2 2 2 26 6 6 6# # # # 	 	 	 [	 . . . X.    X : : : X: ; ; ; X; 7 7 7 X7' ' ' ' ' 'r*   r   c                      e Zd ZdZdZdd	Zd
S )r   a  Represents the payload for a :func:`on_raw_presence_update` event.

    .. versionadded:: 2.5

    Attributes
    ----------
    user_id: :class:`int`
        The ID of the user that triggered the presence update.
    guild_id: Optional[:class:`int`]
        The guild ID for the users presence update. Could be ``None``.
    guild: Optional[:class:`Guild`]
        The guild associated with the presence update and user. Could be ``None``.
    client_status: :class:`ClientStatus`
        The :class:`~.ClientStatus` model which holds information about the status of the user on various clients.
    activities: Tuple[Union[:class:`BaseActivity`, :class:`Spotify`]]
        The activities the user is currently doing. Due to a Discord API limitation, a user's Spotify activity may not appear
        if they are listening to a song with a title longer than ``128`` characters. See :issue:`1738` for more information.
    )user_idguild_idguildr<   
activitiesr   r   stater   r    r!   c               @   t          |d         d                   | _        t          |d         |d                   | _        t	          fd|d         D                       | _        t          |d          | _                            | j                  | _	        d S )	Nuseridr   r<   r   c              3  8   K   | ]}t          |          V  d S r>   r   )r/   drZ   s     r(   r1   z2RawPresenceUpdateEvent.__init__.<locals>.<genexpr>   s.      :q:qYZ?1e;T;T:q:q:q:q:q:qr*   rY   rW   )
intrV   r   r<   tuplerY   r   rW   
_get_guildrX   )r'   r   rZ   s     `r(   r)   zRawPresenceUpdateEvent.__init__   s    VT 233+7tH~TXYhTi+j+j+j5::q:q:q:q^bco^p:q:q:q5q5q'8z'J'J&+&6&6t}&E&E


r*   N)r   r   rZ   r   r    r!   )r6   rO   rP   rQ   rR   r)   r.   r*   r(   r   r   |   s@         & PIF F F F F Fr*   r   N)rQ   
__future__r   typingr   r   r   activityr	   enumsr
   r   utilsr   r   r   typing_extensionsr   r   rX   r   rZ   r   types.activityr   r   r   __all__r   r.   r*   r(   <module>rk      sh   0 # " " " " " 1 1 1 1 1 1 1 1 1 1 % % % % % % # # # # # # # # < < < < < < < < < < [&&&&&&''''''&&&&&&ZZZZZZZZI' I' I' I' I' I' I' I'XF F F F F] F F F F Fr*   