
    cjh                   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 ddlmZmZ ddlmZ ddlmZmZmZ dd	l dd
lmZmZ ddlmZ ddlmZm Z m!Z! ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 ddl1m2Z2m3Z3m4Z4 ddl5m6Z6 ddl7m8Z8 ddl9m:Z:m;Z; ddl<m=Z= ddl>m?Z?m@Z@mAZAmBZB ddlCmDZDmEZE ddlFmGZG ddlHmIZI ddlJmKZK ddlLmMZM ddlNmOZO ddlPmQZQmRZR ddlSmTZT ddlUmVZV ddlWmXZXmYZY ddlZm[Z[ ddl\m]Z]m^Z^ dd l_m`Z` d!Zaej                  Zber|ddlcZcdd"lmdZdmeZe dd#lmfZfmgZgmhZhmiZimjZj dd$lLmkZk dd%llmmZm dd&lnmoZo dd'lpmqZr dd!lpmsZt dd(lpmuZumvZv dd)lwmDZx dd*lymXZz dd+l{m|Z| dd,l}m~Z~ dd-lmZ eejehf   Zeejeheiegeff   Zeeef   e	e   f   Z G d. d/e
      Z G d0 d1e
      Z G d2 d3eG      Zsy)4ae  
The MIT License (MIT)

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

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

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

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
    )annotationsN)
TYPE_CHECKINGAnyClassVarList
NamedTupleOptionalSequenceTupleUnionoverload   )abcutils)Asset)AutoModActionAutoModRuleAutoModTriggerMetadata)*)_guild_channel_factory_threaded_guild_channel_factory)Colour)EmojiPartialEmoji	_EmojiTag)AuditLogActionAutoModEventTypeAutoModTriggerTypeChannelTypeContentFilterEntitlementOwnerTypeNotificationLevel	NSFWLevelScheduledEventLocationTypeScheduledEventPrivacyLevelVerificationLevelVideoQualityModeVoiceRegiontry_enum)ClientExceptionInvalidArgumentInvalidData)File)SystemChannelFlags)Integration_integration_factory)Invite)AuditLogIteratorBanIteratorEntitlementIteratorMemberIterator)Member
VoiceState)Hashable)Entitlement)
Onboarding)PermissionOverwrite)Role)ScheduledEventScheduledEventLocation)StageInstance)GuildSticker)ThreadThreadMember)User)WelcomeScreenWelcomeScreenChannel)Widget)Guild)	SnowflakeSnowflakeTime)CategoryChannelForumChannelStageChannelTextChannelVoiceChannel)Permissions)ConnectionStateTemplate)Ban)GuildFeatureMFALevel)r6   )rA   )GuildVoiceState)VoiceClientWebhookc                  "    e Zd ZU ded<   ded<   y)BanEntry
str | NonereasonrC   userN__name__
__module____qualname____annotations__     @/var/www/html/venv/lib/python3.12/site-packages/discord/guild.pyr[   r[   }   s    
Jre   r[   c                  6    e Zd ZU ded<   ded<   ded<   ded<   y)_GuildLimitintemojistickersfloatbitratefilesizeNr_   rd   re   rf   rh   rh      s    JMNMre   rh   c                     e Zd ZU dZdZ edddd       edddd       edd	d
d       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ddZdd Zdd!Zdd"Zdd#Zdd$Zdd%Zdd&Zdd'Z	 	 	 	 	 	 dd(Zdd)Zdd*Zdd+Zdd,Zedd-       Z edd.       Z!edd/       Z"edd0       Z#edd1       Z$edd2       Z%edd3       Z&edd4       Z'edd5       Z(edd6       Z)edd7       Z*dd8Z+dd9Z,dd:Z-dd;Z.dd<Z/edd=       Z0edd>       Z1edd?       Z2edd@       Z3eddA       Z4eddB       Z5eddC       Z6eddD       Z7eddE       Z8ddFZ9eddG       Z:eddH       Z;ddIZ<eddJ       Z=eddK       Z>eddL       Z?eddM       Z@ddNZAeddO       ZBeddP       ZCeddQ       ZDeddR       ZEeddS       ZFeddT       ZGeddU       ZHeddV       ZIeddW       ZJeddX       ZKddYZLeMdZf	 	 	 	 	 	 	 	 	 dd[ZNdZdZeMeMeMeMeMd\	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd]ZOdZdZeMeMeMeMeMeMd^	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd_ZPeMeMdZdZd`	 	 	 	 	 	 	 	 	 	 	 	 	 ddaZQdZdZeMeMeMeMeMeMdb	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddcZReMdZeMdd	 	 	 	 	 	 	 	 	 ddeZSeSZTddfZUddgZVdZdhddiZWeMeMeMeMeMeMeMeMeMeMeMeMeMeMeMeMeMeMeMeMeMdj	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddkZXddlZYddmZZdndZdo	 	 	 	 	 ddpZ[dndqddrZ\ddsZ]ddtZ^d duZ_	 	 	 d	 	 	 	 	 	 	 ddvZ`dweMdZdx	 	 	 	 	 	 	 	 	 ddyZaddzZbdd{ZceMd|	 	 	 	 	 dd}Zddd~ZeeMd	 	 	 	 	 ddZfd	dZgd
dZhddZiddZjdZdZd	 	 	 	 	 	 	 	 	 	 	 ddZkdZdh	 	 	 	 	 ddZlddZmddZneMdZd	 	 	 	 	 	 	 	 	 ddZodZdh	 	 	 	 	 ddZpddZqddZresddddddeMeMd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd       Ztesddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd       ZteMeMeMeMeMeMdZeMeMd		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZtdZdh	 	 	 	 	 ddZudZdhddZvdZdZd	 	 	 	 	 	 	 ddZwdZdZd	 	 	 	 	 	 	 ddZxdZdhddZyddZzddZdZdZdZd	 	 	 	 	 	 	 	 	 	 	 ddZ{ddZ|eMeMd	 	 	 	 	 ddZ}dwdddZ~	 dddZddwd	 	 	 	 	 	 	 	 	 	 	 d dZddd	 	 	 	 	 d!dZd Zesdddd	 	 	 	 	 	 	 d"d       Zesdd       Zd Zdwd	 	 	 d#dZdwd	 	 	 	 	 d$dZd%dZeMeMej                  dZeMd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d&dZed'd       Zd(dZd)dZddZdZdZd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d*dZd ZeMeMeMeMeMd	 	 	 	 	 	 	 	 	 	 	 d+dZdZdh	 	 	 	 	 d,dZd-dZ	 	 	 	 	 d.	 	 	 	 	 	 	 	 	 	 	 d/dZyZ(0  rG   a!  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 timeout to get sent to the AFK channel.
    afk_channel: Optional[:class:`VoiceChannel`]
        The channel that denotes the AFK channel. ``None`` if it doesn't exist.
    id: :class:`int`
        The guild's ID.
    invites_disabled: :class:`bool`
        Indicates if the guild invites are disabled.
    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.
    mfa_level: :class:`int`
        Indicates the guild's two-factor authorisation level. If this value is 0 then
        the guild does not require 2FA for their administrative members. If the value is
        1 then they do.
    verification_level: :class:`VerificationLevel`
        The guild's verification level.
    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. You can find a catalog of guild features
        `here <https://github.com/Delitefully/DiscordLists#guild-feature-glossary>`_.
    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.
    premium_progress_bar_enabled: :class:`bool`
        Indicates if the guild has premium progress bar enabled.

        .. versionadded:: 2.0
    preferred_locale: Optional[:class:`str`]
        The preferred locale for the guild. Used when filtering Server Discovery
        results to a specific language.
    nsfw_level: :class:`NSFWLevel`
        The guild's NSFW level.

        .. versionadded:: 2.0

    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` with ``with_counts=True``.

        .. versionadded:: 2.0

    approximate_presence_count: Optional[:class:`int`]
        The approximate number of members currently active in the guild.
        This includes idle, dnd, online, and invisible members. Offline members are excluded.
        This is ``None`` unless the guild is obtained using :meth:`Client.fetch_guild`
        with ``with_counts=True``.

        .. versionadded:: 2.0
    )*afk_timeoutafk_channelnameidunavailableowner_id	mfa_levelemojisrk   featuresverification_levelexplicit_content_filterdefault_notificationsdescriptionmax_presencesmax_membersmax_video_channel_userspremium_tierpremium_subscription_countpremium_progress_bar_enabledpreferred_locale
nsfw_level_scheduled_events_members	_channels_icon_banner_state_roles_member_count_large_splash_voice_states_system_channel_id_system_channel_flags_discovery_splash_rules_channel_id_public_updates_channel_id_stage_instances_threadsapproximate_member_countapproximate_presence_count2           p@i  )rj   rk   rm   rn   d      g     @@      g     @Ai      <   g     pAi  @)Nr   r         z'ClassVar[dict[int | None, _GuildLimit]]_PREMIUM_GUILD_LIMITSc               z    i | _         i | _        i | _        i | _        i | _        || _        | j                  |       y N)r   r   r   r   r   r   
_from_data)selfdatastates      rf   __init__zGuild.__init__+  s<     35+-<>46+-',re   c               6    || j                   |j                  <   y r   )r   rs   r   channels     rf   _add_channelzGuild._add_channel9  s    %,wzz"re   c               P    | j                   j                  |j                  d        y r   )r   poprs   r   s     rf   _remove_channelzGuild._remove_channel<  s    7::t,re   c               8    | j                   j                  |      S r   )r   getr   user_ids     rf   _voice_state_forzGuild._voice_state_for?  s    !!%%g..re   c               6    || j                   |j                  <   y r   )r   rs   r   members     rf   _add_memberzGuild._add_memberB      #)fii re   c                   || j                   v r*| j                  |      }|r|j                  |       |S d  |S t        | | j                  |      }|r|| j                   |<   |S Nguildr   r   )r   
get_member_updater6   r   )r   payloadr   
cache_flagr   s        rf   _get_and_update_memberzGuild._get_and_update_memberE  si    
 dmm#__W-F'1FNN7#  8<  $dkkHF)/g&re   c               h    t        | | j                  |      }|| j                  |j                  <   |S r   )rA   r   r   rs   )r   r   threads      rf   _store_threadzGuild._store_threadW  s+    d$++GD#)fii re   c               P    | j                   j                  |j                  d        y r   )r   r   rs   r   s     rf   _remove_memberzGuild._remove_member\      &))T*re   c               6    || j                   |j                  <   y r   )r   rs   r   events     rf   _add_scheduled_eventzGuild._add_scheduled_event_  s    +0uxx(re   c               P    | j                   j                  |j                  d        y r   )r   r   rs   r   s     rf   _remove_scheduled_eventzGuild._remove_scheduled_eventb  s    ""588T2re   c               x    | j                   j                          |D ]  }|| j                   |j                  <    y r   )r   clearrs   )r   eventsr   s      rf   _scheduled_events_from_listz!Guild._scheduled_events_from_liste  s7    $$& 	5E/4D""588,	5re   c               6    || j                   |j                  <   y r   )r   rs   r   r   s     rf   _add_threadzGuild._add_threadj  r   re   c               P    | j                   j                  |j                  d        y r   )r   r   rs   r   s     rf   _remove_threadzGuild._remove_threadm  r   re   c                8    | j                   j                          y r   )r   r   r   s    rf   _clear_threadszGuild._clear_threadsp  s    re   c                    | j                   j                         D cg c]  \  }}|j                  |k(  s| }}}|D ]  }| j                   |=  y c c}}w r   r   items	parent_id)r   
channel_idkt	to_removes        rf   _remove_threads_by_channelz Guild._remove_threads_by_channels  sR    #'==#6#6#8V41aAKK:<UQV	V 	!Aa 	! Ws
   AAc                    | j                   j                         D ci c]  \  }}|j                  |v s|| }}}|D ]  }| j                   |=  |S c c}}w r   r   )r   channel_idsr   r   r   s        rf   _filter_threadszGuild._filter_threadsx  sd    !]]002(
Qakk[6PAqD(
	 (
  	!Aa 	!(
s
   AAc                "    | j                   xs dS )N )rr   r   s    rf   __str__zGuild.__str__  s    yyBre   c                    d| j                   fd| j                  fd| j                  fd| j                  fd| j                  ff}dj                  d |D              }d| d	S )
Nrs   rr   shard_idchunkedmember_count c              3  &   K   | ]	  }d |z    yw)z%s=%rNrd   ).0r   s     rf   	<genexpr>z!Guild.__repr__.<locals>.<genexpr>  s     414s   z<Guild >)rs   rr   r   r   r   join)r   attrsinners      rf   __repr__zGuild.__repr__  sk    477OTYY'%T//0
 4e44q!!re   c                   t        |d         }| j                  |      }	 || j                  j                  |      }n| j                  |   }t	        j                  |      }|j                  ||       | j                  |      }|	 t        |d   | j                  |       }|||fS # t        $ r, t        ||      }t        |d       }|| j                  |<   Y hw xY w# t        $ r d }Y Jw xY w)Nr   )r   r   r   r   r   r   )ri   get_channelr   r   copyr   KeyErrorr7   r   r6   r   )r   r   r   r   r   afterbeforer   s           rf   _update_voice_statezGuild._update_voice_state  s     d9o&"":.	0**..w7**73YYu%FMM$( )>T(^4;;dS vu$$  	0D':ET48F*/Dw'		0  s$   AB) 	C! )2CC!C/.C/c                   | j                   j                         D ]&  }|xj                  |j                          z  c_        ( || j                   |j                  <   y r   )r   valuesposition
is_defaultrs   )r   rolers      rf   	_add_rolezGuild._add_role  sK     ##% 	-AJJalln,,J	-  $DGGre   c                   | j                   j                  |      }| j                   j                         D ].  }|xj                  |j                  |j                  kD  z  c_        0 |S r   )r   r   r  r  )r   role_idr  r  s       rf   _remove_rolezGuild._remove_role  sT    {{w'
 ##% 	5AJJ!**t}}44J	5 re   c           	         |j                  d      }|t         d      s| _        |j                  d       _        t	        t
        |j                  d             _        t	        t        |j                  d             _        t	        t        |j                  dd             _
        |j                  d       _        |j                  d	       _        |j                  d
       _        |j                  dd       _        t        |d          _        i  _         j$                  |j                  dg       D ])  }t'         |      }| j"                  |j                   <   + |j                  d       _        t+        t-         fd|j                  dg                    _        t+        t-         fd|j                  dg                    _        |j                  dg        _        |j                  d       _        t7        j8                  |d       _        |j                  d       _        |j                  d       _        |j                  d       _         |j                  d       _!        |j                  dd       _"        |j                  d      xs d _#        |j                  d      xs d _$        |j                  dd       _%        |j                  d        _&        |j                  d!       _'        t7        j8                  |d"       _(        t7        j8                  |d#       _)        t	        tT        |j                  d$d             _+        |j                  d%       _,        |j                  d&       _-        i  _.        |j                  d'g       D ])  }t_         |      }| j\                  |j                   <   +  j$                  j`                  jb                  } j$                  jd                  }|j                  d(g       D ]3  }	tg        |	 )      }
|s|
j                   |k(  s# ji                  |
       5 g }|j                  d*g       D ]^  }|j                  d+d       sd n jk                  |j                  d,            }|jm                  to         j$                   ||-             `  jq                  |        js                  |        j                  d n j                  d.k\   _:        t7        j8                  |d/       _;         jy                  t7        j8                  |d0             _=        |j                  d1g       D ]   } j}                  |t        |d2                " y )3Nr   r   rr   ry   default_message_notificationsrz   r   rp   iconbannerrt   Frs   rolesr   r   r   rv   c                (    j                  |       S r   )store_emojidr   r   s    rf   <lambda>z"Guild._from_data.<locals>.<lambda>  s    %++D!4 re   rw   c                (    j                  |       S r   )store_stickerr  s    rf   r  z"Guild._from_data.<locals>.<lambda>  s    %--dA6 re   rk   rx   splashsystem_channel_idr|   r}   r~   r   r   r   r   system_channel_flagsr   discovery_splashrules_channel_idpublic_updates_channel_idr   r   r   stage_instancesmembersr   r   r   guild_scheduled_eventscreator
creator_idr   r   r#  r   r   ru   afk_channel_idvoice_statesr   )?r   hasattrr   rr   r)   r&   ry   r"   r{   r    rz   rp   r   r   rt   ri   rs   r   r   r<   rv   tuplemaprw   rk   rx   r   r   _get_as_snowflaker   r|   r}   r~   r   r   r   r   r   r   r   r   r   r#   r   r   r   r   r?   member_cache_flagsjoinedself_idr6   r   r   appendr=   r   _syncr   ru   r   rq   r  )r   r   r   r  r  sstage_instancecache_joinedr.  mdatar   r   r   r#  objr   s   `              @rf   r   zGuild._from_data  s   yy0 #74+I-9D6*	5=uyy)=>6
 9Auyy)HI9
" 7?599%>B7
$ !&		- 8!&6!2
#(99X#6!&=%!@5;'')7B' 	(Ad%8D#'DKK 	( $)99[#9).4eii"6MN*
 386		*b8QR3
 -2IIj",E#(99X#6.3.E.E&/
 (-yy'?).?)C',yy'?3899=V3W$!&>1!=II238q 	' II45> 	) +0))4JA*N",1II6H,I-2YY7I-J-2-D-D%.
 7<6M6M.7
' &.i<QR9S%T*/))4P*Q'(-		2L(M%:<,b1 	FA*AUKN7ED!!."3"34	F {{55<<++%%YYy"- 	)Ed%@FvyyG3  (	)
 YY7< 
	E yyD1 __UYY|%<= 
 MM++T7
	 	((0

5&&.DD4F4F#4M 	 %*$;$;E:$N040@0@##E+;<1
 99^R0 	BC$$S#c,.?*@A	Bre   c                   	 |d   | _         d}|j                  dg       D ]9  }t        |d   d         }| j	                  |      }|(|j                  ||       ; d|v rD|d   }|D ]:  }t        |d         \  }}	|s| j                   || || j                               < d	|v r4|d	   }
|
D ])  }| j                  t        | | j                  |
             + y y # t        $ r Y w xY w)Nlargerd   	presencesr^   rs   channelstyper  threadsr   )r   r   r   ri   r   _presence_updater   r   r   r   rA   )r   r   empty_tuplepresencer   r   r9  cfactorych_typer;  r   s               rf   r0  zGuild._sync*  s   	w-DK b1 	?H(6*401G__W-F!''+>		? J'H V#9!F)#D %%gDq&TUV
 9oG! U  d$++F!STU #  		s   
C 	C)(C)c                H    t        | j                  j                               S )z-A list of channels that belong to this guild.)listr   r  r   s    rf   r9  zGuild.channelsC  s     DNN))+,,re   c                H    t        | j                  j                               S )z[A list of threads that you have permission to view.

        .. versionadded:: 2.0
        )rC  r   r  r   s    rf   r;  zGuild.threadsH  s     DMM((*++re   c                     d| j                    S )zbReturns a URL that allows the client to jump to the guild.

        .. versionadded:: 2.0
        zhttps://discord.com/channels/)rs   r   s    rf   jump_urlzGuild.jump_urlP  s     /twwi88re   c                ~    | j                   &| j                  xs t        | j                        dk\  S | j                   S )zIndicates 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.
        r   )r   r   lenr   r   s    rf   r7  zGuild.largeX  s7     ;;&&<#dmm*<DD{{re   c                    | j                   j                         D cg c]  }t        |t              s| }}|j	                  d        |S c c}w )zA list of voice channels that belong to this guild.

        This is sorted by the position and are in UI order from top to bottom.
        c                :    | j                   xs d| j                  fS Nr  rs   r?  s    rf   r  z&Guild.voice_channels.<locals>.<lambda>j      ajj.B5 re   key)r   r  
isinstancerN   sortr   chr  s      rf   voice_channelszGuild.voice_channelsc  sG     ..//1RBZL5QRRR	56 S
   AAc                    | j                   j                         D cg c]  }t        |t              s| }}|j	                  d        |S c c}w )zA list of stage channels that belong to this guild.

        .. versionadded:: 1.7

        This is sorted by the position and are in UI order from top to bottom.
        c                :    | j                   xs d| j                  fS rK  rM  rN  s    rf   r  z&Guild.stage_channels.<locals>.<lambda>v  rO  re   rP  )r   r  rR  rL   rS  rT  s      rf   stage_channelszGuild.stage_channelsm  G     ..//1RBZL5QRRR	56 SrW  c                    | j                   j                         D cg c]  }t        |t              s| }}|j	                  d        |S c c}w )zA list of forum channels that belong to this guild.

        .. versionadded:: 2.0

        This is sorted by the position and are in UI order from top to bottom.
        c                :    | j                   xs d| j                  fS rK  rM  rN  s    rf   r  z&Guild.forum_channels.<locals>.<lambda>  rO  re   rP  )r   r  rR  rK   rS  rT  s      rf   forum_channelszGuild.forum_channelsy  r[  rW  c                d    | j                   j                  j                  }| j                  |      S )zSimilar to :attr:`Client.user` except an instance of :class:`Member`.
        This is essentially used to get the member version of yourself.
        )r   r^   rs   r   )r   r.  s     rf   mezGuild.me  s(    
 ++""%%w''re   c                L    | j                   j                  | j                        S )zDReturns the :class:`VoiceClient` associated with this guild, if any.)r   _get_voice_clientrs   r   s    rf   voice_clientzGuild.voice_client  s     {{,,TWW55re   c                    | j                   j                         D cg c]  }t        |t              s| }}|j	                  d        |S c c}w )zA list of text channels that belong to this guild.

        This is sorted by the position and are in UI order from top to bottom.
        c                :    | j                   xs d| j                  fS rK  rM  rN  s    rf   r  z%Guild.text_channels.<locals>.<lambda>  rO  re   rP  )r   r  rR  rM   rS  rT  s      rf   text_channelszGuild.text_channels  sG     ..//1QBZK5PRQQ	56 RrW  c                    | j                   j                         D cg c]  }t        |t              s| }}|j	                  d        |S c c}w )zA list of categories that belong to this guild.

        This is sorted by the position and are in UI order from top to bottom.
        c                :    | j                   xs d| j                  fS rK  rM  rN  s    rf   r  z"Guild.categories.<locals>.<lambda>  rO  re   rP  )r   r  rR  rJ   rS  rT  s      rf   
categorieszGuild.categories  sG     ..//1UBZO5TRUU	56 VrW  c                   i }| j                   j                         D ]N  }t        |t              r|j	                  |j
                  g        0	 ||j                     j                  |       P dd}| j                   j                  }|j                         D cg c]  \  }} ||      |f }}}|j                  |       |D ]  \  }}	|	j                  d         |S # t        $ r |g||j                  <   Y w xY wc c}}w )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.
        c                T    | \  }}|r|j                   xs d|j                  f|fS d|fS )NrL  )rL  rL  rM  )r   r   vs      rf   rQ  zGuild.by_category.<locals>.key  s4    DAq/0AJJ$"add+AAhAAre   rP  c                P    | j                   | j                  xs d| j                  fS rK  )_sorting_bucketr  rs   rN  s    rf   r  z#Guild.by_category.<locals>.<lambda>  s     ):):AJJ<L"add(S re   )r   ByCategoryItemreturnz*tuple[tuple[int, int], list[GuildChannel]])r   r  rR  rJ   
setdefaultrs   category_idr/  r   r   r   rS  )
r   groupedr   rQ  _getr   rl  as_list_r9  s
             rf   by_categoryzGuild.by_category  s     9;~~,,. 	9G'?3""7::r29++,33G<	9	B ~~!!BI--/(R$!Q$q'1(R(R" 	UKAxMMSMT	U  907y++,9 )Ss   C#D#C?>C?c               x    |y | j                   j                  |      xs | j                  j                  |      S r   r   r   r   )r   rs   s     rf   _resolve_channelzGuild._resolve_channel  s3    :~~!!"%>):):2)>>re   c               r    | j                   j                  |      xs | j                  j                  |      S )ak  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.
        ry  r   r   s     rf   get_channel_or_threadzGuild.get_channel_or_thread  s-     ~~!!*-N1B1B:1NNre   c               8    | j                   j                  |      S )ad  Returns a channel with the given ID.

        .. note::

            This does *not* search for threads.

        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     rf   r   zGuild.get_channel  s    " ~~!!*--re   c               8    | j                   j                  |      S )a1  Returns a thread with the given ID.

        .. 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   	thread_ids     rf   
get_threadzGuild.get_thread  s     }}  ++re   c                X    | j                   }|xr | j                  j                  |      S )zyReturns the guild's channel used for system messages.

        If no channel is set, then this returns ``None``.
        )r   r   r   r|  s     rf   system_channelzGuild.system_channel  s)     ,,
<dnn00<<re   c                @    t        j                  | j                        S )z,Returns the guild's system channel settings.)r.   _from_valuer   r   s    rf   r  zGuild.system_channel_flags  s     "--d.H.HIIre   c                X    | j                   }|xr | j                  j                  |      S )zReturn'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     rf   rules_channelzGuild.rules_channel  s)     ++
<dnn00<<re   c                X    | j                   }|xr | j                  j                  |      S )zReturn'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     rf   public_updates_channelzGuild.public_updates_channel  s)     44
<dnn00<<re   c                    d| j                   v rdnd}t        || j                  | j                     j                        S )z1The maximum number of emoji slots this guild has.
MORE_EMOJI   r   )rx   maxr   r   rj   )r   
more_emojis     rf   emoji_limitzGuild.emoji_limit,  s:     )DMM9Sr
:t99$:K:KLRRSSre   c                    d| j                   v rdnd}t        || j                  | j                     j                        S )z[The maximum number of sticker slots this guild has.

        .. versionadded:: 2.0
        MORE_STICKERSr   r   )rx   r  r   r   rk   )r   more_stickerss     rf   sticker_limitzGuild.sticker_limit2  s?     .>A455d6G6GHQQ
 	
re   c                    d| j                   v r| j                  d   j                  nd}t        t	        || j                  | j
                     j                              S )z;The maximum bitrate for voice channels this guild can have.VIP_REGIONSr   r   )rx   r   rm   ri   r  r   )r   	vip_guilds     rf   bitrate_limitzGuild.bitrate_limit=  s^    
 - &&q)11 	
 	455d6G6GHPPQ
 	
re   c                H    | j                   | j                     j                  S )zGThe maximum number of bytes files can have when uploaded to this guild.)r   r   rn   r   s    rf   filesize_limitzGuild.filesize_limitI  s!     ))$*;*;<EEEre   c                H    t        | j                  j                               S )z,A list of members that belong to this guild.)rC  r   r  r   s    rf   r   zGuild.membersN  s     DMM((*++re   c               8    | j                   j                  |      S )a  Returns a member with the given ID.

        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     rf   r   zGuild.get_memberS  s     }}  ))re   c                Z    | j                   D cg c]  }|j                  | c}S c c}w )z0A list of members who have "boosted" this guild.)r   premium_sincer   s     rf   premium_subscriberszGuild.premium_subscribersb  s'     &*\\V6V5I5I5UVVVs   ((c                H    t        | j                  j                               S )zReturns a :class:`list` of the guild's roles in hierarchy order.

        The first element of this list will be the lowest role in the
        hierarchy.
        )sortedr   r  r   s    rf   r  zGuild.rolesg  s     dkk((*++re   c               8    | j                   j                  |      S )a  Returns a role with the given ID.

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

        Returns
        -------
        Optional[:class:`Role`]
            The role or ``None`` if not found.
        )r   r   )r   r
  s     rf   get_rolezGuild.get_rolep  s     {{w''re   c                8    | j                  | j                        S )z9Gets the @everyone role that all members have by default.)r  rs   r   s    rf   default_rolezGuild.default_role  s     }}TWW%%re   c                j    | j                   j                         D ]  }|j                         s|c S  y)zjGets the premium subscriber role, AKA "boost" role, in this guild.

        .. versionadded:: 1.6
        N)r   r  is_premium_subscriber)r   r  s     rf   premium_subscriber_rolezGuild.premium_subscriber_role  s6     KK&&( 	D))+	 re   c                    | j                   j                  }| j                  j                         D ]$  }|j                  }|s|j
                  |k(  s"|c S  y)zaGets the role associated with this client's user, if any.

        .. versionadded:: 1.6
        N)r   r.  r   r  tagsbot_id)r   r.  r  r  s       rf   	self_rolezGuild.self_role  sP     ++%%KK&&( 	D99Dw.	 re   c                H    t        | j                  j                               S )zReturns a :class:`list` of the guild's stage instances that
        are currently running.

        .. versionadded:: 2.0
        )rC  r   r  r   s    rf   r  zGuild.stage_instances  s     D))00233re   c               8    | j                   j                  |      S )aG  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   stage_instance_ids     rf   get_stage_instancezGuild.get_stage_instance  s     $$(():;;re   c                8    | j                  | j                        S )zThe member that owns the guild.)r   ru   r   s    rf   ownerzGuild.owner  s     t}}--re   c                    | j                   yt        j                  | j                  | j                  | j                         S )z-Returns the guild's icon asset, if available.N)r   r   _from_guild_iconr   rs   r   s    rf   r  z
Guild.icon  s2     ::%%dkk477DJJGGre   c                    | j                   yt        j                  | j                  | j                  | j                   d      S )z/Returns the guild's banner asset, if available.Nbannerspath)r   r   _from_guild_imager   rs   r   s    rf   r  zGuild.banner  s9     <<&&KK$,,Y
 	
re   c                    | j                   yt        j                  | j                  | j                  | j                   d      S )z6Returns the guild's invite splash asset, if available.Nsplashesr  )r   r   r  r   rs   r   s    rf   r  zGuild.splash  s9     <<&&KK$,,Z
 	
re   c                    | j                   yt        j                  | j                  | j                  | j                   d      S )z9Returns the guild's discovery splash asset, if available.Nzdiscovery-splashesr  )r   r   r  r   rs   r   s    rf   r  zGuild.discovery_splash  s>     !!)&&KK$"8"8?S
 	
re   c                    | j                   S )a  Returns the true member count regardless of it being loaded fully or not.

        .. 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.
        )r   r   s    rf   r   zGuild.member_count  s     !!!re   c                `    | j                   y| j                   t        | j                        k(  S )a0  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.
        F)r   rH  r   r   s    rf   r   zGuild.chunked  s-     %!!S%777re   c                X    | j                   j                  }|y| j                  dz	  |z  S )z2Returns the shard ID for this guild if applicable.r      )r   shard_countrs   )r   counts     rf   r   zGuild.shard_id  s.     ''=2&&re   c                @    t        j                  | j                        S )z)Returns the guild's creation time in UTC.)r   snowflake_timers   r   s    rf   
created_atzGuild.created_at  s     ##DGG,,re   c                    d| j                   v S )z?Returns a boolean indicating if the guild invites are disabled.INVITES_DISABLED)rx   r   s    rf   invites_disabledzGuild.invites_disabled  s     "T]]22re   c                   d}| j                   }t              dkD  r,d   dk(  r$dd }t        j                  |dd |      }||S t        j                  fd|      S )a  Returns the first member found that matches the name provided.

        The name can have an optional discriminator argument, e.g. "Jake#0001"
        or "Jake" will both do the lookup. However, the former will give a more
        precise result. Note that the discriminator must have all 4 digits
        for this to work.

        If a nickname is passed, then it is looked up via the nickname. Note
        however, that a nickname + discriminator combo will not look up the nickname
        but rather the username + discriminator combo due to nickname + discriminator
        not being unique.

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

        Parameters
        ----------
        name: :class:`str`
            The name of the member to lookup with an optional discriminator.

        Returns
        -------
        Optional[:class:`Member`]
            The member in this guild with the associated name. If not found
            then ``None`` is returned.
        Nr   #)rr   discriminatorc                N    | j                   | j                  | j                  fv S r   )nickrr   global_name)mrr   s    rf   r  z(Guild.get_member_named.<locals>.<lambda>4  s    DQVVQVVQ]],K$K re   )r   rH  r   r   find)r   rr   resultr   potential_discriminators    `   rf   get_member_namedzGuild.get_member_named	  ss    6 ,,t9q=T"X_ '+23i# YYd3Bi7NF !zzKWUUre   Nc                   |t         u ri }nt        |t              st        d      g }|j	                         D ]  \  }}t        |t
              s"t        d|j                  j                         |j                         \  }	}
|	j                  |
j                  |j                  t        |t              rt        j                  j                  nt        j                  j                  d}|j!                  |        |r|j                  nd } | j"                  j$                  j&                  | j                  |j                  f|||d|S )Nz$overwrites parameter expects a dict.z&Expected PermissionOverwrite received )allowdenyrs   r:  )rr   r   permission_overwrites)MISSINGrR  dictr+   r   r;   	__class__r`   pairvaluers   r<   r   _OverwritesROLEMEMBERr/  r   httpcreate_channel)r   rr   channel_type
overwritescategoryoptionspermstargetpermr  r  r   r   s                rf   _create_channelzGuild._create_channel6  s0     JJ-!"HII&,,. 	"LFDd$78%<T^^=T=T<UV  ))+KE4

ii "&$/ OO((//	G LL!%	"( $,HKK	.t{{..GG
 "'
 
 	
re   )r]   r  r  topicslowmode_delaynsfwr  c               <  K   i }	|t         ur||	d<   |t         ur||	d<   |t         ur||	d<   |t         ur||	d<    | j                  |f|t        j                  ||d|	 d{   }
t	        | j
                  | |
      }|| j                  |j                  <   |S 7 7w)a  |coro|

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

        Note that you need the :attr:`~Permissions.manage_channels` permission
        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.

        Parameters
        ----------
        name: :class:`str`
            The channel's name.
        overwrites: Dict[Union[:class:`Role`, :class:`Member`, :class:`~discord.abc.Snowflake`], :class:`PermissionOverwrite`]
            The overwrites to apply to the 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.
        reason: Optional[:class:`str`]
            The reason for creating this channel. Shows up on the audit log.

        Returns
        -------
        :class:`TextChannel`
            The channel that was just created.

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

        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)
        r  r  rate_limit_per_userr  r  r  r  r]   Nr   r   r   )r  r  r   textrM   r   r   rs   )r   rr   r]   r  r  r  r  r  r  r  r   r   s               rf   create_text_channelzGuild.create_text_channelb  s     p 7""*GJ$GG(-;G)*w"GFO)T))
!$))
 
 
 DKKt$G &-wzz"
s   A B"B#8B)r]   r  r  rm   
user_limit
rtc_regionvideo_quality_moder  c                 K   i }
|t         ur||
d<   |t         ur||
d<   |t         ur||
d<   |t         ur|dn
t        |      |
d<   |t         ur|j                  |
d<    | j                  |f|	t        j
                  ||d|
 d{   }t        | j                  | |      }|| j                  |j                  <   |S 7 7w)	a  |coro|

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

        Parameters
        ----------
        name: :class:`str`
            The channel's name.
        overwrites: Dict[Union[:class:`Role`, :class:`Member`, :class:`~discord.abc.Snowflake`], :class:`PermissionOverwrite`]
            The overwrites to apply to the 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:`VoiceRegion`]
            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
        reason: Optional[:class:`str`]
            The reason for creating this channel. Shows up on the audit log.

        Returns
        -------
        :class:`VoiceChannel`
            The channel that was just created.

        Raises
        ------
        Forbidden
            You do not have the proper permissions to create this channel.
        HTTPException
            Creating the channel failed.
        InvalidArgument
            The permission overwrite information is not in proper form.
        r  rm   r  Nr  r  r  r  )
r  strr  r  r   voicerN   r   r   rs   )r   rr   r]   r  r  rm   r  r  r  r  r  r   r   s                rf   create_voice_channelzGuild.create_voice_channel  s     x 7""*GJ'!!(GIW$$.GL!W$,6,>DC
OGL!W,,>,D,DG())T))
!$**
 
 
 T[[4H &-wzz"
s   BC B>8C )r  r  r  r]   c                  K   d|i}|t         ur||d<    | j                  |f|t        j                  ||d| d{   }t	        | j
                  | |      }	|	| j                  |	j                  <   |	S 7 7w)a  |coro|

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

        .. versionadded:: 1.7

        Parameters
        ----------
        name: :class:`str`
            The channel's name.
        topic: :class:`str`
            The new channel's topic.
        overwrites: Dict[Union[:class:`Role`, :class:`Member`, :class:`~discord.abc.Snowflake`], :class:`PermissionOverwrite`]
            The overwrites to apply to the 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.
        reason: Optional[:class:`str`]
            The reason for creating this channel. Shows up on the audit log.

        Returns
        -------
        :class:`StageChannel`
            The channel that was just created.

        Raises
        ------
        Forbidden
            You do not have the proper permissions to create this channel.
        HTTPException
            Creating the channel failed.
        InvalidArgument
            The permission overwrite information is not in proper form.
        r  r  r  Nr  )r  r  r   stage_voicerL   r   r   rs   )
r   rr   r  r  r  r  r]   r  r   r   s
             rf   create_stage_channelzGuild.create_stage_channel/  s     d U#
 7""*GJ)T))
!$00
 
 
 T[[4H &-wzz"
s   ;A7A58A7)r]   r  r  r  r  r  r  default_reaction_emojic               R  K   i }
|t         ur||
d<   |t         ur||
d<   |t         ur||
d<   |t         ur||
d<   |	t         urt        |	t              r|	j                         }	nOt        |	t              rt        d|	      }	n1t        |	t              rt        j                  |	      }	nt        d      |	j                         |
d<    | j                  |f|t        j                  ||d	|
 d{   }t        | j                  | |
      }|| j                  |j                   <   |S 7 7w)a8  |coro|

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

        Note that you need the :attr:`~Permissions.manage_channels` permission
        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:`~ForumChannel.edit`
            will be required to update the position of the channel in the channel list.

        Parameters
        ----------
        name: :class:`str`
            The channel's name.
        overwrites: Dict[Union[:class:`Role`, :class:`Member`, :class:`~discord.abc.Snowflake`], :class:`PermissionOverwrite`]
            The overwrites to apply to the 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.
        reason: Optional[:class:`str`]
            The reason for creating this channel. Shows up on the audit log.
        default_reaction_emoji: Optional[:class:`Emoji` | :class:`int` | :class:`str`]
            The default reaction emoji.
            Can be a unicode emoji or a custom emoji in the forms:
            :class:`Emoji`, snowflake ID, string representation (eg. '<a:emoji_name:emoji_id>').

            .. versionadded:: v2.5

        Returns
        -------
        :class:`ForumChannel`
            The channel that was just created.

        Raises
        ------
        Forbidden
            You do not have the proper permissions to create this channel.
        HTTPException
            Creating the channel failed.
        InvalidArgument
            The argument is not in proper form.

        Examples
        --------

        Creating a basic channel:

        .. code-block:: python3

            channel = await guild.create_forum_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_forum_channel('secret', overwrites=overwrites)
        r  r  r  r  N)rr   rs   z9default_reaction_emoji must be of type: Emoji | int | strr  r  r  )r  rR  r   _to_partialri   r   r  from_strr+   _to_forum_reaction_payloadr  r   forumrK   r   r   rs   )r   rr   r]   r  r  r  r  r  r  r  r  r   r   s                rf   create_forum_channelzGuild.create_forum_channelt  sK    ~ 7""*GJ$GG(-;G)*w"GFO!00)<)?)K)K)M&2C8)5"8*& 2C8)5)>)>?U)V&%O 
 'AAC ,- *T))
!$**
 
 
 T[[4H &-wzz"
s   C+D'-D%.8D')r  r]   r  c                  K   i }|t         ur||d<    | j                  |f|t        j                  |d| d{   }t	        | j
                  | |      }|| j                  |j                  <   |S 7 7w)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.

        Returns
        -------
        :class:`CategoryChannel`
            The channel that was just created.

        Raises
        ------
        Forbidden
            You do not have the proper permissions to create this channel.
        HTTPException
            Creating the channel failed.
        InvalidArgument
            The permission overwrite information is not in proper form.
        r  )r  r  r]   Nr  )r  r  r   r  rJ   r   r   rs   )r   rr   r  r]   r  r  r   r   s           rf   create_categoryzGuild.create_category   s     > #%7""*GJ)T))
!$--	

 
 
 "4dK &-wzz"
s   8A4A28A4c                ~   K   | j                   j                  j                  | j                         d{    y7 w)a	  |coro|

        Leaves the guild.

        .. note::

            You cannot leave the guild that you own, you must delete it instead
            via :meth:`delete`.

        Raises
        ------
        HTTPException
            Leaving the guild failed.
        N)r   r  leave_guildrs   r   s    rf   leavezGuild.leave2  s*      kk**477333   3=;=c                ~   K   | j                   j                  j                  | j                         d{    y7 w)a  |coro|

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

        Raises
        ------
        HTTPException
            Deleting the guild failed.
        Forbidden
            You do not have permissions to delete the guild.
        N)r   r  delete_guildrs   r   s    rf   deletezGuild.deleteC  s*      kk++DGG444r
  r]   c                  K   | j                   j                  j                  | j                  ||       d{    y7 w)a!  |coro|

        Set whether it is required to have MFA enabled on your account
        to perform moderation actions. You must be the guild owner to do this.

        Parameters
        ----------
        required: :class:`bool`
            Whether MFA should be required to perform moderation actions.
        reason: :class:`str`
            The reason to show up in the audit log.

        Raises
        ------
        HTTPException
            The operation failed.
        Forbidden
            You are not the owner of the guild.
        r  N)r   r  edit_guild_mfars   )r   requiredr]   s      rf   set_mfa_requiredzGuild.set_mfa_requiredR  s1     ( kk--dggx-OOO   6A >A )r]   rr   r|   r  r  r  r  	communityrq   r  rp   r{   ry   rz   r  r  r   r  r  r   disable_invitesc                  K   | j                   j                  }i }|t        ur||d<   |t        ur||d<   |t        ur||d<   |t        ur||d<   |t        ur||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r|||d<   n|j                  |d<   |t        ur|||d<   n|j                  |d<   |
t        ur=| j                  | j                   j                  k7  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        urq| j                  j!                         }|r)d|v rd|v rd|vrD|j#                  d       n2t        d      d|v r#d|v rd|d<   d|v rd|d<   |j%                  d       ||d<   |t        ur||d<   |t        urL| j                  j!                         }|rd|vr'|j#                  d       nd|v r|j%                  d       ||d<    |j&                  | j                  fd|i| d{   }t)        || j                         S 7 w)al  |coro|

        Edits the guild.

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

        .. versionchanged:: 1.4
            The `rules_channel` and `public_updates_channel` keyword-only parameters were added.

        .. versionchanged:: 2.0
            The `discovery_splash` and `community` keyword-only parameters were added.

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

        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 ``PUBLIC`` 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`.
        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.
        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.
        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.
        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:`str`
            The new preferred locale for the guild. Used as the primary language in the guild.
            If set, this must be an ISO 639 code, e.g. ``en-US`` or ``ja`` or ``zh-CN``.
        rules_channel: Optional[:class:`TextChannel`]
            The new channel that is used for rules. This is only available to
            guilds that contain ``PUBLIC`` in :attr:`Guild.features`. Could be ``None`` for no rules
            channel.
        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 ``PUBLIC`` in :attr:`Guild.features`. Could be ``None`` for no
            public updates channel.
        premium_progress_bar_enabled: :class:`bool`
            Whether the guild should have premium progress bar enabled.
        disable_invites: :class:`bool`
            Whether the guild should have server invites enabled or disabled.
        reason: Optional[:class:`str`]
            The reason for editing this guild. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have permissions to edit the guild.
        HTTPException
            Editing the guild failed.
        InvalidArgument
            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.

        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.
        rr   r|   r   rp   Nr  r  r  r  z=default_notifications field must be of type NotificationLevelr  r&  r  r  r  z9To transfer ownership you must be the owner of the guild.ru   z:verification_level field must be of type VerificationLevelry   z;explicit_content_filter field must be of type ContentFilterrz   z=system_channel_flags field must be of type SystemChannelFlagsr  	COMMUNITYz\community field requires both rules_channel and public_updates_channel fields to be providedrx   r   r  r]   r   r   )r   r  r  r   _bytes_to_base64_datarR  r"   r+   r  rs   ru   r.  r&   r    r.   rx   r   r/  remove
edit_guildrG   )r   r]   rr   r|   r  r  r  r  r  rq   r  rp   r{   ry   rz   r  r  r   r  r  r   r  r  fieldsrx   r   s                             rf   editz
Guild.edith  s    t {{!#w!F6Ng%$/F=!7*)9F%&g%$/F=!w%)\Tu7R7RSW7XF6N ~#)x #(#>#>v#Fx  ~#)x #(#>#>v#Fx 7*'-=)*-2-H-H$.)* !/35FG%S  7L6Q6QF23g%"+6'(+6>>'((%.<*+.<.?.?*+'$-:)*-:-=-=)*!0%-6L236L6O6O23}} 3 33%O  "'F:W,02CD%P  ,>+C+CF'("'15}E%Q  1H0M0MF,-w.24FG%S  .B-G-GF)*G#}}))+H&&03v="(2 4)H 
 (*)V359122f<>B:;OOK0!)F:'w65QF12')}}))+H)X5OO$67%1OO$67!)F:$T__TWWFVFvFF$dkk22 Gs   M.N0N1Nc                    K    j                   j                  j                   j                         d{   } fd}|D cg c]
  } ||       c}S 7 c c}w w)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

        Returns
        -------
        Sequence[:class:`abc.GuildChannel`]
            All channels in the guild.

        Raises
        ------
        InvalidData
            An unknown channel type was received from Discord.
        HTTPException
            Retrieving the channels failed.
        Nc                    t        | d         \  }}|t        dj                  |              |j                  |       }|S )Nr:  0Unknown channel type {type} for channel ID {id}.r   )r   r,   
format_mapr   )r  r@  rA  r   r   s       rf   convertz%Guild.fetch_channels.<locals>.convert  sP    5ai@GW!FQQRST  D!DGNre   )r   r  get_all_guild_channelsrs   r   r   r"  r  s   `   rf   fetch_channelszGuild.fetch_channelso  sQ     . [[%%<<TWWEE	 %))q
)) F *!   3AAAAAAc                  K   | j                   j                  j                  | j                         d{   }|j	                  dg       D cg c]  }t        | | j                   |       }}|D ci c]  }|j                  | }}|j	                  dg       D ]>  }|j	                  t        |d               }|#|j                  t        ||             @ |S 7 c c}w c c}w w)a  |coro|

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

        This includes both private and public threads.

        .. versionadded:: 2.0

        Returns
        -------
        List[:class:`Thread`]
            The active threads

        Raises
        ------
        HTTPException
            The request to get the active threads failed.
        Nr;  r   r   rs   )parentr   )	r   r  get_active_threadsrs   r   rA   ri   r   rB   )r   r   r  r;  r   thread_lookupr   s          rf   active_threadszGuild.active_threads  s     & [[%%88AA XXi,
 T[[q9
 
 MT+T&FIIv,=+T+Thhy"- 	MF"&&s6$<'89F!""<vF#KL	M
  B
 ,Us3   3C*CC*C -C*3C%6C*>!C* 
C*i  limitr   c               t    | j                   j                  j                  st        d      t	        | ||      S )a  Retrieves an :class:`.AsyncIterator` 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.

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

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

        Examples
        --------

        Usage ::

            async for member in guild.fetch_members(limit=150):
                print(member.name)

        Flattening into a list ::

            members = await guild.fetch_members(limit=150).flatten()
            # members is now a list of Member...
        ,Intents.members must be enabled to use this.r,  )r   _intentsr   r*   r5   )r   r-  r   s      rf   fetch_memberszGuild.fetch_members  s3    d {{##++!"PQQd%u==re   )r-  c                  K   | j                   j                  j                  | j                  ||       d{   }|D cg c]  }t	        || | j                          c}S 7 *c c}w w)a  Search for guild members whose usernames or nicknames start with the query string. Unlike :meth:`fetch_members`, this does not require :meth:`Intents.members`.

        .. note::

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

        .. versionadded:: 2.6

        Parameters
        ----------
        query: :class:`str`
            Searches for usernames and nicknames that start with this string, case-insensitive.
        limit: :class:`int`
            The maximum number of members to retrieve, up to 1000.

        Returns
        -------
        List[:class:`Member`]
            The list of members that have matched the query.

        Raises
        ------
        HTTPException
            Getting the members failed.
        Nr!  )r   r  search_membersrs   r6   )r   queryr-  r   r  s        rf   r3  zGuild.search_members  sT     6 [[%%44TWWeUKKGKL!AT=LL LLs!   5A)A"A) A$A)$A)c                  K   | j                   j                  j                  | j                  |       d{   }t	        || j                   |       S 7 w)aw  |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.

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

        Returns
        -------
        :class:`Member`
            The member from the member ID.

        Raises
        ------
        Forbidden
            You do not have access to the guild.
        HTTPException
            Fetching the member failed.
        Nr   )r   r  r   rs   r6   )r   	member_idr   s      rf   fetch_memberzGuild.fetch_member
  sD     6 [[%%00)DD4t{{$?? E   4AAAc                   K   | j                   j                  j                  |j                  | j                         d{   }t	        t        | j                   |d         |d         S 7 ,w)a  |coro|

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

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

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

        Returns
        -------
        :class:`BanEntry`
            The :class:`BanEntry` object for the specified user.

        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.
        Nr^   r   r   r]   )r^   r]   )r   r  get_banrs   r[   rC   )r   r^   r   s      rf   	fetch_banzGuild.fetch_ban(  sZ     6 "&!1!1!9!9$''477!KKDKKd6l;DN
 	
 Ls   >A/ A--A/c                 K   | j                   j                  j                  |       d{   }t        |d         \  }}|t	        dj                  |            |t        j                  t        j                  fv rt	        d      t        |d         }| j                  |k7  rt	        d       || | j                   |      }|S 7 w)a.  |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

        Returns
        -------
        Union[:class:`.abc.GuildChannel`, :class:`.Thread`]
            The channel from the ID.

        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.
        Nr:  r   z(Channel ID resolved to a private channelguild_idz&Guild ID resolved to a different guildr   )r   r  r   r   r,   r!  r   groupprivateri   rs   )r   r   r   r@  rA  r>  r   s          rf   fetch_channelzGuild.fetch_channelH  s     : [[%%11*==:4<H?BMMdS  {((+*=*=>>HIItJ'(77hFGG 'd$++D Q! >s   )CC	BCc                     t        | |||      S )a  |coro|

        Retrieves an :class:`.AsyncIterator` that enables receiving the guild's bans. In order to use this, you must
        have the :attr:`~Permissions.ban_members` permission.
        Users will always be returned in ascending order sorted by user ID.
        If both the ``before`` and ``after`` parameters are provided, only before is respected.

        .. versionchanged:: 2.5
            The ``before``. and ``after`` parameters were changed. They are now of the type :class:`.abc.Snowflake` instead of
            `SnowflakeTime` to comply with the discord api.

        .. versionchanged:: 2.0
            The ``limit``, ``before``. and ``after`` parameters were added. Now returns a :class:`.BanIterator` instead
            of a list of ``BanEntry`` objects.

        All parameters are optional.

        Parameters
        ----------
        limit: Optional[:class:`int`]
            The number of bans to retrieve. Defaults to 1000.
        before: Optional[:class:`.abc.Snowflake`]
            Retrieve bans before the given user.
        after: Optional[:class:`.abc.Snowflake`]
            Retrieve bans after the given user.

        Yields
        ------
        :class:`.BanEntry`
            The ban entry for the ban.

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

        Examples
        --------

        Usage ::

            async for ban in guild.bans(limit=150):
                print(ban.user.name)

        Flattening into a list ::

            bans = await guild.bans(limit=150).flatten()
            # bans is now a list of BanEntry...
        )r-  r   r   )r3   )r   r-  r   r   s       rf   bansz
Guild.bansw  s    t 4uV5IIre   Tcompute_prune_countr  r]   c               N  K   t        |t              s#t        d|j                  j                   d      |r#|D cg c]  }t        |j                         c}ng }| j                  j                  j                  | j                  ||||       d{   }|d   S c c}w 7 w)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 have no roles.

        You must have the :attr:`~Permissions.kick_members` permission
        to use 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.

        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.
        InvalidArgument
            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.rD  Npruned)
rR  ri   r+   r  r`   r  rs   r   r  prune_members)r   daysrE  r  r]   r  role_idsr   s           rf   rJ  zGuild.prune_members  s     r $$!NN++,I7 
 8=U3TCL3"[[%%33GG 3 4 
 
 H~ 4
s   :B%B<B%B#B%c                   K   ddl m} | j                  j                  j	                  | j
                         d{   }|D cg c]  } ||| j                         c}S 7 &c c}w w)a~  |coro|

        Gets the list of templates from this guild.

        Requires :attr:`~.Permissions.manage_guild` permissions.

        .. versionadded:: 1.7

        Returns
        -------
        List[:class:`Template`]
            The templates for this guild.

        Raises
        ------
        Forbidden
            You don't have permissions to get the templates.
        r   rQ   Nr  )templaterR   r   r  guild_templatesrs   )r   rR   r   r  s       rf   	templateszGuild.templates  sP     & 	'[[%%55dgg>>=ABat{{3BB ?Bs!   9A)A"A)A$A)$A)c                   K   ddl m} | j                  j                  j	                  | j
                         d{   }|D cg c]   } |j                  || j                        " c}S 7 0c c}w w)a^  |coro|

        Gets the list of webhooks from this guild.

        Requires :attr:`~.Permissions.manage_webhooks` permissions.

        Returns
        -------
        List[:class:`Webhook`]
            The webhooks for this guild.

        Raises
        ------
        Forbidden
            You don't have permissions to get the webhooks.
        r   rX   N)r   )webhookrY   r   r  guild_webhooksrs   
from_state)r   rY   r   r  s       rf   webhookszGuild.webhooks	  sY     $ 	%[[%%44TWW==BFGQ"""1DKK8GG >Gs!   9A3A,A3%A.)A3.A3)r  c               H  K   t        |t              s#t        d|j                  j                   d      |r#|D cg c]  }t        |j                         c}ng }| j                  j                  j                  | j                  ||       d{   }|d   S c c}w 7 w)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.

        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

        Returns
        -------
        :class:`int`
            The number of members estimated to be pruned.

        Raises
        ------
        Forbidden
            You do not have permissions to prune members.
        HTTPException
            An error occurred while fetching the prune members estimate.
        InvalidArgument
            An integer was not passed for ``days``.
        rG  rH  NrI  )
rR  ri   r+   r  r`   r  rs   r   r  estimate_pruned_members)r   rK  r  r  rL  r   s         rf   rW  zGuild.estimate_pruned_members+	  s     D $$!NN++,I7 
 8=U3TCL3"[[%%==dggtXVVH~ 4Vs   :B"B9B"B B"c           	     "  K   | j                   j                  j                  | j                         d{   }g }|D ]J  }| j	                  t        |d   d               }|j                  t        | j                   || |             L |S 7 Ww)a  |coro|

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

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

        Returns
        -------
        List[:class:`Invite`]
            The list of invites that are currently active.

        Raises
        ------
        Forbidden
            You do not have proper permissions to get the information.
        HTTPException
            An error occurred while fetching the information.
        Nr   rs   r   r   r   r   )r   r  invites_fromrs   r   ri   r/  r1   )r   r   r  inviter   s        rf   inviteszGuild.invitesW	  s     * [[%%22477;; 	F&&s6)+<T+B'CDGMMT[[vT7S	  <s   3BBAB)r|   c                  K   ddl m} d|i}|r||d<   | j                  j                  j	                  | j
                  |       d{   } || j                  |      S 7 w)al  |coro|

        Creates a template for the guild.

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

        .. versionadded:: 1.7

        Parameters
        ----------
        name: :class:`str`
            The name of the template.
        description: :class:`str`
            The description of the template.
        r   rQ   rr   r|   Nr:  )rN  rR   r   r  create_templaters   )r   rr   r|   rR   r   r   s         rf   r^  zGuild.create_templatev	  s[     & 	'4.%0GM"[[%%55dggwGGdkk55 Hs   AA"A A"c                  K   | j                   j                  j                  | j                  ||       d{    y7 w)a  |coro|

        Attaches an integration to the guild.

        You must have the :attr:`~Permissions.manage_guild` permission 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_integrationrs   )r   r:  rs   s      rf   r`  zGuild.create_integration	  s.     0 kk11$''4DDDs   5?=?c                    K    j                   j                  j                   j                         d{   } fd}|D cg c]
  } ||       c}S 7 c c}w w)a  |coro|

        Returns a list of all integrations attached to the guild.

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

        .. versionadded:: 1.4

        Returns
        -------
        List[:class:`Integration`]
            The list of integrations that are attached to the guild.

        Raises
        ------
        Forbidden
            You do not have permission to create the integration.
        HTTPException
            Fetching the integrations failed.
        Nc                r    t        | d         \  }}|t        dj                  |              ||       S )Nr:  z9Unknown integration type {type!r} for integration ID {id})r   r   )r0   r,   r!  )r  r@  rv  r   s      rf   r"  z#Guild.integrations.<locals>.convert	  sG    -ai8JGQ!OZZ 
 A..re   )r   r  get_all_integrationsrs   r$  s   `   rf   integrationszGuild.integrations	  sQ     , [[%%::477CC	/ %))q
)) D *r&  c                   K   | j                   j                  j                  | j                         d{   }|D cg c]  }t	        | j                   |       c}S 7 )c c}w w)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.
        Nr:  )r   r  get_all_guild_stickersrs   r@   r   r   r  s      rf   fetch_stickerszGuild.fetch_stickers	  sN     * [[%%<<TWWEEAEFA4;;Q7FF FF    3A&AA&A!A&!A&c                  K   | j                   j                  j                  | j                  |       d{   }t	        | j                   |      S 7 w)ap  |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.

        Returns
        -------
        :class:`GuildSticker`
            The retrieved sticker.

        Raises
        ------
        NotFound
            The sticker requested could not be found.
        HTTPException
            An error occurred fetching the sticker.
        Nr:  )r   r  get_guild_stickerrs   r@   )r   
sticker_idr   s      rf   fetch_stickerzGuild.fetch_sticker	  sB     : [[%%77LL$++D99 M   4AAA)r|   r]   c                 K   dt        |      cxk  rdk  st        d       t        d      |r+dt        |      cxk  rdk  st        d       t        d      ||xs dd}	 t        j                  |      }|j	                  dd	      }||d
<   | j
                  j                  j                  | j                  |||       d{   }| j
                  j                  | |      S # t        $ r Y fw xY w7 /w)aF  |coro|

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

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

        .. versionadded:: 2.0

        Parameters
        ----------
        name: :class:`str`
            The sticker name. Must be 2 to 30 characters.
        description: Optional[:class:`str`]
            The sticker's description. If used, must be 2 to 100 characters.
        emoji: :class:`str`
            The name of a unicode emoji that represents the sticker's expression.
        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.

        Returns
        -------
        :class:`GuildSticker`
            The created sticker.

        Raises
        ------
        Forbidden
            You are not allowed to create stickers.
        HTTPException
            An error occurred creating a sticker.
        TypeError
            The parameters for the sticker are not correctly formatted.
        r   r   z1"name" parameter must be 2 to 30 characters long.r   z9"description" parameter must be 2 to 200 characters long.r   )rr   r|   r   rv  r  N)
rH  	TypeErrorunicodedatarr   replacer   r  create_guild_stickerrs   r  )r   rr   r|   rj   filer]   r   r   s           rf   create_stickerzGuild.create_sticker

  s    Z SY$"$OPP %OPPS%5 < <WXX !=WXX0ArB	,$$U+E MM#s+E[[%%::GGWdF
 
 {{((t44  		
s7   A"C8%C' :AC8C6 C8'	C30C82C33C8c                  K   | j                   j                  j                  | j                  |j                  |       d{    y7 w)am  |coro|

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

        You must have :attr:`~Permissions.manage_emojis_and_stickers` permission 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_stickerrs   )r   stickerr]   s      rf   delete_stickerzGuild.delete_stickerM
  s2     4 kk33DGGWZZPPPs   ?A	AA	c                   K   | j                   j                  j                  | j                         d{   }|D cg c]  }t	        | | j                   |       c}S 7 *c c}w w)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.
        Nr   )r   r  get_all_custom_emojisrs   r   rg  s      rf   fetch_emojiszGuild.fetch_emojisi
  sP     & [[%%;;DGGDDFJKD!<KK EK    3A'A A'A"A'"A'c                  K   | j                   j                  j                  | j                  |       d{   }t	        | | j                   |      S 7 w)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.

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

        Returns
        -------
        :class:`Emoji`
            The retrieved emoji.

        Raises
        ------
        NotFound
            The emoji requested could not be found.
        HTTPException
            An error occurred fetching the emoji.
        Nr   )r   r  get_custom_emojirs   r   )r   emoji_idr   s      rf   fetch_emojizGuild.fetch_emoji
  sD     6 [[%%66twwII4t{{>> Jr8  r  r]   c               .  K   t        j                  |      }|r|D cg c]  }|j                   c}ng }| j                  j                  j                  | j                  ||||       d{   }| j                  j                  | |      S c c}w 7 %w)a  |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 the :attr:`~Permissions.manage_emojis` permission 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.
        r  N)r   r  rs   r   r  create_custom_emojir  )	r   rr   imager  r]   imgr  rL  r   s	            rf   r  zGuild.create_custom_emoji
  s     V ))%027.DGG.R[[%%99GGT3hv : 
 
 {{&&tT22	 /
s   BB<B-B.&Bc                  K   | j                   j                  j                  | j                  |j                  |       d{    y7 w)a5  |coro|

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

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

        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_emojirs   )r   rj   r]   s      rf   delete_emojizGuild.delete_emoji
  s5     2 kk22477EHHV2TTT   A A
AA
c                   K   | j                   j                  j                  | j                         d{   }|D cg c]  }t	        | | j                   |       c}S 7 *c c}w w)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

        Returns
        -------
        List[:class:`Role`]
            All roles in the guild.

        Raises
        ------
        HTTPException
            Retrieving the roles failed.
        Nr   )r   r  	get_rolesrs   r<   rg  s      rf   fetch_roleszGuild.fetch_roles
  sO     * [[%%//88EIJ4t{{;JJ 9Jr}  c                t   K   | j                          d{   }|D ]  }|j                  |k(  s|c S  y7 w)aU  |coro|

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

        .. note::

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

        .. versionadded:: 2.0

        Parameters
        ----------
        role_id: :class:`int`
            The role ID to fetch from the guild.

        Returns
        -------
        Optional[:class:`Role`]
            The role in the guild with the specified ID.
            Returns ``None`` if not found.

        Raises
        ------
        HTTPException
            Retrieving the role failed.
        N)r  rs   )r   r
  r  r  s       rf   _fetch_rolezGuild._fetch_role  s>     6 &&(( 	Dww'!	 )s   8688.)r]   rr   permissionscolourhoistmentionabler  unicode_emojic                  K   y wr   rd   )	r   r]   rr   r  r  r  r  r  r  s	            rf   create_rolezGuild.create_role"           )r]   rr   r  colorr  r  r  r  c                  K   y wr   rd   )	r   r]   rr   r  r  r  r  r  r  s	            rf   r  zGuild.create_role0  r  r  )	rr   r  r  r  r  r  r]   r  r  c       	        V  K   i }
|t         urt        |j                        |
d<   nd|
d<   |xs |xs t        j                         }t        |t              r||
d<   n|j                  |
d<   |t         ur||
d<   |t         ur||
d<   |t         ur||
d<   |t         ur%|d|
d<   nt        j                  |      |
d<   d|
d	<   |	t         ur
|	|
d	<   d|
d<    | j                  j                  j                  | j                  fd
|i|
 d{   }t        | || j                        }|S 7 w)a  |coro|

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

        All fields are optional.

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

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

        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.
        hoist: :class:`bool`
            Indicates if the role should be shown separately in the member list.
            Defaults to ``False``.
        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.
        icon: Optional[:class:`bytes`]
            A :term:`py:bytes-like object` representing the icon. Only PNG/JPEG/WebP is supported.
            If this argument is passed, ``unicode_emoji`` is set to None.
            Only available to guilds that contain ``ROLE_ICONS`` in :attr:`Guild.features`.
        unicode_emoji: Optional[:class:`str`]
            The role's unicode emoji. If this argument is passed, ``icon`` is set to None.
            Only available to guilds that contain ``ROLE_ICONS`` in :attr:`Guild.features`.

        Returns
        -------
        :class:`Role`
            The newly created role.

        Raises
        ------
        Forbidden
            You do not have permissions to create the role.
        HTTPException
            Creating the role failed.
        InvalidArgument
            An invalid keyword argument was given.
        r  0r  r  r  rr   Nr  r  r]   r  )r  r  r  r   defaultrR  ri   r   r  r   r  r  rs   r<   )r   rr   r  r  r  r  r  r]   r  r  r  actual_colourr   r  s                 rf   r  zGuild.create_role>  s<    @ "$g%$'(9(9$:F=!$'F=!;%;6>>+;mS)+F7O+11F7O#F7Og%$/F=!w!F6Nw|!%v!&!<!<T!Bv*.''&3F?#!F6N1T[[%%11$''S&SFSS$T= 	 Ts   DD)D'	D)c                 K   t        |t              st        d      g }|j                         D ]%  \  }}|j                  |d}|j                  |       ' | j                  j                  j                  | j                  ||       d{   }g }|D ]D  }	t        | |	| j                        }|j                  |       || j                  |j                  <   F |S 7 Qw)a|  |coro|

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

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

        .. versionadded:: 1.4

        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: Dict[:class:`Role`, :class:`int`]
            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.

        Returns
        -------
        List[:class:`Role`]
            A list of all the roles in the guild.

        Raises
        ------
        Forbidden
            You do not have permissions to move the roles.
        HTTPException
            Moving the roles failed.
        InvalidArgument
            An invalid keyword argument was given.
        z#positions parameter expects a dict.)rs   r  r  Nr  )rR  r  r+   r   rs   r/  r   r  move_role_positionr<   r   )
r   	positionsr]   role_positionsr  r  r   r   r  r  s
             rf   edit_role_positionszGuild.edit_role_positions  s     \ )T*!"GHH/1'oo/ 	+ND(!WW(;G!!'*	+
 [[%%88GG^F 9 
 
  	(Ad$++>DLL#'DKK 	(
 
s   BC!CAC!c                  K   | j                   j                  j                  |j                  | j                  |       d{    y7 w)a:  |coro|

        Kicks a user from the guild.

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

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

        Parameters
        ----------
        user: :class:`abc.Snowflake`
            The user to kick from their 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  kickrs   r   r^   r]   s      rf   r  z
Guild.kick  s5     0 kk##DGGTWWV#DDDr  )delete_message_secondsr]   c                  K   |"d|cxk  rdk  st        d       t        d      | j                  j                  j                  |j                  | j                  ||       d{    y7 w)a+  |coro|

        Bans a user from the guild.

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

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

        Parameters
        ----------
        user: :class:`abc.Snowflake`
            The user to ban from their guild.
        delete_message_seconds: Optional[: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 (i.e. 7 days). The default is 0.
        reason: Optional[:class:`str`]
            The reason the user got banned.

        Raises
        ------
        Forbidden
            You do not have the proper permissions to ban.
        HTTPException
            Banning failed.
        Nr   :	 <delete_message_seconds must be between 0 and 604800 seconds.r  )rp  r   r  banrs   )r   r^   r  r]   s       rf   r  z	Guild.ban   s}     F "-'161N  2N  kk""GGTWW4V # 
 	
 	
s   A%A/'A-(A/c                 K   |"d|cxk  rdk  st        d       t        d      t        |      dkD  st        |      dk  rt        d      | j                  j                  j                  |D cg c]  }|j                   c}| j                  ||       d{   }|D cg c]  }t        |j                        |d	   v s|! }}|D cg c]  }t        |j                        |d
   v s|! }}||fS c c}w 7 ac c}w c c}w w)a  |coro|

        Bulk ban users from the guild.

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

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

        Example Usage: ::

            # Ban multiple users
            successes, failures = await guild.bulk_ban(user1, user2, user3, ..., reason="Raid")

            # Ban a list of users
            successes, failures = await guild.bulk_ban(*users)

        Parameters
        ----------
        \*users: :class:`abc.Snowflake`
            An argument list of users to ban from the guild, up to 200.
        delete_message_seconds: Optional[: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 (i.e. 7 days). The default is 0.
        reason: Optional[:class:`str`]
            The reason the users were banned.

        Returns
        -------
        Tuple[List[:class:`abc.Snowflake`], List[:class:`abc.Snowflake`]]
            Returns two lists: the first contains members that were successfully banned, while the second is members that could not be banned.

        Raises
        ------
        ValueError
            You tried to ban more than 200 users.
        Forbidden
            You do not have the proper permissions to ban.
        HTTPException
            No users were banned.
        Nr   r  r  r  r   z;The number of users to be banned must be between 1 and 200.r  banned_usersfailed_users)rp  rH  
ValueErrorr   r  bulk_banrs   r  )r   r  r]   usersur   bannedfaileds           rf   r  zGuild.bulk_ban.  s    b "-'161N  2N  u:s5zA~M  [[%%.. !aQTT!GG"	 / 
 
 #Hc!$$i43G&G!HH"Hc!$$i43G&G!HHv~ "
 IHsH   A/D
1C9D
C>D
%D D 	D
D/D3D
 
D
c                  K   | j                   j                  j                  |j                  | j                  |       d{    y7 w)aJ  |coro|

        Unbans a user from the guild.

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

        You must have the :attr:`~Permissions.ban_members` permission 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
        ------
        Forbidden
            You do not have the proper permissions to unban.
        HTTPException
            Unbanning failed.
        r  N)r   r  unbanrs   r  s      rf   r  zGuild.unbanu  s5     0 kk$$TWWdggf$EEEr  c                  K   | j                   j                  j                  | j                         d{   }|d   sy| j                   j                  j	                  |d          d{   }| j                  t        |d   d               }d|d<   d|d<   d|d	<   d|d
<   |j                  dd      |d<   t        | j                   || |      S 7 7 hw)a\  |coro|

        Returns the guild's special vanity invite.

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

        You must have the :attr:`~Permissions.manage_guild` permission to use
        this as well.

        Returns
        -------
        Optional[:class:`Invite`]
            The special vanity invite. If ``None`` then the guild does not
            have a vanity invite set.

        Raises
        ------
        Forbidden
            You do not have the proper permissions to get this.
        HTTPException
            Retrieving the vanity invite failed.
        Ncoder   rs   Frevoked	temporaryr   max_usesmax_ageusesrY  )	r   r  get_vanity_coders   
get_inviter   ri   r   r1   )r   r   r   r   s       rf   vanity_invitezGuild.vanity_invite  s     2 ((88AAv [[%%00AA""3tIt'<#=>"	$
	!++fa0DKKgT7SS B Bs"   3CC5C+C,A'CC)r-  r   r   r^   actionc               `    ||j                   nd}|r|j                  }t        | |||||      S )an  Returns an :class:`AsyncIterator` that enables receiving the guild's audit logs.

        You must have the :attr:`~Permissions.view_audit_log` permission to use this.

        See `API documentation <https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log>`_
        for more information about the `before` and `after` parameters.

        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.
        user: :class:`abc.Snowflake`
            The moderator to filter entries from.
        action: :class:`AuditLogAction`
            The action to filter with.

        Yields
        ------
        :class:`AuditLogEntry`
            The audit log entry.

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

        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 = await guild.audit_logs(limit=None, user=guild.me).flatten()
            await channel.send(f'I made {len(entries)} moderation actions.')
        N)r   r   r-  r   action_type)rs   r  r2   )r   r-  r   r   r^   r  r   s          rf   
audit_logszGuild.audit_logs  s@    ~ "-$''4\\F
 	
re   c                   K   | j                   j                  j                  | j                         d{   }t	        | j                   |      S 7 w)a  |coro|

        Returns the widget of the guild.

        .. note::

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

        Returns
        -------
        :class:`Widget`
            The guild's widget.

        Raises
        ------
        Forbidden
            The widget for this guild is disabled.
        HTTPException
            Retrieving the widget failed.
        Nr:  )r   r  
get_widgetrs   rF   r   r   s     rf   widgetzGuild.widget  s?     * [[%%0099DKKd33 :s   3AAA)enabledr   c                  K   i }|t         ur|dn|j                  |d<   |t         ur||d<   | j                  j                  j	                  | j                  |       d{    y7 w)a]  |coro|

        Edits the widget of the guild.

        You must have the :attr:`~Permissions.manage_guild` permission to
        use 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.

        Raises
        ------
        Forbidden
            You do not have permission to edit the widget.
        HTTPException
            Editing the widget failed.
        Nr   r  )r   )r  rs   r   r  edit_widget)r   r  r   r   s       rf   r  zGuild.edit_widget  sb     4 '!,3ODGL!'!!(GIkk**477G*DDDs   AA)!A'"A)cachec                  K   | j                   j                  j                  st        d      | j                   j	                  |       s%| j                   j                  | |       d{   S y7 w)a  |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.
        r/  r  N)r   r0  r   r*   is_guild_evictedchunk_guild)r   r  s     rf   chunkzGuild.chunk@  s^     * {{##++!"PQQ{{++D100U0CCC 2Cs   A'A1)A/*A1F)r-  user_idsr8  r  c               V  K   |r+| j                   j                  j                  st        d      |r
|dkD  s|dk  r|s|rt	        d      |sd}d}||t	        d      ||t	        d	      ||st	        d
      | j                   j                  | |||||       d{   S 7 w)a  |coro|

        Request members that belong to this guild whose username starts with
        the query given.

        This is a websocket operation and can be slow.

        .. versionadded:: 1.3

        Parameters
        ----------
        query: Optional[:class:`str`]
            The string that the username's start with.
        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
        limit: Optional[:class:`int`]
            The maximum number of members to send back. If no query is passed, passing ``None`` returns all members.
            If a ``query`` or ``user_ids`` is passed, must be between 1 and 100. Defaults to 5.
        presences: Optional[: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. Defaults to ``True``.

        Returns
        -------
        List[:class:`Member`]
            The list of members that have matched the query.

        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.
        z.Intents.presences must be enabled to use this.r   r   z<limit must be between 1 and 100 when using query or user_idsr   r   Nz1Must pass query or user_ids, or set limit to Nonez#Cannot pass both query and user_idsz&user_ids must contain at least 1 value)r4  r-  r  r8  r  )r   r0  r8  r*   r  query_members)r   r4  r-  r  r8  r  s         rf   r  zGuild.query_members[  s     l T[[11;;!"RSSuqy R  = !TUUE$5BCCEFF[[.. / 
 
 	
 
s   B B)"B'#B))	self_mute	self_deafc                  K   | j                   j                  | j                        }|r|j                  nd}|j                  | j                  |||       d{    y7 w)a  |coro|

        Changes client's voice state in the guild.

        .. versionadded:: 1.4

        Parameters
        ----------
        channel: Optional[Union[:class:`VoiceChannel`, :class:`StageChannel`]]
            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_websocketrs   voice_state)r   r   r  r  wsr   s         rf   change_voice_statezGuild.change_voice_state  sI     , [[''0#*WZZ
nnTWWj)YGGGs   AA!AA!c                   K   | j                   j                  j                  | j                         d{   }t	        ||       S 7 w)a  |coro|

        Returns the :class:`WelcomeScreen` of the guild.

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

        You must have the :attr:`~Permissions.manage_guild` permission in order to get this.

        .. versionadded:: 2.0

        Returns
        -------
        :class:`WelcomeScreen`
            The welcome screen of guild.

        Raises
        ------
        Forbidden
            You do not have the proper permissions to get this.
        HTTPException
            Retrieving the welcome screen failed somehow.
        NotFound
            The guild doesn't have a welcome screen or community feature is disabled.
        Nr   r   )r   r  get_welcome_screenrs   rD   r  s     rf   welcome_screenzGuild.welcome_screen  s<     2 [[%%88AA$d33 B   3A	AA	)r|   welcome_channelsr  c                  K   y wr   rd   )r   r|   r  r  s       rf   edit_welcome_screenzGuild.edit_welcome_screen  s      r  c                   K   y wr   rd   r   s    rf   r  zGuild.edit_welcome_screen  s	     14r  c                t  K   |j                  dg       }g }|D ]<  }t        |t              st        d      |j	                  |j                                > ||d<   |rV| j                  j                  j                  | j                  ||j                  d             d{   }t        ||       S y7 w)ap  |coro|

        A shorthand for :attr:`WelcomeScreen.edit` without fetching the welcome screen.

        You must have the :attr:`~Permissions.manage_guild` permission in the
        guild to do this.

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

        Parameters
        ----------
        description: Optional[:class:`str`]
            The new description of welcome screen.
        welcome_channels: Optional[List[:class:`WelcomeScreenChannel`]]
            The welcome channels. The order of the channels would be same as the passed list order.
        enabled: Optional[:class:`bool`]
            Whether the welcome screen should be displayed.
        reason: Optional[:class:`str`]
            The reason that shows up on audit log.

        Returns
        -------
        :class:`WelcomeScreen`
            The edited welcome screen.

        Raises
        ------
        HTTPException
            Editing the welcome screen failed somehow.
        Forbidden
            You don't have permissions to edit the welcome screen.
        NotFound
            This welcome screen does not exist.
        r  zBwelcome_channels parameter must be a list of WelcomeScreenChannel.r]   r  Nr  )r   rR  rE   rp  r/  to_dictr   r  r  rs   rD   )r   r  r  welcome_channels_datar   news         rf   r  zGuild.edit_welcome_screen  s     H #;;'92> "' 	<Gg';<X  "(():;	< '<"#((<<X)> =  C !c66	 s   B!B8#B6$B8with_user_countc          	     p  K   | j                   j                  j                  | j                  |       d{   }g }|D ]^  }|j	                  dd      sdn| j                  |j	                  d            }|j                  t        | j                   | ||             ` | j                  |       |S 7 |w)a  |coro|

        Returns a list of :class:`ScheduledEvent` in the guild.

        .. note::

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

        Parameters
        ----------
        with_user_count: Optional[:class:`bool`]
            If the scheduled event should be fetched with the number of
            users that are interested in the events.
            Defaults to ``True``.

        Returns
        -------
        List[:class:`ScheduledEvent`]
            The fetched scheduled events.

        Raises
        ------
        ClientException
            The scheduled events intent is not enabled.
        HTTPException
            Getting the scheduled events failed.
        r  Nr#  r$  r%  )	r   r  get_scheduled_eventsrs   r   r   r/  r=   r   )r   r  r   r  r   r#  s         rf   fetch_scheduled_eventszGuild.fetch_scheduled_events)  s     < [[%%::GG_ ; 
 
  
	E yyD1 __UYY|%<= 
 MM++T7
	 	((0#
s   5B6B4A=B6c                K   | j                   j                  j                  | j                  ||       d{   }|j	                  dd      sdn| j                  |j	                  d            }t        | j                   | ||      }| j                  j	                  |j                        }|r|| j                  |j                  <   |S | j                  |       |S 7 w)a5  |coro|

        Retrieves a :class:`ScheduledEvent` from event ID.

        .. note::

            This method is an API call. If you have :attr:`Intents.scheduled_events`,
            consider :meth:`get_scheduled_event` instead.

        Parameters
        ----------
        event_id: :class:`int`
            The event's ID to fetch with.
        with_user_count: Optional[:class:`bool`]
            If the scheduled vent should be fetched with the number of
            users that are interested in the event.
            Defaults to ``True``.

        Returns
        -------
        Optional[:class:`ScheduledEvent`]
            The scheduled event from the event ID.

        Raises
        ------
        HTTPException
            Fetching the event failed.
        NotFound
            Event not found.
        )r>  event_idr  Nr#  r$  r%  )	r   r  get_scheduled_eventrs   r   r   r=   r   r   )r   r  r  r   r#  r   	old_events          rf   fetch_scheduled_eventzGuild.fetch_scheduled_eventZ  s     B [[%%99WWx : 
 

 88It, ,!78 	
 ++T7
 **..uxx8	/4D""588,  %%e,%
s   6C!CB'C!c               8    | j                   j                  |      S )a"  Returns a Scheduled Event with the given ID.

        Parameters
        ----------
        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     rf   r  zGuild.get_scheduled_event  s     %%))(33re   )r|   end_timeprivacy_levelr]   r  c                 K   ||j                         t        |      d}	t        |t              st        | j                  |      }|j
                  j                  |	d<   |j
                  t        j                  k(  rd|	d<   d|j                  i|	d<   n|j                  j                  |	d<   d|	d<   |t        ur||	d<   |t        ur|j                         |	d	<   |t        urt        j                  |      |	d
<    | j                  j                  j                  d| j                  |d|	 d{   }
t        | j                  | | j                   |
      }| j#                  |       |S 7 :w)aO  |coro|
        Creates a scheduled event.

        Parameters
        ----------
        name: :class:`str`
            The name of the scheduled event.
        description: Optional[:class:`str`]
            The description of the scheduled event.
        start_time: :class:`datetime.datetime`
            A datetime object of when the scheduled event is supposed to start.
        end_time: Optional[:class:`datetime.datetime`]
            A datetime object of when the scheduled event is supposed to end.
        location: :class:`ScheduledEventLocation`
            The location of where the event is happening.
        privacy_level: :class:`ScheduledEventPrivacyLevel`
            The privacy level of the event. Currently, the only possible value
            is :attr:`ScheduledEventPrivacyLevel.guild_only`, which is default,
            so there is no need to change this parameter.
        reason: Optional[:class:`str`]
            The reason to show in the audit log.
        image: Optional[:class:`bytes`]
            The cover image of the scheduled event

        Returns
        -------
        Optional[:class:`ScheduledEvent`]
            The created scheduled event.

        Raises
        ------
        Forbidden
            You do not have the Manage Events permission.
        HTTPException
            The operation failed.
        )rr   scheduled_start_timer  )r   r  entity_typeNr   locationentity_metadatar|   scheduled_end_timer  )r>  r]   r%  rd   )	isoformatri   rR  r>   r   r:  r  r$   externalrs   r  r   r  r  create_scheduled_eventr=   r`  r   )r   rr   r|   
start_timer  r  r  r]   r  r   r   r   s               rf   r  zGuild.create_scheduled_event  sa    b $.$8$8$: /)
 ($:;-DKKxPH!)!4!4==6???$(GL!*4hnn)EG%&$,NN$5$5GL!)-G%&g%%0GM"7",4,>,>,@G()$::5AGG<T[[%%<< 
WWV
/6
 
 ++T477
 	!!%(
s   D.E-0E+1;E-c                H    t        | j                  j                               S )z)A list of scheduled events in this guild.)rC  r   r  r   s    rf   scheduled_eventszGuild.scheduled_events  s     D**11344re   c                   K   | j                   j                  j                  | j                         d{   }|D cg c]  }t	        | j                   |       c}S 7 )c c}w w)a  |coro|

        Retrieves a list of auto moderation rules for this guild.

        Returns
        -------
        List[:class:`AutoModRule`]
            The auto moderation rules for this guild.

        Raises
        ------
        HTTPException
            Getting the auto moderation rules failed.
        Forbidden
            You do not have the Manage Guild permission.
        Nr:  )r   r  get_auto_moderation_rulesrs   r   )r   r   rules      rf   fetch_auto_moderation_rulesz!Guild.fetch_auto_moderation_rules  sN     " [[%%??HHFJKd$++D9KK IKri  c                   K   | j                   j                  j                  | j                  |       d{   }t	        | j                   |      S 7 w)aj  |coro|

        Retrieves a :class:`AutoModRule` from rule ID.

        Returns
        -------
        :class:`AutoModRule`
            The requested auto moderation rule.

        Raises
        ------
        HTTPException
            Getting the auto moderation rule failed.
        Forbidden
            You do not have the Manage Guild permission.
        Nr:  )r   r  get_auto_moderation_rulers   r   )r   rs   r   s      rf   fetch_auto_moderation_rulez Guild.fetch_auto_moderation_rule  sB     " [[%%>>twwKK488 Lrn  )r  exempt_rolesexempt_channelsr]   c       	   	       K   ||j                   |j                   |j                         |D 
cg c]  }
|
j                          c}
|d}|r|D cg c]  }|j                   c}|d<   |r|D cg c]  }|j                   c}|d<   | j                  j                  j                  | j                  ||	       d{   }t        | j                  |      S c c}
w c c}w c c}w 7 *w)a  
        Creates an auto moderation rule.

        Parameters
        ----------
        name: :class:`str`
            The name of the auto moderation rule.
        event_type: :class:`AutoModEventType`
            The type of event that triggers the rule.
        trigger_type: :class:`AutoModTriggerType`
            The rule's trigger type.
        trigger_metadata: :class:`AutoModTriggerMetadata`
            The rule's trigger metadata.
        actions: List[:class:`AutoModAction`]
            The actions to take when the rule is triggered.
        enabled: :class:`bool`
            Whether the rule is enabled.
        exempt_roles: List[:class:`.abc.Snowflake`]
            A list of roles that are exempt from the rule.
        exempt_channels: List[:class:`.abc.Snowflake`]
            A list of channels that are exempt from the rule.
        reason: Optional[:class:`str`]
            The reason for creating the rule. Shows up in the audit log.

        Returns
        -------
        :class:`AutoModRule`
            The new auto moderation rule.

        Raises
        ------
        HTTPException
            Creating the auto moderation rule failed.
        Forbidden
            You do not have the Manage Guild permission.
        )rr   
event_typetrigger_typetrigger_metadataactionsr  r	  r
  r  Nr:  )r  r  rs   r   r  create_auto_moderation_ruler   )r   rr   r  r  r  r  r  r	  r
  r]   ar   r  r?  r   s                  rf   r  z!Guild.create_auto_moderation_rule  s     d $**(.. 0 8 8 :-45		5
 5A&Bqtt&BGN#8G)H1!$$)HG%&[[%%AAGGWV B 
 
 488 6
 'C *I
s4   +C*CC*C#C*/C#;C*=C(>+C*c                   K   | j                   j                  j                  | j                         d{   }t	        ||       S 7 w)aG  |coro|

        Returns the :class:`Onboarding` flow for the guild.

        .. versionadded:: 2.5

        Returns
        -------
        :class:`Onboarding`
            The onboarding flow for the guild.

        Raises
        ------
        HTTPException
            Retrieving the onboarding flow failed somehow.
        Nr  )r   r  get_onboardingrs   r:   r  s     rf   
onboardingzGuild.onboardingd  s;     " [[%%44TWW==t400 >r  )promptsdefault_channelsr  moder]   c                 K   i }|t         ur!|D cg c]  }|j                          c}|d<   |t         ur|D cg c]  }|j                   c}|d<   |t         ur||d<   |t         ur|j                  |d<   | j                  j
                  j                  | j                  ||       d{   }	t        |	|       S c c}w c c}w 7 w)a  |coro|

        A shorthand for :attr:`Onboarding.edit` without fetching the onboarding flow.

        You must have the :attr:`~Permissions.manage_guild` and :attr:`~Permissions.manage_roles` permissions in the
        guild to do this.

        Parameters
        ----------

        prompts: Optional[List[:class:`OnboardingPrompt`]]
            The new list of prompts for this flow.
        default_channels: Optional[List[:class:`Snowflake`]]
            The new default channels that users are opted into.
        enabled: Optional[:class:`bool`]
            Whether onboarding should be enabled. Setting this to ``True`` requires
            the guild to have ``COMMUNITY`` in :attr:`~Guild.features` and at
            least 7 ``default_channels``.
        mode: Optional[:class:`OnboardingMode`]
            The new onboarding mode.
        reason: Optional[:class:`str`]
            The reason that shows up on Audit log.

        Returns
        -------
        :class:`Onboarding`
            The updated onboarding flow.

        Raises
        ------

        HTTPException
            Editing the onboarding flow failed somehow.
        Forbidden
            You don't have permissions to edit the onboarding flow.
        r  default_channel_idsr  r  r  Nr  )r  r  rs   r  r   r  edit_onboardingr:   )
r   r  r  r  r  r]   r  promptr   r  s
             rf   r  zGuild.edit_onboardingx  s     \ "$'!@G Hf!1 HF97*GW,XGWZZ,XF()'! 'F9w!ZZF6NKK$$44TWWfV4TTs$// !I -Y Us'   C
B>C
CAC
,C-C
c                  K   | j                   j                  j                  | j                  ||       d{    y7 w)a  
        Deletes an auto moderation rule.

        Parameters
        ----------
        id: :class:`int`
            The ID of the auto moderation rule.
        reason: Optional[:class:`str`]
            The reason for deleting the rule. Shows up in the audit log.

        Raises
        ------
        HTTPException
            Deleting the auto moderation rule failed.
        Forbidden
            You do not have the Manage Guild permission.
        r  N)r   r  delete_auto_moderation_rulers   )r   rs   r]   s      rf   r  z!Guild.delete_auto_moderation_rule  s1     0 kk::477Bv:VVVr  c                  K   |j                   | j                   t        j                  j                  d}| j                  j
                  j                  | j                   |       d{   }t        || j                        S 7 w)a"  |coro|

        Creates a test entitlement for the guild.

        Parameters
        ----------
        sku: :class:`Snowflake`
            The SKU to create a test entitlement for.

        Returns
        -------
        :class:`Entitlement`
            The created entitlement.
        )sku_idru   
owner_typeNr  )rs   r!   r   r  r   r  create_test_entitlementr9   )r   skur   r   s       rf   r!  zGuild.create_test_entitlement  sh       ff.44::

 [[%%==dggwOODKK88 Ps   A&B(B)Bc           	         t        | j                  |r|D cg c]  }|j                   c}nd|||| j                  |      S c c}w )a  Returns an :class:`.AsyncIterator` that enables fetching the guild's entitlements.

        This is identical to :meth:`Client.entitlements` with the ``guild`` parameter.

        .. versionadded:: 2.6

        Parameters
        ----------
        skus: list[:class:`.abc.Snowflake`] | None
            Limit the fetched entitlements to entitlements that are for these SKUs.
        before: :class:`.abc.Snowflake` | :class:`datetime.datetime` | None
            Retrieves guilds before 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.
        after: :class:`.abc.Snowflake` | :class:`datetime.datetime` | None
            Retrieve guilds 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.
        limit: Optional[:class:`int`]
            The number of entitlements to retrieve.
            If ``None``, retrieves every entitlement, which may be slow.
            Defaults to ``100``.
        exclude_ended: :class:`bool`
            Whether to limit the fetched entitlements to those that have not ended.
            Defaults to ``False``.

        Yields
        ------
        :class:`.Entitlement`
            The application's entitlements.

        Raises
        ------
        :exc:`HTTPException`
            Retrieving the entitlements failed.
        N)sku_idsr   r   r-  r>  exclude_ended)r4   r   rs   )r   skusr   r   r-  r%  r"  s          rf   entitlementszGuild.entitlements  sE    X #KK04t,SVV,$WW'
 	
,s   A
)r   GuildPayloadr   rP   )r   GuildChannelrp  None)r   rH   rp  r*  )r   ri   rp  zVoiceState | None)r   r6   rp  r*  )r   MemberPayloadr   ri   r   boolrp  r6   )r   ThreadPayloadrp  rA   )r   rH   rp  r*  )r   r=   rp  r*  )r   rH   rp  r*  )r   list[ScheduledEvent]rp  r*  )r   rA   rp  r*  )r   rH   rp  r*  )rp  r*  )r   ri   rp  r*  )r   zset[int]rp  zdict[int, Thread])rp  r  )r   rV   r   ri   rp  z,tuple[Member | None, VoiceState, VoiceState])r  r<   rp  r*  )r
  ri   rp  r<   )r   r(  rp  r*  )r   r(  rp  r*  )rp  zlist[GuildChannel])rp  zlist[Thread])rp  r,  )rp  zlist[VoiceChannel])rp  zlist[StageChannel])rp  zlist[ForumChannel])rp  r6   )rp  zVoiceClient | None)rp  zlist[TextChannel])rp  zlist[CategoryChannel])rp  zlist[ByCategoryItem])rs   
int | Nonerp  zGuildChannel | Thread | None)r   ri   rp  zThread | GuildChannel | None)r   ri   rp  zGuildChannel | None)r  ri   rp  zThread | None)rp  TextChannel | None)rp  r.   )rp  ri   )rp  list[Member])r   ri   rp  Member | None)rp  
list[Role])r
  ri   rp  Role | None)rp  r<   )rp  r4  )rp  zlist[StageInstance])r  ri   rp  zStageInstance | None)rp  r2  )rp  zAsset | None)rp  zdatetime.datetime)rr   r  rp  r2  )
rr   r  r  r   r  (dict[Role | Member, PermissionOverwrite]r  Snowflake | Noner  r   )rr   r  r]   r\   r  CategoryChannel | Noner  ri   r  r  r  ri   r  r,  r  r5  rp  rM   )rr   r  r]   r\   r  r7  r  ri   rm   ri   r  ri   r  zVoiceRegion | Noner  r'   r  r5  rp  rN   )rr   r  r  r  r  ri   r  r5  r  r7  r]   r\   rp  rL   )rr   r  r]   r\   r  r7  r  ri   r  r  r  ri   r  r,  r  r5  r  zEmoji | int | strrp  rK   )
rr   r  r  r5  r]   r\   r  ri   rp  rJ   )r  r,  r]   r  rp  r*  ),r]   r\   rr   r  r|   r\   r  bytes | Noner  r8  r  r8  r  r8  r  r,  rq   zVoiceChannel | Noner  rH   rp   ri   r{   r"   ry   r&   rz   r    r  r0  r  r.   r   r  r  r0  r  r0  r   r,  r  r,  rp  rG   )rp  zSequence[GuildChannel])r-  r/  r   SnowflakeTime | Nonerp  r5   )r4  r  r-  ri   rp  r1  )r6  ri   rp  r6   )r^   rH   rp  r[   )r   ri   rp  zGuildChannel | Thread)NNN)r-  r/  r   r6  r   r6  rp  r3   )
rK  ri   rE  r,  r  list[Snowflake]r]   r\   rp  r/  )rp  zlist[Template])rp  zlist[Webhook])rK  ri   r  r:  rp  ri   )rp  zlist[Invite])rr   r  r|   r  rp  rR   )r:  r  rs   ri   rp  r*  )rp  zlist[Integration])rp  zlist[GuildSticker])rl  ri   rp  r@   )rr   r  r|   r\   rj   r  rt  r-   r]   r\   rp  r@   )rx  rH   r]   r\   rp  r*  )rp  zlist[Emoji])r  ri   rp  r   )
rr   r  r  bytesr  r3  r]   r\   rp  r   )rj   rH   r]   r\   rp  r*  )r]   r\   rr   r  r  rO   r  Colour | intr  r,  r  r,  r  r8  r  r\   rp  r<   )r]   r\   rr   r  r  rO   r  r<  r  r,  r  r,  r  r8  r  r\   rp  r<   )rr   r  r  rO   r  r<  r  r<  r  r,  r  r,  r]   r\   r  r8  r  r\   rp  r<   )r  zdict[Snowflake, int]r]   r\   rp  r3  )r^   rH   r]   r\   rp  r*  )r^   rH   r  r/  r]   r\   rp  r*  )r  rH   r  r/  r]   r\   rp  z'tuple[list[Snowflake], list[Snowflake]])rp  zInvite | None)r-  r/  r   r9  r   r9  r^   rH   r  r   rp  r2   )rp  rF   )r  r,  r   r6  rp  r*  )r  r,  rp  r*  r   )r4  r\   r-  r/  r  zlist[int] | Noner8  r,  r  r,  rp  r1  )r   zVocalGuildChannel | Noner  r,  r  r,  )r|   r\   r  z!list[WelcomeScreenChannel] | Noner  bool | Nonerp  rD   )r  r,  rp  r.  )r  ri   r  r,  rp  ScheduledEvent | None)r  ri   rp  r>  )rr   r  r|   r  r  datetimer  r?  r  z@str | int | VoiceChannel | StageChannel | ScheduledEventLocationr  r%   r]   r\   r  r;  rp  r>  )rp  r.  )rp  zlist[AutoModRule])rs   ri   rp  r   )rr   r  r  r   r  r   r  r   r  zlist[AutoModAction]r  r,  r	  r:  r
  r:  r]   r\   rp  r   )r  zlist[OnboardingPrompt] | Noner  list[Snowflake] | Noner  r=  r  zOnboardingMode | Noner]   r\   rp  r:   )rs   ri   r]   r\   rp  r*  )r"  rH   rp  r9   )NNNr   F)r&  r@  r   r9  r   r9  r-  r/  r%  r,  rp  r4   )r`   ra   rb   __doc__	__slots__rh   r   rc   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r   r0  propertyr9  r;  rF  r7  rV  rZ  r^  r`  rc  rf  ri  rw  rz  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  create_category_channelr	  r  r  r  r%  r+  r1  r3  r7  r<  rA  rC  rJ  rP  rU  rW  r\  r^  r`  rd  rh  rm  ru  ry  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%   
guild_onlyr  r  r  r  r  r  r  r  r!  r'  rd   re   rf   rG   rG      sP   jX+I\ QxPR!THMS2uxPS2uxPS2uyQFB --/*$/2@D	$
+135
*+!
	"%#%14%	5%:	$
eBPU2 - - , , 9 9     	 	 	 	 ( ( 6 6    !F?O".&," = = J J 	= 	= 
= 
= T T
 
 
 	
 	
 F F , ,* W W , ,( & &
   
 
 4 4<" . . H H 
 
 
 
 
 
 " " 8 8 ' ' - - 3 3+Vb @G%)*
*
 "*
 =	*

 #*
 *
` "+/%?Fqq 	q
 )q q q q q =q 
qn "+/!)0/6?FXX 	X
 )X X X X 'X -X =X 
X~  ?F+/!CC 	C
 C =C )C C 
CR "+/%?F4;JJ 	J
 )J J J J J =J !2J 
J` @G!.. =	.
 . . 
.` .4"5 GK P2 %")$&&)0!+2""3:0718-43: ',35<-4 '/E3 E3 	E3
  E3 E3 E3 E3 'E3 E3 )E3 E3 E3  1E3 .E3  "/!E3" +#E3$ 1%E3& 'E3( *)E3* !3+E3, '+-E3. /E30 
1E3N#*JD &*5>"5>2F5>	5>n @D M<@<
@-b !#'"&	:J:J !:J  	:J
 
:J@ %)!(!G G "	G
 G G 
GRC0H0 6=**#2*	*X@ 0766),6	6<E4"*HG0:H #' "A5 A5  	A5
 A5 A5 A5 
A5H ;?Q Q-7Q	Q8L,?F $!03 03 	03
 03 03 
03f 9=UU+5U	U6K0@  !#&"$$+  	
 !     " 
   !#&! $'  	
 !     " 
   #*%&#!$$+d d !	d
 d d d d d d "d 
dN HL@-@:D@	@D CG E< .2!,
,
 !+	,

 ,
 
,
b .2!	EE !+E 	E
 
1EN DH F4'TZ  '+&*!%J
 J
 %	J

 $J
 J
 J
 
J
X44 ")g E E3C E	 ED ,0 D: !S
 %)S
S
 	S

 #S
 S
 S
 
S
r  H *H 	H
 H448  #&>A"   <	
  
  4 457p *./"&/	/d <@33483	3j4& #$4N4Y4Y!R R 	R
 R R SR 2R R R 
Rh 5 5L(98 (,+/!C9 C9 %	C9
 )C9 1C9 %C9 C9 &C9 )C9 C9 
C9J1. 293:&&-$<0 /<0 1	<0
 <0 $<0 <0 
<0D "	WW 	W
 
W492 (,'+&*#4
$4
 %4
 $	4

 4
 4
 
4
re   rG   )rA  
__future__r   r   rq  typingr   r   r   r   r   r	   r
   r   r   r   r   r   r   assetr   automodr   r   r   r   r   r   r  r   rj   r   r   r   enumsr   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   errorsr*   r+   r,   rt  r-   flagsr.   rd  r/   r0   r[  r1   	iteratorsr2   r3   r4   r5   r   r6   r7   mixinsr8   monetizationr9   r  r:   r  r;   r  r<   r  r=   r>   r2  r?   rx  r@   r;  rA   rB   r^   rC   r  rD   rE   r  rF   __all__r  r?  rH   rI   rJ   rK   rL   rM   rN   rO   r   rP   rN  rR   types.guildrS   
BanPayloadrG   r(  rT   rU   types.memberr+  types.threadsr-  types.voicerV   rc  rW   rR  rY   VocalGuildChannelr)  ro  r[   rh   rd   re   rf   <module>rW     sJ  2 #       G G  L  1 1     B A  % ;   '  % " ,  D ) ! )  ? 

---  )&".2356,) lL89lKNL 8O4d<6HHINz 
* R>
H R>
re   