
    il             
         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mZmZmZmZmZ ddlZddlZddlmZ ddlmZmZ ddlmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% 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. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7m8Z8 ddl9m:Z: ddl;m<Z< ddl=m>Z>m?Z? dZ@erddlAmBZBmCZC ddlDmEZE ddlFmGZG ddlHmIZImJZJ ddlKmLZLmMZM ddlNmOZO ddlPmQZQmRZRmSZS ddlTmUZU ddlVmWZW ddlXmYZY dd lZm[Z[m\Z\ dd!l]m^Z^ dd"l_m`Z`maZambZb dd#lcmdZdmeZf dd$lgmhZhmiZimjZj dd%lkmlZmmnZompZqmrZsmtZumvZwmxZymzZ{m|Z}m~ZmZ dd&lmZ dd'lm>Z dd(l=mZ  ed)eGebe<eeGeIe<f                   Z G d* d+ed,-          Z G d. d/ed,-          Z G d0 d1ed,-          Z G d2 d3ed,-          Z G d4 d5ed,-          Z G d6 d7e          Z G d8 d9e          Z G d: d;e>          Z G d< d=          Z G d> d?ejK        j        ejK        je        e'          Zl G d@ dAejK        j        ejK        j        ejK        je        e'          Z G dB dCe          Zp G dD dEe          Zr G dF dGejK        je        e'          Zv G dH dIe'          Z~ G dJ dKejK        je        e'          Zz G dL dMejK        j        ejK        j        e'          Zt G dN dOejK        j        ejK        j        e'          Z G dP dQejK        j        e'          ZdXdTZdXdUZdXdVZdXdWZdS )Ya:  
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)AnyAsyncIteratorCallableDictIterableListLiteralMapping
NamedTupleOptionalTYPE_CHECKINGSequenceTupleTypeVar	TypedDictUnionoverloadN   )ScheduledEvent)PermissionOverwritePermissions)ChannelTypeForumLayoutTypeForumOrderTypePrivacyLeveltry_enumVideoQualityMode
EntityTypeVoiceChannelEffectAnimationType)Hashable)utils)MISSING)Asset)ClientException)StageInstance)Thread)	_EmojiTagPartialEmoji)ChannelFlagsMessageFlags)handle_message_parameters)Object)BaseSoundboardSoundSoundboardDefaultSound)TextChannelVoiceChannelStageChannel	DMChannelCategoryChannelForumTagForumChannelGroupChannelPartialMessageableVoiceChannelEffectVoiceChannelSoundEffect)SelfUnpack)ThreadArchiveDuration)Role)Member
VoiceState)	SnowflakeSnowflakeTime)Embed)MessagePartialMessageEmojiInputType)AllowedMentionsWebhook)ConnectionState)GuildStickerStickerItem)File)
ClientUserUserBaseUser)GuildGuildChannel)BaseViewView
LayoutView)r0   NewsChannelr1   r2   r3   r4   GroupDMChannelr6   MediaChannelr5   r9   )SnowflakeList)r.   )SoundboardSoundOverwriteKeyTc                  $    e Zd ZU ded<   ded<   dS )_BaseCreateChannelOptionsOptional[str]reasonintpositionN__name__
__module____qualname____annotations__     V/home/ubuntu/.hermes/hermes-agent/venv/lib/python3.11/site-packages/discord/channel.pyr]   r]   |   s%         rh   r]   F)totalc                  L    e Zd ZU ded<   ded<   ded<   ded<   ded	<   ded
<   dS )_CreateTextChannelOptionsstrtopicr`   slowmode_delayboolnsfw9Mapping[Union[Role, Member, Object], PermissionOverwrite]
overwritesdefault_auto_archive_durationdefault_thread_slowmode_delayNrb   rg   rh   ri   rl   rl      sT         





MMMM**********rh   rl   c                  B    e Zd ZU ded<   ded<   ded<   ded<   ded	<   d
S )_CreateVoiceChannelOptionsr`   bitrate
user_limitr^   
rtc_regionr   video_quality_moderr   rs   Nrb   rg   rh   ri   rw   rw      H         !!!!,,,,MMMMMMrh   rw   c                  B    e Zd ZU ded<   ded<   ded<   ded<   ded	<   d
S )_CreateStageChannelOptionsr`   rx   ry   r^   rz   r   r{   rr   rs   Nrb   rg   rh   ri   r~   r~      r|   rh   r~   c                  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S )_CreateForumChannelOptionsrm   rn   r`   ro   rp   rq   rr   rs   rt   ru   r   default_sort_orderrF   default_reaction_emojir   default_layoutSequence[ForumTag]available_tagsNrb   rg   rh   ri   r   r      s         





MMMM************....''''******rh   r   c                  $    e Zd ZU ded<   ded<   dS )ThreadWithMessager'   threadrD   messageNrb   rg   rh   ri   r   r      s'         NNNrh   r   c                  $    e Zd ZU ded<   ded<   dS )VoiceChannelEffectAnimationr`   idr    typeNrb   rg   rh   ri   r   r      s'         GGG))))))rh   r   c                  P     e Zd ZdZdZd fd	ZddZedd            ZddZ	 xZ
S )r:   a(  Represents a Discord voice channel sound effect.

    .. versionadded:: 2.5

    .. container:: operations

        .. describe:: x == y

            Checks if two sound effects are equal.

        .. describe:: x != y

            Checks if two sound effects are not equal.

        .. describe:: hash(x)

            Returns the sound effect's hash.

    Attributes
    ------------
    id: :class:`int`
        The ID of the sound.
    volume: :class:`float`
        The volume of the sound as floating point percentage (e.g. ``1.0`` for 100%).
    )_statestaterJ   r   r`   volumefloatc               X    ||d}t                                          ||           d S )N)sound_idr   r   data)super__init__)selfr   r   r   r   	__class__s        ri   r   z VoiceChannelSoundEffect.__init__   s:    ,
 ,
 	u400000rh   returnrm   c                B    d| j         j         d| j         d| j         dS )N< id=z volume=>)r   rc   r   r   r   s    ri   __repr__z VoiceChannelSoundEffect.__repr__   s,    O4>*OOOOOOOOrh   Optional[datetime.datetime]c                `    |                                  rdS t          j        | j                  S )zOptional[:class:`datetime.datetime`]: Returns the snowflake's creation time in UTC.
        Returns ``None`` if it's a default sound.N)
is_defaultr"   snowflake_timer   r   s    ri   
created_atz"VoiceChannelSoundEffect.created_at   s.     ?? 	14'000rh   rp   c                ,    | j         t          j        k     S )z3:class:`bool`: Whether it's a default sound or not.)r   r"   DISCORD_EPOCHr   s    ri   r   z"VoiceChannelSoundEffect.is_default   s     w,,,rh   )r   rJ   r   r`   r   r   r   rm   )r   r   r   rp   )rc   rd   re   __doc__	__slots__r   r   propertyr   r   __classcell__r   s   @ri   r:   r:      s         4 I1 1 1 1 1 1P P P P 1 1 1 X1- - - - - - - -rh   r:   c                  .    e Zd ZdZdZdd	ZddZddZdS )r9   a  Represents a Discord voice channel effect.

    .. versionadded:: 2.5

    Attributes
    ------------
    channel: :class:`VoiceChannel`
        The channel in which the effect is sent.
    user: Optional[:class:`Member`]
        The user who sent the effect. ``None`` if not found in cache.
    animation: Optional[:class:`VoiceChannelEffectAnimation`]
        The animation the effect has. Returns ``None`` if the effect has no animation.
    emoji: Optional[:class:`PartialEmoji`]
        The emoji of the effect.
    sound: Optional[:class:`VoiceChannelSoundEffect`]
        The sound of the effect. Returns ``None`` if it's an emoji effect.
    )channeluser	animationemojisoundr   rJ   r   VoiceChannelEffectPayloadguildrQ   c               X   |                     t          |d                             | _        |                    t          |d                             | _        d | _        |                    d          }|1t          t          |d                   }t          ||          | _        |                    d          }|t          j        |          nd | _        d | _        t          j        |d          }|0|                    d          pd	}t!          |||
          | _        d S d S )N
channel_iduser_idanimation_idanimation_type)r   r   r   r   sound_volumeg        )r   r   r   )get_channelr`   r   
get_memberr   r   getr   r    r   r)   	from_dictr   r   r"   _get_as_snowflaker:   )	r   r   r   r   r   r   r   r   r   s	            ri   r   zVoiceChannelEffect.__init__   s   %*%6%6s4;M7N7N%O%O&+&6&6s4	?7K7K&L&L	@Dxx//#%&EtL\G]^^N8L~^^^DN!!NSN_\-CE-J-J-Jei
8<
"'"9$
"K"K88N33:sL0uR^___DJJJ  rh   r   rm   c                    d| j         f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   r    c              3      K   | ]	}d |z  V  
dS z%s=%rNrg   .0ts     ri   	<genexpr>z.VoiceChannelEffect.__repr__.<locals>.<genexpr>  s&      441444444rh   r   r   )r   r   r   r   r   joinr   rc   )r   attrsinners      ri   r   zVoiceChannelEffect.__repr__  s{    %TY$.)dj!dj!
 44e4444454>*55U5555rh   rp   c                    | j         duS )z4:class:`bool`: Whether the effect is a sound or not.N)r   r   s    ri   is_soundzVoiceChannelEffect.is_sound  s    z%%rh   N)r   rJ   r   r   r   rQ   r   r   )rc   rd   re   r   r   r   r   r   rg   rh   ri   r9   r9      sf         $ CI` ` ` `&	6 	6 	6 	6& & & & & &rh   r9   c                      e Zd ZdZdZdsd	ZdtdZdudZdvdZe	dwd            Z
e	dxd            Ze	dyd            Z ej        ej        j        j                  dz fd            Ze	d{d            Ze	d|d            Zd}d Zd}d!Ze	d~d#            Zedd%            Zed&d'dd+            Zed&d&d&d&d&d&d&d&d&d&d&d&d,dd;            Zd<d'dd?Z ej        ej        j        j                  d<d<d<d@ddA            Zd<d'ddDZdEed<d<d<d<dFd<dGddTZddVZd<d<dWdd[Zd<d'dd]Z dd`Z!ddcZ"d<ed<d<dFd<ddddkZ#dldldEd<dmddrZ$ xZ%S )r0   a  Represents a Discord guild text channel.

    .. container:: operations

        .. describe:: x == y

            Checks if two channels are equal.

        .. describe:: x != y

            Checks if two channels are not equal.

        .. describe:: hash(x)

            Returns the channel's hash.

        .. describe:: str(x)

            Returns the channel's name.

    Attributes
    -----------
    name: :class:`str`
        The channel name.
    guild: :class:`Guild`
        The guild the channel belongs to.
    id: :class:`int`
        The channel ID.
    category_id: Optional[:class:`int`]
        The category channel ID this channel belongs to, if applicable.
    topic: Optional[:class:`str`]
        The channel's topic. ``None`` if it doesn't exist.
    position: :class:`int`
        The position in the channel list. This is a number that starts at 0. e.g. the
        top channel is position 0.
    last_message_id: Optional[:class:`int`]
        The last message ID of the message sent to this channel. It may
        *not* point to an existing or valid message.
    slowmode_delay: :class:`int`
        The number of seconds a member must wait between sending messages
        in this channel. A value of ``0`` denotes that it is disabled.
        Bots and users with :attr:`~Permissions.bypass_slowmode` bypass slowmode.
    nsfw: :class:`bool`
        If the channel is marked as "not safe for work" or "age restricted".
    default_auto_archive_duration: :class:`int`
        The default auto archive duration in minutes for threads created in this channel.

        .. versionadded:: 2.0
    default_thread_slowmode_delay: :class:`int`
        The default slowmode delay in seconds for threads created in this channel.

        .. versionadded:: 2.3
    )namer   r   rn   r   rq   category_idra   ro   _overwrites_typelast_message_idrt   ru   r   rJ   r   rQ   r   -Union[TextChannelPayload, NewsChannelPayload]c                   || _         t          |d                   | _        |d         | _        |                     ||           d S Nr   r   r   r`   r   r   _updater   r   r   r   s       ri   r   zTextChannel.__init__c  s?    ',4:$(L
UD!!!!!rh   r   rm   c                    d| j         fd| j        fd| j        fd| j        fd|                                 fd| j        fg}d                    d |D                       }d	| j        j         d| d
S )Nr   r   ra   rq   newsr   r   c              3      K   | ]	}d |z  V  
dS r   rg   r   s     ri   r   z'TextChannel.__repr__.<locals>.<genexpr>r  &      55!'A+555555rh   r   r   )	r   r   ra   rq   is_newsr   r   r   rc   r   r   joineds      ri   r   zTextChannel.__repr__i  s    47OTY'TYT\\^^$D,-
 55u5555564>*66V6666rh   Nonec                &   || _         |d         | _        t          j        |d          | _        |                    d          | _        |d         | _        |                    dd          | _        |                    dd          | _	        |                    d	d
          | _
        |                    dd          | _        |                    d| j                  | _        t          j        |d          | _        |                     |           d S )Nr   	parent_idrn   ra   rq   Frate_limit_per_userr   rt     "default_thread_rate_limit_per_userr   r   )r   r   r"   r   r   r   rn   ra   rq   ro   rt   ru   r   r   _fill_overwritesr   r   r   s      ri   r   zTextChannel._updateu  s    !
f	*/*A$*T*T$(HHW$5$5
!*-((6511	#'88,A1#E#EDHHHMlnrDsDs*26((;_ab2c2c*$(HHVTZ$@$@
.3.EdL].^.^d#####rh   r;   c                
   K   | S Nrg   r   s    ri   _get_channelzTextChannel._get_channel        rh   +Literal[ChannelType.text, ChannelType.news]c                H    | j         dk    rt          j        S t          j        S )1:class:`ChannelType`: The channel's Discord type.r   )r   r   textr   r   s    ri   r   zTextChannel.type  s!     :??##rh   r`   c                $    t           j        j        S r   r   r   valuer   s    ri   _sorting_bucketzTextChannel._sorting_bucket      %%rh   Optional[EntityType]c                    d S r   rg   r   s    ri   _scheduled_event_entity_typez(TextChannel._scheduled_event_entity_type      trh   objUnion[Member, Role]r   c                   t                                          |          }|                     |           t          j                    }|xj        |j         z  c_        |S r   r   permissions_for_apply_implicit_permissionsr   voicer   r   r   basedeniedr   s       ri   r   zTextChannel.permissions_for  W    ww&&s++((... "$$

v|m#

rh   List[Member]c                4      fd j         j        D             S )zEList[:class:`Member`]: Returns all members that can see this channel.c                H    g | ]}                     |          j        |S rg   r   read_messagesr   mr   s     ri   
<listcomp>z'TextChannel.members.<locals>.<listcomp>  /    WWWa1E1Ea1H1H1VWWWWrh   r   membersr   s   `ri   r  zTextChannel.members  s%     XWWW4:-WWWWrh   List[Thread]c                X      fd j         j                                        D             S )zhList[:class:`Thread`]: Returns all the threads that you can see.

        .. versionadded:: 2.0
        c                4    g | ]}|j         j        k    |S rg   r   r   r   r   r   s     ri   r  z'TextChannel.threads.<locals>.<listcomp>  *    aaa6VEUY]Y`E`E`E`E`E`rh   r   _threadsvaluesr   s   `ri   threadszTextChannel.threads  s1     baaaTZ%8%?%?%A%Aaaaarh   rp   c                    | j         S )z-:class:`bool`: Checks if the channel is NSFW.rq   r   s    ri   is_nsfwzTextChannel.is_nsfw  
    yrh   c                6    | j         t          j        j        k    S )z7:class:`bool`: Checks if the channel is a news channel.)r   r   r   r   r   s    ri   r   zTextChannel.is_news  s    z[-333rh   Optional[Message]c                R    | j         r| j                            | j                   ndS )a:  Retrieves the last message from this channel in cache.

        The message might not be valid or point to an existing message.

        .. admonition:: Reliable Fetching
            :class: helpful

            For a slightly more reliable method of fetching the
            last message, consider using either :meth:`history`
            or :meth:`fetch_message` with the :attr:`last_message_id`
            attribute.

        Returns
        ---------
        Optional[:class:`Message`]
            The last message in this channel or ``None`` if not found.
        Nr   r   _get_messager   s    ri   last_messagezTextChannel.last_message  s-    & BFAU_t{''(<===[__rh   Optional[TextChannel]c                
   K   d S r   rg   r   s    ri   editzTextChannel.edit  s      363rh   .r_   ra   r_   r^   c               
   K   d S r   rg   r   ra   r_   s      ri   r(  zTextChannel.edit        QTQTrh   )r_   r   rn   ra   rq   sync_permissionscategoryro   rt   ru   r   rs   r   rn   rq   r-  r.  Optional[CategoryChannel]ro   rt   r=   ru   r   r   rs   +Mapping[OverwriteKeyT, PermissionOverwrite]c               
   K   d S r   rg   )r   r_   r   rn   ra   rq   r-  r.  ro   rt   ru   r   rs   s                ri   r(  zTextChannel.edit  s        crh   Noptionsr   c                  K   |                      ||           d{V }|"|                     | j        | j        |          S dS )a  |coro|

        Edits the channel.

        You must have :attr:`~Permissions.manage_channels` to do this.

        .. versionchanged:: 1.3
            The ``overwrites`` keyword-only parameter was added.

        .. versionchanged:: 1.4
            The ``type`` keyword-only parameter was added.

        .. versionchanged:: 2.0
            Edits are no longer in-place, the newly edited channel is returned instead.

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` or
            :exc:`ValueError` instead of ``InvalidArgument``.

        Parameters
        ----------
        name: :class:`str`
            The new channel name.
        topic: :class:`str`
            The new channel's topic.
        position: :class:`int`
            The new channel's position.
        nsfw: :class:`bool`
            To mark the channel as NSFW or not.
        sync_permissions: :class:`bool`
            Whether to sync permissions with the channel's new or pre-existing
            category. Defaults to ``False``.
        category: Optional[:class:`CategoryChannel`]
            The new category for this channel. Can be ``None`` to remove the
            category.
        slowmode_delay: :class:`int`
            Specifies the slowmode rate limit for user in this channel, in seconds.
            A value of ``0`` disables slowmode. The maximum value possible is ``21600``.
        type: :class:`ChannelType`
            Change the type of this text channel. Currently, only conversion between
            :attr:`ChannelType.text` and :attr:`ChannelType.news` is supported. This
            is only available to guilds that contain ``NEWS`` in :attr:`Guild.features`.
        reason: Optional[:class:`str`]
            The reason for editing this channel. Shows up on the audit log.
        overwrites: :class:`Mapping`
            A :class:`Mapping` of target (either a role or a member) to
            :class:`PermissionOverwrite` to apply to the channel.
        default_auto_archive_duration: :class:`int`
            The new default auto archive duration in minutes for threads created in this channel.
            Must be one of ``60``, ``1440``, ``4320``, or ``10080``.

            .. versionadded:: 2.0
        default_thread_slowmode_delay: :class:`int`
            The new default slowmode delay in seconds for threads created in this channel.

            .. versionadded:: 2.3
        Raises
        ------
        ValueError
            The new ``position`` is less than 0 or greater than the number of channels.
        TypeError
            The permission overwrite information is not in proper form.
        Forbidden
            You do not have permissions to edit the channel.
        HTTPException
            Editing the channel failed.

        Returns
        --------
        Optional[:class:`.TextChannel`]
            The newly edited text channel. If the edit was only positional
            then ``None`` is returned instead.
        r)  Nr   r   r   _editr   r   r   r   r_   r2  payloads       ri   r(  zTextChannel.edit  sZ      V 

76
::::::::>>4:G>TTT rh   r   r.  r_   c                  K   | j         | j        | j        | j        d}|                                 s
| j        |d<   |                     ||||           d {V S )N)rn   rq   rt   r   r   r9  )rn   rq   rt   ru   r   ro   _clone_implr   r   r.  r_   r  s        ri   clonezTextChannel.clone2  s       ZI-1-O262T	 
  
 ||~~ 	>*.*=D&'%%	 & 
 
 
 
 
 
 
 
 	
rh   messagesIterable[Snowflake]c                 K   t          |t          t          f          st          |          }t          |          dk    rdS t          |          dk    r:|d         j        }| j        j                            | j        |           d{V  dS t          |          dk    rt          d          d |D             }| j        j        	                    | j        ||           d{V  dS )a1  |coro|

        Deletes a list of messages. This is similar to :meth:`Message.delete`
        except it bulk deletes multiple messages.

        As a special case, if the number of messages is 0, then nothing
        is done. If the number of messages is 1 then single message
        delete is done. If it's more than two, then bulk delete is used.

        You cannot bulk delete more than 100 messages or messages that
        are older than 14 days old.

        You must have :attr:`~Permissions.manage_messages` to do this.

        .. versionchanged:: 2.0

            ``messages`` parameter is now positional-only.

            The ``reason`` keyword-only parameter was added.

        Parameters
        -----------
        messages: Iterable[:class:`abc.Snowflake`]
            An iterable of messages denoting which ones to bulk delete.
        reason: Optional[:class:`str`]
            The reason for deleting the messages. Shows up on the audit log.

        Raises
        ------
        ClientException
            The number of messages to delete was more than 100.
        Forbidden
            You do not have proper permissions to delete the messages.
        NotFound
            If single delete, then the message was already deleted.
        HTTPException
            Deleting the messages failed.
        r   Nr   d   0Can only bulk delete messages up to 100 messagesc                    g | ]	}|j         
S rg   r   r   r  s     ri   r  z/TextChannel.delete_messages.<locals>.<listcomp>~      %=%=%=qad%=%=%=rh   r)  

isinstancelisttuplelenr   r   httpdelete_messager%   delete_messagesr   r>  r_   
message_idmessage_idss        ri   rN  zTextChannel.delete_messagesI  s      N (T5M22 	&H~~Hx==AFx==A&qknJ+"11$':FFFFFFFFFFx==3!"TUUU%=%=H%=%=%=k..twF.SSSSSSSSSSSrh   rA  Tlimitcheckbeforeafteraroundoldest_firstbulkr_   rS  Optional[int]rT  Callable[[Message], bool]rU  Optional[SnowflakeTime]rV  rW  rX  Optional[bool]rY  List[Message]c               b   K   t           j                            | ||||||||	  	         d{V S )a	  |coro|

        Purges a list of messages that meet the criteria given by the predicate
        ``check``. If a ``check`` is not provided then all messages are deleted
        without discrimination.

        You must have :attr:`~Permissions.manage_messages` to
        delete messages even if they are your own.
        Having :attr:`~Permissions.read_message_history` is
        also needed to retrieve message history.

        .. versionchanged:: 2.0

            The ``reason`` keyword-only parameter was added.

        Examples
        ---------

        Deleting bot's messages ::

            def is_me(m):
                return m.author == client.user

            deleted = await channel.purge(limit=100, check=is_me)
            await channel.send(f'Deleted {len(deleted)} message(s)')

        Parameters
        -----------
        limit: Optional[:class:`int`]
            The number of messages to search through. This is not the number
            of messages that will be deleted, though it can be.
        check: Callable[[:class:`Message`], :class:`bool`]
            The function used to check if a message should be deleted.
            It must take a :class:`Message` as its sole parameter.
        before: Optional[Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]]
            Same as ``before`` in :meth:`history`.
        after: Optional[Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]]
            Same as ``after`` in :meth:`history`.
        around: Optional[Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]]
            Same as ``around`` in :meth:`history`.
        oldest_first: Optional[:class:`bool`]
            Same as ``oldest_first`` in :meth:`history`.
        bulk: :class:`bool`
            If ``True``, use bulk delete. Setting this to ``False`` is useful for mass-deleting
            a bot's own messages without :attr:`Permissions.manage_messages`. When ``True``, will
            fall back to single delete if messages are older than two weeks.
        reason: Optional[:class:`str`]
            The reason for purging the messages. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have proper permissions to do the actions required.
        HTTPException
            Purging the messages failed.

        Returns
        --------
        List[:class:`.Message`]
            The list of messages that were deleted.
        rR  Ndiscordabc_purge_helper	r   rS  rT  rU  rV  rW  rX  rY  r_   s	            ri   purgezTextChannel.purge  sa      R [..% / 

 

 

 

 

 

 

 

 
	
rh   List[Webhook]c                    K   ddl m  j        j                             j                   d{V } fd|D             S )h  |coro|

        Gets the list of webhooks from this channel.

        You must have :attr:`~.Permissions.manage_webhooks` to do this.

        Raises
        -------
        Forbidden
            You don't have permissions to get the webhooks.

        Returns
        --------
        List[:class:`Webhook`]
            The webhooks for this channel.
        r   rH   Nc                >    g | ]} j         |j                   S r   
from_stater   r   drI   r   s     ri   r  z(TextChannel.webhooks.<locals>.<listcomp>  .    GGGQ""1DK888GGGrh   webhookrI   r   rL  channel_webhooksr   r   r   rI   s   ` @ri   webhookszTextChannel.webhooks  e      $ 	%$$$$$[%66tw????????GGGGG$GGGGrh   avatarr_   rx  Optional[bytes]rI   c                  K   ddl m} |t          j        |          }| j        j                            | j        t          |          ||           d{V } |j	        || j                  S )a  |coro|

        Creates a webhook for this channel.

        You must have :attr:`~.Permissions.manage_webhooks` to do this.

        .. versionchanged:: 1.1
            Added the ``reason`` keyword-only parameter.

        Parameters
        -------------
        name: :class:`str`
            The webhook's name.
        avatar: Optional[:class:`bytes`]
            A :term:`py:bytes-like object` representing the webhook's default avatar.
            This operates similarly to :meth:`~ClientUser.edit`.
        reason: Optional[:class:`str`]
            The reason for creating this webhook. Shows up in the audit logs.

        Raises
        -------
        HTTPException
            Creating the webhook failed.
        Forbidden
            You do not have permissions to create a webhook.

        Returns
        --------
        :class:`Webhook`
            The created webhook.
        r   rH   Nr   rx  r_   rk  
rr  rI   r"   _bytes_to_base64_datar   rL  create_webhookr   rm   rm  r   r   rx  r_   rI   r   s         ri   r~  zTextChannel.create_webhook  s      B 	%$$$$$088F[%44TW3t99U[dj4kkkkkkkk!w!$dk::::rh   destinationc               X  K   |                                  st          d          t          |t                    st	          d|j        j                   ddlm} | j	        j
                            | j        |j        |           d{V } |j        ||| j	        j                  S )av  |coro|

        Follows a channel using a webhook.

        Only news channels can be followed.

        .. note::

            The webhook returned will not provide a token to do webhook
            actions, as Discord does not provide it.

        .. versionadded:: 1.3

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` instead of
            ``InvalidArgument``.

        Parameters
        -----------
        destination: :class:`TextChannel`
            The channel you would like to follow from.
        reason: Optional[:class:`str`]
            The reason for following the channel. Shows up on the destination guild's audit log.

            .. versionadded:: 1.4

        Raises
        -------
        HTTPException
            Following the channel failed.
        Forbidden
            You do not have the permissions to create a webhook.
        ClientException
            The channel is not a news channel.
        TypeError
            The destination channel is not a text channel.

        Returns
        --------
        :class:`Webhook`
            The created webhook.
        z#The channel must be a news channel.zExpected TextChannel received r   rH   )webhook_channel_idr_   N)r   r   )r   r%   rH  r0   	TypeErrorr   rc   rr  rI   r   rL  follow_webhookr   _as_followerr   )r   r  r_   rI   r   s        ri   followzTextChannel.follow  s      X ||~~ 	I!"GHHH+{33 	_][=R=[]]^^^$$$$$$[%44TWQ\Q_hn4oooooooo#w#D+DKDTUUUUrh   rP  rE   c               (    ddl m}  || |          S a&  Creates a :class:`PartialMessage` from the message ID.

        This is useful if you want to work with a message and only have its ID without
        doing an unnecessary API call.

        .. versionadded:: 1.6

        .. versionchanged:: 2.0

            ``message_id`` parameter is now positional-only.

        Parameters
        ------------
        message_id: :class:`int`
            The message ID to create a partial message for.

        Returns
        ---------
        :class:`PartialMessage`
            The partial message.
        r   rE   r   r   r   rE   r   rP  rE   s      ri   get_partial_messagezTextChannel.get_partial_messageM  +    . 	,+++++~dz::::rh   	thread_idOptional[Thread]c               6    | j                             |          S )a  Returns a thread with the given ID.

        .. note::

            This does not always retrieve archived threads, as they are not retained in the internal
            cache. Use :func:`Guild.fetch_channel` instead.

        .. versionadded:: 2.0

        Parameters
        -----------
        thread_id: :class:`int`
            The ID to search for.

        Returns
        --------
        Optional[:class:`Thread`]
            The returned thread or ``None`` if not found.
        )r   
get_thread)r   r  s     ri   r  zTextChannel.get_threadh  s    ( z$$Y///rh   )r   auto_archive_durationr   r_   	invitablero   r   Optional[Snowflake]r  Optional[ChannelType]r  r'   c          	     R  K   |t           j        }|>| j        j                            | j        ||p| j        |j        |||           d{V }n<| j        j                            | j        |j        ||p| j        ||           d{V }t          | j
        | j        |          S )a  |coro|

        Creates a thread in this text channel.

        To create a public thread, you must have :attr:`~discord.Permissions.create_public_threads`.
        For a private thread, :attr:`~discord.Permissions.create_private_threads` is needed instead.

        .. versionadded:: 2.0

        Parameters
        -----------
        name: :class:`str`
            The name of the thread.
        message: Optional[:class:`abc.Snowflake`]
            A snowflake representing the message to create the thread with.
            If ``None`` is passed then a private thread is created.
            Defaults to ``None``.
        auto_archive_duration: :class:`int`
            The duration in minutes before a thread is automatically hidden from the channel list.
            If not provided, the channel's default auto archive duration is used.

            Must be one of ``60``, ``1440``, ``4320``, or ``10080``, if provided.
        type: Optional[:class:`ChannelType`]
            The type of thread to create. If a ``message`` is passed then this parameter
            is ignored, as a thread created with a message is always a public thread.
            By default this creates a private thread if this is ``None``.
        reason: :class:`str`
            The reason for creating a new thread. Shows up on the audit log.
        invitable: :class:`bool`
            Whether non-moderators can add users to the thread. Only applicable to private threads.
            Defaults to ``True``.
        slowmode_delay: Optional[:class:`int`]
            Specifies the slowmode rate limit for user in this channel, in seconds.
            The maximum value possible is ``21600``. By default no slowmode rate limit
            if this is ``None``.

        Raises
        -------
        Forbidden
            You do not have permissions to create a thread.
        HTTPException
            Starting the thread failed.

        Returns
        --------
        :class:`Thread`
            The created thread
        N)r   r  r   r_   r  r   )r   r  r_   r   r   r   r   )r   private_threadr   rL  start_thread_without_messager   rt   r   start_thread_with_messager'   r   )	r   r   r   r  r   r_   r  ro   r   s	            ri   create_threadzTextChannel.create_thread~  s      x <-D?)FF&;&at?aZ#$2 G        DD )CC
&;&at?a$2 D        D DJdkEEEErh   F)privater   rS  rU  r  r   -Optional[Union[Snowflake, datetime.datetime]]AsyncIterator[Thread]c              v  K   |r|st          d          d}t          |t          j                  r;|r$t          t	          j        |d                    }nY|                                }nD|B|rt          |j                  }n+t	          j        |j                                                  }d }| j	        j
        j        j        }|rd }| j	        j
        j        j        }n|r| j	        j
        j        j        }	 d}|&|d	k    rdS t          d
t!          ||                    } || j        ||           d{V }	|	                    dg           }
|
D ]6}t%          | j	        | j	        j
        |          W V  ||dz  }|d	k    r dS 7|	                    dd          sdS  ||
d                   })a9  Returns an :term:`asynchronous iterator` that iterates over all archived threads in this text channel,
        in order of decreasing ID for joined threads, and decreasing :attr:`Thread.archive_timestamp` otherwise.

        You must have :attr:`~Permissions.read_message_history` to do this. If iterating over private threads
        then :attr:`~Permissions.manage_threads` is also required.

        .. versionadded:: 2.0

        Parameters
        -----------
        limit: Optional[:class:`bool`]
            The number of threads to retrieve.
            If ``None``, retrieves every archived thread in the channel. Note, however,
            that this would make it a slow operation.
        before: Optional[Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]]
            Retrieve archived channels before the given date or ID.
        private: :class:`bool`
            Whether to retrieve private archived threads.
        joined: :class:`bool`
            Whether to retrieve private archived threads that you've joined.
            You cannot set ``joined`` to ``True`` and ``private`` to ``False``.

        Raises
        ------
        Forbidden
            You do not have permissions to get archived threads.
        HTTPException
            The request to get the archived threads failed.
        ValueError
            ``joined`` was set to ``True`` and ``private`` was set to ``False``. You cannot retrieve public archived
            threads that you have joined.

        Yields
        -------
        :class:`Thread`
            The archived threads.
        z.Cannot retrieve joined public archived threadsNF)highc                    | d         d         S Nthread_metadataarchive_timestamprg   r   s    ri   <lambda>z.TextChannel.archived_threads.<locals>.<lambda>      T*;%<=P%Q rh   c                    | d         S Nr   rg   r  s    ri   r  z.TextChannel.archived_threads.<locals>.<lambda>  s
    d rh   TrA  r      rU  rS  r  r  r   has_more)
ValueErrorrH  datetimerm   r"   time_snowflake	isoformatr   r   r   r   rL  get_public_archived_threads#get_joined_private_archived_threadsget_private_archived_threadsmaxminr   r'   )r   r  r   rS  rU  before_timestampupdate_beforeendpointretriever   r  
raw_threads               ri   archived_threadszTextChannel.archived_threads  s     Z  	O' 	OMNNNfh/00 		O 6#&u';F'O'O'O#P#P  #)#3#3#5#5   O#&vy>>  #(#7	#B#B#L#L#N#N QQ:$)E 	K33Mz(-QHH 	Kz(-JH	:H A::Fq#h"6"677!$'2B(SSSSSSSSSDhhy"--G%  
4:TZ5FZXXXXXXX $QJEzz88J.. ,}WR[99-	:rh   )r   rJ   r   rQ   r   r   r   )r   rQ   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&  ra   r`   r_   r^   r   r   )r_   r^   r   rm   rn   rm   ra   r`   rq   rp   r-  rp   r.  r/  ro   r`   rt   r=   ru   r`   r   r   rs   r0  r   r0   )r_   r^   r2  r   r   r&  )r   r^   r.  r/  r_   r^   r   r0   r>  r?  r_   r^   r   r   rS  rZ  rT  r[  rU  r\  rV  r\  rW  r\  rX  r]  rY  rp   r_   r^   r   r^  r   rf  r   rm   rx  ry  r_   r^   r   rI   )r  r0   r_   r^   r   rI   rP  r`   r   rE   r  r`   r   r  )r   rm   r   r  r  r=   r   r  r_   r^   r  rp   ro   rZ  r   r'   )
r  rp   r   rp   rS  rZ  rU  r  r   r  )&rc   rd   re   r   r   r   r   r   r   r   r   r   r   r"   copy_docra  rb  rR   r   r  r  r  r   r%  r   r(  r=  rN  r#   re  ru  r~  r  r  r  r  r  r   r   s   @ri   r0   r0     s(       4 4lI"" " " "
7 
7 
7 
7$ $ $ $          X  & & & X&    X U^GK,<==     >= X X X XX b b b Xb   4 4 4 4 ` ` ` X`( 666 X6CFTTTTT XT !$!$.1!?B-0BE     X" 59 NU NU NU NU NU NU` U^GK,233 #.2 $
 
 
 
 
 43
, _c 6T 6T 6T 6T 6T 6Tv  #+2*.)-*.'+ $S
 S
 S
 S
 S
 S
jH H H H. LPim '; '; '; '; '; ';R QU 5V 5V 5V 5V 5V 5Vn; ; ; ;60 0 0 04 (,7>&* $(,SF SF SF SF SF SFp "@D\: \: \: \: \: \: \: \: \: \:rh   r0   c            	          e Zd ZdZdIdZdJdZdKdZdLdZdMdZe	dNd            Z
dOdZe	dPd            Ze	dQd            Ze	dRd            Z ej        ej        j        j                  dS fd            Ze	dTd!            ZdUd$Zd%d&dVd+Zd,ed%d%d%d%d-d%d.dWd;ZdXd=Zd%d%d>dYdDZ ej        ej        j        j                  d%d%d%dEdZdH            Z xZS )[VocalGuildChannel)r   r   r   rq   rx   ry   r   ra   ro   r   r   rz   r{   r   r   rJ   r   rQ   r   /Union[VoiceChannelPayload, StageChannelPayload]c               t    || _         t          |d                   | _        |                     ||           d S r  r   r`   r   r   r   s       ri   r   zVocalGuildChannel.__init__D  4    ',4:UD!!!!!rh   r   r;   c                
   K   | S r   rg   r   s    ri   r   zVocalGuildChannel._get_channelI  r   rh   Tuple[int, str]c                    | j         j        dfS )Nguild_idr   r   r   s    ri   _get_voice_client_keyz'VocalGuildChannel._get_voice_client_keyL  s    z}j((rh   Tuple[int, int]c                (    | j         j        | j        fS r   r  r   s    ri   _get_voice_state_pairz'VocalGuildChannel._get_voice_state_pairO  s    z}dg%%rh   r   c                
   || _         |d         | _        |                    dd          | _        |                    d          | _        t          t          |                    dd                    | _        t          j	        |d          | _
        t          j	        |d          | _        |d	         | _        |                    d
d          | _        |d         | _        |d         | _        |                     |           d S )Nr   rq   Frz   r{   r   r   r   ra   r   r   rx   ry   )r   r   r   rq   rz   r   r   r{   r"   r   r   r   ra   ro   rx   ry   r   r   s      ri   r   zVocalGuildChannel._updateR  s    !
f	((6511	)-,)?)?4<=MtxxXlnoOpOp4q4q*/*A$*T*T.3.EdL].^.^!*-"hh'<a@@ O#L1d#####rh   r`   c                $    t           j        j        S r   )r   r  r   r   s    ri   r   z!VocalGuildChannel._sorting_bucket`  s     &&rh   rp   c                    | j         S )zU:class:`bool`: Checks if the channel is NSFW.

        .. versionadded:: 2.0
        r  r   s    ri   r  zVocalGuildChannel.is_nsfwd  s    
 yrh   r  c                    g }| j         j                                        D ]R\  }}|j        rF|j        j        | j        k    r1| j                             |          }||                    |           S|S )zXList[:class:`Member`]: Returns all members that are currently inside this voice channel.)r   _voice_statesitemsr   r   r   append)r   retr   r   members        ri   r  zVocalGuildChannel.membersk  s{     "j6<<>> 	' 	'NGU} '!1TW!<!<..w77%JJv&&&
rh   Dict[int, VoiceState]c                X      fd j         j                                        D             S )a  Returns a mapping of member IDs who have voice states in this channel.

        .. versionadded:: 1.3

        .. note::

            This function is intentionally low level to replace :attr:`members`
            when the member cache is unavailable.

        Returns
        --------
        Mapping[:class:`int`, :class:`VoiceState`]
            The mapping of member ID to a voice state.
        c                T    i | ]$\  }}|j         r|j         j        j        k    !||%S rg   r  )r   keyr   r   s      ri   
<dictcomp>z2VocalGuildChannel.voice_states.<locals>.<dictcomp>  sG     
 
 
U}
 "'!1TW!<!< !<!<!<rh   )r   r  r  r   s   `ri   voice_stateszVocalGuildChannel.voice_statesv  s?    "
 
 
 
"j6<<>>
 
 
 	
rh   List[ScheduledEvent]c                4      fd j         j        D             S )zuList[:class:`ScheduledEvent`]: Returns all scheduled events for this channel.

        .. versionadded:: 2.0
        c                4    g | ]}|j         j        k    |S rg   )r   r   )r   eventr   s     ri   r  z6VocalGuildChannel.scheduled_events.<locals>.<listcomp>  s*    ^^^%%BRVZV]B]B]B]B]B]rh   )r   scheduled_eventsr   s   `ri   r  z"VocalGuildChannel.scheduled_events  s%     _^^^4:#>^^^^rh   r   r   r   c                  t                                          |          }|                     |           |j        s@t	          j                    }|                    dd           |xj        |j         z  c_        |S )NT)manage_channelsmanage_roles)r   r   r  connectr   r  updater   r  s       ri   r   z!VocalGuildChannel.permissions_for  sw    ww&&s++((... | 	( &((FMM$TMBBBJJ6<-'JJrh   r!  c                R    | j         r| j                            | j                   ndS )aY  Retrieves the last message from this channel in cache.

        The message might not be valid or point to an existing message.

        .. versionadded:: 2.0

        .. admonition:: Reliable Fetching
            :class: helpful

            For a slightly more reliable method of fetching the
            last message, consider using either :meth:`history`
            or :meth:`fetch_message` with the :attr:`last_message_id`
            attribute.

        Returns
        ---------
        Optional[:class:`Message`]
            The last message in this channel or ``None`` if not found.
        Nr#  r   s    ri   r%  zVocalGuildChannel.last_message  s-    * BFAU_t{''(<===[__rh   rP  rE   c               (    ddl m}  || |          S )a  Creates a :class:`PartialMessage` from the message ID.

        This is useful if you want to work with a message and only have its ID without
        doing an unnecessary API call.

        .. versionadded:: 2.0

        Parameters
        ------------
        message_id: :class:`int`
            The message ID to create a partial message for.

        Returns
        ---------
        :class:`PartialMessage`
            The partial message.
        r   r  r  r  r  s      ri   r  z%VocalGuildChannel.get_partial_message  s+    & 	,+++++~dz::::rh   Nr)  r>  r?  r_   r^   c                 K   t          |t          t          f          st          |          }t          |          dk    rdS t          |          dk    r:|d         j        }| j        j                            | j        |           d{V  dS t          |          dk    rt          d          d |D             }| j        j        	                    | j        ||           d{V  dS )a  |coro|

        Deletes a list of messages. This is similar to :meth:`Message.delete`
        except it bulk deletes multiple messages.

        As a special case, if the number of messages is 0, then nothing
        is done. If the number of messages is 1 then single message
        delete is done. If it's more than two, then bulk delete is used.

        You cannot bulk delete more than 100 messages or messages that
        are older than 14 days old.

        You must have :attr:`~Permissions.manage_messages` to do this.

        .. versionadded:: 2.0

        Parameters
        -----------
        messages: Iterable[:class:`abc.Snowflake`]
            An iterable of messages denoting which ones to bulk delete.
        reason: Optional[:class:`str`]
            The reason for deleting the messages. Shows up on the audit log.

        Raises
        ------
        ClientException
            The number of messages to delete was more than 100.
        Forbidden
            You do not have proper permissions to delete the messages.
        NotFound
            If single delete, then the message was already deleted.
        HTTPException
            Deleting the messages failed.
        r   Nr   rA  rB  c                    g | ]	}|j         
S rg   rD  rE  s     ri   r  z5VocalGuildChannel.delete_messages.<locals>.<listcomp>  rF  rh   r)  rG  rO  s        ri   rN  z!VocalGuildChannel.delete_messages  s      F (T5M22 	&H~~Hx==AFx==A&qknJ+"11$':FFFFFFFFFFx==3!"TUUU%=%=H%=%=%=k..twF.SSSSSSSSSSSrh   rA  TrR  rS  rZ  rT  r[  rU  r\  rV  rW  rX  r]  rY  r^  c               b   K   t           j                            | ||||||||	  	         d{V S )aR	  |coro|

        Purges a list of messages that meet the criteria given by the predicate
        ``check``. If a ``check`` is not provided then all messages are deleted
        without discrimination.

        You must have :attr:`~Permissions.manage_messages` to
        delete messages even if they are your own.
        Having :attr:`~Permissions.read_message_history` is
        also needed to retrieve message history.

        .. versionadded:: 2.0

        Examples
        ---------

        Deleting bot's messages ::

            def is_me(m):
                return m.author == client.user

            deleted = await channel.purge(limit=100, check=is_me)
            await channel.send(f'Deleted {len(deleted)} message(s)')

        Parameters
        -----------
        limit: Optional[:class:`int`]
            The number of messages to search through. This is not the number
            of messages that will be deleted, though it can be.
        check: Callable[[:class:`Message`], :class:`bool`]
            The function used to check if a message should be deleted.
            It must take a :class:`Message` as its sole parameter.
        before: Optional[Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]]
            Same as ``before`` in :meth:`history`.
        after: Optional[Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]]
            Same as ``after`` in :meth:`history`.
        around: Optional[Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]]
            Same as ``around`` in :meth:`history`.
        oldest_first: Optional[:class:`bool`]
            Same as ``oldest_first`` in :meth:`history`.
        bulk: :class:`bool`
            If ``True``, use bulk delete. Setting this to ``False`` is useful for mass-deleting
            a bot's own messages without :attr:`Permissions.manage_messages`. When ``True``, will
            fall back to single delete if messages are older than two weeks.
        reason: Optional[:class:`str`]
            The reason for purging the messages. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have proper permissions to do the actions required.
        HTTPException
            Purging the messages failed.

        Returns
        --------
        List[:class:`.Message`]
            The list of messages that were deleted.
        rR  Nr`  rd  s	            ri   re  zVocalGuildChannel.purge  sa      P [..% / 

 

 

 

 

 

 

 

 
	
rh   rf  c                    K   ddl m  j        j                             j                   d{V } fd|D             S )a  |coro|

        Gets the list of webhooks from this channel.

        You must have :attr:`~.Permissions.manage_webhooks` to do this.

        .. versionadded:: 2.0

        Raises
        -------
        Forbidden
            You don't have permissions to get the webhooks.

        Returns
        --------
        List[:class:`Webhook`]
            The webhooks for this channel.
        r   rH   Nc                >    g | ]} j         |j                   S rj  rl  rn  s     ri   r  z.VocalGuildChannel.webhooks.<locals>.<listcomp>p  rp  rh   rq  rt  s   ` @ri   ru  zVocalGuildChannel.webhooksY  se      ( 	%$$$$$[%66tw????????GGGGG$GGGGrh   rw  r   rm   rx  ry  rI   c                  K   ddl m} |t          j        |          }| j        j                            | j        t          |          ||           d{V } |j	        || j                  S )aH  |coro|

        Creates a webhook for this channel.

        You must have :attr:`~.Permissions.manage_webhooks` to do this.

        .. versionadded:: 2.0

        Parameters
        -------------
        name: :class:`str`
            The webhook's name.
        avatar: Optional[:class:`bytes`]
            A :term:`py:bytes-like object` representing the webhook's default avatar.
            This operates similarly to :meth:`~ClientUser.edit`.
        reason: Optional[:class:`str`]
            The reason for creating this webhook. Shows up in the audit logs.

        Raises
        -------
        HTTPException
            Creating the webhook failed.
        Forbidden
            You do not have permissions to create a webhook.

        Returns
        --------
        :class:`Webhook`
            The created webhook.
        r   rH   Nr{  rk  r|  r  s         ri   r~  z VocalGuildChannel.create_webhookr  s      @ 	%$$$$$088F[%44TW3t99U[dj4kkkkkkkk!w!$dk::::rh   r9  r.  r/  c                  K   | j         | j        | j        | j        | j        j        d}| j        r
| j        |d<   |                     ||||           d {V S )N)rx   ry   r   rq   r{   rz   r9  )rx   ry   ro   rq   r{   r   rz   r;  r<  s        ri   r=  zVocalGuildChannel.clone  s      
 |/#'#6I"&"9"?
 
 ? 	1!%D%%	 & 
 
 
 
 
 
 
 
 	
rh   )r   rJ   r   rQ   r   r  r  )r   r  )r   r  )r   rQ   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;   )rc   rd   re   r   r   r   r  r  r   r   r   r  r  r  r  r"   r  ra  rb  rR   r   r%  r  rN  r#   re  ru  r~  r=  r   r   s   @ri   r  r  2  s       I"" " " "
   ) ) ) )& & & &$ $ $ $ ' ' ' X'       X 
 
 
 X
. _ _ _ X_ U^GK,<==
 
 
 
 
 >=
 ` ` ` X`,; ; ; ;. _c 2T 2T 2T 2T 2T 2Tn  #+2*.)-*.'+ $R
 R
 R
 R
 R
 R
hH H H H2 LPim &; &; &; &; &; &;P U^GK,233'+SWqu
 
 
 
 
 43
 
 
 
 
rh   r  c                      e Zd ZdZdZd,dZed-d            Zed.d	            Ze	d/d            Z
e	ddd0d            Z
e	ddddddddddddddd1d#            Z
d$dd2d(Z
d3d+Zd$S )4r1   aE  Represents a Discord guild voice channel.

    .. container:: operations

        .. describe:: x == y

            Checks if two channels are equal.

        .. describe:: x != y

            Checks if two channels are not equal.

        .. describe:: hash(x)

            Returns the channel's hash.

        .. describe:: str(x)

            Returns the channel's name.

    Attributes
    -----------
    name: :class:`str`
        The channel name.
    guild: :class:`Guild`
        The guild the channel belongs to.
    id: :class:`int`
        The channel ID.
    nsfw: :class:`bool`
        If the channel is marked as "not safe for work" or "age restricted".

        .. versionadded:: 2.0
    category_id: Optional[:class:`int`]
        The category channel ID this channel belongs to, if applicable.
    position: :class:`int`
        The position in the channel list. This is a number that starts at 0. e.g. the
        top channel is position 0.
    bitrate: :class:`int`
        The channel's preferred audio bitrate in bits per second.
    user_limit: :class:`int`
        The channel's limit for number of members that can be in a voice channel.
    rtc_region: Optional[:class:`str`]
        The region for the voice channel's voice communication.
        A value of ``None`` indicates automatic voice region detection.

        .. versionadded:: 1.7

        .. versionchanged:: 2.0
            The type of this attribute has changed to :class:`str`.
    video_quality_mode: :class:`VideoQualityMode`
        The camera video quality for the voice channel's participants.

        .. versionadded:: 2.0
    last_message_id: Optional[:class:`int`]
        The last message ID of the message sent to this channel. It may
        *not* point to an existing or valid message.

        .. versionadded:: 2.0
    slowmode_delay: :class:`int`
        The number of seconds a member must wait between sending messages
        in this channel. A value of ``0`` denotes that it is disabled.
        Bots and users with :attr:`~Permissions.bypass_slowmode` bypass slowmode.

        .. versionadded:: 2.2
    rg   r   rm   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g}d	                    d
 |D                       }d| j	        j
         d	| dS )Nr   r   rz   ra   rx   r{   ry   r   r   c              3      K   | ]	}d |z  V  
dS r   rg   r   s     ri   r   z(VoiceChannel.__repr__.<locals>.<genexpr>   r   rh   r   r   )r   r   rz   ra   rx   r{   ry   r   r   r   rc   r   s      ri   r   zVoiceChannel.__repr__  s    47OTY4?+'%!4#:;4?+D,-	
 55u5555564>*66V6666rh   r   c                    t           j        S r   )r   r  r   s    ri   r   z)VoiceChannel._scheduled_event_entity_type  s    rh   Literal[ChannelType.voice]c                    t           j        S r   )r   r  r   s    ri   r   zVoiceChannel.type         rh   r   c                
   K   d S r   rg   r   s    ri   r(  zVoiceChannel.edit        "%#rh   .r)  ra   r`   r_   r^   c               
   K   d S r   rg   r+  s      ri   r(  zVoiceChannel.edit  r,  rh   )r   rq   rx   ry   ra   r-  r.  rs   rz   r{   ro   statusr_   r   rq   rp   rx   ry   r-  r.  r/  rs   r0  rz   r{   r   ro   r	  c               
   K   d S r   rg   )r   r   rq   rx   ry   ra   r-  r.  rs   rz   r{   ro   r	  r_   s                 ri   r(  zVoiceChannel.edit  s      " srh   Nr2  r   Optional[VoiceChannel]c                  K   |                      ||           d{V }|"|                     | j        | j        |          S dS )a  |coro|

        Edits the channel.

        You must have :attr:`~Permissions.manage_channels` to do this.

        .. versionchanged:: 1.3
            The ``overwrites`` keyword-only parameter was added.

        .. versionchanged:: 2.0
            Edits are no longer in-place, the newly edited channel is returned instead.

        .. versionchanged:: 2.0
            The ``region`` parameter now accepts :class:`str` instead of an enum.

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` instead of
            ``InvalidArgument``.

        Parameters
        ----------
        name: :class:`str`
            The new channel's name.
        bitrate: :class:`int`
            The new channel's bitrate.
        nsfw: :class:`bool`
            To mark the channel as NSFW or not.
        user_limit: :class:`int`
            The new channel's user limit.
        position: :class:`int`
            The new channel's position.
        sync_permissions: :class:`bool`
            Whether to sync permissions with the channel's new or pre-existing
            category. Defaults to ``False``.
        category: Optional[:class:`CategoryChannel`]
            The new category for this channel. Can be ``None`` to remove the
            category.
        slowmode_delay: :class:`int`
            Specifies the slowmode rate limit for user in this channel, in seconds.
            A value of ``0`` disables slowmode. The maximum value possible is ``21600``.
        reason: Optional[:class:`str`]
            The reason for editing this channel. Shows up on the audit log.
        overwrites: :class:`Mapping`
            A :class:`Mapping` of target (either a role or a member) to
            :class:`PermissionOverwrite` to apply to the channel.
        rtc_region: Optional[:class:`str`]
            The new region for the voice channel's voice communication.
            A value of ``None`` indicates automatic voice region detection.

            .. versionadded:: 1.7
        video_quality_mode: :class:`VideoQualityMode`
            The camera video quality for the voice channel's participants.

            .. versionadded:: 2.0
        status: Optional[:class:`str`]
            The new voice channel status. It can be up to 500 characters.
            Can be ``None`` to remove the status.

            .. versionadded:: 2.4

        Raises
        ------
        TypeError
            If the permission overwrite information is not in proper form.
        Forbidden
            You do not have permissions to edit the channel.
        HTTPException
            Editing the channel failed.

        Returns
        --------
        Optional[:class:`.VoiceChannel`]
            The newly edited voice channel. If the edit was only positional
            then ``None`` is returned instead.
        r)  Nr4  r5  r7  s       ri   r(  zVoiceChannel.edit%  sZ      X 

76
::::::::>>4:G>TTT rh   r   .Union[SoundboardSound, SoundboardDefaultSound]c                  K   d|j         i}t          |t                    s)| j        j         |j        j         k    r|j        j         |d<    | j        j        j        | j         fi | d{V  dS )a  |coro|

        Sends a soundboard sound for this channel.

        You must have :attr:`~Permissions.speak` and :attr:`~Permissions.use_soundboard` to do this.
        Additionally, you must have :attr:`~Permissions.use_external_sounds` if the sound is from
        a different guild.

        .. versionadded:: 2.5

        Parameters
        -----------
        sound: Union[:class:`SoundboardSound`, :class:`SoundboardDefaultSound`]
            The sound to send for this channel.

        Raises
        -------
        Forbidden
            You do not have permissions to send a sound for this channel.
        HTTPException
            Sending the sound failed.
        r   source_guild_idN)r   rH  r/   r   r   rL  send_soundboard_sound)r   r   r8  s      ri   
send_soundzVoiceChannel.send_soundv  s      . ux(%!788 	8TZ]ekn=\=\).G%&4dk4TWHHHHHHHHHHHHHrh   r   r  )r   r  r   r   r  )r   rm   rq   rp   rx   r`   ry   r`   ra   r`   r-  r`   r.  r/  rs   r0  rz   r^   r{   r   ro   r`   r	  r^   r_   r^   r   r1   )r_   r^   r2  r   r   r  )r   r  r   r   )rc   rd   re   r   r   r   r   r   r   r   r(  r  rg   rh   ri   r1   r1     sN       @ @D I7 7 7 7       X  ! ! ! X! %%% X%CFTTTTT XT  #.1BE$'/2! # #     X$ 59 OU OU OU OU OU OUbI I I I I Irh   r1   c                  l    e Zd ZdZdZd?dZd@ fdZedAd            ZedBd            Z	edBd            Z
edBd            ZedBd            ZedCd            ZedDd            ZededddEd$ZdFd%ZedGd&            Zed'd(dHd+            Zed'd'd'd'd'd'd'd'd'd'd'd'd,dId:            Zdd(dJd>Z xZS )Kr2   a5  Represents a Discord guild stage channel.

    .. versionadded:: 1.7

    .. container:: operations

        .. describe:: x == y

            Checks if two channels are equal.

        .. describe:: x != y

            Checks if two channels are not equal.

        .. describe:: hash(x)

            Returns the channel's hash.

        .. describe:: str(x)

            Returns the channel's name.

    Attributes
    -----------
    name: :class:`str`
        The channel name.
    guild: :class:`Guild`
        The guild the channel belongs to.
    id: :class:`int`
        The channel ID.
    nsfw: :class:`bool`
        If the channel is marked as "not safe for work" or "age restricted".

        .. versionadded:: 2.0
    topic: Optional[:class:`str`]
        The channel's topic. ``None`` if it isn't set.
    category_id: Optional[:class:`int`]
        The category channel ID this channel belongs to, if applicable.
    position: :class:`int`
        The position in the channel list. This is a number that starts at 0. e.g. the
        top channel is position 0.
    bitrate: :class:`int`
        The channel's preferred audio bitrate in bits per second.
    user_limit: :class:`int`
        The channel's limit for number of members that can be in a stage channel.
    rtc_region: Optional[:class:`str`]
        The region for the stage channel's voice communication.
        A value of ``None`` indicates automatic voice region detection.
    video_quality_mode: :class:`VideoQualityMode`
        The camera video quality for the stage channel's participants.

        .. versionadded:: 2.0
    last_message_id: Optional[:class:`int`]
        The last message ID of the message sent to this channel. It may
        *not* point to an existing or valid message.

        .. versionadded:: 2.2
    slowmode_delay: :class:`int`
        The number of seconds a member must wait between sending messages
        in this channel. A value of ``0`` denotes that it is disabled.
        Bots and users with :attr:`~Permissions.bypass_slowmode` bypass slowmode.

        .. versionadded:: 2.2
    )rn   r   rm   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d	| j        fg	}d
	                    d |D                       }d| j
        j         d
| dS )Nr   r   rn   rz   ra   rx   r{   ry   r   r   c              3      K   | ]	}d |z  V  
dS r   rg   r   s     ri   r   z(StageChannel.__repr__.<locals>.<genexpr>  r   rh   r   r   )r   r   rn   rz   ra   rx   r{   ry   r   r   r   rc   r   s      ri   r   zStageChannel.__repr__  s    47OTYdj!4?+'%!4#:;4?+D,-

 55u5555564>*66V6666rh   r   rQ   r   StageChannelPayloadr   c                    t                                          ||           |                    d          | _        d S )Nrn   )r   r   r   rn   )r   r   r   r   s      ri   r   zStageChannel._update  s2    t$$$$(HHW$5$5


rh   r   c                    t           j        S r   )r   stage_instancer   s    ri   r   z)StageChannel._scheduled_event_entity_type  s    ((rh   r  c                $    d | j         D             S )zZList[:class:`Member`]: A list of members who are requesting to speak in the stage channel.c                8    g | ]}|j         	|j         j        |S r   )r  requested_to_speak_atr   r  s     ri   r  z4StageChannel.requesting_to_speak.<locals>.<listcomp>  s)    uuu6V\uflFhFtFtFtFtrh   r  r   s    ri   requesting_to_speakz StageChannel.requesting_to_speak  s     vuT\uuuurh   c                $    d | j         D             S )zList[:class:`Member`]: A list of members who have been permitted to speak in the stage channel.

        .. versionadded:: 2.0
        c                P    g | ]#}|j         r|j         j        s|j         j        !|$S r   )r  suppressr  r  s     ri   r  z)StageChannel.speakers.<locals>.<listcomp>  sI     
 
 
|
 %+L$9
 ?El>`>h >h>h>hrh   r  r   s    ri   speakerszStageChannel.speakers  s%    
 
,
 
 
 	
rh   c                $    d | j         D             S )zxList[:class:`Member`]: A list of members who are listening in the stage channel.

        .. versionadded:: 2.0
        c                8    g | ]}|j         	|j         j        |S rg   )r  r"  r  s     ri   r  z*StageChannel.listeners.<locals>.<listcomp>  s)    \\\6V\\flF[\\\\rh   r  r   s    ri   	listenerszStageChannel.listeners   s     ]\T\\\\\rh   c                T     t          j                     fd j        D             S )zvList[:class:`Member`]: A list of members who are moderating the stage channel.

        .. versionadded:: 2.0
        c                F    g | ]}                     |          k    |S rg   )r   )r   r  required_permissionsr   s     ri   r  z+StageChannel.moderators.<locals>.<listcomp>  s2    jjj6T5I5I&5Q5QUi5i5i5i5i5irh   )r   stage_moderatorr  )r   r)  s   `@ri   
moderatorszStageChannel.moderators  s4      +:<<jjjjjT\jjjjrh    Literal[ChannelType.stage_voice]c                    t           j        S r  )r   stage_voicer   s    ri   r   zStageChannel.type  s     &&rh   Optional[StageInstance]c                L    t          j        | j        j        | j                  S )zzOptional[:class:`StageInstance`]: The running stage instance of the stage channel.

        .. versionadded:: 2.0
        )r   )r"   r   r   stage_instancesr   r   s    ri   instancezStageChannel.instance  s      y3HHHHrh   FN)privacy_levelsend_start_notificationscheduled_eventr_   rn   r3  r   r4  rp   r5  rA   r_   r^   r&   c               2  K   | j         |d}|t          ur.t          |t                    st	          d          |j        |d<   |t          ur
|j         |d<   ||d<    | j        j        j        d	i |d|i d{V }t          | j
        | j        |          S )
aD  |coro|

        Create a stage instance.

        You must have :attr:`~Permissions.manage_channels` to do this.

        .. versionadded:: 2.0

        Parameters
        -----------
        topic: :class:`str`
            The stage instance's topic.
        privacy_level: :class:`PrivacyLevel`
            The stage instance's privacy level. Defaults to :attr:`PrivacyLevel.guild_only`.
        send_start_notification: :class:`bool`
            Whether to send a start notification. This sends a push notification to @everyone if ``True``. Defaults to ``False``.
            You must have :attr:`~Permissions.mention_everyone` to do this.

            .. versionadded:: 2.3
        scheduled_event: :class:`~discord.abc.Snowflake`
            The guild scheduled event associated with the stage instance.

            .. versionadded:: 2.4
        reason: :class:`str`
            The reason the stage instance was created. Shows up on the audit log.

        Raises
        ------
        TypeError
            If the ``privacy_level`` parameter is not the proper type.
        Forbidden
            You do not have permissions to create a stage instance.
        HTTPException
            Creating a stage instance failed.

        Returns
        --------
        :class:`StageInstance`
            The newly created stage instance.
        )r   rn   z0privacy_level field must be of type PrivacyLevelr3  guild_scheduled_event_idr4  r_   Nr  rg   )r   r#   rH  r   r  r   r   rL  create_stage_instancer&   r   )r   rn   r3  r4  r5  r_   r8  r   s           ri   create_instancezStageChannel.create_instance  s      d 265"I"I''m\:: T RSSS'4':GO$'))2A2DG./-D)*;T[%;UUgUUfUUUUUUUUU4:T[tLLLLrh   c                   K   | j         j                            | j                   d{V }t	          | j        | j         |          S )au  |coro|

        Gets the running :class:`StageInstance`.

        .. versionadded:: 2.0

        Raises
        -------
        NotFound
            The stage instance or channel could not be found.
        HTTPException
            Getting the stage instance failed.

        Returns
        --------
        :class:`StageInstance`
            The stage instance.
        Nr  )r   rL  get_stage_instancer   r&   r   r   r   s     ri   fetch_instancezStageChannel.fetch_instance`  sM      & [%88AAAAAAAA4:T[tLLLLrh   c                
   K   d S r   rg   r   s    ri   r(  zStageChannel.editv  r  rh   .r)  ra   r`   c               
   K   d S r   rg   r+  s      ri   r(  zStageChannel.edity  r,  rh   )r   rq   rx   ry   ra   r-  r.  rs   rz   r{   ro   r_   r   rq   rx   ry   r-  r.  r/  rs   r0  rz   r{   r   ro   c               
   K   d S r   rg   )r   r   rq   rx   ry   ra   r-  r.  rs   rz   r{   ro   r_   s                ri   r(  zStageChannel.edit|  s        srh   r2  r   Optional[StageChannel]c                  K   |                      ||           d{V }|"|                     | j        | j        |          S dS )aD
  |coro|

        Edits the channel.

        You must have :attr:`~Permissions.manage_channels` to do this.

        .. versionchanged:: 2.0
            The ``topic`` parameter must now be set via :attr:`create_instance`.

        .. versionchanged:: 2.0
            Edits are no longer in-place, the newly edited channel is returned instead.

        .. versionchanged:: 2.0
            The ``region`` parameter now accepts :class:`str` instead of an enum.

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` instead of
            ``InvalidArgument``.

        Parameters
        ----------
        name: :class:`str`
            The new channel's name.
        bitrate: :class:`int`
            The new channel's bitrate.
        position: :class:`int`
            The new channel's position.
        nsfw: :class:`bool`
            To mark the channel as NSFW or not.
        user_limit: :class:`int`
            The new channel's user limit.
        sync_permissions: :class:`bool`
            Whether to sync permissions with the channel's new or pre-existing
            category. Defaults to ``False``.
        category: Optional[:class:`CategoryChannel`]
            The new category for this channel. Can be ``None`` to remove the
            category.
        slowmode_delay: :class:`int`
            Specifies the slowmode rate limit for user in this channel, in seconds.
            A value of ``0`` disables slowmode. The maximum value possible is ``21600``.
        reason: Optional[:class:`str`]
            The reason for editing this channel. Shows up on the audit log.
        overwrites: :class:`Mapping`
            A :class:`Mapping` of target (either a role or a member) to
            :class:`PermissionOverwrite` to apply to the channel.
        rtc_region: Optional[:class:`str`]
            The new region for the stage channel's voice communication.
            A value of ``None`` indicates automatic voice region detection.
        video_quality_mode: :class:`VideoQualityMode`
            The camera video quality for the stage channel's participants.

            .. versionadded:: 2.0

        Raises
        ------
        ValueError
            If the permission overwrite information is not in proper form.
        Forbidden
            You do not have permissions to edit the channel.
        HTTPException
            Editing the channel failed.

        Returns
        --------
        Optional[:class:`.StageChannel`]
            The newly edited stage channel. If the edit was only positional
            then ``None`` is returned instead.
        r)  Nr4  r5  r7  s       ri   r(  zStageChannel.edit  sZ      L 

76
::::::::>>4:G>TTT rh   r   )r   rQ   r   r  r   r   r  r  )r   r,  )r   r/  )rn   rm   r3  r   r4  rp   r5  rA   r_   r^   r   r&   )r   r&   r  r  )r   rm   rq   rp   rx   r`   ry   r`   ra   r`   r-  r`   r.  r/  rs   r0  rz   r^   r{   r   ro   r`   r_   r^   r   r2   )r_   r^   r2  r   r   rA  )rc   rd   re   r   r   r   r   r   r   r  r#  r&  r+  r   r2  r#   r9  r=  r   r(  r   r   s   @ri   r2   r2     s`       ? ?B I7 7 7 76 6 6 6 6 6 ) ) ) X) v v v Xv 	
 	
 	
 X	
 ] ] ] X] k k k Xk ' ' ' X' I I I XI '.(-%, $@M @M @M @M @M @MDM M M M, %%% X%CFTTTTT XT  #.1BE$'/2! #     X" 59 IU IU IU IU IU IU IU IU IU IUrh   r2   c                  8    e Zd ZdZdZdDd	ZdEdZdFdZedGd            Z	edHd            Z
edId            ZdJdZ ej        ej        j        j                  dddddKd            ZedLd            Zed d!dMd#            Zed d d d d d$dNd(            Zdd!dOd+Z ej        ej        j        j                  dP fd-            ZedQd/            ZedRd1            ZedSd3            ZedTd5            ZedUd7            ZdVd:ZdWd=ZdXd@ZdYdCZ xZS )Zr4   a  Represents a Discord channel category.

    These are useful to group channels to logical compartments.

    .. container:: operations

        .. describe:: x == y

            Checks if two channels are equal.

        .. describe:: x != y

            Checks if two channels are not equal.

        .. describe:: hash(x)

            Returns the category's hash.

        .. describe:: str(x)

            Returns the category's name.

    Attributes
    -----------
    name: :class:`str`
        The category name.
    guild: :class:`Guild`
        The guild the category belongs to.
    id: :class:`int`
        The category channel ID.
    position: :class:`int`
        The position in the category list. This is a number that starts at 0. e.g. the
        top category is position 0.
    nsfw: :class:`bool`
        If the channel is marked as "not safe for work".

        .. note::

            To check if the channel or the guild of that channel are marked as NSFW, consider :meth:`is_nsfw` instead.
    )r   r   r   rq   r   ra   r   r   r   rJ   r   rQ   r   CategoryChannelPayloadc               t    || _         t          |d                   | _        |                     ||           d S r  r  r   s       ri   r   zCategoryChannel.__init__  r  rh   r   rm   c           	     H    d| j          d| j        d| j         d| j         d	S )Nz<CategoryChannel id= name=z
 position=z nsfw=r   )r   r   ra   rq   r   s    ri   r   zCategoryChannel.__repr__  s5    mdgmmTYmmDMmmaeajmmmmrh   r   c                    || _         |d         | _        t          j        |d          | _        |                    dd          | _        |d         | _        |                     |           d S )Nr   r   rq   Fra   )	r   r   r"   r   r   r   rq   ra   r   r   s      ri   r   zCategoryChannel._update  sd    !
f	*/*A$*T*T((6511	!*-d#####rh   r`   c                $    t           j        j        S r   )r   r.  r   r   s    ri   r   zCategoryChannel._sorting_bucket  s    #))rh   r   c                    d S r   rg   r   s    ri   r   z,CategoryChannel._scheduled_event_entity_type  r   rh   Literal[ChannelType.category]c                    t           j        S r  )r   r.  r   s    ri   r   zCategoryChannel.type  s     ##rh   rp   c                    | j         S )z.:class:`bool`: Checks if the category is NSFW.r  r   s    ri   r  zCategoryChannel.is_nsfw#  r  rh   Nr9  r   r^   r.  r/  r_   c               P   K   |                      d| j        i||           d {V S )Nrq   r   r_   )r;  rq   )r   r   r.  r_   s       ri   r=  zCategoryChannel.clone'  s<       %%vty&9V%TTTTTTTTTrh   c                
   K   d S r   rg   r   s    ri   r(  zCategoryChannel.edit1  r  rh   .r)  ra   c               
   K   d S r   rg   r+  s      ri   r(  zCategoryChannel.edit4  r,  rh   )r   ra   rq   rs   r_   rq   rs   r0  c               
   K   d S r   rg   )r   r   ra   rq   rs   r_   s         ri   r(  zCategoryChannel.edit7  s       #rh   r2  r   c                  K   |                      ||           d{V }|"|                     | j        | j        |          S dS )a6  |coro|

        Edits the channel.

        You must have :attr:`~Permissions.manage_channels` to do this.

        .. versionchanged:: 1.3
            The ``overwrites`` keyword-only parameter was added.

        .. versionchanged:: 2.0
            Edits are no longer in-place, the newly edited channel is returned instead.

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` or
            :exc:`ValueError` instead of ``InvalidArgument``.

        Parameters
        ----------
        name: :class:`str`
            The new category's name.
        position: :class:`int`
            The new category's position.
        nsfw: :class:`bool`
            To mark the category as NSFW or not.
        reason: Optional[:class:`str`]
            The reason for editing this category. Shows up on the audit log.
        overwrites: :class:`Mapping`
            A :class:`Mapping` of target (either a role or a member) to
            :class:`PermissionOverwrite` to apply to the channel.

        Raises
        ------
        ValueError
            If position is less than 0 or greater than the number of categories.
        TypeError
            The overwrite information is not in proper form.
        Forbidden
            You do not have permissions to edit the category.
        HTTPException
            Editing the category failed.

        Returns
        --------
        Optional[:class:`.CategoryChannel`]
            The newly edited category channel. If the edit was only positional
            then ``None`` is returned instead.
        r)  Nr4  r5  r7  s       ri   r(  zCategoryChannel.editB  sZ      b 

76
::::::::>>4:G>TTT rh   kwargsc                v   K   |                     dd             t                      j        di | d {V  d S )Nr.  rg   )popr   move)r   rT  r   s     ri   rW  zCategoryChannel.movex  sO      

:t$$$eggl$$V$$$$$$$$$$$rh   List[GuildChannelType]c                j     d } fd j         j        D             }|                    |           |S )zList[:class:`abc.GuildChannel`]: Returns the channels that are under this category.

        These are sorted by the official Discord UI, which places voice channels below the text channels.
        c                <    t          | t                     | j        fS r   )rH  r0   ra   )r   s    ri   
comparatorz,CategoryChannel.channels.<locals>.comparator  s    "7K888':JKKrh   c                4    g | ]}|j         j        k    |S rg   )r   r   r   cr   s     ri   r  z,CategoryChannel.channels.<locals>.<listcomp>  s'    JJJQ$'1I1Iq1I1I1Irh   r  r   channelssort)r   r[  r  s   `  ri   ra  zCategoryChannel.channels}  sO    	L 	L 	L KJJJ$*-JJJZ   
rh   List[TextChannel]c                f      fd j         j        D             }|                    d            |S )zSList[:class:`TextChannel`]: Returns the text channels that are under this category.c                ^    g | ])}|j         j        k    t          |t                    '|*S rg   )r   r   rH  r0   r]  s     ri   r  z1CategoryChannel.text_channels.<locals>.<listcomp>  s8    iiiQ$'1I1IjYZ\gNhNh1Iq1I1I1Irh   c                    | j         | j        fS r   ra   r   r^  s    ri   r  z/CategoryChannel.text_channels.<locals>.<lambda>      
AD1 rh   r_  r`  r   r  s   ` ri   text_channelszCategoryChannel.text_channels  sA     jiii$*-iii11222
rh   List[VoiceChannel]c                f      fd j         j        D             }|                    d            |S )zUList[:class:`VoiceChannel`]: Returns the voice channels that are under this category.c                ^    g | ])}|j         j        k    t          |t                    '|*S rg   )r   r   rH  r1   r]  s     ri   r  z2CategoryChannel.voice_channels.<locals>.<listcomp>  8    jjjQ$'1I1IjYZ\hNiNi1Iq1I1I1Irh   c                    | j         | j        fS r   rg  rh  s    ri   r  z0CategoryChannel.voice_channels.<locals>.<lambda>  ri  rh   r_  r`  rj  s   ` ri   voice_channelszCategoryChannel.voice_channels  sA     kjjj$*-jjj11222
rh   List[StageChannel]c                f      fd j         j        D             }|                    d            |S )z}List[:class:`StageChannel`]: Returns the stage channels that are under this category.

        .. versionadded:: 1.7
        c                ^    g | ])}|j         j        k    t          |t                    '|*S rg   )r   r   rH  r2   r]  s     ri   r  z2CategoryChannel.stage_channels.<locals>.<listcomp>  ro  rh   c                    | j         | j        fS r   rg  rh  s    ri   r  z0CategoryChannel.stage_channels.<locals>.<lambda>  ri  rh   r_  r`  rj  s   ` ri   stage_channelszCategoryChannel.stage_channels  sA     kjjj$*-jjj11222
rh   List[ForumChannel]c                f      fd j         j        D             }|                    d            |S )z}List[:class:`ForumChannel`]: Returns the forum channels that are under this category.

        .. versionadded:: 2.4
        c                ^    g | ])}|j         j        k    t          |t                    '|*S rg   )r   r   rH  r6   r]  s     ri   r  z*CategoryChannel.forums.<locals>.<listcomp>  s8    hhh1q}/G/GJWXZfLgLg/GQ/G/G/Grh   c                    | j         | j        fS r   rg  rh  s    ri   r  z(CategoryChannel.forums.<locals>.<lambda>  s    aj!$/ rh   r_  r`  )r   rs   ` ri   forumszCategoryChannel.forums  sA     ihhh
+hhh	//000rh   !Unpack[_CreateTextChannelOptions]r0   c                <   K    | j         j        |fd| i| d{V S )z|coro|

        A shortcut method to :meth:`Guild.create_text_channel` to create a :class:`TextChannel` in the category.

        Returns
        -------
        :class:`TextChannel`
            The channel that was just created.
        r.  N)r   create_text_channelr   r   r2  s      ri   r  z#CategoryChannel.create_text_channel  s<       4TZ3DSS4S7SSSSSSSSSrh   "Unpack[_CreateVoiceChannelOptions]r1   c                <   K    | j         j        |fd| i| d{V S )z|coro|

        A shortcut method to :meth:`Guild.create_voice_channel` to create a :class:`VoiceChannel` in the category.

        Returns
        -------
        :class:`VoiceChannel`
            The channel that was just created.
        r.  N)r   create_voice_channelr  s      ri   r  z$CategoryChannel.create_voice_channel  s<       5TZ4TTTDTGTTTTTTTTTrh   "Unpack[_CreateStageChannelOptions]r2   c                <   K    | j         j        |fd| i| d{V S )a  |coro|

        A shortcut method to :meth:`Guild.create_stage_channel` to create a :class:`StageChannel` in the category.

        .. versionadded:: 1.7

        Returns
        -------
        :class:`StageChannel`
            The channel that was just created.
        r.  N)r   create_stage_channelr  s      ri   r  z$CategoryChannel.create_stage_channel  s<       5TZ4TTTDTGTTTTTTTTTrh   "Unpack[_CreateForumChannelOptions]r6   c                <   K    | j         j        |fd| i| d{V S )a	  |coro|

        A shortcut method to :meth:`Guild.create_forum` to create a :class:`ForumChannel` in the category.

        .. versionadded:: 2.0

        Returns
        --------
        :class:`ForumChannel`
            The channel that was just created.
        r.  N)r   create_forumr  s      ri   r  zCategoryChannel.create_forum  s<       -TZ,TLLDLGLLLLLLLLLrh   )r   rJ   r   rQ   r   rD  r   )r   rQ   r   rD  r   r   r  r  )r   rK  r   )r   r^   r.  r/  r_   r^   r   r4   r  r  )r   rm   ra   r`   rq   rp   rs   r0  r_   r^   r   r4   )r_   r^   r2  r   r   r/  )rT  r   r   r   )r   rX  )r   rc  )r   rl  )r   rr  )r   rw  )r   rm   r2  r}  r   r0   )r   rm   r2  r  r   r1   )r   rm   r2  r  r   r2   )r   rm   r2  r  r   r6   ) rc   rd   re   r   r   r   r   r   r   r   r   r   r  r"   r  ra  rb  rR   r=  r   r(  rW  ra  rk  rq  rv  r|  r  r  r  r  r   r   s   @ri   r4   r4     s       ' 'R dI" " " "
n n n n$ $ $ $ * * * X*    X $ $ $ X$    U^GK,233 #.2 $U U U U U 43U %%% X%CFTTTTT XT BE #     X 59 4U 4U 4U 4U 4U 4Ul U^GK,122% % % % % 32%    X    X    X    X    X
T 
T 
T 
T
U 
U 
U 
UU U U UM M M M M M M Mrh   r4   c                  V    e Zd ZdZdZdddddZedd            ZddZddZ	ddZ
dS )r5   a  Represents a forum tag that can be applied to a thread within a :class:`ForumChannel`.

    .. versionadded:: 2.1

    .. container:: operations

        .. describe:: x == y

            Checks if two forum tags are equal.

        .. describe:: x != y

            Checks if two forum tags are not equal.

        .. describe:: hash(x)

            Returns the forum tag's hash.

        .. describe:: str(x)

            Returns the forum tag's name.


    Attributes
    -----------
    id: :class:`int`
        The ID of the tag. If this was manually created then the ID will be ``0``.
    name: :class:`str`
        The name of the tag. Can only be up to 20 characters.
    moderated: :class:`bool`
        Whether this tag can only be added or removed by a moderator with
        the :attr:`~Permissions.manage_threads` permission.
    emoji: Optional[:class:`PartialEmoji`]
        The emoji that is used to represent this tag.
        Note that if the emoji is a custom emoji, it will *not* have name information.
    )r   r   	moderatedr   NF)r   r  r   rm   r   Optional[EmojiInputType]r  rp   r   r   c               :   || _         d| _        || _        d | _        t	          |t
                    r|                                | _        d S t	          |t                    rt          j	        |          | _        d S |t          d|j        j                   d S )Nr   z5emoji must be a Emoji, PartialEmoji, str or None not )r   r   r  r   rH  r(   _to_partialrm   r)   from_strr  r   rc   )r   r   r   r  s       ri   r   zForumTag.__init__
	  s    	(-1
eY'' 	p**,,DJJJs## 	p%.u55DJJJnTYTcTlnnooo rh   r   rJ   r   ForumTagPayloadr;   c               F   |                      |           }|d         |_        t          |d                   |_        |                    dd          |_        |d         pd}t          j        |d          pd }|s
|sd |_        nt          j
        |||          |_        |S )	Nr   r   r  F
emoji_name emoji_id)r   r   r   )__new__r   r`   r   r   r  r"   r   r   r)   
with_state)clsr   r   r   r  r  s         ri   	from_datazForumTag.from_data	  s    {{3L	d4j//+u55,'-2
*4<<D 	\( 	\DJJ%0u:RZ[[[DJrh   Dict[str, Any]c                    | j         | j        d}| j        -|                    | j                                                   n|                    d d            | j        r
| j        |d<   |S )N)r   r  )r  r  r   )r   r  r   r  _to_forum_tag_payloadr   )r   r8  s     ri   to_dictzForumTag.to_dict%	  su    I#
 #
 :!NN4:;;==>>>>NNDTN:::7 	$ GGDMrh   c           	     H    d| j          d| j        d| j        d| j         d	S )Nz<ForumTag id=rG  z emoji=z moderated=r   )r   r   r   r  r   s    ri   r   zForumTag.__repr__4	  s5    ltwlldill$*ll[_[illllrh   c                    | j         S r   r   r   s    ri   __str__zForumTag.__str__7	  s
    yrh   )r   rm   r   r  r  rp   r   r   )r   rJ   r   r  r   r;   )r   r  r   )rc   rd   re   r   r   r   classmethodr  r  r   r  rg   rh   ri   r5   r5     s        # #J 5IGK_d 
p 
p 
p 
p 
p 
p    [   m m m m     rh   r5   c                       e Zd ZdZdZdd	ZddZddZedd            Z	edd            Z
edd            Zedd            Z ej        ej        j        j                  d fd            ZddZedd            Zedd!            Zedd#            Zdd&Zdd(Zdd)Z ej        ej        j        j                  d*d*d+dd1            Zedd2            Zed3d4dd6            Zed3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d7ddK            Zd*d4ddOZd*dPd*dQddVZed3d3d3d3d3d3d3d3d3d3dW
ddg            Zed3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3dhddr            Zed*d*dPeeeeeeeeedPdPd*dhddtZddvZ d*d*dwdd{Z!d|d*d}ddZ" xZ#S )r6   a	  Represents a Discord guild forum channel.

    .. versionadded:: 2.0

    .. container:: operations

        .. describe:: x == y

            Checks if two forums are equal.

        .. describe:: x != y

            Checks if two forums are not equal.

        .. describe:: hash(x)

            Returns the forum's hash.

        .. describe:: str(x)

            Returns the forum's name.

    Attributes
    -----------
    name: :class:`str`
        The forum name.
    guild: :class:`Guild`
        The guild the forum belongs to.
    id: :class:`int`
        The forum ID.
    category_id: Optional[:class:`int`]
        The category channel ID this forum belongs to, if applicable.
    topic: Optional[:class:`str`]
        The forum's topic. ``None`` if it doesn't exist. Called "Guidelines" in the UI.
        Can be up to 4096 characters long.
    position: :class:`int`
        The position in the channel list. This is a number that starts at 0. e.g. the
        top channel is position 0.
    last_message_id: Optional[:class:`int`]
        The last thread ID that was created on this forum. This technically also
        coincides with the message ID that started the thread that was created.
        It may *not* point to an existing or valid thread or message.
    slowmode_delay: :class:`int`
        The number of seconds a member must wait between creating threads
        in this forum. A value of ``0`` denotes that it is disabled.
        Bots and users with :attr:`~Permissions.bypass_slowmode` bypass slowmode.
    nsfw: :class:`bool`
        If the forum is marked as "not safe for work" or "age restricted".
    default_auto_archive_duration: :class:`int`
        The default auto archive duration in minutes for threads created in this forum.
    default_thread_slowmode_delay: :class:`int`
        The default slowmode delay in seconds for threads created in this forum.

        .. versionadded:: 2.1
    default_reaction_emoji: Optional[:class:`PartialEmoji`]
        The default reaction emoji for threads created in this forum to show in the
        add reaction button.

        .. versionadded:: 2.1
    default_layout: :class:`ForumLayoutType`
        The default layout for posts in this forum channel.
        Defaults to :attr:`ForumLayoutType.not_set`.

        .. versionadded:: 2.2
    default_sort_order: Optional[:class:`ForumOrderType`]
        The default sort order for posts in this forum channel.

        .. versionadded:: 2.3
    )r   r   r   rn   r   _flagsr   rq   r   ra   ro   r   r   rt   ru   r   r   r   _available_tagsr  r   rJ   r   rQ   r   /Union[ForumChannelPayload, MediaChannelPayload]c                   || _         t          |d                   | _        |d         | _        |                     ||           d S r   r   r   s       ri   r   zForumChannel.__init__	  s?    ',4:&*6l
UD!!!!!rh   r   rm   c                    d| j         fd| j        fd| j        fd| j        fd| j        fg}d                    d |D                       }d| j        j         d| d	S )
Nr   r   ra   rq   r   r   c              3      K   | ]	}d |z  V  
dS r   rg   r   s     ri   r   z(ForumChannel.__repr__.<locals>.<genexpr>	  r   rh   r   r   )r   r   ra   rq   r   r   r   rc   r   s      ri   r   zForumChannel.__repr__	  s{    47OTY'TYD,-
 55u5555564>*66V6666rh   r   c                "    | _         |d          _        t          j        |d           _        |                    d           _        |d          _        |                    dd           _        |                    dd           _	        |                    d	d
           _
        t          j        |d           _         fd|                    dg           D             }|                    dd           _        t          t          |                    dd                     _        d |D              _        d  _        |                    d          }|rKt%          j         j        t          j        |d          pd |                    d          pd           _        d  _        |                    d          }|t          t,          |           _        |                    dd           _                             |           d S )Nr   r   rn   ra   rq   Fr   r   rt   r   r   c                R    g | ]#}t                               j        |           $S )r   )r5   r  r   )r   tagr   s     ri   r  z(ForumChannel._update.<locals>.<listcomp>	  s.    jjjC""3"??jjjrh   r   r   default_forum_layoutc                    i | ]
}|j         |S rg   rD  r   r  s     ri   r  z(ForumChannel._update.<locals>.<dictcomp>	  s    4Q4Q4QSSVS4Q4Q4Qrh   r   r  r  r  )r   r   r   r   flags)r   r   r"   r   r   r   rn   ra   rq   ro   rt   r   ru   r   r   r   r  r   r)   r  r   r   r   r  r   )r   r   r   tagsr   r   s   `     ri   r   zForumChannel._update	  s   !
f	*/*A$*T*T$(HHW$5$5
!*-((6511	#'88,A1#E#EDHHHMlnrDsDs*.3.EdL].^.^jjjj488TdfhKiKijjj26((;_ab2c2c*/7RhjkIlIl/m/m4Q4QD4Q4Q4Q>B#!%*B!C!C! 	*6*Ak*+A:NNVRV+//==C+ + +D' =A!XX&:;;)&.~?Q&R&RD#88GQ//d#####rh   -Literal[ChannelType.forum, ChannelType.media]c                H    | j         dk    rt          j        S t          j        S )r      )r   r   mediaforumr   s    ri   r   zForumChannel.type	  s#     :$$  rh   r`   c                $    t           j        j        S r   r   r   s    ri   r   zForumChannel._sorting_bucket	  r   rh   r  c                4      fd j         j        D             S )zmList[:class:`Member`]: Returns all members that can see this channel.

        .. versionadded:: 2.5
        c                H    g | ]}                     |          j        |S rg   r
  r  s     ri   r  z(ForumChannel.members.<locals>.<listcomp>	  r  rh   r  r   s   `ri   r  zForumChannel.members	  s%     XWWW4:-WWWWrh   r   c                    d S r   rg   r   s    ri   r   z)ForumChannel._scheduled_event_entity_type	  r   rh   r   r   r   c                   t                                          |          }|                     |           t          j                    }|xj        |j         z  c_        |S r   r   r  s       ri   r   zForumChannel.permissions_for	  r  rh   r  r  c               b    | j                             |          }||j        | j        k    r|S dS )a  Returns a thread with the given ID.

        .. note::

            This does not always retrieve archived threads, as they are not retained in the internal
            cache. Use :func:`Guild.fetch_channel` instead.

        .. versionadded:: 2.2

        Parameters
        -----------
        thread_id: :class:`int`
            The ID to search for.

        Returns
        --------
        Optional[:class:`Thread`]
            The returned thread or ``None`` if not found.
        N)r   r  r   r   )r   r  r   s      ri   r  zForumChannel.get_thread	  s8    ( &&y11&"2dg"="=Mtrh   r  c                X      fd j         j                                        D             S )z@List[:class:`Thread`]: Returns all the threads that you can see.c                4    g | ]}|j         j        k    |S rg   r  r  s     ri   r  z(ForumChannel.threads.<locals>.<listcomp>
  r  rh   r  r   s   `ri   r  zForumChannel.threads
  s1     baaaTZ%8%?%?%A%Aaaaarh   r*   c                4    t          j        | j                  S )ze:class:`ChannelFlags`: The flags associated with this thread.

        .. versionadded:: 2.1
        )r*   _from_valuer  r   s    ri   r  zForumChannel.flags

  s     '444rh   r   c                X    t          j        | j                                                  S )zsSequence[:class:`ForumTag`]: Returns all the available tags for this forum.

        .. versionadded:: 2.1
        )r"   SequenceProxyr  r  r   s    ri   r   zForumChannel.available_tags
  s$     "4#7#>#>#@#@AAArh   tag_idOptional[ForumTag]c               6    | j                             |          S )a6  Returns the tag with the given ID.

        .. versionadded:: 2.1

        Parameters
        ----------
        tag_id: :class:`int`
            The ID to search for.

        Returns
        -------
        Optional[:class:`ForumTag`]
            The tag with the given ID, or ``None`` if not found.
        )r  r   )r   r  s     ri   get_tagzForumChannel.get_tag
  s     #''///rh   rp   c                    | j         S )z+:class:`bool`: Checks if the forum is NSFW.r  r   s    ri   r  zForumChannel.is_nsfw+
  r  rh   c                6    | j         t          j        j        k    S )z`:class:`bool`: Checks if the channel is a media channel.

        .. versionadded:: 2.4
        )r   r   r  r   r   s    ri   is_mediazForumChannel.is_media/
  s    
 z[.444rh   NrO  r   r^   r.  r/  r_   c               l  K   | j         | j        | j        | j        d | j        D             | j        d}| j        r| j        j        |d<   | j        r| j        	                                |d<   | 
                                s| j        r| j        j        |d<   |                     ||||           d {V S )Nc                6    g | ]}|                                 S rg   r  r  s     ri   r  z&ForumChannel.clone.<locals>.<listcomp>C
  s     LLLs{{}}LLLrh   )rn   r   rq   rt   r   r   r   r   r  r9  )rn   ro   rq   rt   r   ru   r   r   r   r  r  r   r;  r<  s        ri   r=  zForumChannel.clone6
  s       Z#'#6I-1-OLL8KLLL262T
 
 " 	G)-)@)FD%&& 	a-1-H-^-^-`-`D)*}} 	E4#6 	E+/+>+DD'(%%	 & 
 
 
 
 
 
 
 
 	
rh   c                
   K   d S r   rg   r   s    ri   r(  zForumChannel.editT
  r  rh   .r)  ra   c               
   K   d S r   rg   r+  s      ri   r(  zForumChannel.editW
  r,  rh   )r_   r   rn   ra   rq   r-  r.  ro   rt   r   rs   r   ru   r   r   r   require_tagrn   rq   r-  ro   rt   r=   r   r   rs   r0  r   ru   r   r  r   r   r   r   r  c               
   K   d S r   rg   )r   r_   r   rn   ra   rq   r-  r.  ro   rt   r   rs   r   ru   r   r   r   r  s                     ri   r(  zForumChannel.editZ
  s      * srh   r2  r   Optional[ForumChannel]c               f  K   	 |                     d          }d |D             |d<   n# t          $ r Y nw xY w	 |                     d          }|d|d<   nt          |t                    r*|                                                                |d<   nOt          |t                    r)t          j        |                                          |d<   n# t          $ r Y nw xY w	 |                     d          }| j	        }||_
        |j        |d<   n# t          $ r Y nw xY w	 |                     d          }t          |t                    st          d|j        j                   |j        |d	<   n# t          $ r Y nw xY w	 |                     d
          }|d|d
<   nLt          |t                     st          d|j        j                   |j        |d
<   n# t          $ r Y nw xY w|                     ||           d{V }	|	"|                     | j        | j        |	          S dS )a  |coro|

        Edits the forum.

        You must have :attr:`~Permissions.manage_channels` to do this.

        Parameters
        ----------
        name: :class:`str`
            The new forum name.
        topic: :class:`str`
            The new forum's topic.
        position: :class:`int`
            The new forum's position.
        nsfw: :class:`bool`
            To mark the forum as NSFW or not.
        sync_permissions: :class:`bool`
            Whether to sync permissions with the forum's new or pre-existing
            category. Defaults to ``False``.
        category: Optional[:class:`CategoryChannel`]
            The new category for this forum. Can be ``None`` to remove the
            category.
        slowmode_delay: :class:`int`
            Specifies the slowmode rate limit for user in this forum, in seconds.
            A value of ``0`` disables slowmode. The maximum value possible is ``21600``.
        type: :class:`ChannelType`
            Change the type of this text forum. Currently, only conversion between
            :attr:`ChannelType.text` and :attr:`ChannelType.news` is supported. This
            is only available to guilds that contain ``NEWS`` in :attr:`Guild.features`.
        reason: Optional[:class:`str`]
            The reason for editing this forum. Shows up on the audit log.
        overwrites: :class:`Mapping`
            A :class:`Mapping` of target (either a role or a member) to
            :class:`PermissionOverwrite` to apply to the forum.
        default_auto_archive_duration: :class:`int`
            The new default auto archive duration in minutes for threads created in this channel.
            Must be one of ``60``, ``1440``, ``4320``, or ``10080``.
        available_tags: Sequence[:class:`ForumTag`]
            The new available tags for this forum.

            .. versionadded:: 2.1
        default_thread_slowmode_delay: :class:`int`
            The new default slowmode delay for threads in this channel.

            .. versionadded:: 2.1
        default_reaction_emoji: Optional[Union[:class:`Emoji`, :class:`PartialEmoji`, :class:`str`]]
            The new default reaction emoji for threads in this channel.

            .. versionadded:: 2.1
        default_layout: :class:`ForumLayoutType`
            The new default layout for posts in this forum.

            .. versionadded:: 2.2
        default_sort_order: Optional[:class:`ForumOrderType`]
            The new default sort order for posts in this forum.

            .. versionadded:: 2.3
        require_tag: :class:`bool`
            Whether to require a tag for threads in this channel or not.

            .. versionadded:: 2.1

        Raises
        ------
        ValueError
            The new ``position`` is less than 0 or greater than the number of channels.
        TypeError
            The permission overwrite information is not in proper form or a type
            is not the expected type.
        Forbidden
            You do not have permissions to edit the forum.
        HTTPException
            Editing the forum failed.

        Returns
        --------
        Optional[:class:`.ForumChannel`]
            The newly edited forum channel. If the edit was only positional
            then ``None`` is returned instead.
        r   c                6    g | ]}|                                 S rg   r  r  s     ri   r  z%ForumChannel.edit.<locals>.<listcomp>
  s     (G(G(G3(G(G(Grh   r   Nr  r  r   z7default_layout parameter must be a ForumLayoutType not r  r   z:default_sort_order parameter must be a ForumOrderType not r)  r4  )rV  KeyErrorrH  r(   r  r  rm   r)   r  r  r  r   r   r  r   rc   r   r6  r   r   )
r   r_   r2  r  r   r  r  layout
sort_orderr8  s
             ri   r(  zForumChannel.editq
  s     d	H'.{{3C'D'DD )H(G$(G(G(GG$%%  	 	 	D	

	z?F{{Kc?d?d" &-480112I>> z4J4V4V4X4X4n4n4p4p0112C88 z4@4IJ`4a4a4w4w4y4y01  	 	 	D		+!++m44K JE +E${GG  	 	 	D		;[[!122F fo66 w uZ`ZjZs u uvvv.4lG*++  	 	 	D		A %9::J !04,--!*n== #tU_UiUrtt   1;0@,--  	 	 	D	 

76
::::::::>>4:G>TTT sS   ) 
66C 
C"!C"&D 
D! D!%E6 6
FFG   
G-,G-F)r   r  r_   r   Optional[PartialEmoji]r  r5   c                 K   t          | j                                                  }t          |||          }|                    |           | j        j                            | j        |d |D                        d{V }	 t          |d         d         d                   |_        n# t          t          t          f$ r Y nw xY w|S )aT  |coro|

        Creates a new tag in this forum.

        You must have :attr:`~Permissions.manage_channels` to do this.

        Parameters
        ----------
        name: :class:`str`
            The name of the tag. Can only be up to 20 characters.
        emoji: Optional[Union[:class:`str`, :class:`PartialEmoji`]]
            The emoji to use for the tag.
        moderated: :class:`bool`
            Whether the tag can only be applied by moderators.
        reason: Optional[:class:`str`]
            The reason for creating this tag. Shows up on the audit log.

        Raises
        ------
        Forbidden
            You do not have permissions to create a tag in this forum.
        HTTPException
            Creating the tag failed.

        Returns
        -------
        :class:`ForumTag`
            The newly created tag.
        )r   r   r  c                6    g | ]}|                                 S rg   r  r  s     ri   r  z+ForumChannel.create_tag.<locals>.<listcomp>'  s     3S3S3ScCKKMM3S3S3Srh   )r_   r   Nr   r  r   )rI  r  r  r5   r  r   rL  edit_channelr   r`   r  
IndexErrorr  )r   r   r   r  r_   priorresultr8  s           ri   
create_tagzForumChannel.create_tag
  s      L T)002233t5IFFFV(55GF3S3SU3S3S3S 6 
 
 
 
 
 
 
 
	G$45b9$?@@FII*j1 	 	 	D	 s   &B/ /C	C	)
r  ro   filefilesallowed_mentionsmention_authorapplied_tagssuppress_embedssilentr_   r  rZ  r  rM   r  Sequence[File]r  rG   r  r  viewrU   r  r  r   c               
   K   d S r   rg   )r   r   r  ro   r  r  r  r  r  r  r  r  r_   s                ri   r  zForumChannel.create_thread0  s         Crh   )r  ro   contentttsembedembedsr  r  stickersr  r  r  r  r  r  r_   r  r  r  rC   r  Sequence[Embed]r  *Sequence[Union[GuildSticker, StickerItem]]rT   c               
   K   d S r   rg   )r   r   r  ro   r  r  r  r  r  r  r  r  r  r  r  r  r  r_   s                     ri   r  zForumChannel.create_threadB  s      *  Crh   rS   c                 K   | j         }|j        }|
t          u rt          }nd |
D             }|r,t          |d          st	          d|j        j                   |s|r#t          j        d          }||_	        ||_
        nt          }|rt          |          nt          }||p| j        |dd}|t          urd |D             |d<   t          ||||	|||||t          u rd	n|||||
          5 }ddlm} |j                            | j        ||           d	{V }t'          | j        | j         |          } || j         ||d                   }|rH|                                s4|                                r | j                             ||j                   t1          ||          cd	d	d	           S # 1 swxY w Y   d	S )ar  |coro|

        Creates a thread in this forum.

        This thread is a public thread with the initial message given. Currently in order
        to start a thread in this forum, the user needs :attr:`~discord.Permissions.send_messages`.

        You must send at least one of ``content``, ``embed``, ``embeds``, ``file``, ``files``,
        or ``view`` to create a thread in a forum, since forum channels must have a starter message.

        Parameters
        -----------
        name: :class:`str`
            The name of the thread.
        auto_archive_duration: :class:`int`
            The duration in minutes before a thread is automatically hidden from the channel list.
            If not provided, the channel's default auto archive duration is used.

            Must be one of ``60``, ``1440``, ``4320``, or ``10080``, if provided.
        slowmode_delay: Optional[:class:`int`]
            Specifies the slowmode rate limit for user in this channel, in seconds.
            The maximum value possible is ``21600``. By default no slowmode rate limit
            if this is ``None``.
        content: Optional[:class:`str`]
            The content of the message to send with the thread.
        tts: :class:`bool`
            Indicates if the message should be sent using text-to-speech.
        embed: :class:`~discord.Embed`
            The rich embed for the content.
        embeds: List[:class:`~discord.Embed`]
            A list of embeds to upload. Must be a maximum of 10.
        file: :class:`~discord.File`
            The file to upload.
        files: List[:class:`~discord.File`]
            A list of files to upload. Must be a maximum of 10.
        allowed_mentions: :class:`~discord.AllowedMentions`
            Controls the mentions being processed in this message. If this is
            passed, then the object is merged with :attr:`~discord.Client.allowed_mentions`.
            The merging behaviour only overrides attributes that have been explicitly passed
            to the object, otherwise it uses the attributes set in :attr:`~discord.Client.allowed_mentions`.
            If no object is passed at all then the defaults given by :attr:`~discord.Client.allowed_mentions`
            are used instead.
        mention_author: :class:`bool`
            If set, overrides the :attr:`~discord.AllowedMentions.replied_user` attribute of ``allowed_mentions``.
        applied_tags: List[:class:`discord.ForumTag`]
            A list of tags to apply to the thread.
        view: Union[:class:`discord.ui.View`, :class:`discord.ui.LayoutView`]
            A Discord UI View to add to the message.
        stickers: Sequence[Union[:class:`~discord.GuildSticker`, :class:`~discord.StickerItem`]]
            A list of stickers to upload. Must be a maximum of 3.
        suppress_embeds: :class:`bool`
            Whether to suppress embeds for the message. This sends the message without any embeds if set to ``True``.
        silent: :class:`bool`
            Whether to suppress push and desktop notifications for the message. This will increment the mention counter
            in the UI, but will not actually send a notification.

            .. versionadded:: 2.7
        reason: :class:`str`
            The reason for creating a new thread. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have permissions to create a thread.
        HTTPException
            Starting the thread failed.
        ValueError
            The ``files`` or ``embeds`` list is not of the appropriate size.
        TypeError
            You specified both ``file`` and ``files``,
            or you specified both ``embed`` and ``embeds``.

        Returns
        --------
        Tuple[:class:`Thread`, :class:`Message`]
            The created thread with the created message.
            This is also accessible as a namedtuple with ``thread`` and ``message`` fields.
        c                    g | ]	}|j         
S rg   rD  )r   ss     ri   r  z.ForumChannel.create_thread.<locals>.<listcomp>  s    )A)A)A1!$)A)A)Arh   __discord_ui_view__z view parameter must be View not r      )r   r  r   r   c                6    g | ]}t          |j                  S rg   )rm   r   r  s     ri   r  z.ForumChannel.create_thread.<locals>.<listcomp>  s     .S.S.Sss36{{.S.S.Srh   r  N)r  r  r  r  r  r  r  previous_allowed_mentionsr  r  r  r  channel_payloadr   )rD   )paramsr_   r  r   )r   r   r   )r   r   )r   r  r#   hasattrr  r   rc   r+   r  r  suppress_notificationsrm   rt   r,   r   rD   rL  start_thread_in_forumr   r'   r   is_finishedis_dispatchable
store_viewr   )r   r   r  ro   r  r  r  r  r  r  r  r  r  r  r  r  r  r_   r   previous_allowed_mentionsticker_idsr  r  r  rD   r   r   r   s                               ri   r  zForumChannel.create_threadY  s     H #(#9 w!KK)A)A)A)A)AK 	Z&;<< 	ZXt~?VXXYYY 	f 	 ,Q//E$3E!+1E((E")6#g,,,w %:%`d>`#1	
 
 w&&.S.Sl.S.S.SON+&-&>#1W#<#<44. +
 
 
 	E ((((((99$'&Y_9````````D$*DKdKKKFgDKd9oVVVG 9D,,.. 943G3G3I3I 9&&tWZ888$FGDDD1	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	Es   /B>F::F>F>rf  c                    K   ddl m  j        j                             j                   d{V } fd|D             S )rh  r   rH   Nc                >    g | ]} j         |j                   S rj  rl  rn  s     ri   r  z)ForumChannel.webhooks.<locals>.<listcomp>	  rp  rh   rq  rt  s   ` @ri   ru  zForumChannel.webhooks  rv  rh   rw  rx  ry  rI   c                  K   ddl m} |t          j        |          }| j        j                            | j        t          |          ||           d{V } |j	        || j                  S )a)  |coro|

        Creates a webhook for this channel.

        You must have :attr:`~.Permissions.manage_webhooks` to do this.

        Parameters
        -------------
        name: :class:`str`
            The webhook's name.
        avatar: Optional[:class:`bytes`]
            A :term:`py:bytes-like object` representing the webhook's default avatar.
            This operates similarly to :meth:`~ClientUser.edit`.
        reason: Optional[:class:`str`]
            The reason for creating this webhook. Shows up in the audit logs.

        Raises
        -------
        HTTPException
            Creating the webhook failed.
        Forbidden
            You do not have permissions to create a webhook.

        Returns
        --------
        :class:`Webhook`
            The created webhook.
        r   rH   Nr{  rk  r|  r  s         ri   r~  zForumChannel.create_webhook  s      < 	%$$$$$088F[%44TW3t99U[dj4kkkkkkkk!w!$dk::::rh   rA  )rS  rU  rS  rU  r  r  c              t  K   d}t          |t          j                  r|                                }n-|+t          j        |j                                                  }d }	 d}|&|dk    rdS t          dt          ||                    }| j        j	        j
                            | j        ||           d{V }|                    dg           }|D ]6}t          | j        | j        j	        |	          W V  ||d
z  }|dk    r dS 7|                    dd          sdS  ||d                   })a  Returns an :term:`asynchronous iterator` that iterates over all archived threads in this forum
        in order of decreasing :attr:`Thread.archive_timestamp`.

        You must have :attr:`~Permissions.read_message_history` to do this.

        .. versionadded:: 2.0

        Parameters
        -----------
        limit: Optional[:class:`bool`]
            The number of threads to retrieve.
            If ``None``, retrieves every archived thread in the channel. Note, however,
            that this would make it a slow operation.
        before: Optional[Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]]
            Retrieve archived channels before the given date or ID.

        Raises
        ------
        Forbidden
            You do not have permissions to get archived threads.
        HTTPException
            The request to get the archived threads failed.

        Yields
        -------
        :class:`Thread`
            The archived threads.
        Nc                    | d         d         S r  rg   r  s    ri   r  z/ForumChannel.archived_threads.<locals>.<lambda>Z  r  rh   TrA  r   r  r  r  r  r   r  Fr  )rH  r  r  r"   r   r   r  r  r   r   rL  r  r   r'   )	r   rS  rU  r  r  r  r   r  r  s	            ri   r  zForumChannel.archived_threads1  ss     D  fh/00 	K%//11$3FI>>HHJJQQ	:H A::Fq#h"6"677*/KKDG\lt|K}}}}}}}}Dhhy"--G%  
4:TZ5FZXXXXXXX $QJEzz88J.. ,}WR[99-	:rh   )r   rJ   r   rQ   r   r  r   )r   rQ   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   r6   r  r  )$r_   r^   r   rm   rn   rm   ra   r`   rq   rp   r-  rp   r.  r/  ro   r`   rt   r=   r   r   rs   r0  r   r   ru   r`   r   r  r   r   r   r   r  rp   r   r6   )r_   r^   r2  r   r   r  )
r   rm   r   r  r  rp   r_   r^   r   r5   )r   rm   r  r=   ro   rZ  r  rM   r  r  r  rG   r  rp   r  r   r  rU   r  rp   r  rp   r_   r^   r   r   )$r   rm   r  r=   ro   rZ  r  r^   r  rp   r  rC   r  r  r  rM   r  r  r  r  r  rG   r  rp   r  r   r  rT   r  rp   r  rp   r_   r^   r   r   )$r   rm   r  r=   ro   rZ  r  r^   r  rp   r  rC   r  r  r  rM   r  r  r  r  r  rG   r  rp   r  r   r  rS   r  rp   r  rp   r_   r^   r   r   r  r  )rS  rZ  rU  r  r   r  )$rc   rd   re   r   r   r   r   r   r   r   r   r  r   r"   r  ra  rb  rR   r   r  r  r  r   r  r  r  r=  r   r(  r  r  r#   ru  r~  r  r   r   s   @ri   r6   r6   ;	  s       D DLI." " " "	7 	7 	7 	7$ $ $ $B ! ! ! X! & & & X& X X X XX    X U^GK,<==     >=   2 b b b Xb 5 5 5 X5 B B B XB0 0 0 0"   5 5 5 5 U^GK,233 # $
 
 
 
 
 43
: %%% X%CFTTTTT XT !$!$.1!?BBE-0-0;>*--0'     X, 59 JU JU JU JU JU JU` )- $1 1 1 1 1 1f 
 8;(+ #,/"+. # #          X " 
 8;(+!$"% #?B,/"+. # #'          X 4 8?(,!%") '?F,3&+2  % $'YE YE YE YE YE YEvH H H H. LPim $; $; $; $; $; $;R  #@D	A: A: A: A: A: A: A: A: A: A:rh   r6   c                      e Zd ZdZ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d,d-d Zd.d#ZdS )/r3   a  Represents a Discord direct message channel.

    .. container:: operations

        .. describe:: x == y

            Checks if two channels are equal.

        .. describe:: x != y

            Checks if two channels are not equal.

        .. describe:: hash(x)

            Returns the channel's hash.

        .. describe:: str(x)

            Returns a string representation of the channel

    Attributes
    ----------
    recipient: Optional[:class:`User`]
        The user you are participating with in the direct message channel.
        If this channel is received through the gateway, the recipient information
        may not be always available.
    recipients: List[:class:`User`]
        The users you are participating with in the DM channel.

        .. versionadded:: 2.4
    me: :class:`ClientUser`
        The user presenting yourself.
    id: :class:`int`
        The direct message channel ID.
    )r   
recipientsmer   r  rN   r   rJ   r   DMChannelPayloadc                   | _         fd|                    dg           D             | _        || _        t	          |d                   | _        d S )Nc                :    g | ]}                     |          S rg   )
store_user)r   ur   s     ri   r  z&DMChannel.__init__.<locals>.<listcomp>  s'    &_&_&_qu'7'7':':&_&_&_rh   r  r   )r   r   r  r  r`   r   r   r  r   r   s     ` ri   r   zDMChannel.__init__  sP    ',&_&_&_&_DHH\[]D^D^&_&_&_ 4:rh   r   r;   c                
   K   | S r   rg   r   s    ri   r   zDMChannel._get_channel  r   rh   rm   c                (    | j         r
d| j          S dS )NzDirect Message with z Direct Message with Unknown User)	recipientr   s    ri   r  zDMChannel.__str__  s"    > 	;:$.:::11rh   c                (    d| j          d| j        dS )Nz<DMChannel id=z recipient=r   )r   r  r   s    ri   r   zDMChannel.__repr__  s    GGGDNGGGGrh   r   r`   c                r    |                      |           }||_        ||_        g |_        |j        |_        |S r   )r  r   r   r  r   r  )r  r   r   r   s       ri   _from_messagezDMChannel._from_message  s6    {{3*rh   Optional[User]c                .    | j         r| j         d         S d S )Nr   )r  r   s    ri   r  zDMChannel.recipient  s    ? 	&?1%%trh   Literal[ChannelType.private]c                    t           j        S r  )r   r  r   s    ri   r   zDMChannel.type  s     ""rh   Optional[Guild]c                    dS )zOptional[:class:`Guild`]: The guild this DM channel belongs to. Always ``None``.

        This is mainly provided for compatibility purposes in duck typing.

        .. versionadded:: 2.0
        Nrg   r   s    ri   r   zDMChannel.guild  	     trh   c                    d| j          S zr:class:`str`: Returns a URL that allows the client to jump to the channel.

        .. versionadded:: 2.0
        !https://discord.com/channels/@me/rD  r   s    ri   jump_urlzDMChannel.jump_url       =47<<<rh   datetime.datetimec                4    t          j        | j                  S )zV:class:`datetime.datetime`: Returns the direct message channel's creation time in UTC.r"   r   r   r   s    ri   r   zDMChannel.created_at       #DG,,,rh   Nr   r   r   c               (    t          j                    S )a!  Handles permission resolution for a :class:`User`.

        This function is there for compatibility with other channel types.

        Actual direct messages do not really have the concept of permissions.

        This returns all the Text related permissions set to ``True`` except:

        - :attr:`~Permissions.send_tts_messages`: You cannot send TTS messages in a DM.
        - :attr:`~Permissions.manage_messages`: You cannot delete others messages in a DM.
        - :attr:`~Permissions.create_private_threads`: There are no threads in a DM.
        - :attr:`~Permissions.create_public_threads`: There are no threads in a DM.
        - :attr:`~Permissions.manage_threads`: There are no threads in a DM.
        - :attr:`~Permissions.send_messages_in_threads`: There are no threads in a DM.

        .. versionchanged:: 2.0

            ``obj`` parameter is now positional-only.

        .. versionchanged:: 2.1

            Thread related permissions are now set to ``False``.

        Parameters
        -----------
        obj: :class:`User`
            The user to check permissions for. This parameter is ignored
            but kept for compatibility with other ``permissions_for`` methods.

        Returns
        --------
        :class:`Permissions`
            The resolved permissions.
        )r   _dm_permissionsr   r   s     ri   r   zDMChannel.permissions_for  s    F *,,,rh   rP  rE   c               (    ddl m}  || |          S r  r  r  s      ri   r  zDMChannel.get_partial_message  r  rh   )r  rN   r   rJ   r   r	  r  r   )r   rJ   r   r`   r   r;   )r   r  )r   r  r   r  r   r!  r   r   r   r   r   r  )rc   rd   re   r   r   r   r   r  r   r  r  r   r  r   r   r  r   r   r  rg   rh   ri   r3   r3   u  sh       " "H 5I' ' ' '   2 2 2 2
H H H H    [    X
 # # # X#    X = = = X= - - - X-#- #- #- #- #-J; ; ; ; ; ;rh   r3   c                      e Zd ZdZdZ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d)dZd*dZd S )+r7   a  Represents a Discord group channel.

    .. container:: operations

        .. describe:: x == y

            Checks if two channels are equal.

        .. describe:: x != y

            Checks if two channels are not equal.

        .. describe:: hash(x)

            Returns the channel's hash.

        .. describe:: str(x)

            Returns a string representation of the channel

    Attributes
    ----------
    recipients: List[:class:`User`]
        The users you are participating with in the group channel.
    me: :class:`ClientUser`
        The user presenting yourself.
    id: :class:`int`
        The group channel ID.
    owner: Optional[:class:`User`]
        The user that owns the group channel.
    owner_id: :class:`int`
        The owner ID that owns the group channel.

        .. versionadded:: 2.0
    name: Optional[:class:`str`]
        The group channel's name if provided.
    )r   r  owner_idowner_iconr   r  r   r  rN   r   rJ   r   GroupChannelPayloadc                   || _         t          |d                   | _        || _        |                     |           d S r  )r   r`   r   r  _update_groupr  s       ri   r   zGroupChannel.__init__C  s;    ',4: 4     rh   r   r   c                    t          j        |d           _        |                    d           _        |                    d           _         fd|                    dg           D              _           j         j        j        k    r j         _	        d S t          j
         fd j                   _	        d S )Nr-  iconr   c                D    g | ]}j                             |          S rg   )r   r  )r   r  r   s     ri   r  z.GroupChannel._update_group.<locals>.<listcomp>M  s)    &e&e&eQt{'='=a'@'@&e&e&erh   r  c                $    | j         j        k    S r   )r   r-  )r  r   s    ri   r  z,GroupChannel._update_group.<locals>.<lambda>S  s    addm.C rh   )r"   r   r-  r   r/  r   r  r  r   r.  findr<  s   ` ri   r2  zGroupChannel._update_groupI  s    ','>tZ'P'P$(HHV$4$4
#'88F#3#3	&e&e&e&e$((S_acJdJd&e&e&e&=DGJ&&DJJJ$C$C$C$CT_UUDJJJrh   r;   c                
   K   | S r   rg   r   s    ri   r   zGroupChannel._get_channelU  r   rh   rm   c                    | j         r| j         S t          | j                  dk    rdS d                    t	          d | j                            S )Nr   Unnamedz, c                    | j         S r   r  )xs    ri   r  z&GroupChannel.__str__.<locals>.<lambda>_  s    qv rh   )r   rK  r  r   mapr   s    ri   r  zGroupChannel.__str__X  sP    9 	9t1$$9yy--t??@@@rh   c                (    d| j          d| j        dS )Nz<GroupChannel id=rG  r   )r   r   r   s    ri   r   zGroupChannel.__repr__a  s    @47@@$)@@@@rh   Literal[ChannelType.group]c                    t           j        S r  )r   groupr   s    ri   r   zGroupChannel.typed  r  rh   r  c                    dS )zOptional[:class:`Guild`]: The guild this group channel belongs to. Always ``None``.

        This is mainly provided for compatibility purposes in duck typing.

        .. versionadded:: 2.0
        Nrg   r   s    ri   r   zGroupChannel.guildi  r  rh   Optional[Asset]c                b    | j         dS t          j        | j        | j        | j         d          S )zHOptional[:class:`Asset`]: Returns the channel's icon asset if available.Nr   )path)r/  r$   
_from_iconr   r   r   s    ri   r4  zGroupChannel.icons  s1     :4TWdjyQQQQrh   r!  c                4    t          j        | j                  S zG:class:`datetime.datetime`: Returns the channel's creation time in UTC.r#  r   s    ri   r   zGroupChannel.created_atz  r$  rh   c                    d| j          S r  rD  r   s    ri   r  zGroupChannel.jump_url  r   rh   r   rA   r   c               h    t          j                    }d|_        |j        | j        k    rd|_        |S )a'  Handles permission resolution for a :class:`User`.

        This function is there for compatibility with other channel types.

        Actual direct messages do not really have the concept of permissions.

        This returns all the Text related permissions set to ``True`` except:

        - :attr:`~Permissions.send_tts_messages`: You cannot send TTS messages in a DM.
        - :attr:`~Permissions.manage_messages`: You cannot delete others messages in a DM.
        - :attr:`~Permissions.create_private_threads`: There are no threads in a DM.
        - :attr:`~Permissions.create_public_threads`: There are no threads in a DM.
        - :attr:`~Permissions.manage_threads`: There are no threads in a DM.
        - :attr:`~Permissions.send_messages_in_threads`: There are no threads in a DM.

        This also checks the kick_members permission if the user is the owner.

        .. versionchanged:: 2.0

            ``obj`` parameter is now positional-only.

        .. versionchanged:: 2.1

            Thread related permissions are now set to ``False``.

        Parameters
        -----------
        obj: :class:`~discord.abc.Snowflake`
            The user to check permissions for.

        Returns
        --------
        :class:`Permissions`
            The resolved permissions for the user.
        T)r   r&  mention_everyoner   r-  kick_members)r   r   r  s      ri   r   zGroupChannel.permissions_for  s7    J *,, $6T]"" $Drh   c                ^   K   | j         j                            | j                   d{V  dS )z|coro|

        Leave the group.

        If you are the only one in the group, this deletes it as well.

        Raises
        -------
        HTTPException
            Leaving the group failed.
        N)r   rL  leave_groupr   r   s    ri   leavezGroupChannel.leave  s;       k**4733333333333rh   N)r  rN   r   rJ   r   r0  )r   r0  r   r   r  r   )r   r?  r)  )r   rC  r*  )r   rA   r   r   r  )rc   rd   re   r   r   r   r2  r   r  r   r   r   r   r4  r   r  r   rO  rg   rh   ri   r7   r7     sd       $ $L [I! ! ! !
V 
V 
V 
V   A A A AA A A A ! ! ! X!    X R R R XR - - - X- = = = X=+ + + +Z4 4 4 4 4 4rh   r7   c                      e Zd ZdZdddZddZd dZed!d            Zedd            Z	ed"d            Z
d#d$dZedd            Zd%dZdS )&r8   a  Represents a partial messageable to aid with working messageable channels when
    only a channel ID is present.

    The only way to construct this class is through :meth:`Client.get_partial_messageable`.

    Note that this class is trimmed down and has no rich attributes.

    .. versionadded:: 2.0

    .. container:: operations

        .. describe:: x == y

            Checks if two partial messageables are equal.

        .. describe:: x != y

            Checks if two partial messageables are not equal.

        .. describe:: hash(x)

            Returns the partial messageable's hash.

    Attributes
    -----------
    id: :class:`int`
        The channel ID associated with this partial messageable.
    guild_id: Optional[:class:`int`]
        The guild ID associated with this partial messageable.
    type: Optional[:class:`ChannelType`]
        The channel type associated with this partial messageable, if given.
    Nr   rJ   r   r`   r  rZ  r   r  c                >    || _         || _        || _        || _        d S r   )r   r   r  r   )r   r   r   r  r   s        ri   r   zPartialMessageable.__init__  s"    ','/+/			rh   r   rm   c                B    d| j         j         d| j         d| j        dS )Nr   r   z type=r   )r   rc   r   r   r   s    ri   r   zPartialMessageable.__repr__  s,    M4>*MMMMtyMMMMrh   c                
   K   | S r   rg   r   s    ri   r   zPartialMessageable._get_channel  r   rh   r  c                @    | j                             | j                  S )zCOptional[:class:`Guild`]: The guild this partial messageable is in.)r   
_get_guildr  r   s    ri   r   zPartialMessageable.guild  s     {%%dm444rh   c                H    | j         
d| j         S d| j          d| j         S )zJ:class:`str`: Returns a URL that allows the client to jump to the channel.Nr  zhttps://discord.com/channels//)r  r   r   s    ri   r  zPartialMessageable.jump_url  s6     = @tw@@@Ht}HHtwHHHrh   r!  c                4    t          j        | j                  S rH  r#  r   s    ri   r   zPartialMessageable.created_at  r$  rh   r   r   r   c               (    t          j                    S )aX  Handles permission resolution for a :class:`User`.

        This function is there for compatibility with other channel types.

        Since partial messageables cannot reasonably have the concept of
        permissions, this will always return :meth:`Permissions.none`.

        Parameters
        -----------
        obj: :class:`User`
            The user to check permissions for. This parameter is ignored
            but kept for compatibility with other ``permissions_for`` methods.

        Returns
        --------
        :class:`Permissions`
            The resolved permissions.
        )r   noner'  s     ri   r   z"PartialMessageable.permissions_for  s    ( !!!rh   c                    d| j          dS )zn:class:`str`: Returns a string that allows you to mention the channel.

        .. versionadded:: 2.5
        z<#r   rD  r   s    ri   mentionzPartialMessageable.mention  s     DGrh   rP  rE   c               (    ddl m}  || |          S )a  Creates a :class:`PartialMessage` from the message ID.

        This is useful if you want to work with a message and only have its ID without
        doing an unnecessary API call.

        Parameters
        ------------
        message_id: :class:`int`
            The message ID to create a partial message for.

        Returns
        ---------
        :class:`PartialMessage`
            The partial message.
        r   r  r  r  r  s      ri   r  z&PartialMessageable.get_partial_message!  s+    " 	,+++++~dz::::rh   )NN)r   rJ   r   r`   r  rZ  r   r  r   )r   r8   r)  r*  r   r+  r  )rc   rd   re   r   r   r   r   r   r   r  r   r   r\  r  rg   rh   ri   r8   r8     s        B0 0 0 0 0N N N N    5 5 5 X5 I I I XI - - - X-" " " " ",    X; ; ; ; ; ;rh   r8   channel_typer`   c                v   t          t          |           }|t          j        u r	t          |fS |t          j        u r	t
          |fS |t          j        u r	t          |fS |t          j        u r	t          |fS |t          j	        u r	t          |fS |t          j        u r	t          |fS |t          j        u r	t          |fS d |fS r   )r   r   r   r0   r  r1   r.  r4   r   r.  r2   r  r6   r  )r^  r   s     ri   _guild_channel_factoryr`  7  s    [,//E   E!!	+#	#	#U""	+&	&	&%%	+"	"	"E!!	+)	)	)U""	+#	#	#U""	+#	#	#U""U{rh   c                    t          |           \  }}|t          j        u r	t          |fS |t          j        u r	t
          |fS ||fS r   )r`  r   r  r3   rA  r7   r^  r  r   s      ri   _channel_factoryrc  K  sO    '55JC###%	+#	#	#U""Ezrh   c                    t          |           \  }}|t          j        t          j        t          j        fv r	t
          |fS ||fS r   )rc  r   r  public_threadnews_threadr'   rb  s      ri   _threaded_channel_factoryrg  U  sB    !,//JC+[-FH_```u}:rh   c                    t          |           \  }}|t          j        t          j        t          j        fv r	t
          |fS ||fS r   )r`  r   r  re  rf  r'   rb  s      ri   _threaded_guild_channel_factoryri  \  sB    '55JC+[-FH_```u}:rh   )r^  r`   )r   
__future__r   typingr   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r  discord.abcra  r5  r   permissionsr   r   enumsr   r   r   r   r   r   r   r    mixinsr!   r  r"   r#   assetr$   errorsr%   r  r&   r  r'   partial_emojir(   r)   r  r*   r+   rL  r,   objectr-   
soundboardr.   r/   __all__typing_extensionsr;   r<   types.threadsr=   roler>   r  r?   r@   rb  rA   rB   r  rC   r   rD   rE   rF   mentionsrG   rr  rI   r   rJ   stickerrK   rL   r  rM   r   rN   rO   rP   r   rQ   rR   GuildChannelTypeui.viewrS   rT   rU   types.channelr0   TextChannelPayloadrV   NewsChannelPayloadr1   VoiceChannelPayloadr2   r  r3   r	  r4   rD  rW   r0  r6   ForumChannelPayloadrX   MediaChannelPayloadr5   r  r9   r   types.snowflakerY   types.soundboardBaseSoundboardSoundPayloadrZ   r[   r]   rl   rw   r~   r   r   r   r:   MessageableConnectabler  PrivateChannelr7   r8   r`  rc  rg  ri  rg   rh   ri   <module>r     s.	   0 # " " " " "                                     &      + + + + + + 9 9 9 9 9 9 9 9	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	                         # # # # # # ) ) ) ) ) )       2 2 2 2 2 2 2 2 - - - - - - - - + + + + + +       C C C C C C C C  H+........444444********--------@@@@@@@@@@))))))      &&&&&&222222220000000000>>>>>>>>3333333333                          /.....SSSSSS++++++GOT8VU4QWY_K_E`aaM    IU    + + + + +$=U + + + +N N N N N%>e N N N NN N N N N%?u N N N N
+ 
+ 
+ 
+ 
+%>e 
+ 
+ 
+ 
+    
   
* * * * ** * * *
3- 3- 3- 3- 3-1 3- 3- 3-l5& 5& 5& 5& 5& 5& 5& 5&pT: T: T: T: T:'+)7;+CX T: T: T:n{
 {
 {
 {
 {
/1H'+Jbdl {
 {
 {
|aI aI aI aI aI$ aI aI aIHCU CU CU CU CU$ CU CU CUL
EM EM EM EM EMgk. EM EM EMPV V V V Vx V V Vrw: w: w: w: w:7;+X w: w: w:tb; b; b; b; b;')CX b; b; b;Jg4 g4 g4 g4 g47;*GK,F g4 g4 g4Tp; p; p; p; p;0( p; p; p;f   (           rh   