Interface CommentData

The attributes specific to Comment objects.

interface CommentData {
    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: string;
    canGild: boolean;
    canModPost: boolean;
    collapsed: boolean;
    createdUtc: number;
    dismissedUserReports?: string[];
    distinguished: Maybe<"admin" | "moderator">;
    edited: number | false;
    gilded: number;
    gildings: Gildings;
    id: string;
    ignoreReports: boolean;
    isSubmitter: boolean;
    likes: Maybe<boolean>;
    locked: boolean;
    modNote: Maybe<string>;
    modReasonBy: Maybe<string>;
    modReasonTitle: Maybe<string>;
    modReports: [string, string][];
    modReportsDismissed?: [string, string][];
    numReports: number;
    permalink: string;
    removed: boolean;
    replies: Listing<Comment>;
    saved: boolean;
    score: number;
    scoreHidden: boolean;
    sendReplies: boolean;
    spam?: boolean;
    stickied: boolean;
    subreddit: string;
    subredditType: SubredditType;
    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 plaintext body of the comment.

bodyHtml: string

The html rendered body of the comment.

canGild: boolean

Whether or not this you can guild this item.

canModPost: boolean

Whether or not you can moderate this item.

collapsed: boolean

Whether or not this comment is collapsed.

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.

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.

id: string

The ID of this object.

ignoreReports: boolean

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

isSubmitter: boolean

Whether or not the author of this comment is also the op of the 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.
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].

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.

permalink: string

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

removed: boolean

Whether or not this item has been removed.

replies: Listing<Comment>

The replies to this comment.

saved: boolean

Whether or not you have saved this item.

score: number

The score that this item has received.

scoreHidden: boolean

Whether or not this comment has its score hidden.

Note: if this is true, score will always be 1.

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.

stickied: boolean

Whether or not this item has been sticked.

subreddit: string

The name of the subreddit this item was posted in.

subredditType: SubredditType

The type of the subreddit this item was posted in.

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