redditwarp.models.subreddit
#
- class redditwarp.models.subreddit.Subreddit(d: Mapping[str, Any])[source]#
Bases:
DatamementoPropertiesMixin
- class Me(d: Mapping[str, Any])[source]#
Bases:
object
- class Flair(d: Mapping[str, Any])[source]#
Bases:
object
- shown: bool#
Whether the current user has their flair enabled in the subreddit.
Value is
False
if the subreddit object comes from a search item.
- template_uuid: str | None#
The current user’s flair template UUID in the subreddit.
Value is
None
if no flair template is being used.
- text_mode: str#
Either
text
orrichtext
.
- text: str#
The flair text.
Check if the value is an empty string to tell if a flair is being used.
- css_class: str#
The current user’s flair CSS class.
When a flair template is being used, the value of this field will be that of the CSS class designated by the template. If the flair template does not specify a CSS class then the value will be an empty string.
- bg_color: str#
A background color hex string. E.g.,
#46d160
.If a flair template is not being used then the value will be an empty string.
If a flair template is being used and the background color is unset then the value is an empty string.
- fg_color_scheme: str#
Either
dark
orlight
, or empty string.Value is empty string if a flair template is not being used.
- has_had_flair_assigned_before_in_subreddit: bool#
Because of quirks in the API, we can tell if the user has ever had flair assigned before in the subreddit.
- has_had_flair_css_class_assigned_before_in_subreddit_when_no_flair_template_assigned: bool#
Because of quirks in the API, we can tell if the user has ever had a flair CSS class assigned before in the subreddit, but this only works if a flair template is not being used.
- favorited: bool#
- is_banned: bool#
- is_approved_user: bool#
- is_moderator: bool#
Whether the current user is a moderator of the subreddit.
- is_muted: bool#
- is_subscribed: bool#
- sr_theme_enabled: bool#
Whether the current user allows subreddit custom CSS.
This is the “allow subreddits to show me custom themes” preference in old reddit.
- class SubredditFlair(d: Mapping[str, Any])[source]#
Bases:
object
- user_flair_enabled: bool#
Whether user flairs are enabled in the subreddit.
In old Reddit this is the flair option that says “enable user flair in this subreddit”.
Caution: Value is false if object was retrieved from a search. This isn’t the case with the other variables.
- user_flair_position: str#
Either
left
orright
, or empty string.Starts off as
right
in new subreddits.Can be set to an empty string via API calls (see
configure_subreddit_flair_settings()
) but not through the UI. If an empty string then all user flairs are hidden, despite theuser_flair_enabled
setting.
- user_flair_self_assign: bool#
Whether or not users can assign a flair to themselves in this subreddit.
If false, only a moderator can assign flairs to users.
In old Reddit this is the flair option that says “allow users to assign their own flair”.
- post_flair_enabled: bool#
Whether post flairs are enabled in the subreddit.
In old Reddit, this field is tied to the ‘link flair position’ flair setting: the value is false when set to
none
.
- post_flair_position: str#
Either
left
orright
, or empty string.Value is empty string if
post_flair_enabled
is false (the ‘none’ option in the old Reddit UI).
- post_flair_self_assign: bool#
Whether or not users can assign a flair to their submission in this subreddit.
If false, only a moderator can assign flairs to submissions.
In old Reddit this is the flair option that says “allow submitters to assign their own link flair”.
- d: Mapping[str, Any]#
- id36: str#
The ID of the subreddit as a base 36 number.
- idn: int#
The subreddit ID.
- name: str#
The name of the subreddit.
- openness: str#
Either:
public
,private
,restricted
,archived
,employees_only
,gold_only
,gold_restricted
, oruser
.
- created_ut: int#
Unix timestamp of when the subreddit was created.
- created_at: datetime#
When the subreddit was created.
- title: str#
The title of the subreddit.
Max. chars.: 100.
- public_description: str#
- public_description_html: str#
- sidebar_description: str#
- sidebar_description_html: str#
- submitting_form_note: str#
- submitting_form_note_html: str#
- submit_text_label: str#
Custom label text for the “Submit a new text post” button.
In old Reddit this is the “Custom label for submit text post button” subreddit option.
- submit_link_label: str#
Custom label text for the “Custom label for submit link button” button.
In old Reddit this is the “Custom label for submit text post button” subreddit option.
- subscriber_count: int#
- viewing_count: int#
The number of online users who are subscribed to the subreddit.
Value is
-1
if object was retrieved from a search.
- accepts_text_submissions: bool#
- accepts_link_submissions: bool#
- accepts_gallery_submissions: bool#
- accepts_poll_submissions: bool#
- suggested_comment_sort: str#
Either:
confidence
(best),new
,old
,top
,qa
,controversial
, orlive
.Value is empty string if not set.
- nsfw: bool#
- quarantined: bool#
- flair: SubredditFlair#
True if the subreddit has a menu widget active, otherwise false.
Value is false if the object was retrieved from a search.
- class redditwarp.models.subreddit.InaccessibleSubreddit(d: Mapping[str, Any])[source]#
Bases:
DatamementoPropertiesMixin
- d: Mapping[str, Any]#
- id36: str#
- idn: int#
- id: int#
- created_ut: int#
- created_at: datetime#
- name: str#
- openness: str#
- title: str#
- redditwarp.models.subreddit.InaccessibleCommunity#
alias of
InaccessibleSubreddit