A single subreddit.

Hierarchy (view full)

Implements

Properties

Methods

Properties

accountsActiveIsFuzzed: boolean

Whether or not activeUserCount is intentionally slightly wrong.

activeUserCount: number

The number of users who interacted with this subreddit in the last 15 minutes.

If accountsActiveIsFuzzed is true this number will be slightly wrong. This is done to prevent statistical inference attacks against small subreddits.

allOriginalContent: boolean

Whether or not all posts on this subreddit will be marked as OC.

allowChatPostCreation: boolean

Whether or not users can create chat posts in this subreddit.

allowDiscovery: boolean

Whether or not this subreddit allows discovery.

allowGalleries: boolean

Whether or not this subreddit allows galleries.

allowImages: boolean

Whether or not this subreddit allows images.

allowPolls: boolean

Whether or not this subreddit allows polls.

allowPredictions: boolean

Whether or not this subreddit allows predictions.

allowPredictionsTournament: boolean

Whether or not this subreddit allows predictions tournaments.

allowVideogifs: boolean

Whether or not this subreddit allows videogifs.

allowVideos: boolean

Whether or not this subreddit allows videos.

bannerBackgroundColor: string

The hex color to display behind the banner.

bannerBackgroundImage: string

The URL of the full-size banner image.

bannerImg: string

The URL of the mobile-sized banner image.

bannerSize: Maybe<Size>

The size of the banner.

canAssignLinkFlair: boolean

Whether or not users can assign flairs to posts.

canAssignUserFlair: boolean

Whether or not users can choose their own user flair.

coins: number

How many coins this subreddit has.

collapseDeletedComments: boolean

Whether or not to collapse deleted comments by default.

commentScoreHideMins: number

How long comment scores are hidden, in minutes.

communityIcon: string

The URL of the icon for this subreddit.

createdUtc: number

The unix timestamp when this object was created.

description: string

The description of this subreddit.

Note

Reddit's API calls this public_description

descriptionHtml: Maybe<string>

The description of this subreddit rendered as HTML, or undefined if this subreddit does not have a description.

Note

Reddit's API calls this public_description_html

displayName: string

The name of this subreddit with no prefix (e.g. funny).

If you need the full name of the subreddit (e.g. r/funny), use displayNamePrefixed instead.

displayNamePrefixed: string

The name of the subreddit prefixed with r/ (or u/ for user subreddits).

emojisCustomSize: Maybe<Size>

The custom emoji size if 'Custom sized emojis' has been configured for this subreddit, or undefined if no custom size was set.

emojisEnabled: boolean

Whether or not emojis are enabled in this subreddit.

freeFormReports: boolean

Whether or not this subreddit allows users to enter their own message when submitting a report.

headerImg: Maybe<string>

The URL of the image that will be displayed in place of the Snoo on old reddit, or undefined if no such image has been set.

headerSize: Maybe<Size>

The size of headerImg, or undefined if no image was set.

headerTitle: Maybe<string>

The text to display when hovering over headerImg, or undefined if no such title has been set.

hideAds: boolean

Whether or not ads are hidden in this subreddit.

id: string

The ID of this object.

linkFlairEnabled: boolean

Whether or not link flairs are enabled in this subreddit.

linkFlairPosition: "" | "left" | "right"

The position of the link flairs in this subreddit.

originalContentTagEnabled: boolean

Whether or not the OC tag is enabled in this subreddit.

over18: boolean

Whether or not this post is marked as 18+/nsfw.

publicTraffic: boolean

Whether or not the traffic statistics of this subreddit are shown to non-moderators.

quarantine: boolean

Whether or not this subreddit has been quarantined.

restrictCommenting: false

Whether or not commenting is restricted in this subreddit. This will be true if subredditType is set to private.

restrictPosting: true

Whether or not posting is restricted in this subreddit. This will be true if subredditType is set to restricted or private.

showMedia: boolean

Whether or not media thumbnails will be shown in the feed.

showMediaPreview: boolean

Whether or not this subreddit shows media previews in the feed.

sidebar: string

The text contents of the old reddit sidebar.

Note

Reddit's API calls this description

sidebarHtml: string

The contents of the old reddit sidebar, rendered as HTML.

Note

Reddit's API calls this description_html

spoilersEnabled: boolean

Whether or not this subreddit allows tagging posts as spoilers.

submissionType: "any" | "link" | "self"

The types of posts that can be submitted to this subreddit.

submitLinkLabel: Maybe<string>

The custom text to display in the 'submit link' button, or undefined if no custom text has been configured.

submitText: string

Custom text to show on the old reddit text post form.

submitTextHtml: Maybe<string>

The custom submit text rendered as HTML, or undefined if no such text was configured.

submitTextLabel: string

The custom text to display in the 'submit text post' button.

subredditType: SubredditType

This subreddit's privacy level.

subscribers: number

The number of subscribers this subreddit has.

title: string

The title of this subreddit.

url: string

The relative url of this subreddit.

userHasFavorited: boolean

Whether or not the authorized user has favorited this subreddit.

userIsBanned: boolean

Whether or not the authorized user is banned from this subreddit.

userIsContributor: boolean

Whether or not the authorized user has been added as an approved poster.

userIsModerator: boolean

Whether or not the authorized user is a moderator of this subreddit.

userIsMuted: boolean

Whether or not the authorized user has been muted on this subreddit.

userIsSubscriber: boolean

Whether or not the authorized user is subscribed to this subreddit.

userSrFlairEnabled: boolean

Whether or not the authorized user as opted to show their user flair.

userSrThemeEnabled: boolean

Whether or not the authorized user has allowed this subreddit to display custom CSS.

wikiEnabled: boolean

Whether or not the authorized user has access to edit this subreddit's wiki.

Methods

  • Accept a moderator invite.

    Returns Promise<void>

    A promise that resolves when the invite has been accepted.

  • Add an approved poster.

    Parameters

    • username: string

      The username of the user to add.

    Returns Promise<void>

    A promise that resolves when the contributor has been added.

  • Add a user to the list of approved wiki editors.

    Parameters

    • username: string

      The username of the user to add.

    Returns Promise<void>

    A promise that resolves when the wiki editor has been added.

  • Ban a user from this subreddit.

    Parameters

    • username: string

      The username of the user to ban.

    • options: BanOptions = {}

      Any additional options for the ban.

    Returns Promise<void>

    A promise that resolves when the user has been banned.

  • Get the posts in this subreddit, sorted by controversial.

    Parameters

    • time: TimeRange = "all"

      The time scale to filter by.

    Returns Listing<Post>

    A listing of posts, with the most controversial ones first.

    Note

    Due to the way Reddit implements Listings, this will only contain the first 1000 posts.

  • Get the posts in this subreddit, sorted by hot.

    Returns Listing<Post>

    A listing of posts, with the hottest ones first.

    Note

    Due to the way Reddit implements Listings, this will only contain the first 1000 posts.

  • Get the list of moderators for this subreddit.

    Returns Promise<Moderator[]>

    A listing of moderators.

    Note

    Due to the way Reddit implements Listings, this will only contain the first 1000 moderators.

  • Get the posts in this subreddit, sorted by new.

    Returns Listing<Post>

    A listing of posts, with the newest ones first.

    Note

    Due to the way Reddit implements Listings, this will only contain the first 1000 posts.

  • Get the ID of a random post from this subreddit.

    Returns Promise<string>

    A promise that resolves to a random post ID.

  • Get the posts in this subreddit, sorted by rising.

    Returns Listing<Post>

    A listing of posts, with the rising ones first.

    Note

    Due to the way Reddit implements Listings, this will only contain the first 1000 posts.

  • Get a Listing of all the comments in this subreddit.

    Parameters

    • sort: "new" = "new"

      How to sort the comments.

    Returns Listing<Comment>

    A sorted Listing of comments.

    Note

    Due to the way Reddit implements Listings, this will only contain the first 1000 posts.

  • Get the posts in this subreddit, sorted by top.

    Parameters

    • time: TimeRange = "all"

      The time scale to filter by.

    Returns Listing<Post>

    A listing of posts, with the top rated ones first.

    Note

    Due to the way Reddit implements Listings, this will only contain the first 1000 posts.

  • Remove yourself (the authorized user) from the list of approved posters.

    Returns Promise<void>

    A promise that resolves when you have been successfully removed.

  • Mute a user in this subreddit.

    This prevents the user from sending modmail to this subreddit for 72 hours.

    Parameters

    • username: string

      The username of the user to mute.

    Returns Promise<void>

  • Submit a crosspost.

    Parameters

    • title: string

      The title of the post.

    • postID: string

      The ID of the post to crosspost.

    • options: LinkPostOptions = {}

      Any extra options.

    Returns Promise<string>

    A promise that resolves to the ID of the new post.

  • Submit a gallery post.

    Parameters

    Returns Promise<string>

    A promise that resolves to the ID of the new post.

  • Submit an image post to this subreddit.

    Parameters

    • title: string

      The title of the post.

    • imageFile: Blob

      The image to post.

    • imageFileName: string

      The name of the image file.

    • noWebsockets: boolean = false

      Whether to disable websockets for the image.

    • options: LinkPostOptions = {}

      Any extra options.

    Returns Promise<undefined | string>

    A promise that resolves to the ID of the new post or undefined

  • Submit a link post to this subreddit.

    Parameters

    • title: string

      The title of the post.

    • url: string

      The url to link to.

    • options: LinkPostOptions = {}

      Any extra options.

    Returns Promise<string>

    A promise that resolves to the ID of the new post.

  • Submit a text post to this subreddit.

    Parameters

    • title: string

      The title of the post.

    • Optional body: string

      The body of the post.

    • options: TextPostOptions = {}

      Any extra options.

    Returns Promise<string>

    A promise that resolves to the ID of the new post.

  • Submit a video post.

    Parameters

    • title: string

      The title of the post.

    • videoFile: Blob

      The video file to post.

    • videoFileName: string

      The name of the video file.

    • thumbnailFile: Blob

      The thumbnail file to use.

    • thumbnailFileName: string

      The name of the thumbnail file.

    • videoGif: boolean = false

      Whether the video is a gif.

    • noWebsockets: boolean = false

      Whether to disable websockets for the video.

    • options: LinkPostOptions = {}

      Any extra options.

    Returns Promise<undefined | string>

    A promise that resolves to the ID of the new post or undefined

  • Remove an approved poster.

    Parameters

    • username: string

      The username of the user to remove.

    Returns Promise<void>

    A promise that resolves when the contributor has been removed.

  • Remove a user from the list of approved wiki editors.

    Parameters

    • username: string

      The username of the user to remove.

    Returns Promise<void>

    A promise that resolves when the wiki editor has been removed.

  • Unban a user from this subreddit.

    Parameters

    • username: string

      The username of the user to unban.

    Returns Promise<void>

    A promise that resolves when the user has been unbanned.

  • Unmute a user in this subreddit.

    Parameters

    • username: string

      The username of the user to unmute.

    Returns Promise<void>

  • Unban a user from editing this subreddit's wiki

    Parameters

    • username: string

      The username of the user to wikiban.

    Returns Promise<void>

  • Ban a user from editing this subreddit's wiki.

    Parameters

    • username: string

      The username of the user to wikiban.

    Returns Promise<void>