
    N[i                          d dl Z d dlZd dlmZ d dlmZmZmZmZ d dlZd dlm	Z	 d dlm
Z
 d dlmZ d dlmZ d dlmZ d d	lmZ  G d
 d      Zy)    N)datetime)UnionBinaryIOOptionalCallable)StopTransmission)raw)types)utils)FilePartMissing)FileTypec                   p    e Zd Z	 	 	 	 	 	 	 ddddeeef   deeef   dededed	ed
ed   de	de
ded   fdZy)SendStickerNselfzpyrogram.Clientchat_idstickerdisable_notificationreply_to_message_idschedule_dateprotect_contentreply_markup)ztypes.InlineKeyboardMarkupztypes.ReplyKeyboardMarkupztypes.ReplyKeyboardRemoveztypes.ForceReplyprogressprogress_argsreturnztypes.Messagec
                   K   d}
	 t        |t              r	t        j                  j	                  |      r| j                  |||	       d{   }
t        j                  j                  | j                  |      xs d|
t        j                  j                  t        j                  j                  |            g      }nt        j                  d|      r!t        j                  j                  |      }nt        j                   |t"        j$                        }n| j                  |||	       d{   }
t        j                  j                  | j                  |j&                        xs d|
t        j                  j                  |j&                        g      }	 	 | j)                  t        j*                  j,                  j/                  | j1                  |       d{   ||xs d|| j3                         t        j4                  |      ||r|j7                  |        d{   ndd		             d{   }|j8                  D ]  }t        |t        j                  j:                  t        j                  j<                  t        j                  j>                  f      s[t        j@                  jC                  | |jD                  |jF                  D ci c]  }|jH                  | c}|jJ                  D ci c]  }|jH                  | c}t        t        j                  j>                        
       d{   c S  	 7 7 7 o7 -7 c c}w c c}w 7 ## tL        $ r;}| j                  ||
jH                  |jN                         d{  7   Y d}~\d}~ww xY w# tP        $ r Y yw xY ww)a(  Send static .webp or animated .tgs stickers.

        .. include:: /_includes/usable-by/users-bots.rst

        Parameters:
            chat_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the target chat.
                For your personal cloud (Saved Messages) you can simply use "me" or "self".
                For a contact that exists in your Telegram address book you can use his phone number (str).

            sticker (``str`` | ``BinaryIO``):
                Sticker to send.
                Pass a file_id as string to send a sticker that exists on the Telegram servers,
                pass an HTTP URL as a string for Telegram to get a .webp sticker file from the Internet,
                pass a file path as string to upload a new sticker that exists on your local machine, or
                pass a binary file-like object with its attribute ".name" set for in-memory uploads.

            disable_notification (``bool``, *optional*):
                Sends the message silently.
                Users will receive a notification with no sound.

            reply_to_message_id (``int``, *optional*):
                If the message is a reply, ID of the original message.

            schedule_date (:py:obj:`~datetime.datetime`, *optional*):
                Date when the message will be automatically sent.

            protect_content (``bool``, *optional*):
                Protects the contents of the sent message from forwarding and saving.

            reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*):
                Additional interface options. An object for an inline keyboard, custom reply keyboard,
                instructions to remove reply keyboard or to force a reply from the user.

            progress (``Callable``, *optional*):
                Pass a callback function to view the file transmission progress.
                The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
                detailed description) and will be called back each time a new file chunk has been successfully
                transmitted.

            progress_args (``tuple``, *optional*):
                Extra custom arguments for the progress callback function.
                You can pass anything you need to be available in the progress callback scope; for example, a Message
                object or a Client instance in order to edit the message with the updated progress status.

        Other Parameters:
            current (``int``):
                The amount of bytes transmitted so far.

            total (``int``):
                The total size of the file.

            *args (``tuple``, *optional*):
                Extra custom arguments as defined in the ``progress_args`` parameter.
                You can either keep ``*args`` or add every single extra argument in your function signature.

        Returns:
            :obj:`~pyrogram.types.Message` | ``None``: On success, the sent sticker message is returned, otherwise,
            in case the upload is deliberately stopped with :meth:`~pyrogram.Client.stop_transmission`, None is
            returned.

        Example:
            .. code-block:: python

                # Send sticker by uploading from local file
                await app.send_sticker("me", "sticker.webp")

                # Send sticker using file_id
                await app.send_sticker("me", file_id)
        N)r   r   z
image/webp)	file_name)	mime_typefile
attributesz
^https?://)url )	peermediasilentreply_to_msg_id	random_idr   
noforwardsr   message)is_scheduled)file_id	file_part))
isinstancestrospathisfile	save_filer	   r
   InputMediaUploadedDocumentguess_mime_typeDocumentAttributeFilenamebasenamerematchInputMediaDocumentExternalr   get_input_media_from_file_idr   STICKERnameinvoke	functionsmessages	SendMediaresolve_peerrnd_iddatetime_to_timestampwriteupdatesUpdateNewMessageUpdateNewChannelMessageUpdateNewScheduledMessageMessage_parser(   usersidchatsr   valuer   )r   r   r   r   r   r   r   r   r   r   r   r#   ries                  Y/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/messages/send_sticker.pysend_stickerzSendSticker.send_sticker"   s    n 8	'3'77>>'*!%(Zg!hhDII@@"&"6"6w"?"O<!II??"''JZJZ[bJc?d$ A E XXlG4II@@# A E ">>wHXHXYE!^^GhVc^dd		<<"227<<@PL		;;gll;S  =  "kk..88'+'8'8'A!A"'#7#?4,?&*kkm*/*E*Em*T'6KW|/A/A$/G)G)G]a$& 9 
 A  YY 	%a#))*D*D*-))*K*K*-))*M*M*O P */)=)= $aii23'' :Qq :23'' :Qq :-7399;^;^-_	 *> * $ 		% 1 i e "B *H, !; :$ ' V..$''QWW.UUUV   		s   OAN3 MC)N3 7M8A-N3 &AM, (M)AM, -M.M, MM, A&N3 -3N3  M 4N3 M%.N3 M*N3 ON3 N3 M, M, M,  N3 ,	N05+N+ N#!N+&N3 +N00N3 3	N?<O>N??O)NNNNNN )__name__
__module____qualname__r   intr-   r   boolr   r   tupler   rR   rS       rQ   r   r   !   s    
 &*#'"& $ !!QQsCxQ sH}%Q #	Q
 !Q  Q Q 
Q Q Q  
/	"!QrZ   r   )r.   r6   r   typingr   r   r   r   pyrogramr   r	   r
   r   pyrogram.errorsr   pyrogram.file_idr   r   rS   rZ   rQ   <module>r_      s7   & 
 	  6 6  %    + %R RrZ   