
    i_                   d   d Z ddlmZ ddlZddl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mZ ddlZddlmZmZ ddlmZ ddlmZm Z  dd	l!m"Z" dd
l#m$Z$ ddl%m&Z& ddl'm(Z( ddl#m)Z) ddl*T ddl*m+Z+ ddl*m,Z, ddl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z= ddl>m?Z? ddl@mAZA ddlBmCZC ddlDmEZE ddlFmGZG ddlHmIZI ddlJmKZKmLZLmMZM ddlNmOZO ddlPmQZQ ddlRmSZSmTZT ddlUmVZV ddlWmXZX ddlYmZZZ ddl[m\Z\m]Z] dd l^m_Z_ dd!l`maZambZb dd"lcmdZdmeZemfZf dd#lgmhZhmiZi dd$ljmkZk dd%llmmZm d&Znejo        Zoerdd'lmpZpmqZq dd(lrmsZtmuZvmwZxmyZzm{Z{m|Z| dd)l}mSZ~ dd*lmZ dd+l%mZ dd,l*mZmZmZmZmZ dd-lmZ dd.lmZ dd/lmZ dd0lmZ dd1lmZmZmZmZmZmZmZ dd2lmZ dd3lmZ dd4lmZ dd5lmZ dd6lmZ dd7l^mZ eeef         Zeeeeef         Zeee         ee         f         Z G d8 d9e          Z G d: d;e          Z G d< d=e          Z G d> d?e?          Zw G d@ dAe?          ZudS )Ba:  
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.
    )annotationsN)AnyAsyncIteratorClassVar
Collection	CoroutineDictIterableListMapping
NamedTupleSequenceSetLiteralOptionalTYPE_CHECKINGTupleUnionoverload   )utilsabc)Role)Member
VoiceState)Emoji)InvalidData)PermissionOverwrite)Colour)ClientException)*)_guild_channel_factory)_threaded_guild_channel_factory)AuditLogActionVideoQualityModeChannelType
EntityTypePrivacyLeveltry_enumVerificationLevelContentFilterNotificationLevel	NSFWLevelMFALevelLocaleAutoModRuleEventTypeForumOrderTypeForumLayoutTypeOnboardingMode)Hashable)User)Invite)Widget)Asset)SystemChannelFlags)IntegrationPartialIntegration_integration_factory)ScheduledEvent)StageInstance)ThreadThreadMemberGuildSticker)File)AuditLogEntry)OLDEST_OBJECTObject)
Onboarding)WelcomeScreenWelcomeChannel)AutoModRuleAutoModTriggerAutoModRuleAction)	_EmojiTagPartialEmoji)SoundboardSound)RawPresenceUpdateEvent)GuildGuildPreviewBanEntry)	SnowflakeSnowflakeTime)BanrQ   rR   RolePositionUpdateGuildFeatureIncidentData)r?   )GuildVoiceState)Permissions)VoiceChannelStageChannelTextChannelForumChannelCategoryChannelTemplateWebhook)ConnectionState)VoiceProtocol)GuildChannelr^   NewsChannelr\   r`   r]   r_   )IntegrationType)SnowflakeList)EditWidgetSettings)AuditLogEvent)EmojiInputType)OnboardingPromptc                  $    e Zd ZU ded<   ded<   dS )rS   Optional[str]reasonr5   userN__name__
__module____qualname____annotations__     T/home/ubuntu/.hermes/hermes-agent/venv/lib/python3.11/site-packages/discord/guild.pyrS   rS      s%         JJJJJry   rS   c                  $    e Zd ZU ded<   ded<   dS )BulkBanResultzList[Object]bannedfailedNrs   rx   ry   rz   r|   r|      s*         ry   r|   c                  8    e Zd ZU ded<   ded<   ded<   ded<   dS )_GuildLimitintemojistickersfloatbitratefilesizeNrs   rx   ry   rz   r   r      s4         JJJMMMNNNMMMMMry   r   c                      e Zd ZdZ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dS )rR   a  Represents a preview of a Discord guild.

        .. versionadded:: 2.5

    .. container:: operations

        .. describe:: x == y

            Checks if two guild previews are equal.

        .. describe:: x != y

            Checks if two guild previews are not equal.

        .. describe:: hash(x)

            Returns the guild's hash.

        .. describe:: str(x)

            Returns the guild's name.

    Attributes
    ----------
    name: :class:`str`
        The guild preview's name.
    id: :class:`int`
        The guild preview's ID.
    features: List[:class:`str`]
        A list of features the guild has. See :attr:`Guild.features` for more information.
    description: Optional[:class:`str`]
        The guild preview's description.
    emojis: Tuple[:class:`Emoji`, ...]
        All emojis that the guild owns.
    stickers: Tuple[:class:`GuildSticker`, ...]
        All stickers that the guild owns.
    approximate_member_count: :class:`int`
        The approximate number of members in the guild.
    approximate_presence_count: :class:`int`
        The approximate number of members currently active in in the guild. Offline members are excluded.
    )_state_icon_splash_discovery_splashidnameemojisr   featuresdescriptionapproximate_member_countapproximate_presence_countdataGuildPreviewPayloadstatere   returnNonec          	          _         t          |d                    _        |d          _        |                    d           _        |                    d           _        |                    d           _        t          t           fd|                    dg                                _
        t          t          fd|                    d	g                                _        |                    d
g            _        |                    d           _        |                    d           _        |                    d           _        d S )Nr   r   iconsplashdiscovery_splashc                X    t                              j                  |           S Nguildr   r   )r    _get_or_create_unavailable_guildr   dselfr   s    rz   <lambda>z'GuildPreview.__init__.<locals>.<lambda>   s(    %e&L&LTW&U&U]bijkkk ry   r   c                &    t          |           S )Nr   r   rA   )r   r   s    rz   r   z'GuildPreview.__init__.<locals>.<lambda>   s    ,U;;; ry   r   r   r   r   r   )r   r   r   r   getr   r   r   tuplemapr   r   r   r   r   r   r   r   r   s   ` `rz   __init__zGuildPreview.__init__   s4   ',d4j//f	$(HHV$4$4
&*hhx&8&8049K0L0L).kkkkk2&& *
 *
 38;;;;TXXjRT=U=UVV3
 3
 -1HHZ,D,D*.((=*A*A-1XX6P-Q-Q%/3xx8T/U/U'''ry   strc                    | j         S Nr   r   s    rz   __str__zGuildPreview.__str__   s
    yry   c                b    d| j         j         d| j         d| j        d| j        d| j         dS )N<z id=z name=z description=z
 features=>)	__class__rt   r   r   r   r   r   s    rz   __repr__zGuildPreview.__repr__   s]    )' ) )TW ) )DI ) )VZVf ) )) ) )	
ry   datetime.datetimec                4    t          j        | j                  S zE:class:`datetime.datetime`: Returns the guild's creation time in UTC.r   snowflake_timer   r   s    rz   
created_atzGuildPreview.created_at        #DG,,,ry   Optional[Asset]c                ^    | j         dS t          j        | j        | j        | j                   S zGOptional[:class:`Asset`]: Returns the guild's icon asset, if available.Nr   r8   _from_guild_iconr   r   r   s    rz   r   zGuildPreview.icon  ,     :4%dk47DJGGGry   c                b    | j         dS t          j        | j        | j        | j         d          S zPOptional[:class:`Asset`]: Returns the guild's invite splash asset, if available.Nsplashespathr   r8   _from_guild_imager   r   r   s    rz   r   zGuildPreview.splash  2     <4&t{DGT\PZ[[[[ry   c                b    | j         dS t          j        | j        | j        | j         d          S zSOptional[:class:`Asset`]: Returns the guild's discovery splash asset, if available.Nzdiscovery-splashesr   r   r8   r   r   r   r   s    rz   r   zGuildPreview.discovery_splash  4     !)4&t{DGT=SZnoooory   N)r   r   r   re   r   r   r   r   r   r   r   r   )rt   ru   rv   __doc__	__slots__r   r   r   propertyr   r   r   r   rx   ry   rz   rR   rR      s        ( (TIV V V V*   
 
 
 
 - - - X- H H H XH \ \ \ X\ p p p Xp p pry   rR   c                      e Zd ZU dZdZ edddej                   edddej                   eddd	ej                   ed
ddd           edddd          dZde	d<   ddZ
ddZdd Zdd$Zdd'Zdd+Zdd,Zdd.Zdd/Zdd0Zdd3Zdd7Zdd:Zdd;Zdd=Zdd>ZddAZddDZddFZeddI            ZddKZe ddM            Z!e ddO            Z"e ddQ            Z#e d dS            Z$e ddU            Z%e ddV            Z&e ddX            Z'e ddZ            Z(e dd\            Z)e dd^            Z*dd`Z+dddZ,d	dfZ-d
dhZ.ddkZ/ddnZ0e ddp            Z1e ddr            Z2e ddt            Z3e ddu            Z4e ddv            Z5e ddw            Z6e ddy            Z7e ddz            Z8e dd{            Z9e dd}            Z:e dd~            Z;e dd            Z<ddZ=e dd            Z>e dd            Z?ddZ@e dd            ZAe dd            ZBe dd            ZCe dd            ZDddZEe dd            ZFddZGe dd            ZHddZId dZJe d!d            ZKe d"d            ZLe d"d            ZMe d"d            ZNe d"d            ZOe d#d            ZPe dd            ZQe dd            ZRe d$d            ZSd%dZTeU	 	 d&d'd            ZVeU	 	 d&d(d            ZVeU	 	 d&d)d            ZVeU	 	 d&d*d            ZVeU	 	 d&d+d            ZVeU	 	 d&d,d            ZVeU	 	 d&d-dń            ZVeU	 	 d&d.dȄ            ZVeWdfd.dʄZVdddeWeWeWeWeWeWeWd̜
d/d؄ZXddeWeWeWeWeWeWeWdٜ	d0dZYddeWeWeWeWeWeWeWdٜ	d1dZZeWdeWdd2dZ[e[Z\eWeWdeWeWeWeWdeWeWeWeWeWeWdd3dZ]ddZ^ ej_                    dd            Z`eWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWeWdd4dZaddZbd5dZcdeWdd6d!Zdd7d#Zed8d&Zfd9d(ZgdeWeWd)d:d,Zhd-eWdɐd.d;d3Zid<d5Zjd=d7ZkeWd8d>d9Zld?d;ZmeWd<d@d>ZndAdAZodBdCZpdCdEZqdDdHZreWdɐdIdEdMZsdɐdNdFdPZtd-dQdGdTZud-dQdHdVZveUddddddddWdIda            ZweUddddddddbdJdd            ZweUdddddddedKdf            ZweUdddddddgdLdi            ZweWeWeWeWeWeWeWdɐdjdMdlZwdNdnZxdOdpZyeWdɐdqdPdsZzdɐdNdQdtZ{dRdvZ|ddwZ}eUdddddeWddddx	dSd            Z~eUdddddeWdddd	dTd            Z~eWeWeWeWeWeWeWdeWeWeWeWddUdZ~dɐdNdVdZdWdZdXdZeWeWeWdɐddYdZdɐdNdZdZdeWeWdd[dZdɐdNdZdZdɐddd\dZe d]d            Zd^dZdeWeWeWeWeWdd_dZd`dZeWeWdɐddadZd-ddbdZ	 dcdddːd-ddddZddːddedZdfdZdgdÄZdeWeWeWdĜdhd΄Ze didЄ            Ze didф            Ze did҄            Ze didӄ            ZddԄZddՄZddքZddׄZdjd؄ZdkdڄZdddɐdܜdld߄ZdmdZeWeWeWeWeWddndZdS (o  rQ   a0  Represents a Discord guild.

    This is referred to as a "server" in the official Discord UI.

    .. container:: operations

        .. describe:: x == y

            Checks if two guilds are equal.

        .. describe:: x != y

            Checks if two guilds are not equal.

        .. describe:: hash(x)

            Returns the guild's hash.

        .. describe:: str(x)

            Returns the guild's name.

    Attributes
    ----------
    name: :class:`str`
        The guild name.
    emojis: Tuple[:class:`Emoji`, ...]
        All emojis that the guild owns.
    stickers: Tuple[:class:`GuildSticker`, ...]
        All stickers that the guild owns.

        .. versionadded:: 2.0
    afk_timeout: :class:`int`
        The number of seconds until someone is moved to the AFK channel.
    id: :class:`int`
        The guild's ID.
    owner_id: :class:`int`
        The guild owner's ID. Use :attr:`Guild.owner` instead.
    unavailable: :class:`bool`
        Indicates if the guild is unavailable. If this is ``True`` then the
        reliability of other attributes outside of :attr:`Guild.id` is slim and they might
        all be ``None``. It is best to not do anything with the guild if it is unavailable.

        Check the :func:`on_guild_unavailable` and :func:`on_guild_available` events.
    max_presences: Optional[:class:`int`]
        The maximum amount of presences for the guild.
    max_members: Optional[:class:`int`]
        The maximum amount of members for the guild.

        .. note::

            This attribute is only available via :meth:`.Client.fetch_guild`.
    max_video_channel_users: Optional[:class:`int`]
        The maximum amount of users in a video channel.

        .. versionadded:: 1.4
    description: Optional[:class:`str`]
        The guild's description.
    verification_level: :class:`VerificationLevel`
        The guild's verification level.
    vanity_url_code: Optional[:class:`str`]
        The guild's vanity url code, if any

        .. versionadded:: 2.0
    explicit_content_filter: :class:`ContentFilter`
        The guild's explicit content filter.
    default_notifications: :class:`NotificationLevel`
        The guild's notification settings.
    features: List[:class:`str`]
        A list of features that the guild has. The features that a guild can have are
        subject to arbitrary change by Discord. A list of guild features can be found
        in :ddocs:`the Discord documentation <resources/guild#guild-object-guild-features>`.

    premium_tier: :class:`int`
        The premium tier for this guild. Corresponds to "Nitro Server" in the official UI.
        The number goes from 0 to 3 inclusive.
    premium_subscription_count: :class:`int`
        The number of "boosts" this guild currently has.
    preferred_locale: :class:`Locale`
        The preferred locale for the guild. Used when filtering Server Discovery
        results to a specific language.

        .. versionchanged:: 2.0
            This field is now an enum instead of a :class:`str`.
    nsfw_level: :class:`NSFWLevel`
        The guild's NSFW level.

        .. versionadded:: 2.0
    mfa_level: :class:`MFALevel`
        The guild's Multi-Factor Authentication requirement level.

        .. versionchanged:: 2.0
            This field is now an enum instead of an :class:`int`.

    approximate_member_count: Optional[:class:`int`]
        The approximate number of members in the guild. This is ``None`` unless the guild is obtained
        using :meth:`Client.fetch_guild` or :meth:`Client.fetch_guilds` with ``with_counts=True``.

        .. versionadded:: 2.0
    approximate_presence_count: Optional[:class:`int`]
        The approximate number of members currently active in the guild.
        Offline members are excluded. This is ``None`` unless the guild is obtained using
        :meth:`Client.fetch_guild` or :meth:`Client.fetch_guilds` with ``with_counts=True``.

        .. versionchanged:: 2.0
    premium_progress_bar_enabled: :class:`bool`
        Indicates if the guild has premium AKA server boost level progress bar enabled.

        .. versionadded:: 2.0
    widget_enabled: :class:`bool`
        Indicates if the guild has widget enabled.

        .. versionadded:: 2.0
    max_stage_video_users: Optional[:class:`int`]
        The maximum amount of users in a stage video channel.

        .. versionadded:: 2.3
    )1afk_timeoutr   r   unavailableowner_idr   r   r   verification_levelexplicit_content_filterdefault_notificationsr   max_presencesmax_membersmax_video_channel_userspremium_tierpremium_subscription_countpreferred_locale
nsfw_level	mfa_levelvanity_url_codewidget_enabled_widget_channel_id_afk_channel_id_members	_channelsr   _bannerr   _roles_member_count_larger   _voice_states_system_channel_id_system_channel_flagsr   _rules_channel_id_public_updates_channel_id_stage_instances_scheduled_events_threadsr   r   premium_progress_bar_enabled_safety_alerts_channel_idmax_stage_video_users_incidents_data_soundboard_sounds2           p@)r   r   r   r   d      g     @@      g     @Ai      <   g     pAi  @)Nr   r         z*ClassVar[Dict[Optional[int], _GuildLimit]]_PREMIUM_GUILD_LIMITSr   GuildPayloadr   re   r   r   c                   i | _         i | _        i | _        i | _        i | _        i | _        i | _        || _        d | _        | 	                    |           d S r   )
r   r   r   r   r   r   r   r   r   
_from_datar   s      rz   r   zGuild.__init__  s^    24+-46+-:<<>>@',,0ry   channelrg   c               $    || j         |j        <   d S r   )r   r   r   r  s     rz   _add_channelzGuild._add_channel  s    %,wz"""ry   rT   c               F    | j                             |j        d            d S r   )r   popr   r  s     rz   _remove_channelzGuild._remove_channel  s"    7:t,,,,,ry   user_idr   Optional[VoiceState]c               6    | j                             |          S r   )r   r   r   r  s     rz   _voice_state_forzGuild._voice_state_for  s    !%%g...ry   memberr   c               $    || j         |j        <   d S r   )r   r   r   r  s     rz   _add_memberzGuild._add_member      #)fi   ry   payloadThreadPayloadr?   c               R    t          | | j        |          }|| j        |j        <   |S r   )r?   r   r   r   )r   r  threads      rz   _store_threadzGuild._store_thread  s+    d$+GDDD#)fi ry   c               F    | j                             |j        d            d S r   )r   r  r   r  s     rz   _remove_memberzGuild._remove_member  "    &)T*****ry   r  c               $    || j         |j        <   d S r   )r   r   r   r  s     rz   _add_threadzGuild._add_thread  r  ry   c               F    | j                             |j        d            d S r   )r   r  r   r%  s     rz   _remove_threadzGuild._remove_thread  r#  ry   c                8    | j                                          d S r   )r   clearr   s    rz   _clear_threadszGuild._clear_threads  s    ry   
channel_idList[Thread]c                v    fd| j                                         D             }|D ]}| j         |j        = |S )Nc                *    g | ]}|j         k    |S rx   	parent_id).0tr,  s     rz   
<listcomp>z4Guild._remove_threads_by_channel.<locals>.<listcomp>  s%    TTT1!+:S:SQ:S:S:Sry   )r   valuesr   )r   r,  	to_remover  s    `  rz   _remove_threads_by_channelz Guild._remove_threads_by_channel  sN    TTTT 4 4 6 6TTT	 	) 	)Ffi((ry   channel_idsSet[int]Dict[int, Thread]c                l    fd| j                                         D             }|D ]
}| j         |= |S )Nc                .    i | ]\  }}|j         v ||S rx   r0  )r2  kr3  r8  s      rz   
<dictcomp>z)Guild._filter_threads.<locals>.<dictcomp>  s.    'm'm'mARSR]alRlRl1RlRlRlry   )r   items)r   r8  r6  r=  s    `  rz   _filter_threadszGuild._filter_threads  sL    'm'm'm'm9L9L9N9N'm'm'm	 	! 	!Aa  ry   soundrO   c               $    || j         |j        <   d S r   )r   r   r   rA  s     rz   _add_soundboard_soundzGuild._add_soundboard_sound  s    ,1)))ry   c               F    | j                             |j        d            d S r   )r   r  r   rC  s     rz   _remove_soundboard_soundzGuild._remove_soundboard_sound  s#    ##EHd33333ry   r   c                    | j         pdS )N r   r   s    rz   r   zGuild.__str__	  s    yBry   c                    d| j         fd| j        fd| j        fd| j        fd| j        ff}d                    d |D                       }d| d	S )
Nr   r   shard_idchunkedmember_count c              3      K   | ]	}d |z  V  
dS )z%s=%rNrx   r2  r3  s     rz   	<genexpr>z!Guild.__repr__.<locals>.<genexpr>  s&      441444444ry   z<Guild r   )r   r   rJ  rK  r   join)r   attrsinners      rz   r   zGuild.__repr__  sn    47OTY'%T/0
 44e44444!!!!!ry   rZ   /Tuple[Optional[Member], VoiceState, VoiceState]c                   t          |d                   }|                     |          }	 || j                            |          }n| j        |         }t	          j        |          }|                    ||           n<# t          $ r/ t          ||          }t          |d           }|| j        |<   Y nw xY w|                     |          }|3	 |d         }t          || j
        |           }n# t          $ r d }Y nw xY w|||fS )Nr  )r   r  r  r   r   r   )r   get_channelr   r  copy_updateKeyErrorr   
get_memberr   r   )	r   r   r,  r  r  afterbeforer  member_datas	            rz   _update_voice_statezGuild._update_voice_state  s>   d9o&&/3/?/?
/K/K	0*..w77*73Yu%%FMM$(((( 	0 	0 	0D':::ET4888F*/Dw'''		0 ))>"8n[4PPP    vu$$s$   AB 6B:9B:C5 5DDroler   c               $    || j         |j        <   d S r   )r   r   r   r`  s     rz   	_add_rolezGuild._add_role3  s    #DGry   role_idc               6    | j                             |          S r   )r   r  r   rd  s     rz   _remove_rolezGuild._remove_role6  s    {w'''ry   guild_idOptional[Dict[str, Any]]c               T    |ddi}|                     |            | ||          S )Nr   Tr   r   )update)clsr   rh  r   s       rz   _create_unavailablezGuild._create_unavailable:  s:    <!4(Dx   sT****ry   r   c           	     4    	 |d          _         n# t          $ r Y nw xY w|                    dd           _        t	          t
          |                    d                     _        t	          t          |                    d                     _        t	          t          |                    dd                     _
        |                    dd           _        |                    d	           _        |                    d
           _        |                    dd           _        t          |d                    _        i  _         j        |                    dg           D ]#}t'           |          }| j        |j        <   $j        r5t+          t-           fd|                    dg                               nd _        j        r5t+          t-           fd|                    dg                               nd _        |                    dg            _        |                    d           _        t7          j        |d           _        |                    d           _        |                    d           _        |                    d           _         |                    d           _!        |                    d           _"        |                    dd           _#        |                    d          pd _$        |                    d           _%        |                    d d           _&        t7          j        |d!           _'        |                    d"d           _(        t	          tR          |                    d#d$                     _*        |                    d%           _+        t7          j        |d&           _,        t7          j        |d'           _-        t7          j        |d(           _.        t	          t^          |                    d)d                     _0        t	          tb          |                    d*d                     _2        |                    d+           _3        |                    d,           _4        |                    d-d           _5        t7          j        |d.           _6         j         d n
 j         d/k     _7        t7          j        |d0           _8        |                    d1           _9        d2|v rM|d2         }|D ]B}tu          |d3                   \  }}|r& ;                     | | j                             C|                    d4g           D ]+} <                    |t          |d5                              , j        j=        j>        }	 j        j=        j?        }
 j        j@        }|                    d6g           D ]K}t          |  j        7          }|	s|j        |k    s|
r#|j         jB        v r C                    |           Ld}|                    d8g           D ]J}t          | j        9          } E                    |jF                  }||G                    ||           Kd:|v r7|d:         }|D ],} H                    t            j        |;                     -d<|v r1|d<         D ](}t           | j                  }| jK        |j        <   )d=|v r0|d=         D ]'}t          | j        9          }| jM        |j        <   (d>|v r7|d>         D ]0}t           | j                  } O                    |           /d S d S )?NrL  r   rH  r   default_message_notificationsr   r   r   r   bannerr   Fr   rolesr   r   r   c                0                         |           S r   )store_emojir   s    rz   r   z"Guild._from_data.<locals>.<lambda>Y  s     1 1$ : : ry   r   rx   c                0                         |           S r   )store_stickerr   s    rz   r   z"Guild._from_data.<locals>.<lambda>^  s     3 3D! < < ry   r   r   r   system_channel_idr   r   r   r   max_stage_video_channel_usersr   r   r   r   widget_channel_idsystem_channel_flagsr   zen-USr   rules_channel_idpublic_updates_channel_idsafety_alerts_channel_idr   r   r   r   r   r   r  afk_channel_idincidents_datachannelstypevoice_statesr,  membersr   r   r   	presencesr   r   threadsr   stage_instancesguild_scheduled_eventssoundboard_sounds)Pr   rZ  r   r   r)   r*   r   r,   r   r+   r   r   r   r   r   r   r   r   r   r   cache_guild_expressionsr   r   r   r   r   r   r   _get_as_snowflaker   r   r   r   r   r   r   r   r   r   r   r   r/   r   r   r   r   r   r-   r   r.   r   r   r   r   r   r   r   r   r"   r  r_  member_cache_flagsjoinedvoiceself_idr   r   r  rP   r[  r  _presence_updater&  r?   r>   r   r=   r   rO   rD  )r   r   rr`  r  cfactorych_typeobjcache_joinedcache_voicer  mdatar  empty_tuplepresenceraw_presencer  r  sstage_instancescheduled_eventsoundboard_soundr   s   `                      @rz   r
  zGuild._from_dataA  s~   	!&~!6D 	 	 	D	 62..	5=>OQVQZQZ[oQpQp5q5q8@uyy)HII9
 9
" 7?}eiiXqstNuNu6v6v$ %		- ; ;$)IIf$5$5
&+ii&9&9!&=%!@!@5;''')7B'' 	( 	(Ad%888D#'DK   ,E#:::::EIIhPR<S<STTUUU 	 ,E#<<<<<eii
TV>W>WXXYYY 	
 -2IIj",E,E&+ii&9&9161HPc1d1d*/))M*B*B,1IIo,F,F*/))M*B*B6;ii@Y6Z6Z$49II>]4^4^"!&>1!=!=/4yy9U/V/V/[Z['.3ii8I.J.J$)II.>$F$F161HPc1d1d*/))4JA*N*N"(0CUW^9_9_(`(`05		:L0M0M050GOa0b0b9>9PQVXs9t9t'8=8OPUWq8r8r&%-i<QR9S9S%T%T#+HeiiQ6O6O#P#P9>C_9`9`'7<yyA[7\7\%27))<Z\a2b2b)','>uj'Q'Q.2.@.HdddN`dgNg.3.EeM].^.^7<yyAQ7R7RZ(H V V#9!F)#D#D  V%%ggDq&T&T&TUUU99^R00 	B 	BC$$S#c,.?*@*@AAAA{5<k4:+%YYy"-- 	) 	)Ed$+FFFF )vyG333	UYUgHgHg  (((		+r22 	C 	CH1xt{SSSL__\%9::F!''kBBBI&G! U U  d$+F!S!S!STTTT%%,- J J!.T!U!U!U;I%n&788#u,,34 M M"0at{"K"K"K=L&'9::%''./ = =#2AT[#Y#Y#Y **+;<<<< ('= =s    
Sequence[GuildChannel]c                X    t          j        | j                                                  S )zSSequence[:class:`abc.GuildChannel`]: A list of channels that belongs to this guild.)r   SequenceProxyr   r5  r   s    rz   r  zGuild.channels  s#     "4>#8#8#:#:;;;ry   Sequence[Thread]c                X    t          j        | j                                                  S )zvSequence[:class:`Thread`]: A list of threads that you have permission to view.

        .. versionadded:: 2.0
        )r   r  r   r5  r   s    rz   r  zGuild.threads  s#     "4=#7#7#9#9:::ry   boolc                r    | j         *| j        | j        dk    S t          | j                  dk    S | j         S )z:class:`bool`: Indicates if the guild is a 'large' guild.

        A large guild is defined as having more than ``large_threshold`` count
        members, which for this library is set to the maximum of 250.
        Nr  )r   r   lenr   r   s    rz   largezGuild.large  s@     ;!-)S00t}%%,,{ry   List[VoiceChannel]c                z    d | j                                         D             }|                    d            |S )zList[:class:`VoiceChannel`]: A list of voice channels that belongs to this guild.

        This is sorted by the position and are in UI order from top to bottom.
        c                <    g | ]}t          |t                    |S rx   )
isinstancer\   r2  chs     rz   r4  z(Guild.voice_channels.<locals>.<listcomp>  '    RRRBZL5Q5QRRRRRry   c                    | j         | j        fS r   positionr   r  s    rz   r   z&Guild.voice_channels.<locals>.<lambda>      aj!$/ ry   keyr   r5  sortr   r  s     rz   voice_channelszGuild.voice_channels  C     SR$.//11RRR	//000ry   List[StageChannel]c                z    d | j                                         D             }|                    d            |S )zList[:class:`StageChannel`]: A list of stage channels that belongs to this guild.

        .. versionadded:: 1.7

        This is sorted by the position and are in UI order from top to bottom.
        c                <    g | ]}t          |t                    |S rx   )r  r]   r  s     rz   r4  z(Guild.stage_channels.<locals>.<listcomp>  r  ry   c                    | j         | j        fS r   r  r  s    rz   r   z&Guild.stage_channels.<locals>.<lambda>  r  ry   r  r  r  s     rz   stage_channelszGuild.stage_channels  sC     SR$.//11RRR	//000ry   c                N    | j         j        j        }|                     |          S )z:class:`Member`: Similar to :attr:`Client.user` except an instance of :class:`Member`.
        This is essentially used to get the member version of yourself.
        )r   rr   r   r[  )r   r  s     rz   mezGuild.me  s#    
 +"%w'''ry   Optional[VoiceProtocol]c                @    | j                             | j                  S )zhOptional[:class:`VoiceProtocol`]: Returns the :class:`VoiceProtocol` associated with this guild, if any.)r   _get_voice_clientr   r   s    rz   voice_clientzGuild.voice_client  s     {,,TW555ry   List[TextChannel]c                z    d | j                                         D             }|                    d            |S )zList[:class:`TextChannel`]: A list of text channels that belongs to this guild.

        This is sorted by the position and are in UI order from top to bottom.
        c                <    g | ]}t          |t                    |S rx   )r  r^   r  s     rz   r4  z'Guild.text_channels.<locals>.<listcomp>  s'    QQQBZK5P5PQRQQQry   c                    | j         | j        fS r   r  r  s    rz   r   z%Guild.text_channels.<locals>.<lambda>  r  ry   r  r  r  s     rz   text_channelszGuild.text_channels  sC     RQ$.//11QQQ	//000ry   List[CategoryChannel]c                z    d | j                                         D             }|                    d            |S )zList[:class:`CategoryChannel`]: A list of categories that belongs to this guild.

        This is sorted by the position and are in UI order from top to bottom.
        c                <    g | ]}t          |t                    |S rx   )r  r`   r  s     rz   r4  z$Guild.categories.<locals>.<listcomp>  s'    UUUBZO5T5TURUUUry   c                    | j         | j        fS r   r  r  s    rz   r   z"Guild.categories.<locals>.<lambda>  r  ry   r  r  r  s     rz   
categorieszGuild.categories  sC     VU$.//11UUU	//000ry   List[ForumChannel]c                z    d | j                                         D             }|                    d            |S )zList[:class:`ForumChannel`]: A list of forum channels that belongs to this guild.

        This is sorted by the position and are in UI order from top to bottom.
        c                <    g | ]}t          |t                    |S rx   )r  r_   r  s     rz   r4  z Guild.forums.<locals>.<listcomp>  r  ry   c                    | j         | j        fS r   r  r  s    rz   r   zGuild.forums.<locals>.<lambda>  r  ry   r  r  r  s     rz   forumszGuild.forums  r  ry   List[ByCategoryItem]c                   i }| j                                         D ]o}t          |t                    r|                    |j        g            3	 ||j                                     |           U# t          $ r |g||j        <   Y lw xY wd	d}| j         j	        fd|
                                D             }|                    |           |D ]\  }}|                    d            |S )
a  Returns every :class:`CategoryChannel` and their associated channels.

        These channels and categories are sorted in the official Discord UI order.

        If the channels do not have a category, then the first element of the tuple is
        ``None``.

        Returns
        --------
        List[Tuple[Optional[:class:`CategoryChannel`], List[:class:`abc.GuildChannel`]]]:
            The categories and their associated channels.
        r3  ByCategoryItemr   *Tuple[Tuple[int, int], List[GuildChannel]]c                4    | \  }}|r|j         |j        fnd|fS )N)r  r  )r3  r=  vs      rz   r  zGuild.by_category.<locals>.key!  s)    DAq*+9QZ&&1==ry   c                0    g | ]\  }} |          |fS rx   rx   )r2  r=  r  _gets      rz   r4  z%Guild.by_category.<locals>.<listcomp>&  s)    (R(R(R$!Q$$q''1(R(R(Rry   r  c                *    | j         | j        | j        fS r   )_sorting_bucketr  r   r  s    rz   r   z#Guild.by_category.<locals>.<lambda>)  s    ):AJ(M ry   )r3  r  r   r  )r   r5  r  r`   
setdefaultr   category_idappendrZ  r   r?  r  )r   groupedr  r  as_list_r  r  s          @rz   by_categoryzGuild.by_category	  s2    <>~,,.. 	9 	9G'?33 ""7:r2229+,33G<<<< 9 9 907y+,,,9	> 	> 	> 	> ~!(R(R(R(R'--//(R(R(R" 	O 	OKAxMMMMMNNNNs    A22B
	B
r   Optional[int]%Optional[Union[GuildChannel, Thread]]c               r    |d S | j                             |          p| j                            |          S r   r   r   r   r   r   s     rz   _resolve_channelzGuild._resolve_channel,  s7    :F~!!"%%>):):2)>)>>ry   %Optional[Union[Thread, GuildChannel]]c               j    | j                             |          p| j                            |          S )am  Returns a channel or thread with the given ID.

        .. versionadded:: 2.0

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

        Returns
        --------
        Optional[Union[:class:`Thread`, :class:`.abc.GuildChannel`]]
            The returned channel or thread or ``None`` if not found.
        r  r   r,  s     rz   get_channel_or_threadzGuild.get_channel_or_thread2  s/     ~!!*--N1B1B:1N1NNry   Optional[GuildChannel]c               6    | j                             |          S )a  Returns a channel with the given ID.

        .. note::

            This does *not* search for threads.

        .. versionchanged:: 2.0

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

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

        Returns
        --------
        Optional[:class:`.abc.GuildChannel`]
            The returned channel or ``None`` if not found.
        )r   r   r  s     rz   rW  zGuild.get_channelC  s    * ~!!*---ry   	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:`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   r   )r   r  s     rz   
get_threadzGuild.get_threadZ  s    ( }  +++ry   emoji_idOptional[Emoji]c               X    | j                             |          }|r|j        | k    r|S dS )a&  Returns an emoji with the given ID.

        .. versionadded:: 2.3

        Parameters
        ----------
        emoji_id: int
            The ID to search for.

        Returns
        --------
        Optional[:class:`Emoji`]
            The returned Emoji or ``None`` if not found.
        N)r   	get_emojir   )r   r  r   s      rz   r  zGuild.get_emojip  s7     %%h// 	U[D((Ltry   Optional[VocalGuildChannel]c                6    |                      | j                  S )zOptional[Union[:class:`VoiceChannel`, :class:`StageChannel`]]: The channel that denotes the AFK channel.

        If no channel is set, then this returns ``None``.
        )rW  r   r   s    rz   afk_channelzGuild.afk_channel  s      4555ry   Optional[TextChannel]c                H    | j         }|o| j                            |          S )zOptional[:class:`TextChannel`]: Returns the guild's channel used for system messages.

        If no channel is set, then this returns ``None``.
        )r   r   r   r  s     rz   system_channelzGuild.system_channel  s'     ,
<dn00<<<ry   r9   c                4    t          j        | j                  S )zI:class:`SystemChannelFlags`: Returns the guild's system channel settings.)r9   _from_valuer   r   s    rz   r{  zGuild.system_channel_flags  s     "-d.HIIIry   c                H    | j         }|o| j                            |          S )zOptional[:class:`TextChannel`]: Return's the guild's channel used for the rules.
        The guild must be a Community guild.

        If no channel is set, then this returns ``None``.

        .. versionadded:: 1.3
        )r   r   r   r  s     rz   rules_channelzGuild.rules_channel  s'     +
<dn00<<<ry   c                H    | j         }|o| j                            |          S )a  Optional[:class:`TextChannel`]: Return's the guild's channel where admins and
        moderators of the guilds receive notices from Discord. The guild must be a
        Community guild.

        If no channel is set, then this returns ``None``.

        .. versionadded:: 1.4
        )r   r   r   r  s     rz   public_updates_channelzGuild.public_updates_channel  s'     4
<dn00<<<ry   c                H    | j         }|o| j                            |          S )zOptional[:class:`TextChannel`]: Return's the guild's channel used for safety alerts, if set.

        For example, this is used for the raid protection setting. The guild must have the ``COMMUNITY`` feature.

        .. versionadded:: 2.3
        )r   r   r   r  s     rz   safety_alerts_channelzGuild.safety_alerts_channel  s'     3
<dn00<<<ry   FOptional[Union[TextChannel, ForumChannel, VoiceChannel, StageChannel]]c                H    | j         }|o| j                            |          S )zOptional[Union[:class:`TextChannel`, :class:`ForumChannel`, :class:`VoiceChannel`, :class:`StageChannel`]]: Returns
        the widget channel of the guild.

        If no channel is set, then this returns ``None``.

        .. versionadded:: 2.3
        )r   r   r   r  s     rz   widget_channelzGuild.widget_channel  s'     ,
<dn00<<<ry   c                f    d| j         v rdnd}t          || j        | j                 j                  S )z?:class:`int`: The maximum number of emoji slots this guild has.
MORE_EMOJI   r   )r   maxr  r   r   )r   
more_emojis     rz   emoji_limitzGuild.emoji_limit  s7     )DM99SSr
:t9$:KLRSSSry   c                f    d| j         v rdnd}t          || j        | j                 j                  S )zi:class:`int`: The maximum number of sticker slots this guild has.

        .. versionadded:: 2.0
        MORE_STICKERSr  r   )r   r  r  r   r   )r   more_stickerss     rz   sticker_limitzGuild.sticker_limit  s7     .>>A=$"<T=N"O"XYYYry   r   c                    d| j         v r| j        d         j        nd}t          || j        | j                 j                  S )zK:class:`float`: The maximum bitrate for voice channels this guild can have.VIP_REGIONSr   r   )r   r  r   r  r   )r   	vip_guilds     rz   bitrate_limitzGuild.bitrate_limit  sE     >Kdm=[=[D.q199ae	9d89JKSTTTry   c                0    | j         | j                 j        S )zU:class:`int`: The maximum number of bytes files can have when uploaded to this guild.)r  r   r   r   s    rz   filesize_limitzGuild.filesize_limit  s     )$*;<EEry   Sequence[Member]c                X    t          j        | j                                                  S )zGSequence[:class:`Member`]: A list of members that belong to this guild.)r   r  r   r5  r   s    rz   r  zGuild.members  s#     "4=#7#7#9#9:::ry   Optional[Member]c               6    | j                             |          S )ae  Returns a member with the given ID.

        .. versionchanged:: 2.0

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

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

        Returns
        --------
        Optional[:class:`Member`]
            The member or ``None`` if not found.
        )r   r   r  s     rz   r[  zGuild.get_member  s    " }  )))ry   List[Member]c                $    d | j         D             S )zGList[:class:`Member`]: A list of members who have "boosted" this guild.c                     g | ]}|j         	|S r   )premium_since)r2  r  s     rz   r4  z-Guild.premium_subscribers.<locals>.<listcomp>  s     VVV6V5I5U5U5U5Ury   )r  r   s    rz   premium_subscriberszGuild.premium_subscribers  s     WVT\VVVVry   Sequence[Role]c                \    t          j        | j                                        d          S )zSequence[:class:`Role`]: Returns a sequence of the guild's roles in hierarchy order.

        The first element of this sequence will be the lowest role in the
        hierarchy.
        T)sorted)r   r  r   r5  r   s    rz   rr  zGuild.roles  s(     "4;#5#5#7#7EEEEry   Optional[Role]c               6    | j                             |          S )a_  Returns a role with the given ID.

        .. versionchanged:: 2.0

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

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

        Returns
        --------
        Optional[:class:`Role`]
            The role or ``None`` if not found.
        )r   r   rf  s     rz   get_rolezGuild.get_role
  s    " {w'''ry   c                6    |                      | j                  S )zH:class:`Role`: Gets the @everyone role that all members have by default.)r-  r   r   s    rz   default_rolezGuild.default_role  s     }}TW%%%ry   c                n    | j                                         D ]}|                                r|c S dS )zOptional[:class:`Role`]: Gets the premium subscriber role, AKA "boost" role, in this guild.

        .. versionadded:: 1.6
        N)r   r5  is_premium_subscriberrb  s     rz   premium_subscriber_rolezGuild.premium_subscriber_role#  sH     K&&(( 	 	D))++ try   c                    | j         j        }| j                                        D ]}|j        }|r|j        |k    r|c S dS )zzOptional[:class:`Role`]: Gets the role associated with this client's user, if any.

        .. versionadded:: 1.6
        N)r   r  r   r5  tagsbot_id)r   r  r`  r4  s       rz   	self_rolezGuild.self_role.  sU     +%K&&(( 	 	D9D w..try   Sequence[StageInstance]c                X    t          j        | j                                                  S )zSequence[:class:`StageInstance`]: Returns a sequence of the guild's stage instances that
        are currently running.

        .. versionadded:: 2.0
        )r   r  r   r5  r   s    rz   r  zGuild.stage_instances;  s$     "4#8#?#?#A#ABBBry   stage_instance_idOptional[StageInstance]c               6    | j                             |          S )aI  Returns a stage instance with the given ID.

        .. versionadded:: 2.0

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

        Returns
        --------
        Optional[:class:`StageInstance`]
            The stage instance or ``None`` if not found.
        )r   r   )r   r9  s     rz   get_stage_instancezGuild.get_stage_instanceD  s     $(():;;;ry   Sequence[ScheduledEvent]c                X    t          j        | j                                                  S )z~Sequence[:class:`ScheduledEvent`]: Returns a sequence of the guild's scheduled events.

        .. versionadded:: 2.0
        )r   r  r   r5  r   s    rz   scheduled_eventszGuild.scheduled_eventsU  s$     "4#9#@#@#B#BCCCry   scheduled_event_idOptional[ScheduledEvent]c               6    | j                             |          S )aM  Returns a scheduled event with the given ID.

        .. versionadded:: 2.0

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

        Returns
        --------
        Optional[:class:`ScheduledEvent`]
            The scheduled event or ``None`` if not found.
        )r   r   )r   r@  s     rz   get_scheduled_eventzGuild.get_scheduled_event]  s     %))*<===ry   Sequence[SoundboardSound]c                X    t          j        | j                                                  S )zSequence[:class:`SoundboardSound`]: Returns a sequence of the guild's soundboard sounds.

        .. versionadded:: 2.5
        )r   r  r   r5  r   s    rz   r  zGuild.soundboard_soundsn  s$     "4#:#A#A#C#CDDDry   sound_idOptional[SoundboardSound]c               6    | j                             |          S )aF  Returns a soundboard sound with the given ID.

        .. versionadded:: 2.5

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

        Returns
        --------
        Optional[:class:`SoundboardSound`]
            The soundboard sound or ``None`` if not found.
        r   r   )r   rF  s     rz   get_soundboard_soundzGuild.get_soundboard_soundv  s     &**8444ry   c               >    |d S | j                             |          S r   rI  r  s     rz   _resolve_soundboard_soundzGuild._resolve_soundboard_sound  s#    :F&**2...ry   c                6    |                      | j                  S )z:Optional[:class:`Member`]: The member that owns the guild.)r[  r   r   s    rz   ownerzGuild.owner  s     t}---ry   r   c                ^    | j         dS t          j        | j        | j        | j                   S r   r   r   s    rz   r   z
Guild.icon  r   ry   c                b    | j         dS t          j        | j        | j        | j         d          S )zIOptional[:class:`Asset`]: Returns the guild's banner asset, if available.Nbannersr   )r   r8   r   r   r   r   s    rz   rq  zGuild.banner  s2     <4&t{DGT\PYZZZZry   c                b    | j         dS t          j        | j        | j        | j         d          S r   r   r   s    rz   r   zGuild.splash  r   ry   c                b    | j         dS t          j        | j        | j        | j         d          S r   r   r   s    rz   r   zGuild.discovery_splash  r   ry   c                    | j         S )aW  Optional[:class:`int`]: Returns the member count if available.

        .. warning::

            Due to a Discord limitation, in order for this attribute to remain up-to-date and
            accurate, it requires :attr:`Intents.members` to be specified.

        .. versionchanged:: 2.0

            Now returns an ``Optional[int]``.
        )r   r   s    rz   rL  zGuild.member_count  s     !!ry   c                H    | j         }|dS |t          | j                  k    S )a?  :class:`bool`: Returns a boolean indicating if the guild is "chunked".

        A chunked guild means that :attr:`member_count` is equal to the
        number of members stored in the internal :attr:`members` cache.

        If this value returns ``False``, then you should request for
        offline members.
        NF)r   r  r   r   counts     rz   rK  zGuild.chunked  s+     "=5DM****ry   c                <    | j         j        }|dS | j        dz	  |z  S )z@:class:`int`: Returns the shard ID for this guild if applicable.Nr      )r   shard_countr   rV  s     rz   rJ  zGuild.shard_id  s)     '=12&&ry   r   c                4    t          j        | j                  S r   r   r   s    rz   r   zGuild.created_at  r   ry   r   c                  | j         }                    d          \  }scdk    s't                    dk    r-                                rt	          j        fd|          S d
fd	}t	          j        ||          S )ab  Returns the first member found that matches the name provided.

        The name is looked up in the following order:

        - Username#Discriminator (deprecated)
        - Username#0 (deprecated, only gets users that migrated from their discriminator)
        - Nickname
        - Global name
        - Username

        If no member is found, ``None`` is returned.

        .. versionchanged:: 2.0

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

        .. deprecated:: 2.3

            Looking up users via discriminator due to Discord API change.

        Parameters
        -----------
        name: :class:`str`
            The name of the member to lookup.

        Returns
        --------
        Optional[:class:`Member`]
            The member in this guild with the associated name. If not found
            then ``None`` is returned.
        #0   c                0    | j         k    o
| j        k    S r   )r   discriminator)mra  usernames    rz   r   z(Guild.get_member_named.<locals>.<lambda>  s    ((:(_qR_?_ ry   rb  r   r   r  c                F    | j         k    p| j        k    p
| j        k    S r   )nickglobal_namer   )rb  r   s    rz   predz$Guild.get_member_named.<locals>.pred  s&    6T>LQ]d%:LafnLry   )rb  r   r   r  )r  
rpartitionr  isdigitr   find)r   r   r  r  rg  ra  rc  s    `   @@rz   get_member_namedzGuild.get_member_named  s    B ,%)__S%9%9"!]  	>&.#M8CC$6$6!$;$;@U@U@W@W$;:_____ahiii	M 	M 	M 	M 	M 	M z$(((ry   .channel_typeLiteral[ChannelType.text]
overwrites9Mapping[Union[Role, Member, Object], PermissionOverwrite]categoryOptional[Snowflake]optionsr   'Coroutine[Any, Any, TextChannelPayload]c                    d S r   rx   r   r   rl  rn  rp  rr  s         rz   _create_channelzGuild._create_channel
  	     36#ry   Literal[ChannelType.voice](Coroutine[Any, Any, VoiceChannelPayload]c                    d S r   rx   ru  s         rz   rv  zGuild._create_channel  	     473ry    Literal[ChannelType.stage_voice](Coroutine[Any, Any, StageChannelPayload]c                    d S r   rx   ru  s         rz   rv  zGuild._create_channel  r{  ry   Literal[ChannelType.category]+Coroutine[Any, Any, CategoryChannelPayload]c                    d S r   rx   ru  s         rz   rv  zGuild._create_channel(  s	     7:cry   Literal[ChannelType.news]'Coroutine[Any, Any, NewsChannelPayload]c                    d S r   rx   ru  s         rz   rv  zGuild._create_channel2  rw  ry   +Literal[ChannelType.news, ChannelType.text]BCoroutine[Any, Any, Union[TextChannelPayload, NewsChannelPayload]]c                    d S r   rx   ru  s         rz   rv  zGuild._create_channel<  s     NQSry   Literal[ChannelType.forum](Coroutine[Any, Any, ForumChannelPayload]c                    d S r   rx   ru  s         rz   rv  zGuild._create_channelF  r{  ry   r&   (Coroutine[Any, Any, GuildChannelPayload]c                    d S r   rx   ru  s         rz   rv  zGuild._create_channelP  r{  ry   Nc                ^   |t           u ri }n$t          |t                    st          d          g }|                                D ]\  }}t          |t
                    st          d|j        j                   |                                \  }	}
|	j	        |
j	        |j
        d}t          |t                    rt          j        j        |d<   nt          j        j        |d<   |                    |           |r|j
        nd } | j        j        j        | j
        |j	        f|||d|S )Nz$overwrites parameter expects a dict.z&Expected PermissionOverwrite received )allowdenyr   r  )r   r1  permission_overwrites)MISSINGr  r   	TypeErrorr?  r   r   rt   pairvaluer   r   r   _OverwritesROLEMEMBERr  r   httpcreate_channel)r   r   rl  rn  rp  rr  permstargetpermr  r  r  r1  s                rz   rv  zGuild._create_channelZ  sG      JJJ00 	DBCCC&,,.. 	" 	"LFDd$788 d bI` b bccc))++KE4 %TZvyQQG&$'' 9"%/"6"%/"8LL!!!!#+5HKK	.t{.G\'
.2i_d
 
ho
 
 	
ry   F)
rq   rp  newsr  topicslowmode_delaynsfwrn  default_auto_archive_durationdefault_thread_slowmode_delayrq   rp   Optional[CategoryChannel]r  r  r  r  r  r  r  r^   c       
        d  K   i }|t           ur||d<   |t           ur||d<   |t           ur||d<   |t           ur||d<   |
t           ur|
|d<   |t           ur||d<    | j        |f|	|rt          j        nt          j        ||d| d{V }t          | j        | |	          }|| j        |j        <   |S )
a  |coro|

        Creates a :class:`TextChannel` for the guild.

        Note that you must have :attr:`~Permissions.manage_channels` to create the channel.

        The ``overwrites`` parameter can be used to create a 'secret'
        channel upon creation. This parameter expects a :class:`dict` of
        overwrites with the target (either a :class:`Member` or a :class:`Role`)
        as the key and a :class:`PermissionOverwrite` as the value.

        .. note::

            Creating a channel of a specified position will not update the position of
            other channels to follow suit. A follow-up call to :meth:`~TextChannel.edit`
            will be required to update the position of the channel in the channel list.

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

        Examples
        ----------

        Creating a basic channel:

        .. code-block:: python3

            channel = await guild.create_text_channel('cool-channel')

        Creating a "secret" channel:

        .. code-block:: python3

            overwrites = {
                guild.default_role: discord.PermissionOverwrite(read_messages=False),
                guild.me: discord.PermissionOverwrite(read_messages=True)
            }

            channel = await guild.create_text_channel('secret', overwrites=overwrites)

        Parameters
        -----------
        name: :class:`str`
            The channel's name.
        overwrites: Dict[Union[:class:`Role`, :class:`Member`], :class:`PermissionOverwrite`]
            A :class:`dict` of target (either a role or a member) to
            :class:`PermissionOverwrite` to apply upon creation of a channel.
            Useful for creating secret channels.
        category: Optional[:class:`CategoryChannel`]
            The category to place the newly created channel under.
            The permissions will be automatically synced to category if no
            overwrites are provided.
        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.
        topic: :class:`str`
            The new channel's topic.
        slowmode_delay: :class:`int`
            Specifies the slowmode rate limit for user in this channel, in seconds.
            The maximum value possible is ``21600``.
        nsfw: :class:`bool`
            To mark the channel as NSFW or not.
        news: :class:`bool`
            Whether to create the text channel as a news channel.

            .. versionadded:: 2.0
        default_auto_archive_duration: :class:`int`
            The default auto archive duration for threads created in the text channel (in minutes).
            Must be one of ``60``, ``1440``, ``4320``, or ``10080``.

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

            .. versionadded:: 2.3
        reason: Optional[:class:`str`]
            The reason for creating this channel. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have the proper permissions to create this channel.
        HTTPException
            Creating the channel failed.
        TypeError
            The permission overwrite information is not in proper form.

        Returns
        -------
        :class:`TextChannel`
            The channel that was just created.
        r  r  rate_limit_per_userr  r  "default_thread_rate_limit_per_userrn  rl  rp  rq   Nr   r   r   )	r  rv  r&   r  textr^   r   r   r   )r   r   rq   rp  r  r  r  r  r  rn  r  r  rr  r   r  s                  rz   create_text_channelzGuild.create_text_channel{  s      Z 7"""*GJ$GG((-;G)*w"GFO(777TG34(77<YG89)T)
!-1G)){7G
 
 
 
 
 
 
 
 
 
 DKt$GGG &-wz"ry   )	rq   rp  r  r   
user_limit
rtc_regionvideo_quality_modern  r  r   r  r  r  r%   r\   c       	          K   i }|t           ur||d<   |t           ur||d<   |t           ur||d<   |t           ur	|dn||d<   |t           ur.t          |t                    st          d          |j        |d<   |
t           ur|
|d<    | j        |f|	t          j        ||d	| d{V }t          | j	        | |
          }|| j
        |j        <   |S )a  |coro|

        This is similar to :meth:`create_text_channel` except makes a :class:`VoiceChannel` instead.

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

        Parameters
        -----------
        name: :class:`str`
            The channel's name.
        overwrites: Dict[Union[:class:`Role`, :class:`Member`], :class:`PermissionOverwrite`]
            A :class:`dict` of target (either a role or a member) to
            :class:`PermissionOverwrite` to apply upon creation of a channel.
            Useful for creating secret channels.
        category: Optional[:class:`CategoryChannel`]
            The category to place the newly created channel under.
            The permissions will be automatically synced to category if no
            overwrites are provided.
        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
        video_quality_mode: :class:`VideoQualityMode`
            The camera video quality for the voice channel's participants.

            .. versionadded:: 2.0
        nsfw: :class:`bool`
            To mark the channel as NSFW or not.

            .. versionadded:: 2.6
        reason: Optional[:class:`str`]
            The reason for creating this channel. Shows up on the audit log.

        Raises
        ------
        Forbidden
            You do not have the proper permissions to create this channel.
        HTTPException
            Creating the channel failed.
        TypeError
            The permission overwrite information is not in proper form.

        Returns
        -------
        :class:`VoiceChannel`
            The channel that was just created.
        r  r   r  Nr  3video_quality_mode must be of type VideoQualityModer  r  r  r  )r  r  r%   r  r  rv  r&   r  r\   r   r   r   r   r   rq   rp  r  r   r  r  r  rn  r  rr  r   r  s                 rz   create_voice_channelzGuild.create_voice_channel	  s>     N 7"""*GJ'!!!(GIW$$$.GL!W$$,6,>DDJGL!W,,02BCC W UVVV,>,DG()w"GFO)T)
'k6GRZci
 
mt
 
 
 
 
 
 
 
 T[4HHH &-wz"ry   r]   c       	          K   i }|t           ur||d<   |t           ur||d<   |t           ur||d<   |t           ur	|dn||d<   |t           ur.t          |t                    st          d          |j        |d<   |
t           ur|
|d<    | j        |f|	t          j        ||d	| d{V }t          | j	        | |
          }|| j
        |j        <   |S )a1	  |coro|

        This is similar to :meth:`create_text_channel` except makes a :class:`StageChannel` instead.

        .. versionadded:: 1.7

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

        Parameters
        -----------
        name: :class:`str`
            The channel's name.
        overwrites: Dict[Union[:class:`Role`, :class:`Member`], :class:`PermissionOverwrite`]
            A :class:`dict` of target (either a role or a member) to
            :class:`PermissionOverwrite` to apply upon creation of a channel.
            Useful for creating secret channels.
        category: Optional[:class:`CategoryChannel`]
            The category to place the newly created channel under.
            The permissions will be automatically synced to category if no
            overwrites are provided.
        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.

            .. versionadded:: 2.2
        user_limit: :class:`int`
            The channel's limit for number of members that can be in a voice channel.

            .. versionadded:: 2.2
        rtc_region: Optional[:class:`str`]
            The region for the voice channel's voice communication.
            A value of ``None`` indicates automatic voice region detection.

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

            .. versionadded:: 2.2
        nsfw: :class:`bool`
            To mark the channel as NSFW or not.

            .. versionadded:: 2.6
        reason: Optional[:class:`str`]
            The reason for creating this channel. Shows up on the audit log.

        Raises
        ------
        Forbidden
            You do not have the proper permissions to create this channel.
        HTTPException
            Creating the channel failed.
        TypeError
            The permission overwrite information is not in proper form.

        Returns
        -------
        :class:`StageChannel`
            The channel that was just created.
        r  r   r  Nr  r  r  r  r  r  )r  r  r%   r  r  rv  r&   stage_voicer]   r   r   r   r  s                 rz   create_stage_channelzGuild.create_stage_channeln  s>     \ 7"""*GJ'!!!(GIW$$$.GL!W$$,6,>DDJGL!W,,02BCC W UVVV,>,DG()w"GFO)T)
'k6MX`io
 
sz
 
 
 
 
 
 
 
 T[4HHH &-wz"ry   )rn  rq   r  r`   c                  K   i }|t           ur||d<    | j        |f|t          j        |d| d{V }t	          | j        | |          }|| j        |j        <   |S )a  |coro|

        Same as :meth:`create_text_channel` except makes a :class:`CategoryChannel` instead.

        .. note::

            The ``category`` parameter is not supported in this function since categories
            cannot have categories.

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

        Raises
        ------
        Forbidden
            You do not have the proper permissions to create this channel.
        HTTPException
            Creating the channel failed.
        TypeError
            The permission overwrite information is not in proper form.

        Returns
        -------
        :class:`CategoryChannel`
            The channel that was just created.
        r  )rn  rl  rq   Nr  )r  rv  r&   rp  r`   r   r   r   )r   r   rn  rq   r  rr  r   r  s           rz   create_categoryzGuild.create_category  s      F #%7"""*GJ)T)
'k6JSY
 
]d
 
 
 
 
 
 
 
 "4dKKK &-wz"ry   )r  r  rp  r  r  mediarn  rq   r  r  default_sort_orderdefault_reaction_emojidefault_layoutavailable_tagsr  r  r1   r  rm   r  r2   r  Sequence[ForumTag]r_   c          	       K   i }|t           ur||d<   |t           ur||d<   |t           ur||d<   |t           ur||d<   |
t           ur|
|d<   |t           ur||d<   |t           ur;t          |t                    st          d|j        j                   |j        |d<   |t           urt          |t                    r*|                                	                                |d	<   nNt          |t                    r*t          j        |          	                                |d	<   nt          d
          |sD|t           ur;t          |t                    st          d|j        j                   |j        |d<   |t           urd |D             |d<    | j        d|||st           j        nt           j        ||	d| d{V }t'          | j        | |          }|| j        |j        <   |S )a  |coro|

        Similar to :meth:`create_text_channel` except makes a :class:`ForumChannel` instead.

        The ``overwrites`` parameter can be used to create a 'secret'
        channel upon creation. This parameter expects a :class:`dict` of
        overwrites with the target (either a :class:`Member` or a :class:`Role`)
        as the key and a :class:`PermissionOverwrite` as the value.

        .. versionadded:: 2.0

        Parameters
        -----------
        name: :class:`str`
            The channel's name.
        overwrites: Dict[Union[:class:`Role`, :class:`Member`], :class:`PermissionOverwrite`]
            A :class:`dict` of target (either a role or a member) to
            :class:`PermissionOverwrite` to apply upon creation of a channel.
            Useful for creating secret channels.
        topic: :class:`str`
            The channel's topic.
        category: Optional[:class:`CategoryChannel`]
            The category to place the newly created channel under.
            The permissions will be automatically synced to category if no
            overwrites are provided.
        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.
        nsfw: :class:`bool`
            To mark the channel as NSFW or not.
        slowmode_delay: :class:`int`
            Specifies the slowmode rate limit for users in this channel, in seconds.
            The maximum possible value is ``21600``.
        reason: Optional[:class:`str`]
            The reason for creating this channel. Shows up in the audit log.
        default_auto_archive_duration: :class:`int`
            The default auto archive duration for threads created in the forum channel (in minutes).
            Must be one of ``60``, ``1440``, ``4320``, or ``10080``.
        default_thread_slowmode_delay: :class:`int`
            The default slowmode delay in seconds for threads created in this forum.

            .. versionadded:: 2.1
        default_sort_order: :class:`ForumOrderType`
            The default sort order for posts in this forum channel.

            .. versionadded:: 2.3
        default_reaction_emoji: Union[:class:`Emoji`, :class:`PartialEmoji`, :class:`str`]
            The default reaction emoji for threads created in this forum to show in the
            add reaction button.

            .. versionadded:: 2.3
        default_layout: :class:`ForumLayoutType`
            The default layout for posts in this forum.
            This cannot be set if ``media`` is set to ``True``.

            .. versionadded:: 2.3
        available_tags: Sequence[:class:`ForumTag`]
            The available tags for this forum channel.

            .. versionadded:: 2.1
        media: :class:`bool`
            Whether to create a media forum channel.

            .. versionadded:: 2.6

        Raises
        -------
        Forbidden
            You do not have the proper permissions to create this channel.
        HTTPException
            Creating the channel failed.
        TypeError
            The permission overwrite information is not in proper form.

        Returns
        -------
        :class:`ForumChannel`
            The channel that was just created.
        r  r  r  r  r  r  z:default_sort_order parameter must be a ForumOrderType not r  r  zKdefault_reaction_emoji parameter must be either Emoji, PartialEmoji, or strz7default_layout parameter must be a ForumLayoutType not default_forum_layoutc                6    g | ]}|                                 S rx   to_dictrO  s     rz   r4  z&Guild.create_forum.<locals>.<listcomp>  s     (M(M(M(M(M(Mry   r  )r   rn  rl  rp  rq   Nr  rx   )r  r  r1   r  r   rt   r  rM   _to_partial_to_forum_tag_payloadr   rN   from_str
ValueErrorr2   rv  r&   forumr  r_   r   r   r   )r   r   r  r  rp  r  r  r  rn  rq   r  r  r  r  r  r  rr  r   r  s                      rz   create_forumzGuild.create_forum  s     D 7"""*GJ$GG((-;G)*w"GFO(777TG34(77<YG89W,,0.AA xQcQmQvxx   -?,DG()!000)<< q4J4V4V4X4X4n4n4p4p0112C88 q4@4IJ`4a4a4w4w4y4y011 !oppp 	Cw66no>> qnNfNoqq   /=.BG*+(((M(Mn(M(M(MG$%)T) 
!27N**[=N
 
 
 
 
 
 
 
 
 
 +
 
 
 &-wz"ry   c                ^   K   | j         j                            | j                   d{V  dS )z|coro|

        Leaves the guild.

        Raises
        --------
        HTTPException
            Leaving the guild failed.
        N)r   r  leave_guildr   r   s    rz   leavezGuild.leave  s;       k**4733333333333ry   c                ^   K   | j         j                            | j                   d{V  dS )a|  |coro|

        Deletes the guild. You must be the guild owner to delete the
        guild.

        .. deprecated:: 2.6
           This method is deprecated and will be removed in a future version.

        Raises
        --------
        HTTPException
            Deleting the guild failed.
        Forbidden
            You do not have permissions to delete the guild.
        N)r   r  delete_guildr   r   s    rz   deletezGuild.delete  s;      $ k++DG44444444444ry   )rq   r   r   r   rq  r   r   	communityr   rN  r   r   r   r   vanity_coder  r{  r   r  r	  r   discoverableinvites_disabledr   r  r   raid_alerts_disabledr  invites_disabled_untildms_disabled_untilr   r   Optional[bytes]rq  r   r   r  r   Optional[VoiceChannel]rN  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  c               4  K   | j         j        }|t          ur#|                    | j        ||           d{V  i } |t          ur|| d<   |t          ur|| d<   |t          urt          |          | d<   |t          ur|| d<   |t          ur||| d<   nt          j        |          | d<   |t          ur||| d<   nt          j        |          | d<   |t          ur||| d	<   nt          j        |          | d	<   |t          ur||| d
<   nt          j        |          | d
<   |t          ur.t          |t                    st          d          |j        | d<   |	t          ur|	|	| d<   n
|	j        | d<   |t          ur||| d<   n
|j        | d<   |t          urC||| d<   n;t          |t                    st          d|j        j                   |j        | d<   |t          urC||| d<   n;t          |t                    st          d|j        j                   |j        | d<   |t          urC||| d<   n1t          |t                    st          d|j        j                   |j        | d<   |
t          ur.| j        | j         j        k    rt#          d          |
j        | d<   |t          ur.t          |t$                    st          d          |j        | d<   |t          ur.t          |t&                    st          d          |j        | d<   |t          ur.t          |t(                    st          d          |j        | d<   t+          d ||||fD                       rt-          | j                  }!|t          urD|r-d| v rd| v r|!                    d           n$t#          d          |!                    d           |t          ur-|r|!                    d            n|!                    d            |t          ur-|r|!                    d!           n|!                    d!           |t          ur-|r|!                    d"           n|!                    d"           t5          |!          | d#<   |t          ur|| d$<   i }"|t          ur|dn|j        |"d%<   |t          ur||"d&<   |"r-| j         j                            | j        |"|'           d{V  |t          urXt          |t8                    st          d(|j        j                   |                    | j        |j        )           d{V  i }#|t          ur5|d|#d*<   n-|j        t          d+          |                                |#d*<   |t          ur5|d|#d,<   n-|j        t          d-          |                                |#d,<   |#r"|                     | j        |#.           d{V   |j!        | j        fd/|i|  d{V }$tE          |$| j         0          S )1aS  |coro|

        Edits the guild.

        You must have :attr:`~Permissions.manage_guild` to edit the guild.

        .. versionchanged:: 2.0
            The newly updated guild is returned.

        .. versionchanged:: 2.0
            The ``region`` keyword parameter has been removed.

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

        Parameters
        ----------
        name: :class:`str`
            The new name of the guild.
        description: Optional[:class:`str`]
            The new description of the guild. Could be ``None`` for no description.
            This is only available to guilds that contain ``COMMUNITY`` in :attr:`Guild.features`.
        icon: :class:`bytes`
            A :term:`py:bytes-like object` representing the icon. Only PNG/JPEG is supported.
            GIF is only available to guilds that contain ``ANIMATED_ICON`` in :attr:`Guild.features`.
            Could be ``None`` to denote removal of the icon.
        banner: :class:`bytes`
            A :term:`py:bytes-like object` representing the banner.
            Could be ``None`` to denote removal of the banner. This is only available to guilds that contain
            ``BANNER`` in :attr:`Guild.features`.
        splash: :class:`bytes`
            A :term:`py:bytes-like object` representing the invite splash.
            Only PNG/JPEG supported. Could be ``None`` to denote removing the
            splash. This is only available to guilds that contain ``INVITE_SPLASH``
            in :attr:`Guild.features`.
        discovery_splash: :class:`bytes`
            A :term:`py:bytes-like object` representing the discovery splash.
            Only PNG/JPEG supported. Could be ``None`` to denote removing the
            splash. This is only available to guilds that contain ``DISCOVERABLE``
            in :attr:`Guild.features`.

            .. versionadded:: 2.0
        community: :class:`bool`
            Whether the guild should be a Community guild. If set to ``True``\, both ``rules_channel``
            and ``public_updates_channel`` parameters are required.

            .. versionadded:: 2.0
        afk_channel: Optional[:class:`VoiceChannel`]
            The new channel that is the AFK channel. Could be ``None`` for no AFK channel.
        afk_timeout: :class:`int`
            The number of seconds until someone is moved to the AFK channel.
        owner: :class:`Member`
            The new owner of the guild to transfer ownership to. Note that you must
            be owner of the guild to do this.

            .. deprecated:: 2.6
               This parameter is deprecated and will be removed in a future version as bots can no longer own guilds.
        verification_level: :class:`VerificationLevel`
            The new verification level for the guild.
        default_notifications: :class:`NotificationLevel`
            The new default notification level for the guild.
        explicit_content_filter: :class:`ContentFilter`
            The new explicit content filter for the guild.
        vanity_code: :class:`str`
            The new vanity code for the guild.

            .. deprecated:: 2.6
               This parameter is deprecated and will be removed in a future version as bots can no longer set this.
        system_channel: Optional[:class:`TextChannel`]
            The new channel that is used for the system channel. Could be ``None`` for no system channel.
        system_channel_flags: :class:`SystemChannelFlags`
            The new system channel settings to use with the new system channel.
        preferred_locale: :class:`Locale`
            The new preferred locale for the guild. Used as the primary language in the guild.

            .. versionchanged:: 2.0

                Now accepts an enum instead of :class:`str`.
        rules_channel: Optional[:class:`TextChannel`]
            The new channel that is used for rules. This is only available to
            guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no rules
            channel.

            .. versionadded:: 1.4
        public_updates_channel: Optional[:class:`TextChannel`]
            The new channel that is used for public updates from Discord. This is only available to
            guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no
            public updates channel.

            .. versionadded:: 1.4
        premium_progress_bar_enabled: :class:`bool`
            Whether the premium AKA server boost level progress bar should be enabled for the guild.

            .. versionadded:: 2.0
        discoverable: :class:`bool`
            Whether server discovery is enabled for this guild.

            .. versionadded:: 2.1
        invites_disabled: :class:`bool`
            Whether joining via invites should be disabled for the guild.

            .. versionadded:: 2.1
        widget_enabled: :class:`bool`
            Whether to enable the widget for the guild.

            .. versionadded:: 2.3
        widget_channel: Optional[:class:`abc.Snowflake`]
             The new widget channel. ``None`` removes the widget channel.

            .. versionadded:: 2.3
        mfa_level: :class:`MFALevel`
            The new guild's Multi-Factor Authentication requirement level.
            Note that you must be owner of the guild to do this.

            .. versionadded:: 2.3
            .. deprecated:: 2.6
               This parameter is deprecated and will be removed in a future version as bots can no longer own guilds.
        reason: Optional[:class:`str`]
            The reason for editing this guild. Shows up on the audit log.

        raid_alerts_disabled: :class:`bool`
            Whether the alerts for raid protection should be disabled for the guild.

            .. versionadded:: 2.3

        safety_alerts_channel: Optional[:class:`TextChannel`]
            The new channel that is used for safety alerts. This is only available to
            guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no
            safety alerts channel.

            .. versionadded:: 2.3

        invites_disabled_until: Optional[:class:`datetime.datetime`]
            The time when invites should be enabled again, or ``None`` to disable the action.
            This must be a timezone-aware datetime object. Consider using :func:`utils.utcnow`.

            .. versionadded:: 2.4

        dms_disabled_until: Optional[:class:`datetime.datetime`]
            The time when direct messages should be allowed again, or ``None`` to disable the action.
            This must be a timezone-aware datetime object. Consider using :func:`utils.utcnow`.

            .. versionadded:: 2.4

        Raises
        -------
        Forbidden
            You do not have permissions to edit the guild.
        HTTPException
            Editing the guild failed.
        ValueError
            The image format passed in to ``icon`` is invalid. It must be
            PNG or JPG. This is also raised if you are not the owner of the
            guild and request an ownership transfer.
        TypeError
            The type passed to the ``default_notifications``, ``rules_channel``, ``public_updates_channel``,
            ``safety_alerts_channel`` ``verification_level``, ``explicit_content_filter``,
            ``system_channel_flags``, or ``mfa_level`` parameter was of the incorrect type.

        Returns
        --------
        :class:`Guild`
            The newly updated guild. Note that this has the same limitations as
            mentioned in :meth:`Client.fetch_guild` and may not have full data.
        rq   Nr   r   r   r   r   rq  r   r   z=default_notifications field must be of type NotificationLevelrp  r  rx  r|  z.rules_channel must be of type TextChannel not r}  z7public_updates_channel must be of type TextChannel not r~  z6safety_alerts_channel must be of type TextChannel not z9To transfer ownership you must be the owner of the guild.r   z:verification_level field must be of type VerificationLevelr   z;explicit_content_filter field must be of type ContentFilterr   z=system_channel_flags field must be of type SystemChannelFlagsr{  c              3  (   K   | ]}|t           uV  d S r   )r  )r2  feats     rz   rP  zGuild.edit.<locals>.<genexpr>	  s'      qqtt7"qqqqqqry   	COMMUNITYz\community field requires both rules_channel and public_updates_channel fields to be providedDISCOVERABLEINVITES_DISABLEDRAID_ALERTS_DISABLEDr   r   r,  enabledr  rq   z'mfa_level must be of type MFALevel not )r   r  zinvites_disabled_until must be an aware datetime. Consider using discord.utils.utcnow() or datetime.datetime.now().astimezone() for local time.r  zdms_disabled_until must be an aware datetime. Consider using discord.utils.utcnow() or datetime.datetime.now().astimezone() for local time.)r  rq   r  )#r   r  r  change_vanity_coder   r   r   _bytes_to_base64_datar  r,   r  r  r^   r   rt   r   r  r  r*   r+   r9   anysetr   adddiscardlistedit_widgetr.   edit_guild_mfa_leveltzinfo	isoformatedit_incident_actions
edit_guildrQ   )%r   rq   r   r   r   rq  r   r   r  r   rN  r   r   r   r   r  r  r{  r   r  r	  r   r  r  r   r  r   r  r  r  r  r  fieldsr   widget_payloadincident_actions_payloadr   s%                                        rz   editz
Guild.edit  s     R {g%%))$';v)NNNNNNNNN!#w!F6Ng%%$/F=!7**),-=)>)>F%&g%%$/F=!w|!%v!&!<T!B!Bv  ~#)x  #(#>v#F#Fx   ~#)x  #(#>v#F#Fx 7**'-=)**-2-HIY-Z-Z)* //35FGG a _```6K6QF23g%%"+6'((+6>'(((%.<*++.<.?*+''$-:)**!-== y#$wUbUlUu$w$wxxx-:-=)*!00%-6L233!"8+FF #}RhRrR{}}   7M6O23 //$,5J122!"7EE #{QfQpQy{{   2G1IF-.} 333 !\]]]!&F:W,,02CDD ^ \]]]+=+CF'("'115}EE _ ]^^^0G0MF,-w..24FGG a _```-A-GF)*qq	<IY[o/pqqqqq  	04=))H'' 2)V338SW]8]8] [1111(z   $$[1117** 5LL0000$$^444w..# 9LL!34444$$%7888#722' =LL!78888$$%;<<<!%hF:'w665QF12-/((3A3I44~O`N<((((6N9% 	_+"..twW].^^^^^^^^^G##i22 j h)J]Jf h hiii++DGy+OOOOOOOOO13 !00%-EI()ABB)08# j   F\EeEeEgEg()ABW,,!)AE()=>>%,4# f   BTA]A]A_A_()=># 	X,,TW>V,WWWWWWWWW$T_TWFFVFvFFFFFFFF$dk2222ry   c                    K    j         j                             j                   d{V } fdfd|D             S )a  |coro|

        Retrieves all :class:`abc.GuildChannel` that the guild has.

        .. note::

            This method is an API call. For general usage, consider :attr:`channels` instead.

        .. versionadded:: 1.2

        Raises
        -------
        InvalidData
            An unknown channel type was received from Discord.
        HTTPException
            Retrieving the channels failed.

        Returns
        -------
        Sequence[:class:`abc.GuildChannel`]
            All channels in the guild.
        Nc                    t          | d                   \  }}|"t          d                    |                      |j        |           }|S )Nr  0Unknown channel type {type} for channel ID {id}.r   )r"   r   
format_mapr   )r   r  r  r  r   s       rz   convertz%Guild.fetch_channels.<locals>.converts	  sY    5ai@@GW!"T"_"_`a"b"bcccgD!DDDGNry   c                &    g | ]} |          S rx   rx   r2  r   r  s     rz   r4  z(Guild.fetch_channels.<locals>.<listcomp>{	  !    )))q

)))ry   )r   r  get_all_guild_channelsr   r   r   r  s   ` @rz   fetch_channelszGuild.fetch_channelsZ	  sk      . [%<<TWEEEEEEEE	 	 	 	 	 *)))D))))ry   c                   K    j         j                             j                   d{V } fd|                    dg           D             }d |D             }|                    dg           D ]P}|                    t          |d                             }|$|                    t          ||                     Q|S )a  |coro|

        Returns a list of active :class:`Thread` that the client can access.

        This includes both private and public threads.

        .. versionadded:: 2.0

        Raises
        ------
        HTTPException
            The request to get the active threads failed.

        Returns
        --------
        List[:class:`Thread`]
            The active threads
        Nc                >    g | ]}t          j        |           S r   )r?   r   r2  r   r   s     rz   r4  z(Guild.active_threads.<locals>.<listcomp>	  s*    bbbQ6DKa@@@bbbry   r  c                    i | ]
}|j         |S rx   rk  )r2  r  s     rz   r>  z(Guild.active_threads.<locals>.<dictcomp>	  s    +T+T+T&FIv+T+T+Try   r  r   )parentr   )r   r  get_active_threadsr   r   r   r  r@   )r   r   r  thread_lookupr  r  s   `     rz   active_threadszGuild.active_threads}	  s      & [%88AAAAAAAAbbbb$((S\^`JaJabbb+T+TG+T+T+Thhy"-- 	M 	MF"&&s6$<'8'899F!""<vF#K#K#KLLLry     limitr\  r  r\  rU   AsyncIterator[Member]c              b  K   | j         j        j        st          d          	 |dnt	          |d          }|dk     rdS t          |t          j                  r$t          t          j	        |d                    }|pt          }|r|j        nd}| j         }|j                            | j        ||           d{V }|sdS t          |          dk     rd}t          t          |d	         d
         d                             }t!          |          D ]}t#          || |          W V  )a  Retrieves an :term:`asynchronous iterator` that enables receiving the guild's members. In order to use this,
        :meth:`Intents.members` must be enabled.

        .. note::

            This method is an API call. For general usage, consider :attr:`members` instead.

        .. versionadded:: 1.3

        All parameters are optional.

        Parameters
        ----------
        limit: Optional[:class:`int`]
            The number of members to retrieve. Defaults to 1000.
            Pass ``None`` to fetch all members. Note that this is potentially slow.
        after: Optional[Union[:class:`.abc.Snowflake`, :class:`datetime.datetime`]]
            Retrieve members after this date or object.
            If a datetime is provided, it is recommended to use a UTC aware datetime.
            If the datetime is naive, it is assumed to be local time.

        Raises
        ------
        ClientException
            The members intent is not enabled.
        HTTPException
            Getting the members failed.

        Yields
        ------
        :class:`.Member`
            The member with the member data parsed.

        Examples
        --------

        Usage ::

            async for member in guild.fetch_members(limit=150):
                print(member.name)
        ,Intents.members must be enabled to use this.TNr  r   highrk  r   r  rr   r   r  )r   _intentsr  r    minr  datetimerF   r   time_snowflakerE   r   r  get_membersr  r   reversedr   )r   r  r\  retrieveafter_idr   r   
raw_members           rz   fetch_memberszGuild.fetch_members	  sa     V {#+ 	R!"PQQQ	G$}tt#eT2B2BH!||%!233 J%"6u4"H"H"HIII*]E#(2uxxdHKE//8LLLLLLLLD  4yy4c$r(6"24"899:::E&tnn G G
*DFFFFFFFF/	Gry   	member_idc                  K   | j         j                            | j        |           d{V }t	          || j         |           S )a  |coro|

        Retrieves a :class:`Member` from a guild ID, and a member ID.

        .. note::

            This method is an API call. If you have :attr:`Intents.members` and member cache enabled, consider :meth:`get_member` instead.

        .. versionchanged:: 2.0

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

        Parameters
        -----------
        member_id: :class:`int`
            The member's ID to fetch from.

        Raises
        -------
        Forbidden
            You do not have access to the guild.
        HTTPException
            Fetching the member failed.
        NotFound
            The member could not be found.

        Returns
        --------
        :class:`Member`
            The member from the member ID.
        NrV  )r   r  r[  r   r   )r   r  r   s      rz   fetch_memberzGuild.fetch_member	  sN      @ [%00)DDDDDDDD4t{$????ry   rr   rS   c                   K   | j         j                            |j        | j                   d{V }t	          t          | j         |d                   |d                   S )a  |coro|

        Retrieves the :class:`BanEntry` for a user.

        You must have :attr:`~Permissions.ban_members` to get this information.

        Parameters
        -----------
        user: :class:`abc.Snowflake`
            The user to get ban information from.

        Raises
        ------
        Forbidden
            You do not have proper permissions to get the information.
        NotFound
            This user is not banned.
        HTTPException
            An error occurred while fetching the information.

        Returns
        -------
        :class:`BanEntry`
            The :class:`BanEntry` object for the specified user.
        Nrr   r   rq   rr   rq   )r   r  get_banr   rS   r5   )r   rr   r   s      rz   	fetch_banzGuild.fetch_ban
  se      4 "&!1!9!9$'47!K!KKKKKKKT$v,GGGPTU]P^____ry   Union[GuildChannel, Thread]c                 K   | j         j                            |           d{V }t          |d                   \  }}|"t	          d                    |                    |t          j        t          j        fv rt	          d          t          |d                   }| j
        |k    rt	          d           || | j         |          }|S )a0  |coro|

        Retrieves a :class:`.abc.GuildChannel` or :class:`.Thread` with the specified ID.

        .. note::

            This method is an API call. For general usage, consider :meth:`get_channel_or_thread` instead.

        .. versionadded:: 2.0

        Raises
        -------
        InvalidData
            An unknown channel type was received from Discord
            or the guild the channel belongs to is not the same
            as the one in this object points to.
        HTTPException
            Retrieving the channel failed.
        NotFound
            Invalid Channel ID.
        Forbidden
            You do not have permission to fetch this channel.

        Returns
        --------
        Union[:class:`.abc.GuildChannel`, :class:`.Thread`]
            The channel from the ID.
        Nr  r  z(Channel ID resolved to a private channelrh  z&Guild ID resolved to a different guildr   )r   r  rW  r#   r   r  r&   groupprivater   r   )r   r,  r   r  r  rh  r  s          rz   fetch_channelzGuild.fetch_channel!
  s      : [%11*========:4<HH?P[[\`aabbb{(+*=>>>HIIItJ'((7hFGGG 'd$+D Q Q Qry   )r  r]  r\  r]  AsyncIterator[BanEntry]c                 K   |t           ur|t           urt          d           j        j        j        d fd}d fd
}|r||}}n||}}	 |dnt          |d          }|dk     rdS  ||||           d{V \  }	}}t          |	          dk     rd}|	D ]6}
t          t           j        |
d                   |
d                   W V  7)a1  Retrieves an :term:`asynchronous iterator` of the users that are banned from the guild as a :class:`BanEntry`.

        You must have :attr:`~Permissions.ban_members` to get this information.

        .. versionchanged:: 2.0
            Due to a breaking change in Discord's API, this now returns a paginated iterator instead of a list.

        Examples
        ---------

        Usage ::

            async for entry in guild.bans(limit=150):
                print(entry.user, entry.reason)

        Flattening into a list ::

            bans = [entry async for entry in guild.bans(limit=2000)]
            # bans is now a list of BanEntry...

        All parameters are optional.

        Parameters
        -----------
        limit: Optional[:class:`int`]
            The number of bans to retrieve. If ``None``, it retrieves every ban in
            the guild. Note, however, that this would make it a slow operation.
            Defaults to ``1000``.
        before: :class:`.abc.Snowflake`
            Retrieves bans before this user.
        after: :class:`.abc.Snowflake`
            Retrieve bans after this user.

        Raises
        -------
        Forbidden
            You do not have proper permissions to get the information.
        HTTPException
            An error occurred while fetching the information.
        TypeError
            Both ``after`` and ``before`` were provided, as Discord does not
            support this type of pagination.

        Yields
        --------
        :class:`BanEntry`
            The ban entry of the banned user.
        z6bans pagination does not support both before and afterr  r   r]  rq  r  r  c                   K   |r|j         nd } j         | |           d {V }|rC||t          |          z  }t          t          |d         d         d                             }|||fS )N)r  r]  r   rr   r   rk  r   r  rF   r   )r  r]  r  	before_idr   endpointr   s        rz   _before_strategyz$Guild.bans.<locals>._before_strategy
  s      %+5		I!$')LLLLLLLLLD ?$SYY&E3tAwvt'<#=#=>>>&&ry   r\  c                   K   |r|j         nd } j         | |           d {V }|rC||t          |          z  }t          t          |d         d         d                             }|||fS )Nr  r  rr   r   rk  r'  )r  r\  r  r  r   r)  r   s        rz   _after_strategyz#Guild.bans.<locals>._after_strategy
  s      #(2uxxdH!$'JJJJJJJJJD ?$SYY&E#d2hv&6t&<"="=>>>%%ry   TNr  r   r   rr   r   rq   r  r  r   r]  rq  r  r  r  r   r\  rq  r  r  )	r  r  r   r  get_bansr  r  rS   r5   )r   r  r]  r\  r*  r,  strategyr   r  r   er)  s   `          @rz   bansz
Guild.bansN
  sa     p   U'%9%9TUUU ;#,
	' 
	' 
	' 
	' 
	' 
	' 
	'
	& 
	& 
	& 
	& 
	& 
	& 
	&  	5.eHH-ueH	a$}tt#eT2B2BH!||'/x%'G'G!G!G!G!G!G!GD% 4yy4 a aDt{6$K$K$KTUV^T_````````	ary   Tcompute_prune_countrr  rq   daysr4  rr  Collection[Snowflake]c                  K   t          |t                    st          d|j        j         d          |rd |D             }ng }| j        j                            | j        ||||           d{V }|d         S )a  |coro|

        Prunes the guild from its inactive members.

        The inactive members are denoted if they have not logged on in
        ``days`` number of days and they have no roles.

        You must have both :attr:`~Permissions.kick_members` and :attr:`~Permissions.manage_guild` to do this.

        To check how many members you would prune without actually pruning,
        see the :meth:`estimate_pruned_members` function.

        To prune members that have specific roles see the ``roles`` parameter.

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

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

        Parameters
        -----------
        days: :class:`int`
            The number of days before counting as inactive.
        reason: Optional[:class:`str`]
            The reason for doing this action. Shows up on the audit log.
        compute_prune_count: :class:`bool`
            Whether to compute the prune count. This defaults to ``True``
            which makes it prone to timeouts in very large guilds. In order
            to prevent timeouts, you must set this to ``False``. If this is
            set to ``False``\, then this function will always return ``None``.
        roles: List[:class:`abc.Snowflake`]
            A list of :class:`abc.Snowflake` that represent roles to include in the pruning process. If a member
            has a role that is not specified, they'll be excluded.

        Raises
        -------
        Forbidden
            You do not have permissions to prune members.
        HTTPException
            An error occurred while pruning members.
        TypeError
            An integer was not passed for ``days``.

        Returns
        ---------
        Optional[:class:`int`]
            The number of members pruned. If ``compute_prune_count`` is ``False``
            then this returns ``None``.
        $Expected int for ``days``, received 	 instead.c                6    g | ]}t          |j                  S rx   r   r   r2  r`  s     rz   r4  z'Guild.prune_members.<locals>.<listcomp>
       777DG777ry   r3  Npruned)	r  r   r  r   rt   r   r  prune_membersr   )r   r5  r4  rr  rq   role_idsr   s          rz   r?  zGuild.prune_members
  s      x $$$ 	ge4>CZeeefff 	77777HHH[%33GT/B([a 4 
 
 
 
 
 
 
 
 H~ry   List[Template]c                    K   ddl m  j        j                             j                   d{V } fd|D             S )a  |coro|

        Gets the list of templates from this guild.

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

        .. versionadded:: 1.7

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

        Returns
        --------
        List[:class:`Template`]
            The templates for this guild.
        r   ra   Nc                4    g | ]} |j                    S )r  r   )r2  r   rb   r   s     rz   r4  z#Guild.templates.<locals>.<listcomp>  s*    BBBat{333BBBry   )templaterb   r   r  guild_templatesr   )r   r   rb   s   ` @rz   	templateszGuild.templates   se      & 	'&&&&&[%55dg>>>>>>>>BBBBBTBBBBry   List[Webhook]c                    K   ddl m  j        j                             j                   d{V } fd|D             S )ad  |coro|

        Gets the list of webhooks from this guild.

        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 guild.
        r   rc   Nc                >    g | ]} j         |j                   S ))r   
from_stater   )r2  r   rd   r   s     rz   r4  z"Guild.webhooks.<locals>.<listcomp>-  s.    GGGQ""1DK888GGGry   )webhookrd   r   r  guild_webhooksr   )r   r   rd   s   ` @rz   webhookszGuild.webhooks  se      $ 	%$$$$$[%44TW========GGGGG$GGGGry   )rr  c                  K   t          |t                    st          d|j        j         d          |rd |D             }ng }| j        j                            | j        ||           d{V }|d         S )a  |coro|

        Similar to :meth:`prune_members` except instead of actually
        pruning members, it returns how many members it would prune
        from the guild had it been called.

        .. versionchanged:: 2.0
            The returned value can be ``None``.

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

        Parameters
        -----------
        days: :class:`int`
            The number of days before counting as inactive.
        roles: List[:class:`abc.Snowflake`]
            A list of :class:`abc.Snowflake` that represent roles to include in the estimate. If a member
            has a role that is not specified, they'll be excluded.

            .. versionadded:: 1.7

        Raises
        -------
        Forbidden
            You do not have permissions to prune members.
        HTTPException
            An error occurred while fetching the prune members estimate.
        TypeError
            An integer was not passed for ``days``.

        Returns
        ---------
        Optional[:class:`int`]
            The number of members estimated to be pruned.
        r8  r9  c                6    g | ]}t          |j                  S rx   r;  r<  s     rz   r4  z1Guild.estimate_pruned_members.<locals>.<listcomp>Z  r=  ry   Nr>  )	r  r   r  r   rt   r   r  estimate_pruned_membersr   )r   r5  rr  r@  r   s        rz   rR  zGuild.estimate_pruned_members/  s      N $$$ 	ge4>CZeeefff 	77777HHH[%==dgtXVVVVVVVVH~ry   List[Invite]c           	       K   | j         j                            | j                   d{V }g }|D ][}|                     t          |d         d                             }|                    t          | j         || |                     \|S )a  |coro|

        Returns a list of all active instant invites from the guild.

        You must have :attr:`~Permissions.manage_guild` to get this information.

        Raises
        -------
        Forbidden
            You do not have proper permissions to get the information.
        HTTPException
            An error occurred while fetching the information.

        Returns
        -------
        List[:class:`Invite`]
            The list of invites that are currently active.
        Nr  r   r   r   r   r  )r   r  invites_fromr   rW  r   r  r6   )r   r   resultinviter  s        rz   inviteszGuild.invitesa  s      ( [%2247;;;;;;;; 	_ 	_F&&s6)+<T+B'C'CDDGMM&t{tU\]]]^^^^ry   )r   rb   c                  K   ddl m} d|i}|r||d<   | j        j                            | j        |           d{V } || j        |          S )a  |coro|

        Creates a template for the guild.

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

        .. versionadded:: 1.7

        Parameters
        -----------
        name: :class:`str`
            The name of the template.
        description: :class:`str`
            The description of the template.

        Returns
        --------
        :class:`Template`
            The created template.
        r   ra   r   r   Nr   )rE  rb   r   r  create_templater   )r   r   r   rb   r  r   s         rz   r[  zGuild.create_template}  sz      * 	'&&&&&4. 	1%0GM"[%55dgwGGGGGGGGxdk5555ry   r  ri   c               b   K   | j         j                            | j        ||           d{V  dS )a  |coro|

        Attaches an integration to the guild.

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

        .. versionadded:: 1.4

        Parameters
        -----------
        type: :class:`str`
            The integration type (e.g. Twitch).
        id: :class:`int`
            The integration ID.

        Raises
        -------
        Forbidden
            You do not have permission to create the integration.
        HTTPException
            The account could not be found.
        N)r   r  create_integrationr   )r   r  r   s      rz   r]  zGuild.create_integration  s?      . k11$'4DDDDDDDDDDDry   List[Integration]c                    K    j         j                             j                   d{V } fdfd|D             S )a  |coro|

        Returns a list of all integrations attached to the guild.

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

        .. versionadded:: 1.4

        Raises
        -------
        Forbidden
            You do not have permission to create the integration.
        HTTPException
            Fetching the integrations failed.

        Returns
        --------
        List[:class:`Integration`]
            The list of integrations that are attached to the guild.
        Nc                    t          | d                   \  }}|"t          d                    |                      ||           S )Nr  z9Unknown integration type {type!r} for integration ID {id})r   r   )r<   r   r  )r   r  r  r   s      rz   r  z#Guild.integrations.<locals>.convert  sP    -ai88JGQ!"]"h"hij"k"klll7A....ry   c                &    g | ]} |          S rx   rx   r  s     rz   r4  z&Guild.integrations.<locals>.<listcomp>  r  ry   )r   r  get_all_integrationsr   r  s   ` @rz   integrationszGuild.integrations  sk      * [%::47CCCCCCCC	/ 	/ 	/ 	/ 	/ *)))D))))ry   List[GuildSticker]c                x    K    j         j                             j                   d{V } fd|D             S )a  |coro|

        Retrieves a list of all :class:`Sticker`\s for the guild.

        .. versionadded:: 2.0

        .. note::

            This method is an API call. For general usage, consider :attr:`stickers` instead.

        Raises
        ---------
        HTTPException
            An error occurred fetching the stickers.

        Returns
        --------
        List[:class:`GuildSticker`]
            The retrieved stickers.
        Nc                <    g | ]}t          j        |           S r   )rB   r   r   s     rz   r4  z(Guild.fetch_stickers.<locals>.<listcomp>  s(    FFFA4;Q777FFFry   )r   r  get_all_guild_stickersr   r   r   s   ` rz   fetch_stickerszGuild.fetch_stickers  sO      * [%<<TWEEEEEEEEFFFFFFFFry   
sticker_idrB   c                  K   | j         j                            | j        |           d{V }t	          | j         |          S )aw  |coro|

        Retrieves a custom :class:`Sticker` from the guild.

        .. versionadded:: 2.0

        .. note::

            This method is an API call.
            For general usage, consider iterating over :attr:`stickers` instead.

        Parameters
        -------------
        sticker_id: :class:`int`
            The sticker's ID.

        Raises
        ---------
        NotFound
            The sticker requested could not be found.
        HTTPException
            An error occurred fetching the sticker.

        Returns
        --------
        :class:`GuildSticker`
            The retrieved sticker.
        Nr   )r   r  get_guild_stickerr   rB   )r   rk  r   s      rz   fetch_stickerzGuild.fetch_sticker  sK      : [%77LLLLLLLL$+D9999ry   )r   rq   r   filerC   c                  K   ||pd|d}| j         j                            | j        |||           d{V }| j         j        r| j                             | |          S t          | j         |          S )a^  |coro|

        Creates a :class:`Sticker` for the guild.

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

        .. versionadded:: 2.0

        Parameters
        -----------
        name: :class:`str`
            The sticker name. Must be between 2 and 30 characters.
        description: :class:`str`
            The sticker's description. Can be an empty string or a string between 2 and 100 characters.
            Defaults to an empty string if not provided.
        emoji: :class:`str`
            The emoji tag associated with the sticker. This corresponds to the
            ``tags`` field in Discord's API, which is used for emoji autocomplete
            and suggestion purposes. For correct rendering in Discord's UI, this
            should ideally be a raw Unicode emoji or the string ID
            of a custom emoji. Any string up to 200 characters is accepted.
        file: :class:`File`
            The file of the sticker to upload.
        reason: :class:`str`
            The reason for creating this sticker. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You are not allowed to create stickers.
        HTTPException
            An error occurred creating a sticker.

        Returns
        --------
        :class:`GuildSticker`
            The created sticker.
        rH  )r   r   r4  Nr   )r   r  create_guild_stickerr   r  rw  rB   )r   r   r   r   ro  rq   r  r   s           rz   create_stickerzGuild.create_sticker  s      ` &,"
 
 [%::47GTSYZZZZZZZZ;. 	>;,,T4888dk====ry   r  stickerc              l   K   | j         j                            | j        |j        |           d{V  dS )a\  |coro|

        Deletes the custom :class:`Sticker` from the guild.

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

        .. versionadded:: 2.0

        Parameters
        -----------
        sticker: :class:`abc.Snowflake`
            The sticker you are deleting.
        reason: Optional[:class:`str`]
            The reason for deleting this sticker. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You are not allowed to delete stickers.
        HTTPException
            An error occurred deleting the sticker.
        N)r   r  delete_guild_stickerr   )r   rs  rq   s      rz   delete_stickerzGuild.delete_stickerH  sA      . k33DGWZPPPPPPPPPPPry   )with_countsrw  List[ScheduledEvent]c               z    K    j         j                             j        |           d{V } fd|D             S )a  |coro|

        Retrieves a list of all scheduled events for the guild.

        .. versionadded:: 2.0

        Parameters
        ------------
        with_counts: :class:`bool`
            Whether to include the number of users that are subscribed to the event.
            Defaults to ``True``.

        Raises
        -------
        HTTPException
            Retrieving the scheduled events failed.

        Returns
        --------
        List[:class:`ScheduledEvent`]
            The scheduled events.
        Nc                <    g | ]}t          j        |           S rg  )r=   r   r   s     rz   r4  z0Guild.fetch_scheduled_events.<locals>.<listcomp>y  s(    HHHaT[q999HHHry   )r   r  get_scheduled_eventsr   )r   rw  r   s   `  rz   fetch_scheduled_eventszGuild.fetch_scheduled_eventsa  sQ      . [%::47KPPPPPPPPHHHH4HHHHry   r=   c                 K   | j         j                            | j        ||           d{V }t	          | j         |          S )a  |coro|

        Retrieves a scheduled event from the guild.

        .. versionadded:: 2.0

        Parameters
        ------------
        scheduled_event_id: :class:`int`
            The scheduled event ID.
        with_counts: :class:`bool`
            Whether to include the number of users that are subscribed to the event.
            Defaults to ``True``.

        Raises
        -------
        NotFound
            The scheduled event was not found.
        HTTPException
            Retrieving the scheduled event failed.

        Returns
        --------
        :class:`ScheduledEvent`
            The scheduled event.
        Nr   )r   r  rC  r   r=   )r   r@  rw  r   s       rz   fetch_scheduled_eventzGuild.fetch_scheduled_event{  sO      6 [%99$'CUWbccccccccDKd;;;;ry   )entity_typeprivacy_levellocationend_timer   imagerq   
start_timer  Literal[EntityType.external]r  r(   r  r  r  bytesc       	        
   K   d S r   rx   )
r   r   r  r  r  r  r  r   r  rq   s
             rz   create_scheduled_eventzGuild.create_scheduled_event         ry   )r  r  r  r  r   r  rq   4Literal[EntityType.stage_instance, EntityType.voice]c       	        
   K   d S r   rx   )
r   r   r  r  r  r  r  r   r  rq   s
             rz   r  zGuild.create_scheduled_event  r  ry   )r  r  r  r   r  rq   c               
   K   d S r   rx   )	r   r   r  r  r  r  r   r  rq   s	            rz   r  zGuild.create_scheduled_event         ry   )r  r  r  r   r  rq   !Union[VoiceChannel, StageChannel]c               
   K   d S r   rx   )	r   r   r  r  r  r  r   r  rq   s	            rz   r  zGuild.create_scheduled_event  r  ry   )r  r  r  r  r  r   r  rq   r'   c       
        >  K   i }i }||d<   |t           ur-|j        t          d          |                                |d<   |pt	          |dt                     }|t           u re|rKt          |t                    r6|j        t          u rt          j
        }na|j        t          u rt          j        }nF|t           dfvrt          j        }n.t          |t                    st          d          |j        |d<   |t          d|j        j                   |t           ur.t          |t$                    st          d	          |j        |d
<   |t           ur||d<   |	t           urt'          j        |	          }||d<   |t          j        t          j
        fv r=|t           dfv rt          d          |j        |d<   |t           urt          d          nQ|t           urt          d          |t           u s|t          d          ||d<   |t           dfv rt          d          |t           dfvr-|j        t          d          |                                |d<   |r||d<    | j        j        j        | j        fi |d|
i d{V }t3          | j        |          S )a
  |coro|

        Creates a scheduled event for the guild.

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

        .. versionadded:: 2.0

        Parameters
        ------------
        name: :class:`str`
            The name of the scheduled event.
        description: :class:`str`
            The description of the scheduled event.
        channel: Optional[:class:`abc.Snowflake`]
            The channel to send the scheduled event to. If the channel is
            a :class:`StageInstance` or :class:`VoiceChannel` then
            it automatically sets the entity type.

            Required if ``entity_type`` is either :attr:`EntityType.voice` or
            :attr:`EntityType.stage_instance`.
        start_time: :class:`datetime.datetime`
            The scheduled start time of the scheduled event. This must be a timezone-aware
            datetime object. Consider using :func:`utils.utcnow`.
        end_time: :class:`datetime.datetime`
            The scheduled end time of the scheduled event. This must be a timezone-aware
            datetime object. Consider using :func:`utils.utcnow`.

            Required if the entity type is :attr:`EntityType.external`.
        privacy_level: :class:`PrivacyLevel`
            The privacy level of the scheduled event.
        entity_type: :class:`EntityType`
            The entity type of the scheduled event. If the channel is a
            :class:`StageInstance` or :class:`VoiceChannel` then this is
            automatically set to the appropriate entity type. If no channel
            is passed then the entity type is assumed to be
            :attr:`EntityType.external`
        image: :class:`bytes`
            The image of the scheduled event.
        location: :class:`str`
            The location of the scheduled event.

            Required if the ``entity_type`` is :attr:`EntityType.external`.
        reason: Optional[:class:`str`]
            The reason for creating this scheduled event. Shows up on the audit log.

        Raises
        -------
        TypeError
            ``image`` was not a :term:`py:bytes-like object`, or ``privacy_level``
            was not a :class:`PrivacyLevel`, or ``entity_type`` was not an
            :class:`EntityType`, ``status`` was not an :class:`EventStatus`,
            or an argument was provided that was incompatible with the provided
            ``entity_type``.
        ValueError
            ``start_time`` or ``end_time`` was not a timezone-aware datetime object.
        Forbidden
            You are not allowed to create scheduled events.
        HTTPException
            Creating the scheduled event failed.

        Returns
        --------
        :class:`ScheduledEvent`
            The created scheduled event.
        r   Nzstart_time must be an aware datetime. Consider using discord.utils.utcnow() or datetime.datetime.now().astimezone() for local time.scheduled_start_time_scheduled_event_entity_typez&entity_type must be of type EntityTyper  zKinvalid GuildChannel type passed, must be VoiceChannel or StageChannel not z+privacy_level must be of type PrivacyLevel.r  r   r  z?channel must be set when entity_type is voice or stage_instancer,  zBlocation cannot be set when entity_type is voice or stage_instancez2channel cannot be set when entity_type is externalz1location must be set when entity_type is externalr  z1end_time must be set when entity_type is externalzend_time must be an aware datetime. Consider using discord.utils.utcnow() or datetime.datetime.now().astimezone() for local time.scheduled_end_timeentity_metadatarq   r   )r  r  r  r  getattrr  rF   r  r\   r'   r  r]   r  externalr  r  r   rt   r(   r   r  r   r   r  create_guild_scheduled_eventr=   )r   r   r  r  r  r  r  r  r   r  rq   r  metadataimage_as_strr   s                  rz   r  zGuild.create_scheduled_event  s"     ` W$$ (  Z   /9.B.B.D.DG*+!^WW6TV]%^%^'!! 2:gv66 2<<//","2KK\\11",";K'400(1k:66 J HIII%0%6GM"z^e^o^xzz   ''m\:: O MNNN'4':GO$g%%%0GM" % ;E B BL+GG:4j6FGGG7D/)) abbb$+JGL!w&& deee ' g%% TUUU7""h&6 STTT#+HZ GT?** STTTGT?**&  X   -5,>,>,@,@G() 	2)1G%&BT[%B47eegee^deeeeeeeeeDKd;;;;ry   List[Emoji]c                x    K    j         j                             j                   d{V } fd|D             S )a  |coro|

        Retrieves all custom :class:`Emoji`\s from the guild.

        .. note::

            This method is an API call. For general usage, consider :attr:`emojis` instead.

        Raises
        ---------
        HTTPException
            An error occurred fetching the emojis.

        Returns
        --------
        List[:class:`Emoji`]
            The retrieved emojis.
        Nc                >    g | ]}t          j        |           S r  )r   r   r   s     rz   r4  z&Guild.fetch_emojis.<locals>.<listcomp>  s*    KKKD!<<<KKKry   )r   r  get_all_custom_emojisr   ri  s   ` rz   fetch_emojiszGuild.fetch_emojisr  sO      & [%;;DGDDDDDDDDKKKKdKKKKry   r   c                  K   | j         j                            | j        |           d{V }t	          | | j         |          S )a  |coro|

        Retrieves a custom :class:`Emoji` from the guild.

        .. note::

            This method is an API call.
            For general usage, consider iterating over :attr:`emojis` instead.

        .. versionchanged:: 2.0

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

        Parameters
        -------------
        emoji_id: :class:`int`
            The emoji's ID.

        Raises
        ---------
        NotFound
            The emoji requested could not be found.
        HTTPException
            An error occurred fetching the emoji.

        Returns
        --------
        :class:`Emoji`
            The retrieved emoji.
        Nr   )r   r  get_custom_emojir   r   )r   r  r   s      rz   fetch_emojizGuild.fetch_emoji  sM      > [%66twIIIIIIII4t{>>>>ry   rr  rq   Collection[Role]c               *  K   t          j        |          }|rd |D             }ng }| j        j                            | j        ||||           d{V }| j        j        r| j                            | |          S t          | | j        |          S )au  |coro|

        Creates a custom :class:`Emoji` for the guild.

        There is currently a limit of 50 static and animated emojis respectively per guild,
        unless the guild has the ``MORE_EMOJI`` feature which extends the limit to 200.

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

        Parameters
        -----------
        name: :class:`str`
            The emoji name. Must be at least 2 characters.
        image: :class:`bytes`
            The :term:`py:bytes-like object` representing the image data to use.
            Only JPG, PNG and GIF images are supported.
        roles: List[:class:`Role`]
            A :class:`list` of :class:`Role`\s that can use this emoji. Leave empty to make it available to everyone.
        reason: Optional[:class:`str`]
            The reason for creating this emoji. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You are not allowed to create emojis.
        HTTPException
            An error occurred creating an emoji.

        Returns
        --------
        :class:`Emoji`
            The created emoji.
        c                    g | ]	}|j         
S rx   rk  r<  s     rz   r4  z-Guild.create_custom_emoji.<locals>.<listcomp>  s    &A&A&A4tw&A&A&Ary   r  Nr   )	r   r  r   r  create_custom_emojir   r  ru  r   )r   r   r  rr  rq   imgr@  r   s           rz   r  zGuild.create_custom_emoji  s      T )%00 	&A&A5&A&A&AHHH[%99$'4T\ek9llllllll;. 	C;**4666t4;TBBBBry   c              n   K   | j         j                            | j        |j        |           d{V  dS )a~  |coro|

        Deletes the custom :class:`Emoji` from the guild.

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

        .. versionchanged:: 2.0

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

        Parameters
        -----------
        emoji: :class:`abc.Snowflake`
            The emoji you are deleting.
        reason: Optional[:class:`str`]
            The reason for deleting this emoji. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You are not allowed to delete emojis.
        HTTPException
            An error occurred deleting the emoji.
        r  N)r   r  delete_custom_emojir   )r   r   rq   s      rz   delete_emojizGuild.delete_emoji  sD      4 k2247EHV2TTTTTTTTTTTry   
List[Role]c                x    K    j         j                             j                   d{V } fd|D             S )a  |coro|

        Retrieves all :class:`Role` that the guild has.

        .. note::

            This method is an API call. For general usage, consider :attr:`roles` instead.

        .. versionadded:: 1.3

        Raises
        -------
        HTTPException
            Retrieving the roles failed.

        Returns
        -------
        List[:class:`Role`]
            All roles in the guild.
        Nc                >    g | ]}t          j        |           S r  )r   r   r   s     rz   r4  z%Guild.fetch_roles.<locals>.<listcomp>  s*    JJJ4t{;;;JJJry   )r   r  	get_rolesr   ri  s   ` rz   fetch_roleszGuild.fetch_roles  sO      * [%//88888888JJJJTJJJJry   c                  K   | j         j                            | j        |           d{V }t	          | | j         |          S )a<  |coro|

        Retrieves a :class:`Role` with the specified ID.

        .. versionadded:: 2.5

        .. note::

            This method is an API call. For general usage, consider :attr:`get_role` instead.

        Parameters
        ----------
        role_id: :class:`int`
            The role's ID.

        Raises
        -------
        NotFound
            The role requested could not be found.
        HTTPException
            An error occurred fetching the role.

        Returns
        -------
        :class:`Role`
            The retrieved role.
        Nr   )r   r  r-  r   r   )r   rd  r   s      rz   
fetch_rolezGuild.fetch_role  sM      8 [%..tw@@@@@@@@$dk====ry   )	rq   r   permissionscolourhoistdisplay_iconmentionablesecondary_colourtertiary_colourr  r[   r  Union[Colour, int]r  r  Union[bytes, str]r  r  Optional[Union[Colour, int]]r  c       	        
   K   d S r   rx   )
r   rq   r   r  r  r  r  r  r  r  s
             rz   create_rolezGuild.create_role3         sry   )	rq   r   r  colorr  r  r  secondary_colortertiary_colorr  r  r  c       	        
   K   d S r   rx   )
r   rq   r   r  r  r  r  r  r  r  s
             rz   r  zGuild.create_roleB  r  ry   )r   r  r  r  r  r  r  rq   r  r  r  r  c               
  K   i }|t           urt          |j                  |d<   nd|d<   i }|p|pt          j                    }t          |t                    r||d<   n
|j        |d<   |p|	}|p|
}|t           ur-|d|d<   n%t          |t                    r||d<   n
|j        |d<   |t           ur-|d|d<   n%t          |t                    r||d<   n
|j        |d<   ||d<   |t           ur||d<   |t           ur2t          |t                    rt          j	        |          |d	<   n||d
<   |t           ur||d<   |t           ur||d<    | j
        j        j        | j        fd|i| d{V }t          | || j
                  }|S )a	  |coro|

        Creates a :class:`Role` for the guild.

        All fields are optional.

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

        .. versionchanged:: 1.6
            Can now pass ``int`` to ``colour`` keyword-only parameter.

        .. versionadded:: 2.0
            The ``display_icon`` keyword-only parameter was added.

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

        .. versionchanged:: 2.6
            The ``colour`` and ``color`` parameters now set the role's primary color.


        Parameters
        -----------
        name: :class:`str`
            The role name. Defaults to 'new role'.
        permissions: :class:`Permissions`
            The permissions to have. Defaults to no permissions.
        colour: Union[:class:`Colour`, :class:`int`]
            The colour for the role. Defaults to :meth:`Colour.default`.
            This is aliased to ``color`` as well.
        secondary_colour: Optional[Union[:class:`Colour`, :class:`int`]]
            The secondary colour for the role.

            .. versionadded:: 2.6
        tertiary_colour: Optional[Union[:class:`Colour`, :class:`int`]]
            The tertiary colour for the role. Can only be used for the holographic role preset,
            which is ``(11127295, 16759788, 16761760)``

            .. versionadded:: 2.6
        hoist: :class:`bool`
            Indicates if the role should be shown separately in the member list.
            Defaults to ``False``.
        display_icon: Union[:class:`bytes`, :class:`str`]
            A :term:`py:bytes-like object` representing the icon
            or :class:`str` representing unicode emoji that should be used as a role icon.
            Only PNG/JPEG is supported.
            This is only available to guilds that contain ``ROLE_ICONS`` in :attr:`features`.
        mentionable: :class:`bool`
            Indicates if the role should be mentionable by others.
            Defaults to ``False``.
        reason: Optional[:class:`str`]
            The reason for creating this role. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have permissions to create the role.
        HTTPException
            Creating the role failed.
        TypeError
            An invalid keyword argument was given.

        Returns
        --------
        :class:`Role`
            The newly created role.
        r  r^  primary_colorNr  r  colorsr  r   unicode_emojir  r   rq   rs  )r  r   r  r   defaultr  r   r  r   r  r   r  r  r   r   )r   r   r  r  r  r  r  r  rq   r  r  r  r  r  coloursactual_colouractual_secondary_colouractual_tertiary_colourr   r`  s                       rz   r  zGuild.create_roleQ  s     h "$g%%$'(9$:$:F=!!$'F=!"$;%;6>+;+;mS)) 	;'4GO$$'4':GO$"2"Eo!0!BN"'11&.-1)**3S99 K-D)**-D-J)*!00%-,0())2C88 I,B()),B,H()"x#F7Ow&&,.. 7!&!<\!J!Jv*6'g%%$/F=!w!F6N1T[%1$'SS&SFSSSSSSSS$T===ry   	positionsMapping[Snowflake, int]c                 K   t          |t                    st          d          g }|                                D ]$\  }}|j        |d}|                    |           %| j        j                            | j        ||           d{V }g }|D ]=}	t          | |	| j                  }|                    |           || j
        |j        <   >|S )a  |coro|

        Bulk edits a list of :class:`Role` in the guild.

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

        .. versionadded:: 1.4

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

        Example
        ----------

        .. code-block:: python3

            positions = {
                bots_role: 1, # penultimate role
                tester_role: 2,
                admin_role: 6
            }

            await guild.edit_role_positions(positions=positions)

        Parameters
        -----------
        positions
            A :class:`dict` of :class:`Role` to :class:`int` to change the positions
            of each given role.
        reason: Optional[:class:`str`]
            The reason for editing the role positions. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have permissions to move the roles.
        HTTPException
            Moving the roles failed.
        TypeError
            An invalid keyword argument was given.

        Returns
        --------
        List[:class:`Role`]
            A list of all the roles in the guild.
        z#positions parameter expects a dict.)r   r  r  Nrs  )r  r   r  r?  r   r  r   r  move_role_positionr   r   )
r   r  rq   role_positionsr`  r  r  r   rr  r   s
             rz   edit_role_positionszGuild.edit_role_positions  s      ` )W-- 	CABBB'oo// 	+ 	+ND(8<X1V1VG!!'****[%88.Y_8```````` 	( 	(Ad$+>>>DLL#'DK  ry   Dict[Union[Object, Role], int]c                  K   | j         j                            | j                   d{V }i }|                                D ]F\  }}t          |          }|                     |          }|t          |t                    }|||<   G|S )a  |coro|

        Retrieves a mapping of roles to the number of members that have it.

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

        .. versionadded:: 2.7

        Raises
        -------
        Forbidden
            You do not have permissions to view the role member counts.
        HTTPException
            Retrieving the role member counts failed.

        Returns
        --------
        Dict[Union[:class:`Object`, :class:`Role`], :class:`int`]
            A mapping of roles to the number of members that have it.
            If a role is not found in the cache, it will be represented as an :class:`Object`
            instead of a :class:`Role`.
        Nr   r  )	r   r  get_role_member_countsr   r?  r   r-  rF   r   )r   r   rW  rd  rL  r`  s         rz   role_member_countszGuild.role_member_counts  s      . [%<<TWEEEEEEEE13%)ZZ\\ 	( 	(!G\'llG==))D|t444'F4LLry   rH   c                |   K   | j         j                            | j                   d{V }t	          ||           S )a
  |coro|

        Returns the guild's welcome screen.

        The guild must have ``COMMUNITY`` in :attr:`~Guild.features`.

        You must have :attr:`~Permissions.manage_guild` to do this.as well.

        .. versionadded:: 2.0

        Raises
        -------
        Forbidden
            You do not have the proper permissions to get this.
        HTTPException
            Retrieving the welcome screen failed.

        Returns
        --------
        :class:`WelcomeScreen`
            The welcome screen.
        Nr   r   )r   r  get_welcome_screenr   rH   ri  s     rz   welcome_screenzGuild.welcome_screen?  sG      . [%88AAAAAAAA$d3333ry   )r   welcome_channelsr  rq   r  List[WelcomeChannel]r  c               n  K   i }|t           urWg }|D ]M}t          |t                    st          d          |                    |                                           N||d<   |t           ur||d<   |t           ur||d<    | j        j        j        | j	        fd|i| d{V }t          ||           S )a  |coro|

        A shorthand method of :attr:`WelcomeScreen.edit` without needing
        to fetch the welcome screen beforehand.

        The guild must have ``COMMUNITY`` in :attr:`~Guild.features`.

        You must have :attr:`~Permissions.manage_guild` to do this as well.

        .. versionadded:: 2.0

        Returns
        --------
        :class:`WelcomeScreen`
            The edited welcome screen.
        z;welcome_channels parameter must be a list of WelcomeChannelr  r   r  rq   Nr  )r  r  rI   r  r  r  r   r  edit_welcome_screenr   rH   )	r   r   r  r  rq   r  welcome_channels_serialisedwcr   s	            rz   r  zGuild.edit_welcome_screenY  s      0 7***,'& A A!"n55 c#$abbb+222::<<@@@@)DF%&g%%$/F=!'!! 'F99T[%9$'[[&[TZ[[[[[[[[$d3333ry   c               n   K   | j         j                            |j        | j        |           d{V  dS )a#  |coro|

        Kicks a user from the guild.

        The user must meet the :class:`abc.Snowflake` abc.

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

        Parameters
        -----------
        user: :class:`abc.Snowflake`
            The user to kick from the guild.
        reason: Optional[:class:`str`]
            The reason the user got kicked.

        Raises
        -------
        Forbidden
            You do not have the proper permissions to kick.
        HTTPException
            Kicking failed.
        r  N)r   r  kickr   r   rr   rq   s      rz   r  z
Guild.kick  sD      . k##DGTWV#DDDDDDDDDDDry   )rq   delete_message_daysdelete_message_secondsr  r  c                  K   |t           ur|t           urt          d          |t           ur#d}t          j        |t          d           |dz  }|t           u rd}| j        j                            |j        | j        ||           d{V  dS )aw  |coro|

        Bans a user from the guild.

        The user must meet the :class:`abc.Snowflake` abc.

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

        Parameters
        -----------
        user: :class:`abc.Snowflake`
            The user to ban from the guild.
        delete_message_days: :class:`int`
            The number of days worth of messages to delete from the user
            in the guild. The minimum is 0 and the maximum is 7.
            Defaults to 1 day if neither ``delete_message_days`` nor
            ``delete_message_seconds`` are passed.

            .. deprecated:: 2.1
        delete_message_seconds: :class:`int`
            The number of seconds worth of messages to delete from the user
            in the guild. The minimum is 0 and the maximum is 604800 (7 days).
            Defaults to 1 day if neither ``delete_message_days`` nor
            ``delete_message_seconds`` are passed.

            .. versionadded:: 2.1
        reason: Optional[:class:`str`]
            The reason the user got banned.

        Raises
        -------
        NotFound
            The requested user was not found.
        Forbidden
            You do not have the proper permissions to ban.
        HTTPException
            Banning failed.
        TypeError
            You specified both ``delete_message_days`` and ``delete_message_seconds``.
        zLCannot mix delete_message_days and delete_message_seconds keyword arguments.zEdelete_message_days is deprecated, use delete_message_seconds insteadr  )
stacklevelQ r  N)	r  r  warningswarnDeprecationWarningr   r  banr   )r   rr   rq   r  r  msgs         rz   r  z	Guild.ban  s      ` g--2HPW2W2Wjkkkg--YCM#1a@@@@%85%@"!W,,%*"k""47DG5KTZ"[[[[[[[[[[[ry   c               n   K   | j         j                            |j        | j        |           d{V  dS )au  |coro|

        Unbans a user from the guild.

        The user must meet the :class:`abc.Snowflake` abc.

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

        Parameters
        -----------
        user: :class:`abc.Snowflake`
            The user to unban.
        reason: Optional[:class:`str`]
            The reason for doing this action. Shows up on the audit log.

        Raises
        -------
        NotFound
            The requested unban was not found.
        Forbidden
            You do not have the proper permissions to unban.
        HTTPException
            Unbanning failed.
        r  N)r   r  unbanr   r  s      rz   r  zGuild.unban  sD      2 k$$TWdgf$EEEEEEEEEEEry   r  )rq   r  usersIterable[Snowflake]r|   c                 K   | j         j                            | j        d |D             ||           d{V }t	          d |                    dg           pg D             d |                    dg           pg D                       S )	a  |coro|

        Bans multiple users from the guild.

        The users must meet the :class:`abc.Snowflake` abc.

        You must have :attr:`~Permissions.ban_members` and :attr:`~Permissions.manage_guild` to do this.

        .. versionadded:: 2.4

        Parameters
        -----------
        users: Iterable[:class:`abc.Snowflake`]
            The users to ban from the guild, up to 200 users.
        delete_message_seconds: :class:`int`
            The number of seconds worth of messages to delete from the user
            in the guild. The minimum is 0 and the maximum is 604800 (7 days).
            Defaults to 1 day.
        reason: Optional[:class:`str`]
            The reason the users got banned.

        Raises
        -------
        Forbidden
            You do not have the proper permissions to ban.
        HTTPException
            Banning failed.

        Returns
        --------
        :class:`BulkBanResult`
            The result of the bulk ban operation.
        c                    g | ]	}|j         
S rx   rk  )r2  us     rz   r4  z"Guild.bulk_ban.<locals>.<listcomp>   s    ***qad***ry   )user_idsr  rq   Nc                T    g | ]%}t          t          |          t                     &S r  rF   r   r5   r2  r  s     rz   r4  z"Guild.bulk_ban.<locals>.<listcomp>%  +    mmm7Fc'll666mmmry   banned_usersc                T    g | ]%}t          t          |          t                     &S r  r  r  s     rz   r4  z"Guild.bulk_ban.<locals>.<listcomp>&  r  ry   failed_users)r}   r~   )r   r  bulk_banr   r|   r   )r   r  rq   r  responses        rz   r  zGuild.bulk_ban  s      R )22G**E***#9	 3 
 
 
 
 
 
 
 
 mmhllSaceFfFfFljlmmmmmhllSaceFfFfFljlmmm
 
 
 	
ry   c                @    | j         dS t          j         d| j          S )z{Optional[:class:`str`]: The Discord vanity invite URL for this guild, if available.

        .. versionadded:: 2.0
        N/)r   r6   BASEr   s    rz   
vanity_urlzGuild.vanity_url)  s+     '4+66 4666ry   Optional[Invite]c                  K   | j         j                            | j                   d{V }|d         sdS | j         j                            |d                    d{V }|                     t          |d         d                             }d|d<   d|d<   d|d	<   d|d
<   |                    dd          |d<   t          | j         || |          S )aF  |coro|

        Returns the guild's special vanity invite.

        The guild must have ``VANITY_URL`` in :attr:`~Guild.features`.

        You must have :attr:`~Permissions.manage_guild` to do this as well.

        Raises
        -------
        Forbidden
            You do not have the proper permissions to get this.
        HTTPException
            Retrieving the vanity invite failed.

        Returns
        --------
        Optional[:class:`Invite`]
            The special vanity invite. If ``None`` then the guild does not
            have a vanity invite set.
        Ncoder  r   Frevoked	temporaryr   max_usesmax_ageusesrU  )	r   r  get_vanity_coder   
get_inviterW  r   r   r6   )r   r  r   r  s       rz   vanity_invitezGuild.vanity_invite3  s      0 (88AAAAAAAAv 	4 [%00AAAAAAAA""3tIt'<#=#=>>"	$
	!++fa00DKgT7SSSSry   )r  r]  r\  oldest_firstrr   actionr  r  r$   AsyncIterator[AuditLogEntry]c          
       K   d' fd}d( fd	}|t           ur|j        nd
|t           ur|j        nd
t          t          j                  r$t          t          j        d                    t          t          j                  r$t          t          j        d                    |rt           u rt          d
}	|r|}}
rfd}	n|}}
rfd}	ddl	m
 ddlm 	 |dnt          |d          }|dk     rd
S  |
|||           d
{V \  }}}}|	rt          |	|          } fd|                    dg           D             }d |D             } fd|                    dg           D             }d |D             } fd|                    dg           D             }d |D             } fd|                    dg           D             }d  |D             } fd!|                    d"g           D             }d# |D             }d$}t!          |d          D ]'\  }}|d%         t#          |||||| &          W V  (|dk     rd
S r))a{  Returns an :term:`asynchronous iterator` that enables receiving the guild's audit logs.

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

        Examples
        ----------

        Getting the first 100 entries: ::

            async for entry in guild.audit_logs(limit=100):
                print(f'{entry.user} did {entry.action} to {entry.target}')

        Getting entries for a specific action: ::

            async for entry in guild.audit_logs(action=discord.AuditLogAction.ban):
                print(f'{entry.user} banned {entry.target}')

        Getting entries made by a specific user: ::

            entries = [entry async for entry in guild.audit_logs(limit=None, user=guild.me)]
            await channel.send(f'I made {len(entries)} moderation actions.')

        Parameters
        -----------
        limit: Optional[:class:`int`]
            The number of entries to retrieve. If ``None`` retrieve all entries.
        before: Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]
            Retrieve entries before this date or entry.
            If a datetime is provided, it is recommended to use a UTC aware datetime.
            If the datetime is naive, it is assumed to be local time.
        after: Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]
            Retrieve entries after this date or entry.
            If a datetime is provided, it is recommended to use a UTC aware datetime.
            If the datetime is naive, it is assumed to be local time.
        oldest_first: :class:`bool`
            If set to ``True``, return entries in oldest->newest order. Defaults to ``True`` if
            ``after`` is specified, otherwise ``False``.
        user: :class:`abc.Snowflake`
            The moderator to filter entries from.
        action: :class:`AuditLogAction`
            The action to filter with.

        Raises
        -------
        Forbidden
            You are not allowed to fetch audit logs
        HTTPException
            An error occurred while fetching the audit logs.

        Yields
        --------
        :class:`AuditLogEntry`
            The audit log entry.
        r  r   r]  rq  r  r  c                6  K   |r|j         nd }j        j                            j         | |           d {V }|                    dg           }|r?|r=||t          |          z  }t          t          |d         d                             }||||fS )N)r  r  action_typer]  audit_log_entriesr  r   rk  r   r   r  get_audit_logsr   r  rF   r   )	r  r]  r  r(  r   entriesr  r   r  s	         rz   r*  z*Guild.audit_logs.<locals>._before_strategy  s      %+5		I)88xkZc 9        D hh2B77G ; ;$S\\)E3wr{4'8#9#9:::&%//ry   r\  c                6  K   |r|j         nd }j        j                            j         | |           d {V }|                    dg           }|r?|r=||t          |          z  }t          t          |d         d                             }||||fS )N)r  r  r  r\  r  r  r   rk  r  )	r  r\  r  r  r   r  r  r   r  s	         rz   r,  z)Guild.audit_logs.<locals>._after_strategy  s      #(2uxxdH)88xkYa 9        D hh2B77G : :$S\\)E#gbk$&7"8"8999%..ry   NFr  rk  Tc                @    t          | d                   j        k     S Nr   r   r   )rb  r]  s    rz   r   z"Guild.audit_logs.<locals>.<lambda>  s    c!D'llVY&> ry   c                @    t          | d                   j        k    S r  r  )rb  r\  s    rz   r   z"Guild.audit_logs.<locals>.<lambda>  s    c!D'llUX&= ry   r   )
AppCommandrc   r   c              3  D   K   | ]}t          |j                   V  dS r  N)r5   r   )r2  raw_userr   s     rz   rP  z#Guild.audit_logs.<locals>.<genexpr>  s2      bbTxt{;;;bbbbbbry   r  c                    i | ]
}|j         |S rx   rk  )r2  rr   s     rz   r>  z$Guild.audit_logs.<locals>.<dictcomp>  s    888$888ry   c              3  :   K   | ]}t          |           V  dS )r  N)r;   )r2  raw_ir   s     rz   rP  z#Guild.audit_logs.<locals>.<genexpr>  s1      qq5.EFFFqqqqqqry   rc  c                    i | ]
}|j         |S rx   rk  )r2  integrations     rz   r>  z$Guild.audit_logs.<locals>.<dictcomp>      [[[{{~{[[[ry   c              3  <   K   | ]} |j                    V  dS r   rD  )r2  raw_cmdr  r   s     rz   rP  z#Guild.audit_logs.<locals>.<genexpr>  s4      ||GJJG4;GGG||||||ry   application_commandsc                    i | ]
}|j         |S rx   rk  )r2  app_commands     rz   r>  z$Guild.audit_logs.<locals>.<dictcomp>  r'  ry   c              3  F   K   | ]}t          |j                   V  dS )r  NrJ   r   )r2  raw_ruler   s     rz   rP  z#Guild.audit_logs.<locals>.<genexpr>  sH         T[III     ry   auto_moderation_rulesc                    i | ]
}|j         |S rx   rk  )r2  rules     rz   r>  z$Guild.audit_logs.<locals>.<dictcomp>  s    HHH$HHHry   c              3  F   K   | ]} j         |j                   V  dS r   rK  )r2  raw_webhookrd   r   s     rz   rP  z#Guild.audit_logs.<locals>.<genexpr>  s9      ||T_**4;OOO||||||ry   rO  c                    i | ]
}|j         |S rx   rk  )r2  rM  s     rz   r>  z$Guild.audit_logs.<locals>.<dictcomp>  s    GGG77:wGGGry   r   r  )r   r  rc  app_commandsautomod_rulesrO  r   r-  r.  )r  r   r  r  r  rF   r   r  rE   r6  r  rM  rd   r  filterr   	enumeraterD   )r   r  r]  r\  r  rr   r  r*  r,  	predicater0  r   r  r   raw_entriesr  user_maprc  integration_mapr6  app_command_mapr7  automod_rule_maprO  webhook_maprW  	raw_entryr  rd   r  r  s   ` ``                       @@@@rz   
audit_logszGuild.audit_logs[  s     B	0 	0 	0 	0 	0 	0 	0 	0 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/  wgGGG  39<KKKfh/00 	Iu3FGGGHHHFeX.// 	Fe25tDDDEEEE 	&%	 	>-ueH ?>>>>	.eH >====	 	-,,,,,$$$$$$/	#mssUCH!||4<HXue4T4T.T.T.T.T.T.T+D+ue =$Y<<bbbbDHHU\^`LaLabbbE88%888HqqqqTXT\T\]kmoTpTpqqqL[[l[[[O|||||W[W_W_`vxzW{W{|||L[[l[[[O    $)@" E E  M  IH-HHH|||||cgckcklvxzc{c{|||HGGhGGGKE$-k1$=$=   y]+3#""!0!0"2(        s{{_/	ry   r7   c                   K   | j         j                            | j                   d{V }t	          | j         |          S )a  |coro|

        Returns the widget of the guild.

        .. note::

            The guild must have the widget enabled to get this information.

        Raises
        -------
        Forbidden
            The widget for this guild is disabled.
        HTTPException
            Retrieving the widget failed.

        Returns
        --------
        :class:`Widget`
            The guild's widget.
        Nr   )r   r  
get_widgetr   r7   ri  s     rz   widgetzGuild.widget  sI      * [%0099999999DKd3333ry   )r  r  rq   c                  K   i }|t           ur|dn|j        |d<   |t           ur||d<   |r/| j        j                            | j        ||           d{V  dS dS )a  |coro|

        Edits the widget of the guild. This can also be done with :attr:`~Guild.edit`.

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

        .. versionadded:: 2.0

        Parameters
        -----------
        enabled: :class:`bool`
            Whether to enable the widget for the guild.
        channel: Optional[:class:`~discord.abc.Snowflake`]
            The new widget channel. ``None`` removes the widget channel.
        reason: Optional[:class:`str`]
            The reason for editing this widget. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have permission to edit the widget.
        HTTPException
            Editing the widget failed.
        Nr,  r  r  )r  r   r   r  r  )r   r  r  rq   r  s        rz   r  zGuild.edit_widget(  s      > ')'!!,3ODDGL!'!!!(GI 	X+"..twPV.WWWWWWWWWWW	X 	Xry   cacherH  c                  K   | j         j        j        st          d          | j                             |           s"| j                             | |           d{V S g S )a2  |coro|

        Requests all members that belong to this guild. In order to use this,
        :meth:`Intents.members` must be enabled.

        This is a websocket operation and can be slow.

        .. versionadded:: 1.5

        Parameters
        -----------
        cache: :class:`bool`
            Whether to cache the members as well.

        Raises
        -------
        ClientException
            The members intent is not enabled.

        Returns
        --------
        List[:class:`Member`]
            The list of members in the guild.
        r  rG  N)r   r  r  r    is_guild_evictedchunk_guild)r   rH  s     rz   chunkzGuild.chunkP  ss      4 {#+ 	R!"PQQQ{++D11 	D00U0CCCCCCCCC	ry   )r  r  r  rH  queryr  Optional[List[int]]r  c               V  K   |r | j         j        j        st          d          |dk    rt	          d          ||t	          d          ||t	          d          ||st	          d          t          d|pd	          }| j                             | |||||
           d{V S )ap  |coro|

        Request members of this guild whose username or nickname starts with the given query.
        This is a websocket operation.

        .. versionadded:: 1.3

        Parameters
        -----------
        query: Optional[:class:`str`]
            The string that the username or nickname should start with.
        limit: :class:`int`
            The maximum number of members to send back. This must be
            a number between 5 and 100.
        presences: :class:`bool`
            Whether to request for presences to be provided. This defaults
            to ``False``.

            .. versionadded:: 1.6

        cache: :class:`bool`
            Whether to cache the members internally. This makes operations
            such as :meth:`get_member` work for those that matched.
        user_ids: Optional[List[:class:`int`]]
            List of user IDs to search for. If the user ID is not in the guild then it won't be returned.

            .. versionadded:: 1.4


        Raises
        -------
        asyncio.TimeoutError
            The query timed out waiting for the members.
        ValueError
            Invalid parameters were passed to the function
        ClientException
            The presences intent is not enabled.

        Returns
        --------
        List[:class:`Member`]
            The list of members that have matched the query.
        z.Intents.presences must be enabled to use this.rH  zCannot pass empty query string.Nz"Must pass either query or user_idsz#Cannot pass both query and user_idsz&user_ids must contain at least 1 valuer   r   )rM  r  r  r  rH  )r   r  r  r    r  r  query_members)r   rM  r  r  r  rH  s         rz   rP  zGuild.query_membersr  s      j  	TT[1; 	T!"RSSSB;;>???=X-ABBBE$5BCCCEFFFC!$$[..UXZ_ / 
 
 
 
 
 
 
 
 	
ry   )	self_mute	self_deafOptional[abc.Snowflake]rQ  rR  c                  K   | j                             | j                  }|r|j        nd}|                    | j        |||           d{V  dS )a  |coro|

        Changes client's voice state in the guild.

        .. versionadded:: 1.4

        Parameters
        -----------
        channel: Optional[:class:`abc.Snowflake`]
            Channel the client wants to join. Use ``None`` to disconnect.
        self_mute: :class:`bool`
            Indicates if the client should be self-muted.
        self_deaf: :class:`bool`
            Indicates if the client should be self-deafened.
        N)r   _get_websocketr   voice_state)r   r  rQ  rR  wsr,  s         rz   change_voice_statezGuild.change_voice_state  sa      $ [''00#*4WZZ
nnTWj)YGGGGGGGGGGGry   automod_rule_idrJ   c                  K   | j         j                            | j        |           d{V }t	          || | j                   S )aZ  |coro|

        Fetches an active automod rule from the guild.

        You must have :attr:`Permissions.manage_guild` to do this.

        .. versionadded:: 2.0

        Parameters
        -----------
        automod_rule_id: :class:`int`
            The ID of the automod rule to fetch.

        Raises
        -------
        Forbidden
            You do not have permission to view the automod rule.
        NotFound
            The automod rule does not exist within this guild.

        Returns
        --------
        :class:`AutoModRule`
            The automod rule that was fetched.
        Nr  )r   r  get_auto_moderation_ruler   rJ   )r   rY  r   s      rz   fetch_automod_rulezGuild.fetch_automod_rule  sM      6 [%>>twXXXXXXXXDDDDDry   List[AutoModRule]c                x    K    j         j                             j                   d{V } fd|D             S )a  |coro|

        Fetches all automod rules from the guild.

        You must have :attr:`Permissions.manage_guild` to do this.

        .. versionadded:: 2.0

        Raises
        -------
        Forbidden
            You do not have permission to view the automod rule.
        NotFound
            There are no automod rules within this guild.

        Returns
        --------
        List[:class:`AutoModRule`]
            The automod rules that were fetched.
        Nc                >    g | ]}t          |j                   S )r  r.  r   s     rz   r4  z-Guild.fetch_automod_rules.<locals>.<listcomp>  s*    QQQq$dkBBBQQQry   )r   r  get_auto_moderation_rulesr   ri  s   ` rz   fetch_automod_ruleszGuild.fetch_automod_rules  sO      * [%??HHHHHHHHQQQQDQQQQry   )r  exempt_rolesexempt_channelsrq   
event_typer0   triggerrK   actionsList[AutoModRuleAction]rb  Sequence[Snowflake]rc  c               .  K   | j         j                            | j        ||j        |j        j        |                                pdd |D             ||rd |D             nd|rd |D             nd|
  
         d{V }	t          |	| | j                   S )ah  |coro|

        Create an automod rule.

        You must have :attr:`Permissions.manage_guild` to do this.

        .. versionadded:: 2.0

        Parameters
        -----------
        name: :class:`str`
            The name of the automod rule.
        event_type: :class:`AutoModRuleEventType`
            The type of event that the automod rule will trigger on.
        trigger: :class:`AutoModTrigger`
            The trigger that will trigger the automod rule.
        actions: List[:class:`AutoModRuleAction`]
            The actions that will be taken when the automod rule is triggered.
        enabled: :class:`bool`
            Whether the automod rule is enabled.
            Defaults to ``False``.
        exempt_roles: Sequence[:class:`abc.Snowflake`]
            A list of roles that will be exempt from the automod rule.
        exempt_channels: Sequence[:class:`abc.Snowflake`]
            A list of channels that will be exempt from the automod rule.
        reason: :class:`str`
            The reason for creating this automod rule. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have permissions to create an automod rule.
        HTTPException
            Creating the automod rule failed.

        Returns
        --------
        :class:`AutoModRule`
            The automod rule that was created.
        Nc                6    g | ]}|                                 S rx   r  )r2  as     rz   r4  z-Guild.create_automod_rule.<locals>.<listcomp>C  s     222QQYY[[222ry   c                6    g | ]}t          |j                  S rx   r;  )r2  r  s     rz   r4  z-Guild.create_automod_rule.<locals>.<listcomp>E  s     :::#ad)):::ry   c                6    g | ]}t          |j                  S rx   r;  r2  r  s     rz   r4  z-Guild.create_automod_rule.<locals>.<listcomp>F  s     @@@1SYY@@@ry   )	r   rd  trigger_typetrigger_metadatarf  r  rb  rc  rq   r  )r   r  create_auto_moderation_ruler   r  r  to_metadata_dictrJ   )
r   r   rd  re  rf  r  rb  rc  rq   r   s
             rz   create_automod_rulezGuild.create_automod_rule	  s      h [%AAG!' +$5577?422'222>JT::\::::PTDS]@@@@@@Y] B 
 
 
 
 
 
 
 
 DDDDDry   Optional[datetime.datetime]c                l    | j         sdS t          j        | j                             d                    S )zOptional[:class:`datetime.datetime`]: If invites are paused, returns when
        invites will get enabled in UTC, otherwise returns None.

        .. versionadded:: 2.4
        Nr  r   r   
parse_timer   r   s    rz   invites_paused_untilzGuild.invites_paused_untilL  s7     # 	4 4 8 89Q R RSSSry   c                l    | j         sdS t          j        | j                             d                    S )zOptional[:class:`datetime.datetime`]: If DMs are paused, returns when DMs
        will get enabled in UTC, otherwise returns None.

        .. versionadded:: 2.4
        Nr  rv  r   s    rz   dms_paused_untilzGuild.dms_paused_untilX  s7     # 	4 4 8 89M N NOOOry   c                l    | j         sdS t          j        | j                             d                    S )z|:class:`datetime.datetime`: Returns the time when DM spam was detected in the guild.

        .. versionadded:: 2.5
        Ndm_spam_detected_atrv  r   s    rz   r|  zGuild.dm_spam_detected_atd  s7     # 	4 4 8 89N O OPPPry   c                l    | j         sdS t          j        | j                             d                    S )zOptional[:class:`datetime.datetime`]: Returns the time when a raid was detected in the guild.

        .. versionadded:: 2.5
        Nraid_detected_atrv  r   s    rz   r~  zGuild.raid_detected_ato  s7     # 	4 4 8 89K L LMMMry   c                Z    | j         s	d| j        v S | j         t          j                    k    S )z_:class:`bool`: Whether invites are paused in the guild.

        .. versionadded:: 2.4
        r  )rx  r   r   utcnowr   s    rz   invites_pausedzGuild.invites_pausedz  s0    
 ( 	7%66(5<>>99ry   c                L    | j         sdS | j         t          j                    k    S )z[:class:`bool`: Whether DMs are paused in the guild.

        .. versionadded:: 2.4
        F)rz  r   r  r   s    rz   
dms_pausedzGuild.dms_paused  (    
 $ 	5$u|~~55ry   c                L    | j         sdS | j         t          j                    k    S )za:class:`bool`: Whether DM spam was detected in the guild.

        .. versionadded:: 2.5
        F)r|  r   r  r   s    rz   is_dm_spam_detectedzGuild.is_dm_spam_detected  s(    
 ' 	5'%,..88ry   c                L    | j         sdS | j         t          j                    k    S )z`:class:`bool`: Whether a raid was detected in the guild.

        .. versionadded:: 2.5
        F)r~  r   r  r   s    rz   is_raid_detectedzGuild.is_raid_detected  r  ry   c                  K   | j         j                            | j        |           d{V }t	          | | j         |          S )a  |coro|

        Retrieves a :class:`SoundboardSound` with the specified ID.

        .. versionadded:: 2.5

        .. note::

            Using this, in order to receive :attr:`SoundboardSound.user`, you must have :attr:`~Permissions.create_expressions`
            or :attr:`~Permissions.manage_expressions`.

        .. note::

            This method is an API call. For general usage, consider :attr:`get_soundboard_sound` instead.

        Raises
        -------
        NotFound
            The sound requested could not be found.
        HTTPException
            Retrieving the sound failed.

        Returns
        --------
        :class:`SoundboardSound`
            The retrieved sound.
        Nr   )r   r  rJ  r   rO   )r   rF  r   s      rz   fetch_soundboard_soundzGuild.fetch_soundboard_sound  sM      8 [%::47HMMMMMMMMT4HHHHry   List[SoundboardSound]c                    K    j         j                             j                   d{V } fd|d         D             S )a  |coro|

        Retrieves a list of all soundboard sounds for the guild.

        .. versionadded:: 2.5

        .. note::

            Using this, in order to receive :attr:`SoundboardSound.user`, you must have :attr:`~Permissions.create_expressions`
            or :attr:`~Permissions.manage_expressions`.

        .. note::

            This method is an API call. For general usage, consider :attr:`soundboard_sounds` instead.

        Raises
        -------
        HTTPException
            Retrieving the sounds failed.

        Returns
        --------
        List[:class:`SoundboardSound`]
            The retrieved soundboard sounds.
        Nc                >    g | ]}t          j        |           S r  )rO   r   )r2  rA  r   s     rz   r4  z1Guild.fetch_soundboard_sounds.<locals>.<listcomp>  s*    fffud$+EJJJfffry   r?  )r   r  get_soundboard_soundsr   ri  s   ` rz   fetch_soundboard_soundszGuild.fetch_soundboard_sounds  sV      4 [%;;DGDDDDDDDDffffX\]dXeffffry   r   )volumer   rq   r  Optional[EmojiInputType]c                 K   |t          j        |d          |ddd}|tt          |t                    r|                                }n,t          |t
                    rt          j        |          }nd}||j        |j	        |d<   n
|j        |d<    | j
        j        j        | j        fd|i| d{V }t          | | j
        |          S )	a  |coro|

        Creates a :class:`SoundboardSound` for the guild.
        You must have :attr:`Permissions.create_expressions` to do this.

        .. versionadded:: 2.5

        Parameters
        ----------
        name: :class:`str`
            The name of the sound. Must be between 2 and 32 characters.
        sound: :class:`bytes`
            The :term:`py:bytes-like object` representing the sound data.
            Only MP3 and OGG sound files that don't exceed the duration of 5.2s are supported.
        volume: :class:`float`
            The volume of the sound. Must be between 0 and 1. Defaults to ``1``.
        emoji: Optional[Union[:class:`Emoji`, :class:`PartialEmoji`, :class:`str`]]
            The emoji of the sound.
        reason: Optional[:class:`str`]
            The reason for creating the sound. Shows up on the audit log.

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

        Returns
        -------
        :class:`SoundboardSound`
            The newly created soundboard sound.
        T)audioN)r   rA  r  r  
emoji_namer  r  rq   r   )r   r  r  rM   r  r   rN   r  r   r   r   r  create_soundboard_soundrO   )	r   r   rA  r  r   rq   r  partial_emojir   s	            rz   r  zGuild.create_soundboard_sound  s     V 0dCCC#
 #
 %++ % % 1 1 3 3E3'' % , 5e < < $( #+,9,>GL))*7*:GJ'=T[%=dg``f`X_````````T4HHHHry   rG   c                   K   | j         j                            | j                   d{V }t	          || | j                   S )z|coro|

        Fetches the onboarding configuration for this guild.

        .. versionadded:: 2.6

        Returns
        --------
        :class:`Onboarding`
            The onboarding configuration that was fetched.
        Nr  )r   r  get_guild_onboardingr   rG   ri  s     rz   
onboardingzGuild.onboarding!  sK       [%::47CCCCCCCCt4t{CCCCry   )promptsdefault_channelsr  moderq   r  List[OnboardingPrompt]r  List[Snowflake]r  r3   c          	     N  K   | j         j                            | j        |t          urd t          |          D             nd|t          urd |D             nd|t          ur|nd|t          ur|j        nd|t          ur|nd           d{V }t          || | j                   S )a+  |coro|

        Edits the onboarding configuration for this guild.

        You must have :attr:`Permissions.manage_guild` and
        :attr:`Permissions.manage_roles` to do this.

        .. versionadded:: 2.6

        Parameters
        -----------
        prompts: List[:class:`OnboardingPrompt`]
            The prompts that will be shown to new members.
            This overrides the existing prompts and its options.
        default_channels: List[:class:`abc.Snowflake`]
            The channels that will be used as the default channels for new members.
            This overrides the existing default channels.
        enabled: :class:`bool`
            Whether the onboarding configuration is enabled.
            This overrides the existing enabled state.
        mode: :class:`OnboardingMode`
            The mode that will be used for the onboarding configuration.
        reason: :class:`str`
            The reason for editing the onboarding configuration. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have permissions to edit the onboarding configuration.
        HTTPException
            Editing the onboarding configuration failed.

        Returns
        --------
        :class:`Onboarding`
            The new onboarding configuration.
        c                @    g | ]\  }}|                     |           S )rk  r  )r2  ips      rz   r4  z)Guild.edit_onboarding.<locals>.<listcomp>`  s(    DDDAQYY!Y__DDDry   Nc                    g | ]	}|j         
S rx   rk  rn  s     rz   r4  z)Guild.edit_onboarding.<locals>.<listcomp>a  s     @ @ @! @ @ @ry   )r  default_channel_idsr  r  rq   r  )r   r  edit_guild_onboardingr   r  r9  r  rG   )r   r  r  r  r  rq   r   s          rz   edit_onboardingzGuild.edit_onboarding0  s      \ [%;;GHOW^H^H^DD71C1CDDDDdhDT\cDcDc @ @/? @ @ @ @im&g55GG4#722#72266 < 
 
 
 
 
 
 
 
 t4t{CCCCry   )r   r  r   re   r   r   )r  rg   r   r   )r  rT   r   r   )r  r   r   r  )r  r   r   r   )r  r  r   r?   )r  rT   r   r   )r  r?   r   r   )r  rT   r   r   )r   r   )r,  r   r   r-  )r8  r9  r   r:  )rA  rO   r   r   r   )r   rZ   r,  r   r   rT  )r`  r   r   r   )rd  r   r   r   )r   re   rh  r   r   ri  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  r   r  )r,  r   r   r  )r,  r   r   r  )r  r   r   r  )r  r   r   r  )r   r  )r   r  )r   r9   )r   r  )r   r   )r   r   )r   r  )r  r   r   r!  )r   r#  )r   r(  )rd  r   r   r+  )r   r   )r   r+  )r   r7  )r9  r   r   r:  )r   r=  )r@  r   r   rA  )r   rD  )rF  r   r   rG  )r   r  r   rG  )r   r!  r   )r   r  r   )r   r   r   r!  )..)r   r   rl  rm  rn  ro  rp  rq  rr  r   r   rs  )r   r   rl  rx  rn  ro  rp  rq  rr  r   r   ry  )r   r   rl  r|  rn  ro  rp  rq  rr  r   r   r}  )r   r   rl  r  rn  ro  rp  rq  rr  r   r   r  )r   r   rl  r  rn  ro  rp  rq  rr  r   r   r  )r   r   rl  r  rn  ro  rp  rq  rr  r   r   r  )r   r   rl  r  rn  ro  rp  rq  rr  r   r   r  )r   r   rl  r&   rn  ro  rp  rq  rr  r   r   r  )r   r   rq   rp   rp  r  r  r  r  r   r  r   r  r   r  r  rn  ro  r  r   r  r   r   r^   )r   r   rq   rp   rp  r  r  r   r   r   r  r   r  rp   r  r%   rn  ro  r  r  r   r\   )r   r   rq   rp   rp  r  r  r   r   r   r  r   r  rp   r  r%   rn  ro  r  r  r   r]   )
r   r   rn  ro  rq   rp   r  r   r   r`   ) r   r   r  r   r  r   rp  r  r  r   r  r  r  r  rn  ro  rq   rp   r  r   r  r   r  r1   r  rm   r  r2   r  r  r   r_   )>rq   rp   r   r   r   rp   r   r  rq  r  r   r  r   r  r  r  r   r  rN  rT   r   r   r   r,   r   r*   r   r+   r  r   r  r  r{  r9   r   r/   r  r  r	  r  r   r  r  r  r  r  r   r  r  rq  r   r.   r  r  r  r^   r  r   r  r   r   rQ   )r   r-  )r  r  r\  rU   r   r	  )r  r   r   r   )rr   rT   r   rS   )r,  r   r   r  )r  r  r]  rT   r\  rT   r   r$  )
r5  r   r4  r  rr  r6  rq   rp   r   r  )r   rA  )r   rH  )r5  r   rr  r6  r   r  )r   rS  )r   r   r   r   r   rb   )r  ri   r   r   r   r   )r   r^  )r   rd  )rk  r   r   rB   )r   r   r   r   r   r   ro  rC   rq   rp   r   rB   )rs  rT   rq   rp   r   r   )rw  r  r   rx  )r@  r   rw  r  r   r=   )r   r   r  r   r  r  r  r(   r  r   r  r   r   r   r  r  rq   rp   r   r=   )r   r   r  r   r  r  r  r(   r  rT   r  r   r   r   r  r  rq   rp   r   r=   )r   r   r  r   r  r(   r  r   r  r   r   r   r  r  rq   rp   r   r=   )r   r   r  r   r  r(   r  r  r  r   r   r   r  r  rq   rp   r   r=   )r   r   r  r   r  r'   r  r(   r  rq  r  r   r  r   r   r   r  r  rq   rp   r   r=   )r   r  )r  r   r   r   )
r   r   r  r  rr  r  rq   rp   r   r   )r   rT   rq   rp   r   r   )r   r  )rq   rp   r   r   r  r[   r  r  r  r  r  r  r  r  r  r  r  r  r   r   )rq   rp   r   r   r  r[   r  r  r  r  r  r  r  r  r  r  r  r  r   r   )r   r   r  r[   r  r  r  r  r  r  r  r  r  r  rq   rp   r  r  r  r  r  r  r  r  r   r   )r  r  rq   rp   r   r  )r   r  )r   rH   )
r   r   r  r  r  r  rq   rp   r   rH   )rr   rT   rq   rp   r   r   )
rr   rT   rq   rp   r  r   r  r   r   r   )r  r  rq   rp   r  r   r   r|   )r   rp   )r   r  )r  r  r]  rU   r\  rU   r  r  rr   rT   r  r$   r   r  )r   r7   )r  r  r  rq  rq   rp   r   r   )rH  r  r   r#  r   )rM  rp   r  r   r  rN  r  r  rH  r  r   r#  )r  rS  rQ  r  rR  r  r   r   )rY  r   r   rJ   )r   r]  )r   r   rd  r0   re  rK   rf  rg  r  r  rb  rh  rc  rh  rq   r   r   rJ   )r   rt  )rF  r   r   rO   )r   r  )r   r   rA  r  r  r   r   r  rq   rp   r   rO   )r   rG   )r  r  r  r  r  r  r  r3   rq   r   r   rG   )rt   ru   rv   r   r   r   r   DEFAULT_FILE_SIZE_LIMIT_BYTESr  rw   r   r  r  r  r  r   r"  r&  r(  r+  r7  r@  rD  rF  r   r   r_  rc  rg  classmethodrn  r
  r   r  r  r  r  r  r  r  r  r  r  r  r  r  rW  r  r  r   r  r{  r  r	  r  r  r  r  r  r  r  r[  r'  rr  r-  r/  r2  r6  r  r<  r?  rC  r  rJ  rL  rN  r   rq  r   r   rL  rK  rJ  r   rk  r   rv  r  r  r  r  r  create_category_channelr  r  
deprecatedr  r  r  r  r  r  r  r#  r2  r?  rG  rO  rR  rY  r[  r]  rc  rj  rn  rr  rv  r|  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rB  rE  r  rL  rP  rX  r\  ra  rs  rx  rz  r|  r~  r  r  r  r  r  r  r  r  r  rx   ry   rz   rQ   rQ     s#        u un2Ij kQuGjkkk;R!TEDghhh;S2uuGjkkk;S2uxPPP;S2uyQQQI I    
 
 
 
- - - -- - - -/ / / /* * * *   
+ + + +* * * *+ + + +         2 2 2 24 4 4 4   	" 	" 	" 	"% % % %8$ $ $ $( ( ( ( + + + [+j= j= j= j=X < < < X< ; ; ; X; 
 
 
 X
    X 	 	 	 X	 ( ( ( X( 6 6 6 X6    X    X    X! ! ! !F? ? ? ?O O O O". . . .., , , ,,   ( 6 6 6 X6 = = = X= J J J XJ 	= 	= 	= X	= 
= 
= 
= X
= = = = X= 	= 	= 	= X	= T T T XT
 Z Z Z XZ U U U XU
 F F F XF ; ; ; X;* * * *& W W W XW F F F XF( ( ( (& & & & X&
    X 
 
 
 X
 C C C XC< < < <" D D D XD> > > >" E E E XE5 5 5 5"/ / / / . . . X. H H H XH [ [ [ X[ \ \ \ X\ p p p Xp " " " X" + + + X+ ' ' ' X' - - - X-/) /) /) /)b 
 QT(+6 6 6 6 X6 
 QT(+7 7 7 7 X7 
 QT(+7 7 7 7 X7 
 QT(+: : : : X: 
 QT(+6 6 6 6 X6 
 QT(+Q Q Q Q XQ 
 QT(+7 7 7 7 X7 
 QT(+7 7 7 7 X7 QX(,
 
 
 
 
J !%.2%PW-4-4L L L L L Ld !%.2!$+/6PWc c c c c cR !%.2!$+/6PWj j j j j j` QX $. . . . . .` . .2%PW $-4-4-418*1-4#b b b b b bH
4 
4 
4 
4 U5 5 5 5, !(%, '")"),3!.5""3:0718"073:#*/68?-4$!(&.5%%,-44;07AH3 H3 H3 H3 H3 H3T!* !* !* !*F   : =AY` EG EG EG EG EG EGN!@ !@ !@ !@F` ` ` `:+ + + +`  $#"ga ga ga ga ga gaZ %)'. $G G G G G GRC C C C0H H H H. Za 0 0 0 0 0 0d   8 FM 6 6 6 6 6 6@E E E E2* * * *>G G G G0: : : :H # !%9> 9> 9> 9> 9> 9>v VZ Q Q Q Q Q Q2 CG I I I I I I4 ^b < < < < < <<  58&)&) #     X  MP&) &) #     X  '*&) #     X  '*58&) #     X$ #*&-'.&-" $]< ]< ]< ]< ]< ]<~L L L L, ?  ?  ?  ?N #* $4C 4C 4C 4C 4C 4Cl RV U U U U U U8K K K K0> > > >>  !$#&%(*19<8;     X  !$#&$'*18;7:     X" #*$+%,*1# $8?7>9@8?I I I I I IV hl @ @ @ @ @ @D   B4 4 4 4: #18 $)4 )4 )4 )4 )4 )4V FJ E E E E E E: !%#*&-;\ ;\ ;\ ;\ ;\ ;\z GK F F F F F F> !%&+2
 2
 2
 2
 2
 2
h 7 7 7 X7&T &T &T &TV  # '&$!!(r r r r r rh4 4 4 48  '. $&X &X &X &X &X &XP ,0            H  $G
 (,G
 G
 G
 G
 G
 G
T FK^cH H H H H H,E E E E>R R R R@ ,3/6AE AE AE AE AE AEF 	T 	T 	T X	T 	P 	P 	P X	P Q Q Q XQ N N N XN: : : :6 6 6 69 9 9 96 6 6 6I I I I>g g g gD *. $AI AI AI AI AI AIFD D D D$ +2,3&6D 6D 6D 6D 6D 6D 6D 6Dry   rQ   )r   
__future__r   rX  r  typingr   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r  rH  r   r   r`  r   r  r   r   r   r   errorsr   r  r   r  r   r    r  r"   r#   enumsr$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   mixinsr4   rr   r5   rX  r6   rE  r7   assetr8   flagsr9   rc  r:   r;   r<   r  r=   r  r>   r  r?   r@   rs  rB   ro  rC   rB  rD   objectrE   rF   r  rG   r  rH   rI   automodrJ   rK   rL   r  rM   rN   
soundboardrO   r  rP   __all__r  rT   rU   types.guildrV   
BanPayloadrQ   r  rR   r   rW   RolePositionUpdatePayloadrX   rY   types.threadsr  types.voicerZ   r[   r\   r]   r^   r_   r`   rE  rb   rM  rd   r   re   r  rf   types.channelrg   GuildChannelPayloadTextChannelPayloadrh   NewsChannelPayloadVoiceChannelPayloadCategoryChannelPayloadStageChannelPayloadForumChannelPayloadtypes.integrationri   types.snowflakerj   types.widgetrk   types.audit_logrl   messagerm   rn   VocalGuildChannelr  rS   r|   r   rx   ry   rz   <module>r     si   0 # " " " " "                                         (                & & & & & & & &             , , , , , ,       # # # # # #     + + + + + + 4 4 4 4 4 4                                   $                               % % % % % % O O O O O O O O O O + + + + + + ) ) ) ) ) ) ) ) ) ) ) ) ) ) ! ! ! ! ! !       % % % % % % ) ) ) ) ) ) ) ) " " " " " " 9 9 9 9 9 9 9 9 C C C C C C C C C C 2 2 2 2 2 2 2 2 ' ' ' ' ' ' - - - - - - - &J--------                     -,,,,,((((((______________""""""      &&&&&&++++++                  322222......000000......'''''',,,,,,lL89*L+VWL8O4d<6HHIN    z   
    J   
    *   pp pp pp pp pp8 pp pp ppfLID LID LID LID LIDH LID LID LID LID LIDry   