
    {i*                        S r SSKJr  SSKrSSKJrJrJr  SSKJ	r	  SSK
Jr  SS	KJrJr  \(       a  SSKr " S
 S\5      r " S S\5      rg)z*Provide the :class:`.UserSubreddit` class.    )annotationsN)TYPE_CHECKINGAnyCallable)warn   )cachedproperty   )	SubredditSubredditModerationc                  b   ^  \ rS rSrSr\SS j5       r\S	S j5       rS
S jr	SU 4S jjr
SrU =r$ )UserSubreddit   a  A class for :class:`.User` Subreddits.

To obtain an instance of this class execute:

.. code-block:: python

    subreddit = reddit.user.me().subreddit

.. include:: ../../typical_attributes.rst

========================= ==========================================================
Attribute                 Description
========================= ==========================================================
``can_assign_link_flair`` Whether users can assign their own link flair.
``can_assign_user_flair`` Whether users can assign their own user flair.
``created_utc``           Time the subreddit was created, represented in `Unix
                          Time`_.
``description``           Subreddit description, in Markdown.
``description_html``      Subreddit description, in HTML.
``display_name``          Name of the subreddit.
``id``                    ID of the subreddit.
``name``                  Fullname of the subreddit.
``over18``                Whether the subreddit is NSFW.
``public_description``    Description of the subreddit, shown in searches and on the
                          "You must be invited to visit this community" page (if
                          applicable).
``spoilers_enabled``      Whether the spoiler tag feature is enabled.
``subscribers``           Count of subscribers. This will be ``0`` unless unless the
                          authenticated user is a moderator.
``user_is_banned``        Whether the authenticated user is banned.
``user_is_moderator``     Whether the authenticated user is a moderator.
``user_is_subscriber``    Whether the authenticated user is subscribed.
========================= ==========================================================

.. _unix time: https://en.wikipedia.org/wiki/Unix_time

c                   ^  SU 4S jjnU$ )z.Show deprecation notice for dict only methods.c                 N   > [        STR                   S3[        SS9  T" U 0 UD6$ )NzT'Redditor.subreddit' is no longer a dict and is now an UserSubreddit object. Using 'z.' is deprecated and will be removed in PRAW 8.   category
stacklevel)r   __name__DeprecationWarning)argskwargsfuncs     [/home/james-whalen/.local/lib/python3.13/site-packages/praw/models/reddit/user_subreddit.pywrapper7UserSubreddit._dict_deprecated_wrapper.<locals>.wrapper;   s=    ##'==/ 2 , (((    )r   r   r   r    )r   r   s   ` r   _dict_deprecated_wrapper&UserSubreddit._dict_deprecated_wrapper7   s    	) r   c                    [        U 5      $ )zProvide an instance of :class:`.UserSubredditModeration`.

For example, to update the authenticated user's display name:

.. code-block:: python

    reddit.user.me().subreddit.mod.update(title="New display name")

)UserSubredditModeration)selfs    r   modUserSubreddit.modG   s     't,,r   c                6    [        S[        SS9  [        X5      $ )z8Show deprecation notice for dict method ``__getitem__``.z'Redditor.subreddit' is no longer a dict and is now an UserSubreddit object. Accessing attributes using string indices is deprecated.r   r   )r   r   getattr)r$   items     r   __getitem__UserSubreddit.__getitem__T   s#    P'		
 t""r   c                   > SS jn[         R                  " [        US9 H=  u  pVUS:w  d  M  [        U UU R	                  [        U R                  U5      5      5        M?     [        TU ]   " U/UQ70 UD6  g)a  Initialize an :class:`.UserSubreddit` instance.

:param reddit: An instance of :class:`.Reddit`.

.. note::

    This class should not be initialized directly. Instead, obtain an instance
    via: ``reddit.user.me().subreddit`` or
    ``reddit.redditor("redditor_name").subreddit``.

c                    [        U SS 5      nU[        [        5      [        [        5      -   ;  =(       a    U[        [        5      ;   $ )Nr   )r(   dirobjectr   dict)r)   names     r   	predicate)UserSubreddit.__init__.<locals>.predicatek   s6    4T2Ds6{S^;;QD	@QQr   )r2   r*   N)r)   str)	inspect
getmembersr0   setattrr    r(   __dict__super__init__)r$   redditr   r   r2   r1   _member	__class__s          r   r:   UserSubreddit.__init__^   sm    	R %//	JMD}$11'$--2NO K 	1$1&1r   r   )r   r   returnr   )r?   z9praw.models.reddit.user_subreddit.UserSubredditModeration)r)   r4   r?   r   )r;   zpraw.Redditr   r   r   r   )r   
__module____qualname____firstlineno____doc__staticmethodr    r	   r%   r*   r:   __static_attributes____classcell__)r=   s   @r   r   r      s@    $L   
- 
-#2 2r   r   c                  "    \ rS rSrSrSS jrSrg)r#   {   zProvides a set of moderation functions to a :class:`.UserSubreddit`.

For example, to accept a moderation invite from the user subreddit of u/spez:

.. code-block:: python

    reddit.subreddit("test").mod.accept_invite()

c                   U R                  5       nSSSSSSS.nUR                  5        H  u  pEUR                  U5      X$'   M     UR                  U5        [        R
                  " S	SU R                  R                  0UD6$ )
a  Update the :class:`.Subreddit`'s settings.

:param all_original_content: Mandate all submissions to be original content
    only.
:param allow_chat_post_creation: Allow users to create chat submissions.
:param allow_images: Allow users to upload images using the native image
    hosting.
:param allow_polls: Allow users to post polls to the subreddit.
:param allow_post_crossposts: Allow users to crosspost submissions from other
    subreddits.
:param allow_top: Allow the subreddit to appear on r/all as well as the default
    and trending lists.
:param allow_videos: Allow users to upload videos using the native image
    hosting.
:param collapse_deleted_comments: Collapse deleted and removed comments on
    comments pages by default.
:param crowd_control_chat_level: Controls the crowd control level for chat
    rooms. Goes from 0-3.
:param crowd_control_level: Controls the crowd control level for submissions.
    Goes from 0-3.
:param crowd_control_mode: Enables/disables crowd control.
:param comment_score_hide_mins: The number of minutes to hide comment scores.
:param description: Shown in the sidebar of your subreddit.
:param disable_contributor_requests: Specifies whether redditors may send
    automated modmail messages requesting approval as a submitter.
:param exclude_banned_modqueue: Exclude posts by site-wide banned users from
    modqueue/unmoderated.
:param free_form_reports: Allow users to specify custom reasons in the report
    menu.
:param header_hover_text: The text seen when hovering over the snoo.
:param hide_ads: Don't show ads within this subreddit. Only applies to
    Premium-user only subreddits.
:param key_color: A 6-digit rgb hex color (e.g., ``"#AABBCC"``), used as a
    thematic color for your subreddit on mobile.
:param lang: A valid IETF language tag (underscore separated).
:param link_type: The types of submissions users can make. One of ``"any"``,
    ``"link"``, or ``"self"``.
:param original_content_tag_enabled: Enables the use of the ``original content``
    label for submissions.
:param over_18: Viewers must be over 18 years old (i.e., NSFW).
:param public_description: Public description blurb. Appears in search results
    and on the landing page for private subreddits.
:param public_traffic: Make the traffic stats page public.
:param restrict_commenting: Specifies whether approved users have the ability to
    comment.
:param restrict_posting: Specifies whether approved users have the ability to
    submit posts.
:param show_media: Show thumbnails on submissions.
:param show_media_preview: Expand media previews on comments pages.
:param spam_comments: Spam filter strength for comments. One of ``"all"``,
    ``"low"``, or ``"high"``.
:param spam_links: Spam filter strength for links. One of ``"all"``, ``"low"``,
    or ``"high"``.
:param spam_selfposts: Spam filter strength for selfposts. One of ``"all"``,
    ``"low"``, or ``"high"``.
:param spoilers_enabled: Enable marking posts as containing spoilers.
:param submit_link_label: Custom label for submit link button (None for
    default).
:param submit_text: Text to show on submission page.
:param submit_text_label: Custom label for submit text post button (None for
    default).
:param subreddit_type: The string ``"user"``.
:param suggested_comment_sort: All comment threads will use this sorting method
    by default. Leave ``None``, or choose one of ``confidence``,
    ``"controversial"``, ``"live"``, ``"new"``, ``"old"``, ``"qa"``,
    ``"random"``, or ``"top"``.
:param title: The title of the subreddit.
:param welcome_message_enabled: Enables the subreddit welcome message.
:param welcome_message_text: The text to be used as a welcome message. A welcome
    message is sent to all new subscribers by a Reddit bot.
:param wiki_edit_age: Account age, in days, required to edit and create wiki
    pages.
:param wiki_edit_karma: Subreddit karma required to edit and create wiki pages.
:param wikimode: One of ``"anyone"``, ``"disabled"``, or ``"modonly"``.

Additional keyword arguments can be provided to handle new settings as Reddit
introduces them.

Settings that are documented here and aren't explicitly set by you in a call to
:meth:`.SubredditModeration.update` should retain their current value. If they
do not please file a bug.

.. warning::

    Undocumented settings, or settings that were very recently documented, may
    not retain their current value when updating. This often occurs when Reddit
    adds a new setting but forgets to add that setting to the API endpoint that
    is used to fetch the current settings.

default_setheader_hover_textlanguagecontent_optionssubreddit_idsubreddit_type)	allow_topheader_titlelang	link_typesrtype_redditr   )settingsitemspopupdater   _create_or_update	subredditrV   )r$   rW   current_settingsremapnewolds         r   rZ   UserSubredditModeration.update   s    v  ==? '/* $
 HC$4$8$8$=! & 	).. 
NN**
.>
 	
r   r   N)rW   zstr | int | boolr?   zdict[str, str | int | bool])r   r@   rA   rB   rC   rZ   rE   r   r   r   r#   r#   {   s    l
r   r#   )rC   
__future__r   r5   typingr   r   r   warningsr   
util.cacher	   r\   r   r   praw.modelsprawr   r#   r   r   r   <module>rh      sA    0 "  / /  ( 5g2I g2Vw
1 w
r   