Skip to main content
Version: 0.10

Class: Comment

models.Comment

Table of contents

Accessors

Methods

Accessors

approved

get approved(): boolean

Returns

boolean


authorId

get authorId(): undefined | `t2_${string}`

Returns

undefined | `t2_${string}`


authorName

get authorName(): string

Returns

string


body

get body(): string

Returns

string


collapsedBecauseCrowdControl

get collapsedBecauseCrowdControl(): boolean

Returns

boolean


createdAt

get createdAt(): Date

Returns

Date


distinguishedBy

get distinguishedBy(): undefined | string

Returns

undefined | string


edited

get edited(): boolean

Returns

boolean


id

get id(): `t1_${string}`

Returns

`t1_${string}`


locked

get locked(): boolean

Returns

boolean


modReportReasons

get modReportReasons(): string[]

Returns

string[]


numReports

get numReports(): number

Returns

number


parentId

get parentId(): `t1_${string}` | `t3_${string}`

Returns

`t1_${string}` | `t3_${string}`


get permalink(): string

Returns

string


postId

get postId(): `t3_${string}`

Returns

`t3_${string}`


removed

get removed(): boolean

Returns

boolean


replies

get replies(): Listing<Comment>

Returns

Listing<Comment>


score

get score(): number

Returns

number


spam

get spam(): boolean

Returns

boolean


stickied

get stickied(): boolean

Returns

boolean


subredditId

get subredditId(): `t5_${string}`

Returns

`t5_${string}`


subredditName

get subredditName(): string

Returns

string


url

get url(): string

Returns

string


userReportReasons

get userReportReasons(): string[]

Returns

string[]

Methods

addRemovalNote

addRemovalNote(options): Promise<void>

Add a mod note for why the comment was removed

Parameters

NameTypeDescription
optionsObject-
options.modNote?stringthe reason for removal (maximum 100 characters) (optional)
options.reasonIdstringid of a Removal Reason - you can leave this as an empty string if you don't have one

Returns

Promise<void>


approve

approve(): Promise<void>

Returns

Promise<void>


delete

delete(): Promise<void>

Returns

Promise<void>


distinguish

distinguish(makeSticky?): Promise<void>

Parameters

NameTypeDefault value
makeStickybooleanfalse

Returns

Promise<void>


distinguishAsAdmin

distinguishAsAdmin(makeSticky?): Promise<void>

Parameters

NameTypeDefault value
makeStickybooleanfalse

Returns

Promise<void>


edit

edit(options): Promise<Comment>

Parameters

NameType
optionsCommentSubmissionOptions

Returns

Promise<Comment>


getAuthor

getAuthor(): Promise<User>

Returns

Promise<User>


isApproved

isApproved(): boolean

Returns

boolean


isDistinguished

isDistinguished(): boolean

Returns

boolean


isEdited

isEdited(): boolean

Returns

boolean


isLocked

isLocked(): boolean

Returns

boolean


isRemoved

isRemoved(): boolean

Returns

boolean


isSpam

isSpam(): boolean

Returns

boolean


isStickied

isStickied(): boolean

Returns

boolean


lock

lock(): Promise<void>

Returns

Promise<void>


remove

remove(isSpam?): Promise<void>

Parameters

NameTypeDefault value
isSpambooleanfalse

Returns

Promise<void>


reply

reply(options): Promise<Comment>

Parameters

NameType
optionsCommentSubmissionOptions

Returns

Promise<Comment>


toJSON

toJSON(): Pick<Comment, "subredditName" | "id" | "score" | "url" | "subredditId" | "postId" | "body" | "spam" | "replies" | "permalink" | "authorName" | "createdAt" | "approved" | "stickied" | "removed" | "edited" | "locked" | "distinguishedBy" | "userReportReasons" | "modReportReasons" | "parentId" | "numReports" | "collapsedBecauseCrowdControl">

Returns

Pick<Comment, "subredditName" | "id" | "score" | "url" | "subredditId" | "postId" | "body" | "spam" | "replies" | "permalink" | "authorName" | "createdAt" | "approved" | "stickied" | "removed" | "edited" | "locked" | "distinguishedBy" | "userReportReasons" | "modReportReasons" | "parentId" | "numReports" | "collapsedBecauseCrowdControl">


undistinguish

undistinguish(): Promise<void>

Returns

Promise<void>


unlock

unlock(): Promise<void>

Returns

Promise<void>

  • Table of contents
  • Accessors
    • approved
    • authorId
    • authorName
    • body
    • collapsedBecauseCrowdControl
    • createdAt
    • distinguishedBy
    • edited
    • id
    • locked
    • modReportReasons
    • numReports
    • parentId
    • permalink
    • postId
    • removed
    • replies
    • score
    • spam
    • stickied
    • subredditId
    • subredditName
    • url
    • userReportReasons
  • Methods
    • addRemovalNote
    • approve
    • delete
    • distinguish
    • distinguishAsAdmin
    • edit
    • getAuthor
    • isApproved
    • isDistinguished
    • isEdited
    • isLocked
    • isRemoved
    • isSpam
    • isStickied
    • lock
    • remove
    • reply
    • toJSON
    • undistinguish
    • unlock