Ë
    Fü´j  ã                  óX   — d Z ddlmZ ddlmZ ddlmZ er
ddlZddlmZ  G d„ d«      Z	y)	z#Provide the MessageableMixin class.é    )Úannotations)ÚTYPE_CHECKING)ÚAPI_PATHN)Úmodelsc                  ó<   — e Zd ZU dZerded<   ddœ	 	 	 	 	 	 	 dd„Zy)ÚMessageableMixinz+Interface for classes that can be messaged.zpraw.RedditÚ_redditN)Úfrom_subredditc               óª   — ||t        | j                  dd«      › | › �dœ}|rt        |«      |d<   | j                  j	                  t
        d   |¬«       y)a°  Send a message to a :class:`.Redditor` or a :class:`.Subreddit`'s moderators (modmail).

        :param from_subreddit: A :class:`.Subreddit` instance or string to send the
            message from. When provided, messages are sent from the subreddit rather
            than from the authenticated user.

            .. note::

                The authenticated user must be a moderator of the subreddit and have the
                ``mail`` moderator permission.

        :param message: The message content.
        :param subject: The subject of the message.

        For example, to send a private message to u/spez, try:

        .. code-block:: python

            reddit.redditor("spez").message(subject="TEST", message="test message from PRAW")

        To send a message to u/spez from the moderators of r/test try:

        .. code-block:: python

            reddit.redditor("spez").message(
                subject="TEST", message="test message from r/test", from_subreddit="test"
            )

        To send a message to the moderators of r/test, try:

        .. code-block:: python

            reddit.subreddit("test").message(subject="TEST", message="test PM from PRAW")

        ÚMESSAGE_PREFIXÚ )ÚsubjectÚtextÚtoÚfrom_srÚcompose)ÚdataN)ÚgetattrÚ	__class__Ústrr	   Úpostr   )Úselfr
   Úmessager   r   s        úc/root/workspace/ytshorts/venv/lib/python3.12/site-packages/praw/models/reddit/mixins/messageable.pyr   zMessageableMixin.message   s\   € ðV ØÜ˜TŸ^™^Ð-=¸rÓBÐCÀDÀ6ÐJñ
ˆñ
 Ü! .Ó1ˆD�‰OØ�‰×Ñœ( 9Ñ-°DÐÕ9ó    )r
   zmodels.Subreddit | str | Noner   r   r   r   ÚreturnÚNone)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   © r   r   r   r      s@   … Ù5áàÓð
 9=ñ1:ð 6ð1:ð ð	1:ð
 ð1:ð 
ô1:r   r   )
r!   Ú
__future__r   Útypingr   Ú
praw.constr   Úprawr   r   r#   r   r   ú<module>r(      s$   ðÙ )å "å  å áÛÝ÷8:ò 8:r   