o
    2g`                     @  sF   d Z ddlmZ ddlmZ ddlmZ erddlZG dd dZ	dS )	z!Provide the ReplyableMixin class.    )annotations)TYPE_CHECKING   )API_PATHNc                   @  s   e Zd ZdZd	ddZdS )
ReplyableMixinzBInterface for :class:`.RedditBase` classes that can be replied to.bodystrreturn0praw.models.Comment | praw.models.Message | Nonec                 C  s@   || j d}| jjtd |d}z|d W S  ty   Y dS w )a  Reply to the object.

        :param body: The Markdown formatted content for a comment.

        :returns: A :class:`.Comment` or :class:`.Message` object for the newly created
            comment or message or ``None`` if Reddit doesn't provide one.

        :raises: ``prawcore.exceptions.Forbidden`` when attempting to reply to some
            items, such as locked submissions/comments or non-replyable messages.

        A ``None`` value can be returned if the target is a comment or submission in a
        quarantined subreddit and the authenticated user has not opt-ed into viewing the
        content. When this happens the comment will be successfully created on Reddit
        and can be retried by drawing the comment from the user's comment history.

        Example usage:

        .. code-block:: python

            submission = reddit.submission("5or86n")
            submission.reply("reply")

            comment = reddit.comment("dxolpyc")
            comment.reply("reply")

        )textthing_idcomment)datar   N)fullname_redditpostr   
IndexError)selfr   r   comments r   [/home/garg/my-data/venv/lib/python3.10/site-packages/praw/models/reddit/mixins/replyable.pyreply   s   
zReplyableMixin.replyN)r   r   r	   r
   )__name__
__module____qualname____doc__r   r   r   r   r   r      s    r   )
r   
__future__r   typingr   constr   praw.modelsprawr   r   r   r   r   <module>   s    