Skip to main content

Class: Comment

Hierarchy#

  • _Comment<typeof default, this> & default<this>

    ↳ Comment

Implemented by#

Constructors#

constructor#

+ new Comment(r: Reddit, id: string, submission: Submission): Comment

Parameters#

NameType
rReddit
idstring
submissionSubmission

Returns: Comment

Overrides: _Comment(Post).constructor

Defined in: objects/post/comment/small.ts:37

Properties#

fullId#

• fullId: string

Inherited from: _Comment(Post).fullId

Defined in: objects/post/small.ts:15


id#

• id: string

Inherited from: _Comment(Post).id

Defined in: objects/post/small.ts:14


r#

• r: Reddit

Inherited from: _Comment(Post).r

Defined in: objects/post/small.ts:12


submission#

• submission: Submission

Inherited from: _Comment(Post).submission

Defined in: objects/post/comment/small.ts:10

Accessors#

key#

• get key(): string

Returns: string

Defined in: objects/post/small.ts:17

Methods#

approve#

â–¸ approve(): Promise<void>

Returns: Promise<void>

Inherited from: _Comment(Post).approve

Defined in: objects/post/small.ts:103


award#

â–¸ award(award: Award, anonymous: boolean): Promise<void>

Parameters#

NameType
awardAward
anonymousboolean

Returns: Promise<void>

Inherited from: _Comment(Post).award

Defined in: objects/post/small.ts:53


comment#

â–¸ comment(body: string): Promise<void>

Parameters#

NameType
bodystring

Returns: Promise<void>

Inherited from: _Comment(Post).comment

Defined in: objects/post/small.ts:108


delete#

â–¸ delete(): Promise<void>

Delete this thing

Returns: Promise<void>

Inherited from: _Comment(Post).delete

Defined in: objects/post/small.ts:30


distinguish#

â–¸ distinguish(kind?: DistinguishKinds): Promise<void>

Parameters#

NameTypeDefault value
kindDistinguishKinds"mod"

Returns: Promise<void>

Inherited from: _Comment(Post).distinguish

Defined in: objects/post/small.ts:95


edit#

â–¸ edit(body: string): Promise<void>

Edit the body of a submission or comment

Parameters#

NameTypeDescription
bodystringThe new body in markdown

Returns: Promise<void>

Inherited from: _Comment(Post).edit

Defined in: objects/post/small.ts:66


fetch#

â–¸ fetch(): Promise<null | FullComment>

Returns: Promise<null | FullComment>

Inherited from: _Comment(Post).fetch

Defined in: objects/post/comment/small.ts:19


hide#

â–¸ hide(save?: boolean): Promise<void>

Parameters#

NameTypeDefault value
savebooleantrue

Returns: Promise<void>

Inherited from: _Comment(Post).hide

Defined in: objects/post/small.ts:81


lock#

â–¸ lock(lock?: boolean): Promise<void>

Parameters#

NameTypeDefault value
lockbooleantrue

Returns: Promise<void>

Inherited from: _Comment(Post).lock

Defined in: objects/post/small.ts:88


save#

â–¸ save(save?: boolean): Promise<void>

Parameters#

NameTypeDefault value
savebooleantrue

Returns: Promise<void>

Inherited from: _Comment(Post).save

Defined in: objects/post/small.ts:74


vote#

â–¸ vote(dir: VoteDirection): Promise<void>

Casting a vote on a submission or comment

Note: votes must be cast by humans. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the reddit rules for more details on what constitutes vote cheating.

Parameters#

NameTypeDescription
dirVoteDirectionThe direction of the vote 1 = upvote \ 0 = unvote \ -1 = downvote

Returns: Promise<void>

Inherited from: _Comment(Post).vote

Defined in: objects/post/small.ts:48