
    {iT+                       S r SSKJr  SSKJr  SSKJrJr  SSKJ	r	  SSK
Jr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK J!r!  \(       a  SSK"r# " S S\5      r$ " S S\\\\\\\!5	      r%g)z&Package providing reddit class mixins.    )annotations)dumps)TYPE_CHECKINGOptional   )API_PATH)_deprecate_args   )EditableMixin)FullnameMixin)GildableMixin)InboxableMixin)InboxToggleableMixin)MessageableMixin)ModNoteMixin)ReplyableMixin)ReportableMixin)SavableMixin)VotableMixinNc                      \ rS rSrSrSrSSS.S S jjrS	 r\" S
S5      SSS.S!S jj5       r	S r
S r\" SSS5      SSSS.     S"S jj5       r\" SSS5      SSS.       S#S jj5       rS rS rS rSrg)$ThingModerationMixin   zQProvides moderation methods for :class:`.Comment`\ s and :class:`.Submission`\ s.N mod_note	reason_idr   r   c                   U(       d  U(       d  Sn[        U5      eU R                  R                  /UUS.nU R                  R                  R	                  [
        S   S[        U5      0S9  g)aI  Add a removal reason for a :class:`.Comment` or :class:`.Submission`.

:param mod_note: A message for the other moderators.
:param reason_id: The removal reason ID.

It is necessary to first call :meth:`.remove` on the :class:`.Comment` or
:class:`.Submission`.

If ``reason_id`` is not specified, ``mod_note`` cannot be blank.

z6mod_note cannot be blank if reason_id is not specified)item_idsr   r   removal_reasonsjsondataN)
ValueErrorthingfullname_redditpostr   r   )selfr   r   msgr"   s        \/home/james-whalen/.local/lib/python3.13/site-packages/praw/models/reddit/mixins/__init__.py_add_removal_reason(ThingModerationMixin._add_removal_reason   sf     JCS/! ,,- "

 	

): ;65QU;BWX    c                    U R                   R                  R                  [        S   SU R                   R                  0S9  g)a  Approve a :class:`.Comment` or :class:`.Submission`.

Approving a comment or submission reverts a removal, resets the report counter,
adds a green check mark indicator (only visible to other moderators) on the
website view, and sets the ``approved_by`` attribute to the authenticated user.

Example usage:

.. code-block:: python

    # approve a comment:
    comment = reddit.comment("dkk4qjd")
    comment.mod.approve()
    # approve a submission:
    submission = reddit.submission("5or86n")
    submission.mod.approve()

approveidr!   Nr$   r&   r'   r   r%   r(   s    r*   r/   ThingModerationMixin.approve6   s5    & 	

 34ATAT:UVr-   howstickyyesF)r4   r5   c                   XR                   R                  S.nU(       a!  [        U R                   SS5      (       a  SUS'   U R                   R                  R	                  [
        S   US9  g)	aZ  Distinguish a :class:`.Comment` or :class:`.Submission`.

:param how: One of ``"yes"``, ``"no"``, ``"admin"``, or ``"special"``. ``"yes"``
    adds a moderator level distinguish. ``"no"`` removes any distinction.
    ``"admin"`` and ``"special"`` require special user privileges to use
    (default ``"yes"``).
:param sticky: :class:`.Comment` is stickied if ``True``, placing it at the top
    of the comment page regardless of score. If thing is not a top-level
    comment, this parameter is silently ignored (default ``False``).

Example usage:

.. code-block:: python

    # distinguish and sticky a comment:
    comment = reddit.comment("dkk4qjd")
    comment.mod.distinguish(sticky=True)
    # undistinguish a submission:
    submission = reddit.submission("5or86n")
    submission.mod.distinguish(how="no")

.. seealso::

    :meth:`.undistinguish`

)r4   r0   is_rootFTr5   distinguishr!   N)r$   r%   getattrr&   r'   r   )r(   r4   r5   r"   s       r*   r9    ThingModerationMixin.distinguishK   sV    8 **"5"56gdjj)U;;!DN

 7dCr-   c                    U R                   R                  R                  [        S   SU R                   R                  0S9  g)a  Ignore future reports on a :class:`.Comment` or :class:`.Submission`.

Calling this method will prevent future reports on this :class:`.Comment` or
:class:`.Submission` from both triggering notifications and appearing in the
various moderation listings. The report count will still increment on the
:class:`.Comment` or :class:`.Submission`.

Example usage:

.. code-block:: python

    # ignore future reports on a comment:
    comment = reddit.comment("dkk4qjd")
    comment.mod.ignore_reports()
    # ignore future reports on a submission:
    submission = reddit.submission("5or86n")
    submission.mod.ignore_reports()

.. seealso::

    :meth:`.unignore_reports`

ignore_reportsr0   r!   Nr1   r2   s    r*   r=   #ThingModerationMixin.ignore_reportsl   s;    0 	

%&dDJJ4G4G-H 	  	
r-   c                    U R                   R                  R                  [        S   SU R                   R                  0S9  g)a4  Lock a :class:`.Comment` or :class:`.Submission`.

Example usage:

.. code-block:: python

    # lock a comment:
    comment = reddit.comment("dkk4qjd")
    comment.mod.lock()
    # lock a submission:
    submission = reddit.submission("5or86n")
    submission.mod.lock()

.. seealso::

    :meth:`.unlock`

lockr0   r!   Nr1   r2   s    r*   r@   ThingModerationMixin.lock   s5    & 	

 0djj>Q>Q7RSr-   spam)r   rB   r   c                   U R                   R                  [        U5      S.nU R                   R                  R	                  [
        S   US9  [        X1/5      (       a  U R                  XS9  gg)aH  Remove a :class:`.Comment` or :class:`.Submission`.

:param mod_note: A message for the other moderators.
:param spam: When ``True``, use the removal to help train the
    :class:`.Subreddit`'s spam filter (default: ``False``).
:param reason_id: The removal reason ID.

If either ``reason_id`` or ``mod_note`` are provided, a second API call is made
to add the removal reason.

Example usage:

.. code-block:: python

    # remove a comment and mark as spam:
    comment = reddit.comment("dkk4qjd")
    comment.mod.remove(spam=True)
    # remove a submission
    submission = reddit.submission("5or86n")
    submission.mod.remove()
    # remove a submission with a removal reason
    reason = reddit.subreddit.mod.removal_reasons["110ni21zo23ql"]
    submission = reddit.submission("5or86n")
    submission.mod.remove(reason_id=reason.id)

)r0   rB   remover!   r   N)r$   r%   boolr&   r'   r   anyr+   )r(   r   rB   r   r"   s        r*   rD   ThingModerationMixin.remove   sb    < jj))4:>

 2>	$%%$$h$L &r-   messagetitletypeignoredpublic)rI   rJ   c                  U R                   c  Sn[        U5      e[        U R                      nU R                  R                  /UUUS.nU R                  R
                  R                  US[        U5      0S9=(       d    S$ )ac  Send a removal message for a :class:`.Comment` or :class:`.Submission`.

.. warning::

    The object has to be removed before giving it a removal reason. Remove the
    object with :meth:`.remove`. Trying to add a removal reason without removing
    the object will result in :class:`.RedditAPIException` being thrown with an
    ``INVALID_ID`` error_type.

Reddit adds human-readable information about the object to the message.

:param type: One of ``"public"``, ``"public_as_subreddit"``, ``"private"``, or
    ``"private_exposed"``. ``"public"`` leaves a stickied comment on the post.
    ``"public_as_subreddit"`` leaves a stickied comment on the post with the
    u/subreddit-ModTeam account. ``"private"`` sends a modmail message with
    hidden username. ``"private_exposed"`` sends a modmail message without
    hidden username (default: ``"public"``).
:param title: The short reason given in the message. Ignored if type is
    ``"public"`` or ``"public_as_subreddit"``.
:param message: The body of the message.

:returns: The new :class:`.Comment` if ``type`` is ``"public"`` or
    ``"public_as_subreddit"``.

Nz&ThingModerationMixin must be extended.)item_idrH   rI   rJ   r    r!   )REMOVAL_MESSAGE_APINotImplementedErrorr   r$   r%   r&   r'   r   )r(   rH   rI   rJ   r)   urlr"   s          r*   send_removal_message)ThingModerationMixin.send_removal_message   s    F ##+:C%c**t//0 

++,	
 zz!!&&s&%+1F&GO4Or-   c                "    U R                  SS9  g)a  Remove mod, admin, or special distinguishing from an object.

Also unstickies the object if applicable.

Example usage:

.. code-block:: python

    # undistinguish a comment:
    comment = reddit.comment("dkk4qjd")
    comment.mod.undistinguish()
    # undistinguish a submission:
    submission = reddit.submission("5or86n")
    submission.mod.undistinguish()

.. seealso::

    :meth:`.distinguish`

no)r4   N)r9   r2   s    r*   undistinguish"ThingModerationMixin.undistinguish   s    * 	T"r-   c                    U R                   R                  R                  [        S   SU R                   R                  0S9  g)a%  Resume receiving future reports on a :class:`.Comment` or :class:`.Submission`.

Future reports on this :class:`.Comment` or :class:`.Submission` will cause
notifications, and appear in the various moderation listings.

Example usage:

.. code-block:: python

    # accept future reports on a comment:
    comment = reddit.comment("dkk4qjd")
    comment.mod.unignore_reports()
    # accept future reports on a submission:
    submission = reddit.submission("5or86n")
    submission.mod.unignore_reports()

.. seealso::

    :meth:`.ignore_reports`

unignore_reportsr0   r!   Nr1   r2   s    r*   rY   %ThingModerationMixin.unignore_reports	  s;    , 	

'(djj6I6I/J 	  	
r-   c                    U R                   R                  R                  [        S   SU R                   R                  0S9  g)a<  Unlock a :class:`.Comment` or :class:`.Submission`.

Example usage:

.. code-block:: python

    # unlock a comment:
    comment = reddit.comment("dkk4qjd")
    comment.mod.unlock()
    # unlock a submission:
    submission = reddit.submission("5or86n")
    submission.mod.unlock()

.. seealso::

    :meth:`.lock`

unlockr0   r!   Nr1   r2   s    r*   r\   ThingModerationMixin.unlock#  s5    & 	

 2$

@S@S9TUr-    )r   strr   
str | None)r4   r_   r5   rE   )r   r_   rB   rE   r   r`   )rH   r_   rI   r_   rJ   r_   returnzpraw.models.Comment | None)__name__
__module____qualname____firstlineno____doc__rO   r+   r/   r	   r9   r=   r@   rD   rR   rV   rY   r\   __static_attributes__r^   r-   r*   r   r      s    \57QU Y.W* UH%(-e D &D@
8T* VZ5!#%QU M M+/ MDN M 6 MD Y0
 /P /P 	/P
 /P 
$/P 1/Pb#.
4Vr-   r   c                      \ rS rSrSrSrg)UserContentMixini9  zBA convenience mixin that applies to both Comments and Submissions.r^   N)rb   rc   rd   re   rf   rg   r^   r-   r*   ri   ri   9  s     Mr-   ri   )&rf   
__future__r   r    r   typingr   r   constr   utilr	   editabler   r%   r   gildabler   	inboxabler   inboxtoggleabler   messageabler   modnoter   	replyabler   
reportabler   savabler   votabler   praw.modelsprawr   ri   r^   r-   r*   <module>rz      sp    , "  *  $ # # # % 1 ) ! % ' ! !\V< \V~	M	Mr-   