
    i[                       d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZ ddlmZmZmZmZ dZe
r`ddlmZmZ  edee         	          Z G d
 dee         ed          Z G d dee                   Z G d deee                            Z G d de          ZddZ e             G d de                      Z d Z!e! G d d                      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)CallableAnyClassVarDictIteratorSetTYPE_CHECKINGTupleOptional	TypedDictGenericTypeVar   )	BaseFlags
flag_valuefill_with_flagsalias_flag_value)PermissionsPermissionOverwrite)SelfUnpackBoolOrNoneT)boundc                  T   e Zd ZU ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded <   ded!<   ded"<   ded#<   ded$<   ded%<   ded&<   ded'<   ded(<   ded)<   ded*<   ded+<   ded,<   ded-<   ded.<   ded/<   ded0<   ded1<   ded2<   ded3<   ded4<   ded5<   ded6<   ded7<   ded8<   ded9<   ded:<   ded;<   d<S )=_BasePermissionsKwargsr   create_instant_invitekick_membersban_membersadministratormanage_channelsmanage_guildadd_reactionsview_audit_logpriority_speakerstreamread_messagesview_channelsend_messagessend_tts_messagesmanage_messagesembed_linksattach_filesread_message_historymention_everyoneexternal_emojisuse_external_emojisview_guild_insightsconnectspeakmute_membersdeafen_membersmove_membersuse_voice_activationchange_nicknamemanage_nicknamesmanage_rolesmanage_permissionsmanage_webhooksmanage_expressionsmanage_emojismanage_emojis_and_stickersuse_application_commandsrequest_to_speakmanage_eventsmanage_threadscreate_public_threadscreate_private_threadssend_messages_in_threadsexternal_stickersuse_external_stickersuse_embedded_activitiesmoderate_membersuse_soundboarduse_external_soundssend_voice_messagesset_voice_channel_statuscreate_expressionscreate_events
send_pollscreate_pollsuse_external_appspin_messagesbypass_slowmodeN__name__
__module____qualname____annotations__     Z/home/ubuntu/.hermes/hermes-agent/venv/lib/python3.11/site-packages/discord/permissions.pyr   r   (   s        ****!!!!    """"$$$$!!!!""""####%%%%""""!!!!""""&&&&$$$$    !!!!))))%%%%$$$$((((((((!!!!####!!!!))))$$$$%%%%!!!!''''$$$$''''""""////----%%%%""""####****++++----&&&&****,,,,%%%%####((((((((----''''""""!!!!&&&&!!!!$$$$$$r]   r   F)totalc                      e Zd ZdS )_PermissionsKwargsNrX   rY   rZ   r\   r]   r^   ra   ra   d             r]   ra   c                      e Zd ZdS )_PermissionOverwriteKwargsNrb   r\   r]   r^   re   re   f   rc   r]   re   c                      e Zd ZU ded<   dS )permission_aliasstraliasNrW   r\   r]   r^   rg   rg   k   s         JJJJJr]   rg   ri   rh   return2Callable[[Callable[[Any], int]], permission_alias]c                     d fd}|S )NfuncCallable[[Any], int]rj   rg   c                4    t          |           }|_        |S N)rg   ri   )rm   retri   s     r^   	decoratorz(make_permission_alias.<locals>.decoratorp   s    t$$	
r]   )rm   rn   rj   rg   r\   )ri   rr   s   ` r^   make_permission_aliasrs   o   s)         
 r]   c                     e Zd ZdZdZdidjdZdkdZdkdZdkdZdkdZ	eZ
eZeZe	Zedld            Zedld            Zedmd            Zedld            Zednd            Zedld            Zedld            Zedld            Zedld            Zedld            Zedld            Zedld            Zedld            Zedld            Zedld             Zedld!            Zdod#Zdpd&Z e!dmd'            Z"e!dmd(            Z#e!dmd)            Z$e!dmd*            Z%e!dmd+            Z&e!dmd,            Z'e!dmd-            Z(e!dmd.            Z)e!dmd/            Z*e!dmd0            Z+e!dmd1            Z, e-d2          dmd3            Z.e!dmd4            Z/e!dmd5            Z0e!dmd6            Z1e!dmd7            Z2e!dmd8            Z3e!dmd9            Z4e!dmd:            Z5e!dmd;            Z6 e-d<          dmd=            Z7e!dmd>            Z8e!dmd?            Z9e!dmd@            Z:e!dmdA            Z;e!dmdB            Z<e!dmdC            Z=e!dmdD            Z>e!dmdE            Z?e!dmdF            Z@e!dmdG            ZA e-dH          dmdI            ZBe!dmdJ            ZCe!dmdK            ZD e-dL          dmdM            ZE e-dL          dmdN            ZFe!dmdO            ZGe!dmdP            ZHe!dmdQ            ZIe!dmdR            ZJe!dmdS            ZKe!dmdT            ZLe!dmdU            ZM e-dV          dmdW            ZNe!dmdX            ZOe!dmdY            ZPe!dmdZ            ZQe!dmd[            ZRe!dmd\            ZSe!dmd]            ZTe!dmd^            ZUe!dmd_            ZVe!dmd`            ZWe!dmda            ZXe!dmdb            ZY e-dc          dmdd            ZZe!dmde            Z[e!dmdf            Z\e!dmdg            Z]dhS )qr   aQ	  Wraps up the Discord permission value.

    The properties provided are two way. You can set and retrieve individual
    bits using the properties as if they were regular bools. This allows
    you to edit permissions.

    .. versionchanged:: 1.3
        You can now use keyword arguments to initialize :class:`Permissions`
        similar to :meth:`update`.

    .. container:: operations

        .. describe:: x == y

            Checks if two permissions are equal.
        .. describe:: x != y

            Checks if two permissions are not equal.
        .. describe:: x <= y

            Checks if a permission is a subset of another permission.
        .. describe:: x >= y

            Checks if a permission is a superset of another permission.
        .. describe:: x < y

             Checks if a permission is a strict subset of another permission.
        .. describe:: x > y

             Checks if a permission is a strict superset of another permission.

        .. describe:: x | y, x |= y

            Returns a Permissions instance with all enabled flags from
            both x and y.

            .. versionadded:: 2.0

        .. describe:: x & y, x &= y

            Returns a Permissions instance with only flags enabled on
            both x and y.

            .. versionadded:: 2.0

        .. describe:: x ^ y, x ^= y

            Returns a Permissions instance with only flags enabled on
            only one of x or y, not on both.

            .. versionadded:: 2.0

        .. describe:: ~x

            Returns a Permissions instance with all flags inverted from x.

            .. versionadded:: 2.0

        .. describe:: hash(x)

               Return the permission's hash.
        .. describe:: iter(x)

               Returns an iterator of ``(perm, value)`` pairs. This allows it
               to be, for example, constructed as a dict or a list of pairs.
               Note that aliases are not shown.

        .. describe:: bool(b)

            Returns whether the permissions object has any permissions set to ``True``.

            .. versionadded:: 2.0

    Attributes
    -----------
    value: :class:`int`
        The raw value. This value is a bit array field of a 53-bit integer
        representing the currently available permissions. You should query
        permissions via the properties rather than using this raw value.
    r\   r   permissionsintkwargsUnpack[_PermissionsKwargs]c                6   t          |t                    st          d|j        j         d          || _        |                                D ]J\  }}	 | j        |         }|                     ||           *# t          $ r t          |d          d w xY wd S )Nz!Expected int parameter, received z	 instead.z  is not a valid permission name.)

isinstancerv   	TypeError	__class__rX   valueitemsVALID_FLAGS	_set_flagKeyError)selfru   rw   keykwvalueflags         r^   __init__zPermissions.__init__   s    +s++ 	ki@U@^iiijjj 
"LLNN 	. 	.LC.', tW----  V V V3 J J JKKQUUV	. 	.s   A88Botherrj   boolc                    t          |t                    r| j        |j        z  | j        k    S t          d| j        j         d|j        j                   )zDReturns ``True`` if self has the same or fewer permissions as other.cannot compare  with rz   r   r}   r{   r|   rX   r   r   s     r^   	is_subsetzPermissions.is_subset   T    e[)) 	iJ,;;gdn.EggU_Megghhhr]   c                    t          |t                    r| j        |j        z  | j        k    S t          d| j        j         d|j        j                   )zCReturns ``True`` if self has the same or more permissions as other.r   r   r   r   s     r^   is_supersetzPermissions.is_superset   r   r]   c                8    |                      |          o| |k    S )zRReturns ``True`` if the permissions on other are a strict subset of those on self.)r   r   s     r^   is_strict_subsetzPermissions.is_strict_subset   s    ~~e$$66r]   c                8    |                      |          o| |k    S )zTReturns ``True`` if the permissions on other are a strict superset of those on self.)r   r   s     r^   is_strict_supersetzPermissions.is_strict_superset   s    &&845=8r]   r   c                     | d          S )zcA factory method that creates a :class:`Permissions` with all
        permissions set to ``False``.r   r\   clss    r^   nonezPermissions.none   s     s1vvr]   c                     | d          S )zkA factory method that creates a :class:`Permissions` with all
        permissions set to ``True``.
        l    r\   r   s    r^   allzPermissions.all   s     sdeeer]   c                V    |                                  }d|_        d|_        |j         S )NF)r   r(   r.   r}   )r   ps     r^   _timeout_maskzPermissions._timeout_mask  s'    GGII!&xr]   c                    |                                  }d|_        d|_        d|_        d|_        d|_        d|_        d|_        d|_        d|_	        |S )NTF)
textr'   r*   r+   rU   rF   rE   rD   rG   rV   )r   bases     r^   _dm_permissionszPermissions._dm_permissions
  s\    xxzz!!&$ &+#%*"#(-%$r]   in_guildc                   |                                  }d|_        d|_        d|_        d|_        d|_        |rd|_        d|_        d|_        |S )NT)	r   r)   r-   r,   r0   rN   r'   r*   rG   )r   r   r   s      r^   _user_installed_permissionsz'Permissions._user_installed_permissions  s^    xxzz! ##'  	1 "&D%)D",0D)r]   c                     | d          S )a  A :class:`Permissions` with all channel-specific permissions set to
        ``True`` and the guild-specific ones set to ``False``. The guild-specific
        permissions are currently:

        - :attr:`manage_expressions`
        - :attr:`view_audit_log`
        - :attr:`view_guild_insights`
        - :attr:`manage_guild`
        - :attr:`change_nickname`
        - :attr:`manage_nicknames`
        - :attr:`kick_members`
        - :attr:`ban_members`
        - :attr:`administrator`
        - :attr:`create_expressions`
        - :attr:`moderate_members`
        - :attr:`create_events`
        - :attr:`manage_events`
        - :attr:`view_creator_monetization_analytics`

        .. versionchanged:: 1.7
           Added :attr:`stream`, :attr:`priority_speaker` and :attr:`use_application_commands` permissions.

        .. versionchanged:: 2.0
           Added :attr:`create_public_threads`, :attr:`create_private_threads`, :attr:`manage_threads`,
           :attr:`use_external_stickers`, :attr:`send_messages_in_threads` and
           :attr:`request_to_speak` permissions.

        .. versionchanged:: 2.3
           Added :attr:`use_soundboard`, :attr:`create_expressions` permissions.

        .. versionchanged:: 2.4
            Added :attr:`send_polls`, :attr:`send_voice_messages`, attr:`use_external_sounds`,
            :attr:`use_embedded_activities`, and :attr:`use_external_apps` permissions.

        .. versionchanged:: 2.7
            Added :attr:`pin_messages` and :attr:`bypass_slowmode` permissions.
        l   Qg r\   r   s    r^   all_channelzPermissions.all_channel(  s    N sdeeer]   c                     | d          S )a  A factory method that creates a :class:`Permissions` with all
        "General" permissions from the official Discord UI set to ``True``.

        .. versionchanged:: 1.7
           Permission :attr:`read_messages` is now included in the general permissions, but
           permissions :attr:`administrator`, :attr:`create_instant_invite`, :attr:`kick_members`,
           :attr:`ban_members`, :attr:`change_nickname` and :attr:`manage_nicknames` are
           no longer part of the general permissions.

        .. versionchanged:: 2.3
            Added :attr:`create_expressions` permission.

        .. versionchanged:: 2.4
            Added :attr:`view_creator_monetization_analytics` permission.
        l   `(r\   r   s    r^   generalzPermissions.generalQ  s    " sdeeer]   c                     | d          S )zA factory method that creates a :class:`Permissions` with all
        "Membership" permissions from the official Discord UI set to ``True``.

        .. versionadded:: 1.7
        l      r\   r   s    r^   
membershipzPermissions.membershipd       sdeeer]   c                     | d          S )af  A factory method that creates a :class:`Permissions` with all
        "Text" permissions from the official Discord UI set to ``True``.

        .. versionchanged:: 1.7
           Permission :attr:`read_messages` is no longer part of the text permissions.
           Added :attr:`use_application_commands` permission.

        .. versionchanged:: 2.0
           Added :attr:`create_public_threads`, :attr:`create_private_threads`, :attr:`manage_threads`,
           :attr:`send_messages_in_threads` and :attr:`use_external_stickers` permissions.

        .. versionchanged:: 2.3
            Added :attr:`send_voice_messages` permission.

        .. versionchanged:: 2.4
            Added :attr:`send_polls` and :attr:`use_external_apps` permissions.

        .. versionchanged:: 2.7
            Added :attr:`pin_messages` and :attr:`bypass_slowmode` permissions.
        l   @x  r\   r   s    r^   r   zPermissions.textm  s    , sdeeer]   c                     | d          S )zA factory method that creates a :class:`Permissions` with all
        "Voice" permissions from the official Discord UI set to ``True``.

        .. versionchanged:: 2.7
            Added :attr:`set_voice_channel_status` permission.
        l     	 r\   r   s    r^   voicezPermissions.voice       sdeeer]   c                     | d          S )zA factory method that creates a :class:`Permissions` with all
        "Stage Channel" permissions from the official Discord UI set to ``True``.

        .. versionadded:: 1.7
                r\   r   s    r^   stagezPermissions.stage  s     s7||r]   c                     | d          S )a  A factory method that creates a :class:`Permissions` with all permissions
        for stage moderators set to ``True``. These permissions are currently:

        - :attr:`manage_channels`
        - :attr:`mute_members`
        - :attr:`move_members`

        .. versionadded:: 1.7

        .. versionchanged:: 2.0
            Added :attr:`manage_channels` permission and removed :attr:`request_to_speak` permission.
        i @r\   r   s    r^   stage_moderatorzPermissions.stage_moderator  s     sdeeer]   c                     | d          S )a'  A factory method that creates a :class:`Permissions` with all permissions
        that require 2FA set to ``True``. These permissions are currently:

        - :attr:`kick_members`
        - :attr:`ban_members`
        - :attr:`administrator`
        - :attr:`manage_channels`
        - :attr:`manage_guild`
        - :attr:`manage_messages`
        - :attr:`manage_roles`
        - :attr:`manage_webhooks`
        - :attr:`manage_expressions`
        - :attr:`manage_threads`
        - :attr:`moderate_members`

        .. versionadded:: 2.0
        l   >  `r\   r   s    r^   elevatedzPermissions.elevated  s    & sdeeer]   c                     | d          S )zA factory method that creates a :class:`Permissions` with all
        "Apps" permissions from the official Discord UI set to ``True``.


        .. versionadded:: 2.6
        l         r\   r   s    r^   appszPermissions.apps  r   r]   c                     | d          S )zA factory method that creates a :class:`Permissions` with all
        "Events" permissions from the official Discord UI set to ``True``.

        .. versionadded:: 2.4
        l       @r\   r   s    r^   eventszPermissions.events  r   r]   c                     | d          S )zA factory method that creates a :class:`Permissions` with all
        "Advanced" permissions from the official Discord UI set to ``True``.

        .. versionadded:: 1.7
           r\   r   s    r^   advancedzPermissions.advanced  s     s6{{r]   Nonec                    |                                 D ]7\  }}| j                            |          }||                     ||           8dS )aw  Bulk updates this permission object.

        Allows you to set multiple attributes by using keyword
        arguments. The names must be equivalent to the properties
        listed. Extraneous key/value pairs will be silently ignored.

        Parameters
        ------------
        \*\*kwargs
            A list of key/value pairs to bulk update permissions with.
        N)r~   r   getr   )r   rw   r   r}   r   s        r^   updatezPermissions.update  sZ     !,,.. 	, 	,JC#'',,DtU+++	, 	,r]   allowdenyc                ,    | j         | z  |z  | _         d S rp   )r}   )r   r   r   s      r^   handle_overwritezPermissions.handle_overwrite  s      :-6


r]   c                    dS )zG:class:`bool`: Returns ``True`` if the user can create instant invites.r   r\   r   s    r^   r   z!Permissions.create_instant_invite  	     vr]   c                    dS )zJ:class:`bool`: Returns ``True`` if the user can kick users from the guild.   r\   r   s    r^   r   zPermissions.kick_members  r   r]   c                    dS )zG:class:`bool`: Returns ``True`` if a user can ban users from the guild.   r\   r   s    r^   r   zPermissions.ban_members  r   r]   c                    dS )z:class:`bool`: Returns ``True`` if a user is an administrator. This role overrides all other permissions.

        This also bypasses all channel-specific overrides.
        r   r\   r   s    r^   r    zPermissions.administrator  s	     vr]   c                    dS )z:class:`bool`: Returns ``True`` if a user can edit, delete, or create channels in the guild.

        This also corresponds to the "Manage Channel" channel-specific override.   r\   r   s    r^   r!   zPermissions.manage_channels  s	    
 vr]   c                    dS )zD:class:`bool`: Returns ``True`` if a user can edit guild properties.    r\   r   s    r^   r"   zPermissions.manage_guild  r   r]   c                    dS )zH:class:`bool`: Returns ``True`` if a user can add reactions to messages.@   r\   r   s    r^   r#   zPermissions.add_reactions  r   r]   c                    dS )zI:class:`bool`: Returns ``True`` if a user can view the guild's audit log.   r\   r   s    r^   r$   zPermissions.view_audit_log!  r   r]   c                    dS )zQ:class:`bool`: Returns ``True`` if a user can be more easily heard while talking.   r\   r   s    r^   r%   zPermissions.priority_speaker&  r   r]   c                    dS )zH:class:`bool`: Returns ``True`` if a user can stream in a voice channel.i   r\   r   s    r^   r&   zPermissions.stream+  r   r]   c                    dS )z_:class:`bool`: Returns ``True`` if a user can read messages from all or specific text channels.   r\   r   s    r^   r'   zPermissions.read_messages0  	     wr]   r'   c                    dS )zZ:class:`bool`: An alias for :attr:`read_messages`.

        .. versionadded:: 1.3
        r   r\   r   s    r^   r(   zPermissions.view_channel5  	     wr]   c                    dS )z_:class:`bool`: Returns ``True`` if a user can send messages from all or specific text channels.i   r\   r   s    r^   r)   zPermissions.send_messages=  r   r]   c                    dS )zc:class:`bool`: Returns ``True`` if a user can send TTS messages from all or specific text channels.i   r\   r   s    r^   r*   zPermissions.send_tts_messagesB  r   r]   c                    dS )z:class:`bool`: Returns ``True`` if a user can delete messages in a text channel.

        .. note::

            Note that there are currently no ways to edit other people's messages.
        i    r\   r   s    r^   r+   zPermissions.manage_messagesG  s	     wr]   c                    dS )z_:class:`bool`: Returns ``True`` if a user's messages will automatically be embedded by Discord.i @  r\   r   s    r^   r,   zPermissions.embed_linksQ  r   r]   c                    dS )zK:class:`bool`: Returns ``True`` if a user can send files in their messages.i   r\   r   s    r^   r-   zPermissions.attach_filesV  r   r]   c                    dS )zV:class:`bool`: Returns ``True`` if a user can read a text channel's previous messages.i   r\   r   s    r^   r.   z Permissions.read_message_history[  r   r]   c                    dS )zi:class:`bool`: Returns ``True`` if a user's @everyone or @here will mention everyone in the text channel.i   r\   r   s    r^   r/   zPermissions.mention_everyone`  r   r]   c                    dS )zK:class:`bool`: Returns ``True`` if a user can use emojis from other guilds.   r\   r   s    r^   r0   zPermissions.external_emojise  r   r]   r0   c                    dS )z\:class:`bool`: An alias for :attr:`external_emojis`.

        .. versionadded:: 1.3
        r   r\   r   s    r^   r1   zPermissions.use_external_emojisj  r   r]   c                    dS )zp:class:`bool`: Returns ``True`` if a user can view the guild's insights.

        .. versionadded:: 1.3
        i   r\   r   s    r^   r2   zPermissions.view_guild_insightsr  r   r]   c                    dS )zI:class:`bool`: Returns ``True`` if a user can connect to a voice channel.i   r\   r   s    r^   r3   zPermissions.connectz  r   r]   c                    dS )zG:class:`bool`: Returns ``True`` if a user can speak in a voice channel.i    r\   r   s    r^   r4   zPermissions.speak  r   r]   c                    dS )z?:class:`bool`: Returns ``True`` if a user can mute other users.i  @ r\   r   s    r^   r5   zPermissions.mute_members  r   r]   c                    dS )zA:class:`bool`: Returns ``True`` if a user can deafen other users.i   r\   r   s    r^   r6   zPermissions.deafen_members  r   r]   c                    dS )zV:class:`bool`: Returns ``True`` if a user can move users between other voice channels.i   r\   r   s    r^   r7   zPermissions.move_members  r   r]   c                    dS )zU:class:`bool`: Returns ``True`` if a user can use voice activation in voice channels.i   r\   r   s    r^   r8   z Permissions.use_voice_activation  r   r]   c                    dS )zQ:class:`bool`: Returns ``True`` if a user can change their nickname in the guild.i   r\   r   s    r^   r9   zPermissions.change_nickname  r   r]   c                    dS )zX:class:`bool`: Returns ``True`` if a user can change other user's nickname in the guild.i   r\   r   s    r^   r:   zPermissions.manage_nicknames  r   r]   c                    dS )z:class:`bool`: Returns ``True`` if a user can create or edit roles less than their role's position.

        This also corresponds to the "Manage Permissions" channel-specific override.
           r\   r   s    r^   r;   zPermissions.manage_roles  r   r]   r;   c                    dS )zY:class:`bool`: An alias for :attr:`manage_roles`.

        .. versionadded:: 1.3
        r   r\   r   s    r^   r<   zPermissions.manage_permissions  r   r]   c                    dS )zO:class:`bool`: Returns ``True`` if a user can create, edit, or delete webhooks.i    r\   r   s    r^   r=   zPermissions.manage_webhooks  r   r]   c                    dS )z:class:`bool`: Returns ``True`` if a user can edit or delete emojis, stickers, and soundboard sounds.

        .. versionadded:: 2.3
           @r\   r   s    r^   r>   zPermissions.manage_expressions  r   r]   r>   c                    dS )z7:class:`bool`: An alias for :attr:`manage_expressions`.r   r\   r   s    r^   r?   zPermissions.manage_emojis  r   r]   c                    dS )z_:class:`bool`: An alias for :attr:`manage_expressions`.

        .. versionadded:: 2.0
        r   r\   r   s    r^   r@   z&Permissions.manage_emojis_and_stickers  r   r]   c                    dS )zi:class:`bool`: Returns ``True`` if a user can use slash commands.

        .. versionadded:: 1.7
        l        r\   r   s    r^   rA   z$Permissions.use_application_commands  r   r]   c                    dS )zz:class:`bool`: Returns ``True`` if a user can request to speak in a stage channel.

        .. versionadded:: 1.7
        r   r\   r   s    r^   rB   zPermissions.request_to_speak  r   r]   c                    dS )zj:class:`bool`: Returns ``True`` if a user can manage guild events.

        .. versionadded:: 2.0
        l        r\   r   s    r^   rC   zPermissions.manage_events  r   r]   c                    dS )ze:class:`bool`: Returns ``True`` if a user can manage threads.

        .. versionadded:: 2.0
        l        r\   r   s    r^   rD   zPermissions.manage_threads  r   r]   c                    dS )zl:class:`bool`: Returns ``True`` if a user can create public threads.

        .. versionadded:: 2.0
        l         r\   r   s    r^   rE   z!Permissions.create_public_threads  r   r]   c                    dS )zm:class:`bool`: Returns ``True`` if a user can create private threads.

        .. versionadded:: 2.0
        l       @ r\   r   s    r^   rF   z"Permissions.create_private_threads  r   r]   c                    dS )zu:class:`bool`: Returns ``True`` if a user can use stickers from other guilds.

        .. versionadded:: 2.0
                r\   r   s    r^   rH   zPermissions.external_stickers  r   r]   rH   c                    dS )z^:class:`bool`: An alias for :attr:`external_stickers`.

        .. versionadded:: 2.0
        r  r\   r   s    r^   rI   z!Permissions.use_external_stickers  r   r]   c                    dS )zo:class:`bool`: Returns ``True`` if a user can send messages in threads.

        .. versionadded:: 2.0
        l        r\   r   s    r^   rG   z$Permissions.send_messages_in_threads  r   r]   c                    dS )z:class:`bool`: Returns ``True`` if a user can launch an embedded application in a Voice channel.

        .. versionadded:: 2.0
        l        r\   r   s    r^   rJ   z#Permissions.use_embedded_activities  r   r]   c                    dS )zm:class:`bool`: Returns ``True`` if a user can time out other members.

        .. versionadded:: 2.0
        l        r\   r   s    r^   rK   zPermissions.moderate_members  r   r]   c                    dS )zv:class:`bool`: Returns ``True`` if a user can view role subscription insights.

        .. versionadded:: 2.4
        l        r\   r   s    r^   #view_creator_monetization_analyticsz/Permissions.view_creator_monetization_analytics$  r   r]   c                    dS )zi:class:`bool`: Returns ``True`` if a user can use the soundboard.

        .. versionadded:: 2.3
        l        r\   r   s    r^   rL   zPermissions.use_soundboard,  r   r]   c                    dS )z:class:`bool`: Returns ``True`` if a user can create emojis, stickers, and soundboard sounds.

        .. versionadded:: 2.3
        l         r\   r   s    r^   rP   zPermissions.create_expressions4  r   r]   c                    dS )zj:class:`bool`: Returns ``True`` if a user can create guild events.

        .. versionadded:: 2.4
        l        @r\   r   s    r^   rQ   zPermissions.create_events<  r   r]   c                    dS )zs:class:`bool`: Returns ``True`` if a user can use sounds from other guilds.

        .. versionadded:: 2.3
        l          r\   r   s    r^   rM   zPermissions.use_external_soundsD  r   r]   c                    dS )zj:class:`bool`: Returns ``True`` if a user can send voice messages.

        .. versionadded:: 2.3
        l          r\   r   s    r^   rN   zPermissions.send_voice_messagesL  r   r]   c                    dS )zo:class:`bool`: Returns ``True`` if a user can set voice channel status.

        .. versionadded:: 2.7
        l          r\   r   s    r^   rO   z$Permissions.set_voice_channel_statusT  r   r]   c                    dS )zi:class:`bool`: Returns ``True`` if a user can send poll messages.

        .. versionadded:: 2.4
                  r\   r   s    r^   rR   zPermissions.send_polls\  r   r]   rR   c                    dS )zW:class:`bool`: An alias for :attr:`send_polls`.

        .. versionadded:: 2.4
        r  r\   r   s    r^   rS   zPermissions.create_pollsd  r   r]   c                    dS )zh:class:`bool`: Returns ``True`` if a user can use external apps.

        .. versionadded:: 2.4
        l           r\   r   s    r^   rT   zPermissions.use_external_appsl  r   r]   c                    dS )zc:class:`bool`: Returns ``True`` if a user can pin messages.

        .. versionadded:: 2.7
        l         @ r\   r   s    r^   rU   zPermissions.pin_messagest  r   r]   c                    dS )zf:class:`bool`: Returns ``True`` if a user can bypass slowmode.

        .. versionadded:: 2.7
        l          r\   r   s    r^   rV   zPermissions.bypass_slowmode|  r   r]   N)r   )ru   rv   rw   rx   )r   r   rj   r   )rj   r   )rj   rv   )r   r   rj   r   )rw   rx   rj   r   )r   rv   r   rv   rj   r   )^rX   rY   rZ   __doc__	__slots__r   r   r   r   r   __le____ge____lt____gt__classmethodr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   rs   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rH   rI   rG   rJ   rK   r  rL   rP   rQ   rM   rN   rO   rR   rS   rT   rU   rV   r\   r]   r^   r   r   x   s
       O Ob I. . . . .i i i ii i i i7 7 7 79 9 9 9 FFFF   [
 f f f [f    [    [    [ &f &f &f [&fP f f f [f$ f f f [f f f f [f. f f f [f    [ f f f [f f f f [f( f f f [f f f f [f    [, , , ,"7 7 7 7    Z    Z    Z    Z    Z    Z    Z    Z    Z    Z    Z ?++   ,+    Z    Z    Z    Z    Z    Z    Z    Z ,--   .-    Z    Z    Z    Z    Z    Z    Z    Z    Z    Z >**   +*    Z    Z /00   10 /00   10    Z    Z    Z    Z    Z    Z    Z .//   0/    Z    Z    Z    Z    Z    Z    Z    Z    Z    Z    Z <((   )(    Z    Z    Z  r]   r   c                   t          t          j                  | _        t                      }t          j                                        D ]{\  }}t          |t                    r|j        }|	                    |           nt          |t                    r|}nP|fd}|fd}t          ||          }t          | ||           || j        |z
  | _        | S )Nc                6    | j                             |          S rp   )_valuesr   )r   xs     r^   getterz)_augment_from_permissions.<locals>.getter  s    <##A&&&r]   c                2    |                      ||           d S rp   )_set)r   r}   r  s      r^   setterz)_augment_from_permissions.<locals>.setter  s    IIar]   )setr   r   VALID_NAMES__dict__r~   rz   rg   ri   addr   propertysetattr
PURE_FLAGS)r   aliasesnamer}   r   r  r"  props           r^   _augment_from_permissionsr-    s    +122COeeG #+1133 ! !ee-.. 	+CKKz** 	CC  	' 	' 	' 	' #& 	  	  	  	  ''T4    _w.CNJr]   c                     e Zd ZU dZdZer,ded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded <   ded!<   ded"<   ded#<   ded$<   ded%<   ded&<   ded'<   ded(<   ded)<   ded*<   ded+<   ded,<   ded-<   ded.<   ded/<   ded0<   ded1<   ded2<   ded3<   ded4<   ded5<   ded6<   ded7<   ded8<   ded9<   ded:<   ded;<   ded<<   ded=<   ded><   ded?<   ded@<   dZdEZd[dIZd\dMZ	d]dOZ
ed^dT            Zd_dUZdZdVZd`dXZdYS )ar   a  A type that is used to represent a channel specific permission.

    Unlike a regular :class:`Permissions`\, the default value of a
    permission is equivalent to ``None`` and not ``False``. Setting
    a value to ``False`` is **explicitly** denying that permission,
    while setting a value to ``True`` is **explicitly** allowing
    that permission.

    The values supported by this are the same as :class:`Permissions`
    with the added possibility of it being set to ``None``.

    .. container:: operations

        .. describe:: x == y

            Checks if two overwrites are equal.
        .. describe:: x != y

            Checks if two overwrites are not equal.
        .. describe:: iter(x)

           Returns an iterator of ``(perm, value)`` pairs. This allows it
           to be, for example, constructed as a dict or a list of pairs.
           Note that aliases are not shown.

    Parameters
    -----------
    \*\*kwargs
        Set the value of permissions by their name.
    )r  zClassVar[Set[str]]r$  r)  Optional[bool]r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rw   "Unpack[_PermissionOverwriteKwargs]rj   r   c                    i | _         |                                D ]2\  }}|| j        vrt          d| d          t	          | ||           3d S )Nzno permission called .)r  r~   r$  
ValueErrorr(  r   rw   r   r}   s       r^   r   zPermissionOverwrite.__init__  sk    24 ,,.. 	& 	&JC$*** !?!?!?!?@@@D#u%%%%		& 	&r]   r   objectr   c                L    t          |t                    o| j        |j        k    S rp   )rz   r   r  r   s     r^   __eq__zPermissionOverwrite.__eq__  s!    %!455W$,%-:WWr]   r   rh   r}   c                    |dvrt          d|j        j                   || j                            |d            d S || j        |<   d S )N)TNFz$Expected bool or NoneType, received )r{   r|   rX   r  pop)r   r   r}   s      r^   r!  zPermissionOverwrite._set  s_    +++]5?C[]]^^^=LS$''''' %DLr]   Tuple[Permissions, Permissions]c                   t                                           }t                                           }| j                                        D ]0\  }}|du rt	          ||d           |du rt	          ||d           1||fS )zfTuple[:class:`Permissions`, :class:`Permissions`]: Returns the (allow, deny) pair from this overwrite.TF)r   r   r  r~   r(  )r   r   r   r   r}   s        r^   pairzPermissionOverwrite.pair  s       ""!!,,,.. 	) 	)JC}}sD))))%c4(((d{r]   r   r   r   r   c                     |             }|D ]\  }}|du rt          ||d           |D ]\  }}|du rt          ||d           |S )zECreates an overwrite from an allow/deny pair of :class:`Permissions`.TF)r(  )r   r   r   rq   r   r}   s         r^   	from_pairzPermissionOverwrite.from_pair&  sr     cee 	( 	(JC}}S$''' 	) 	)JC}}S%(((
r]   c                2    t          | j                  dk    S )a  Checks if the permission overwrite is currently empty.

        An empty permission overwrite is one that has no overwrites set
        to ``True`` or ``False``.

        Returns
        -------
        :class:`bool`
            Indicates if the overwrite is empty.
        r   )lenr  r   s    r^   is_emptyzPermissionOverwrite.is_empty4  s     4<  A%%r]   c                p    |                                 D ] \  }}|| j        vrt          | ||           !dS )au  Bulk updates this permission overwrite object.

        Allows you to set multiple attributes by using keyword
        arguments. The names must be equivalent to the properties
        listed. Extraneous key/value pairs will be silently ignored.

        Parameters
        ------------
        \*\*kwargs
            A list of key/value pairs to bulk update with.
        N)r~   r$  r(  r4  s       r^   r   zPermissionOverwrite.updateA  sO     !,,.. 	& 	&JC$***D#u%%%%		& 	&r]   $Iterator[Tuple[str, Optional[bool]]]c              #  Z   K   | j         D ] }|| j                            |          fV  !d S rp   )r)  r  r   )r   r   s     r^   __iter__zPermissionOverwrite.__iter__S  sE      ? 	- 	-Ct|'',,,,,,,	- 	-r]   N)rw   r0  rj   r   )r   r5  rj   r   )r   rh   r}   r/  rj   r   )rj   r:  )r   r   r   r   rj   r   )rj   r   )rj   rC  )rX   rY   rZ   r  r  r
   r[   r   r7  r!  r<  r  r>  rA  r   rE  r\   r]   r^   r   r     s         > I =(''''&&&&----$$$$####%%%%''''$$$$%%%%&&&&((((%%%%$$$$%%%%))))''''####$$$$,,,,((((''''++++++++$$$$&&&&$$$$,,,,''''(((($$$$****''''****%%%%22220000((((%%%%&&&&----....0000))))----////((((&&&&++++++++0000****%%%%""""$$$$))))$$$$''''& & & &X X X X& & & &       [& & & && & & &$- - - - - -r]   r   N)ri   rh   rj   rk   )#r  
__future__r   typingr   r   r   r   r   r	   r
   r   r   r   r   r   flagsr   r   r   r   __all__typing_extensionsr   r   r   r   r   ra   re   rg   rs   r   r-  r   r\   r]   r^   <module>rK     s=   0 # " " " " " | | | | | | | | | | | | | | | | | | | | | | | | | | | | K K K K K K K K K K K K
  CR........'-x~>>>K:% :% :% :% :%!5y :% :% :% :%x @????3D9???QQQQQ%;HTN%KQQQ
    '       I I I I I) I I IX  8 s- s- s- s- s- s- s- s- s- s-r]   