Interface PostData

The attributes specific to Post objects.

interface PostData {
    approved?: boolean;
    approvedAtUtc: Maybe<number>;
    approvedBy: Maybe<string>;
    archived: boolean;
    author: string;
    authorPatreonFlair: boolean;
    authorPremium: boolean;
    banNote?: string;
    bannedAtUtc: Maybe<number>;
    bannedBy: Maybe<string>;
    body: string;
    bodyHtml: Maybe<string>;
    canGild: boolean;
    canModPost: boolean;
    comments: Listing<Comment>;
    contestMode: boolean;
    createdUtc: number;
    dismissedUserReports?: string[];
    distinguished: Maybe<"admin" | "moderator">;
    domain: string;
    edited: number | false;
    gilded: number;
    gildings: Gildings;
    hidden: boolean;
    hideScore: boolean;
    id: string;
    ignoreReports: boolean;
    isCrosspostable: boolean;
    isMeta: boolean;
    isOriginalContent: boolean;
    isRedditMediaDomain: boolean;
    isRobotIndexable: boolean;
    isSelf: boolean;
    isVideo: boolean;
    likes: Maybe<boolean>;
    linkFlairTemplateId: Maybe<string>;
    locked: boolean;
    modNote: Maybe<string>;
    modReasonBy: Maybe<string>;
    modReasonTitle: Maybe<string>;
    modReports: [string, string][];
    modReportsDismissed?: [string, string][];
    numComments: number;
    numCrossposts: number;
    numReports: number;
    over18: boolean;
    permalink: string;
    pinned: boolean;
    removed: boolean;
    saved: boolean;
    score: number;
    sendReplies: boolean;
    spam?: boolean;
    spoiler: boolean;
    stickied: boolean;
    subreddit: string;
    subredditSubscribers: number;
    subredditType: SubredditType;
    suggestedSort: Maybe<SuggestedSort>;
    title: string;
    upvoteRatio: number;
    url: string;
    userReports: [string, number][];
    userReportsDismissed?: [string, number][];
}

Hierarchy (view full)

Implemented by

Properties

approved?: boolean

Whether or not this item was approved.

approvedAtUtc: Maybe<number>

The unix timestamp of when this was approved.

This can be undefined if the item either hasn't been approved or you don't have permission to know (i.e. you're not a mod on that subreddit).

approvedBy: Maybe<string>

The username of the mod who approved this post.

This can be undefined if the item either hasn't been approved or you don't have permission to know (i.e. you're not a mod on that subreddit).

archived: boolean

Whether or not this post is archived.

author: string

The username of the user who created this item.

authorPatreonFlair: boolean

Whether or not the author has a Patreon flair.

authorPremium: boolean

Whether or not the author has Reddit Premium.

banNote?: string

The note of why this item was banned (removed).

bannedAtUtc: Maybe<number>

The unix timestamp of when this item was banned (removed).

This can be undefined if the item either hasn't been banned or you don't have permission to know (i.e. you're not a mod on that subreddit).

bannedBy: Maybe<string>

The username of the mod who banned (removed) this item.

This can be undefined if the item either hasn't been banned or you don't have permission to know (i.e. you're not a mod on that subreddit).

body: string

The text body of the post.

Note

The Reddit API calls this parameter selftext.

bodyHtml: Maybe<string>

The HTML body of the post, or undefined if the body is empty.

Note

The Reddit API calls this parameter selftextHtml.

canGild: boolean

Whether or not this you can guild this item.

canModPost: boolean

Whether or not you can moderate this item.

comments: Listing<Comment>

A Listing of comments on this post.

contestMode: boolean

Whether or not this post is in contest mode.

createdUtc: number

The unix timestamp when this object was created.

dismissedUserReports?: string[]

The old reports on this item.

distinguished: Maybe<"admin" | "moderator">

Whether or not this item was distinguished, and by whom.

domain: string

The domain of the link for this post.

edited: number | false

The unix timestamp when this item was edited, or false if it wasn't.

gilded: number

How many times this item has been gilded.

gildings: Gildings

The gildings that this item has received.

hidden: boolean

Whether or not this post is hidden.

hideScore: boolean

Whether or not the score of this post is hidden.

id: string

The ID of this object.

ignoreReports: boolean

Whether or not future reports of this item will be ignored.

isCrosspostable: boolean

Whether or not you are allowed to crosspost this post.

isMeta: boolean

Whether or not this is a meta post.

isOriginalContent: boolean

Whether or not this post is marked as OC.

isRedditMediaDomain: boolean

Whether the domain is reddit-controlled (true) or 3rd party (false).

isRobotIndexable: boolean

Whether or not robots are allowed to index this post.

isSelf: boolean

Whether or not this is a self (text) post.

isVideo: boolean

Whether or not this is a video post.

likes: Maybe<boolean>

Whether and how you voted on this item.

Value Meaning
true You upvoted this item.
false You downvoted this item.
undefined You have not voted on this item.
linkFlairTemplateId: Maybe<string>

The ID of the link flair template, or undefined if there is no flair.

locked: boolean

Whether or not this item is locked.

modNote: Maybe<string>

A note about why this item was removed that only the moderators can see, or undefined if no note was added or this item hasn't been removed.

modReasonBy: Maybe<string>

The username of the mod who added a removal reason to this item, or undefined if no reason was given or this item hasn't been removed.

modReasonTitle: Maybe<string>

The reason this item was removed, or undefined if no reason was given or this item hasn't been removed.

modReports: [string, string][]

The current reports on this item that were made by mods.

Each entry is of the form [report, username].

modReportsDismissed?: [string, string][]

The old reports on this item that were made by mods.

Each entry is of the form [report, username].

numComments: number

The number of comments on this post.

numCrossposts: number

The number of times this has been crossposted.

numReports: number

The number of reports this item has.

This seems to be calculated as follows:

max(
modReports.length - modReportsDismissed.length,
userReports.length - userReportsDismissed.length
)

This means that it will be negative if there were reports that have been dismissed.

over18: boolean

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

permalink: string

The permalink to this item, relative to reddit.com.

pinned: boolean

Whether or not this post has been pinned.

removed: boolean

Whether or not this item has been removed.

saved: boolean

Whether or not you have saved this item.

score: number

The score that this item has received.

sendReplies: boolean

Whether or not replies to this item will notify the author.

spam?: boolean

Whether or not this item has been marked as spam.

spoiler: boolean

Whether or not this post was marked as being a spoiler.

stickied: boolean

Whether or not this item has been sticked.

subreddit: string

The name of the subreddit this item was posted in.

subredditSubscribers: number

The number of subscribers the subreddit this was posted to has.

subredditType: SubredditType

The type of the subreddit this item was posted in.

suggestedSort: Maybe<SuggestedSort>

The suggested way to sort the comments of this post, or undefined if no such suggestion has been given.

title: string

The title of this post.

upvoteRatio: number

The ratio of upvotes to downvotes on this post.

This will be in the range [0, 1], where 1 is 100% upvoted.

url: string

The URL of this post.

If this is a link post url will be that link. Otherwise it will be the fully-qualified URL of this post.

userReports: [string, number][]

The current reports on this item that were made by users.

Each entry is of the form [report, count].

userReportsDismissed?: [string, number][]

The old reports on this item that were made by users.

Each entry is of the form [report, count].

Generated using TypeDoc