Class: Comment
#
Hierarchy_Comment<typeof default, this> & default<this>
↳ Comment
#
Implemented by#
Constructors#
constructor+ new Comment(r
: Reddit, id
: string, submission
: Submission): Comment
#
ParametersName | Type |
---|---|
r | |
id | string |
submission | Submission |
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>
#
ParametersName | Type |
---|---|
award | Award |
anonymous | boolean |
Returns: Promise<void>
Inherited from: _Comment(Post).award
Defined in: objects/post/small.ts:53
#
commentâ–¸ comment(body
: string): Promise<void>
#
ParametersName | Type |
---|---|
body | string |
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>
#
ParametersName | Type | Default value |
---|---|---|
kind | DistinguishKinds | "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
#
ParametersName | Type | Description |
---|---|---|
body | string | The 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>
#
ParametersName | Type | Default value |
---|---|---|
save | boolean | true |
Returns: Promise<void>
Inherited from: _Comment(Post).hide
Defined in: objects/post/small.ts:81
#
lockâ–¸ lock(lock?
: boolean): Promise<void>
#
ParametersName | Type | Default value |
---|---|---|
lock | boolean | true |
Returns: Promise<void>
Inherited from: _Comment(Post).lock
Defined in: objects/post/small.ts:88
#
saveâ–¸ save(save?
: boolean): Promise<void>
#
ParametersName | Type | Default value |
---|---|---|
save | boolean | true |
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.
#
ParametersName | Type | Description |
---|---|---|
dir | VoteDirection | The 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