
    PjF5                        d Z ddlmZ ddlmZmZmZmZmZm	Z	 ddl
mZ dZ G d d      Z G d	 d
e      Z G d de      Z G d de      Z G d d      Zy)a:  
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

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

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

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
    )annotations)DictIteratorListLiteralOptionalTuple   )ConnectionState)SearchAuthorType	SearchHasSearchEmbedTypeSearchResultc                       e Zd ZdZddZddZy)_BaseSearchTypevaluec                    i | _         y Nr   selfs    A/root/.hermes/venv/lib/python3.12/site-packages/discord/search.py__init__z_BaseSearchType.__init__)   s	    &(
    c              #  l   K   | j                   j                         D ]  \  }}|r| d|   y w)N-)r   items)r   keyr   s      r   __iter__z_BaseSearchType.__iter__,   s9     ****, 	 JC	#i		 s   24N)returnNone)r    zIterator[str])__name__
__module____qualname__	__slots__r   r    r   r   r   r   &   s    I) r   r   c                       e Zd ZdZdZddddd fdZedd       Zej                  dd       Zedd       Z	e	j                  dd	       Z	edd
       Z
e
j                  dd       Z
 xZS )r   a  Represents the search ``author_type`` filter.

    .. versionadded:: 2.7

    Parameters
    ----------
    user: Optional[:class:`bool`]
        Whether to include regular users in the search. This can be ``False`` to exclude instead.
    bot: Optional[:class:`bool`]
        Whether to include bots in the search. This can be ``False`` to exclude instead.
    webhook: Optional[:class:`bool`]
        Whether to include webhooks in the search. This can be ``False`` to exclude instead.
    r&   N)userbotwebhookc                   t         |           ||| j                  d<   ||| j                  d<   ||| j                  d<   y y )Nr(   r)   r*   superr   r   )r   r(   r)   r*   	__class__s       r   r   zSearchAuthorType.__init__E   sN    !%DJJv? #DJJu$+DJJy! r   c                :    | j                   j                  dd      S )zAOptional[bool]: Whether regular users are included in the search.r(   Nr   getr   s    r   r(   zSearchAuthorType.userO        zz~~fd++r   c                `    || j                   j                  dd        y || j                   d<   y )Nr(   r   popr   r   s     r   r(   zSearchAuthorType.userT   '    =JJNN64(!&DJJvr   c                :    | j                   j                  dd      S )z8Optional[bool]: Whether bots are included in the search.r)   Nr0   r   s    r   r)   zSearchAuthorType.bot[        zz~~eT**r   c                `    || j                   j                  dd        y || j                   d<   y )Nr)   r4   r6   s     r   r)   zSearchAuthorType.bot`   s'    =JJNN5$' %DJJur   c                :    | j                   j                  dd      S )z<Optional[bool]: Whether webhooks are included in the search.r*   Nr0   r   s    r   r*   zSearchAuthorType.webhookg        zz~~i..r   c                `    || j                   j                  dd        y || j                   d<   y )Nr*   r4   r6   s     r   r*   zSearchAuthorType.webhookl   '    =JJNN9d+$)DJJy!r   )r(   Optional[bool]r)   r?   r*   r?   r    r!   r    r?   r   r?   r    r!   )r"   r#   r$   __doc__r%   r   propertyr(   setterr)   r*   __classcell__r.   s   @r   r   r   4   s     I15Tmq , , , 
[[' ' + + 	ZZ& & / / ^^* *r   r   c            
      X    e Zd ZdZdddddddddd		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZedd       Zej                  dd       Zedd       Zej                  dd       Zedd	       Z	e	j                  dd
       Z	edd       Z
e
j                  dd       Z
edd       Zej                  dd       Zedd       Zej                  dd       Zedd       Zej                  dd       Zedd       Zej                  dd       Zedd       Zej                  dd       Z xZS )r   a  Represents the search ``has`` filter.

    .. versionadded:: 2.7

    Parameters
    ----------
    link: Optional[:class:`bool`]
        Whether to include messages with a link. This can be ``False`` to exclude instead.
    embed: Optional[:class:`bool`]
        Whether to include messages with an embed. This can be ``False`` to exclude instead.
    file: Optional[:class:`bool`]
        Whether to include messages with an uploaded file. This can be ``False`` to exclude instead.
    image: Optional[:class:`bool`]
        Whether to include messages with an image. This can be ``False`` to exclude instead.
    video: Optional[:class:`bool`]
        Whether to include messages with a video. This can be ``False`` to exclude instead.
    sound: Optional[:class:`bool`]
        Whether to include messages with an uploaded audio file. This can be ``False`` to exclude instead.
    sticker: Optional[:class:`bool`]
        Whether to include messages with a sticker. This can be ``False`` to exclude instead.
    poll: Optional[:class:`bool`]
        Whether to include messages with a poll. This can be ``False`` to exclude instead.
    snapshot: Optional[:class:`bool`]
        Whether to include messages with a forwarded message. This can be ``False`` to exclude instead.
    N)	linkembedfileimagevideosoundstickerpollsnapshotc       	        V   t         
|           ||| j                  d<   ||| j                  d<   ||| j                  d<   ||| j                  d<   ||| j                  d<   ||| j                  d<   ||| j                  d<   ||| j                  d<   |	|	| j                  d	<   y y )
NrH   rI   rJ   rK   rL   rM   rN   rO   rP   r,   )r   rH   rI   rJ   rK   rL   rM   rN   rO   rP   r.   s             r   r   zSearchHas.__init__   s     	!%DJJv"'DJJw!%DJJv"'DJJw"'DJJw"'DJJw$+DJJy!!%DJJv%-DJJz"  r   c                :    | j                   j                  dd      S )zAOptional[:class:`bool`]: Whether to include messages with a link.rH   Nr0   r   s    r   rH   zSearchHas.link   r2   r   c                `    || j                   j                  dd        y || j                   d<   y )NrH   r4   r6   s     r   rH   zSearchHas.link   r7   r   c                :    | j                   j                  dd      S )zCOptional[:class:`bool`]: Whether to include messages with an embed.rI   Nr0   r   s    r   rI   zSearchHas.embed        zz~~gt,,r   c                `    || j                   j                  dd        y || j                   d<   y )NrI   r4   r6   s     r   rI   zSearchHas.embed   '    =JJNN7D)"'DJJwr   c                :    | j                   j                  dd      S )zKOptional[:class:`bool`]: Whether to include messages with an uploaded file.rJ   Nr0   r   s    r   rJ   zSearchHas.file   r2   r   c                `    || j                   j                  dd        y || j                   d<   y )NrJ   r4   r6   s     r   rJ   zSearchHas.file   r7   r   c                :    | j                   j                  dd      S )zCOptional[:class:`bool`]: Whether to include messages with an image.rK   Nr0   r   s    r   rK   zSearchHas.image   rU   r   c                `    || j                   j                  dd        y || j                   d<   y )NrK   r4   r6   s     r   rK   zSearchHas.image   rW   r   c                :    | j                   j                  dd      S )zBOptional[:class:`bool`]: Whether to include messages with a video.rL   Nr0   r   s    r   rL   zSearchHas.video   rU   r   c                `    || j                   j                  dd        y || j                   d<   y )NrL   r4   r6   s     r   rL   zSearchHas.video   rW   r   c                :    | j                   j                  dd      S )zQOptional[:class:`bool`]: Whether to include messages with an uploaded audio file.rM   Nr0   r   s    r   rM   zSearchHas.sound   rU   r   c                `    || j                   j                  dd        y || j                   d<   y )NrM   r4   r6   s     r   rM   zSearchHas.sound   rW   r   c                :    | j                   j                  dd      S )zDOptional[:class:`bool`]: Whether to include messages with a sticker.rN   Nr0   r   s    r   rN   zSearchHas.sticker   r<   r   c                `    || j                   j                  dd        y || j                   d<   y )NrN   r4   r6   s     r   rN   zSearchHas.sticker   r>   r   c                :    | j                   j                  dd      S )zAOptional[:class:`bool`]: Whether to include messages with a poll.rO   Nr0   r   s    r   rO   zSearchHas.poll  r2   r   c                `    || j                   j                  dd        y || j                   d<   y )NrO   r4   r6   s     r   rO   zSearchHas.poll	  r7   r   c                :    | j                   j                  dd      S )zNOptional[:class:`bool`]: Whether to include messages with a forwarded message.rP   Nr0   r   s    r   rP   zSearchHas.snapshot  s     zz~~j$//r   c                `    || j                   j                  dd        y || j                   d<   y )NrP   r4   r6   s     r   rP   zSearchHas.snapshot  s'    =JJNN:t,%*DJJz"r   )rH   r?   rI   r?   rJ   r?   rK   r?   rL   r?   rM   r?   rN   r?   rO   r?   rP   r?   r    r!   r@   rA   )r"   r#   r$   rB   r   rC   rH   rD   rI   rJ   rK   rL   rM   rN   rO   rP   rE   rF   s   @r   r   r   t   s   :  $ $# $ $ $"&##'. . 	.
 . . . .  . . !. 
.B , , 
[[' ' - - \\( ( , , 
[[' ' - - \\( ( - - \\( ( - - \\( ( / / ^^* * , , 
[[' ' 0 0 __+ +r   r   c                  `    e Zd ZdZdddddd	 	 	 	 	 	 	 	 	 	 	 d fdZedd       Zej                  dd       Zedd       Zej                  dd       Zedd	       Z	e	j                  dd
       Z	edd       Z
e
j                  dd       Z
edd       Zej                  dd       Z xZS )r   a  Represents the search ``embed_type`` filter.

    .. versionadded:: 2.7

    Parameters
    ----------
    image: Optional[:class:`bool`]
        Whether to include image embeds. This *cannot* be ``False`` to exclude.
    video: Optional[:class:`bool`]
        Whether to include video embeds. This *cannot* be ``False`` to exclude.
    gif: Optional[:class:`bool`]
        Whether to include gif embeds. This *cannot* be ``False`` to exclude.
    sound: Optional[:class:`bool`]
        Whether to include sound embeds. This *cannot* be ``False`` to exclude.
    article: Optional[:class:`bool`]
        Whether to include article embeds. This *cannot* be ``False`` to exclude.
    N)rK   rL   gifrM   articlec                   t         |           |rd| j                  d<   |rd| j                  d<   |rd| j                  d<   |rd| j                  d<   |rd| j                  d<   y y )NTrK   rL   rg   rM   rh   r,   )r   rK   rL   rg   rM   rh   r.   s         r   r   zSearchEmbedType.__init__0  sj     	"&DJJw"&DJJw $DJJu"&DJJw$(DJJy! r   c                :    | j                   j                  dd      S )zIOptional[:class:`bool`]: Whether image embeds are included in the search.rK   Nr0   r   s    r   rK   zSearchEmbedType.imageF  rU   r   c                `    |rd| j                   d<   y | j                   j                  dd        y )NTrK   r4   r6   s     r   rK   zSearchEmbedType.imageK  %    "&DJJwJJNN7D)r   c                :    | j                   j                  dd      S )zIOptional[:class:`bool`]: Whether video embeds are included in the search.rL   Nr0   r   s    r   rL   zSearchEmbedType.videoR  rU   r   c                `    |rd| j                   d<   y | j                   j                  dd        y )NTrL   r4   r6   s     r   rL   zSearchEmbedType.videoW  rl   r   c                :    | j                   j                  dd      S )zGOptional[:class:`bool`]: Whether gif embeds are included in the search.rg   Nr0   r   s    r   rg   zSearchEmbedType.gif^  r9   r   c                `    |rd| j                   d<   y | j                   j                  dd        y )NTrg   r4   r6   s     r   rg   zSearchEmbedType.gifc  s%     $DJJuJJNN5$'r   c                :    | j                   j                  dd      S )zIOptional[:class:`bool`]: Whether sound embeds are included in the search.rM   Nr0   r   s    r   rM   zSearchEmbedType.soundj  rU   r   c                `    |rd| j                   d<   y | j                   j                  dd        y )NTrM   r4   r6   s     r   rM   zSearchEmbedType.soundo  rl   r   c                :    | j                   j                  dd      S )zKOptional[:class:`bool`]: Whether article embeds are included in the search.rh   Nr0   r   s    r   rh   zSearchEmbedType.articlev  r<   r   c                `    |rd| j                   d<   y | j                   j                  dd        y )NTrh   r4   r6   s     r   rh   zSearchEmbedType.article{  s%    $(DJJy!JJNN9d+r   )rK   Literal[True, None]rL   ru   rg   ru   rM   ru   rh   ru   r    r!   r@   )r   ru   r    r!   )r"   r#   r$   rB   r   rC   rK   rD   rL   rg   rM   rh   rE   rF   s   @r   r   r     s6   * &*%)#'%)'+) #) #	)
 !) #) %) 
), - - \\* * - - \\* * + + 	ZZ( ( - - \\* * / / ^^, ,r   r   c                  (    e Zd Z	 	 	 	 	 	 	 	 	 	 ddZy)_SearchResultFuturec               <    || _         || _        || _        || _        y r   )paramsstatelimitwait_for_index)r   rz   ry   r{   r|   s        r   r   z_SearchResultFuture.__init__  s!     .4&+
$)
$2r   N)
rz   r   ry   zList[Tuple[str, str]]r{   zOptional[int]r|   boolr    r!   )r"   r#   r$   r   r&   r   r   rw   rw     s9    3 3 &	3
 3 3 
3r   rw   N)rB   
__future__r   typingr   r   r   r   r   r	   rz   r   __all__r   r   r   r   rw   r&   r   r   <module>r      s^   0 # A A "   =* =*@f+ f+Rc,o c,r3 3r   