Class: Submission
#
Hierarchy_Submission<typeof default, this> & default<this>
↳ Submission
#
Implemented by#
Constructors#
constructor+ new Submission(r
: Reddit, id
: string): Submission
#
ParametersName | Type |
---|---|
r | |
id | string |
Returns: Submission
Overrides: _Submission(Post).constructor
Defined in: objects/post/submission/small.ts:68
#
Properties#
fullId• fullId: string
Inherited from: _Submission(Post).fullId
Defined in: objects/post/small.ts:15
#
id• id: string
Inherited from: _Submission(Post).id
Defined in: objects/post/small.ts:14
#
r• r: Reddit
Inherited from: _Submission(Post).r
Defined in: objects/post/small.ts:12
#
Accessors#
key• get key(): string
Returns: string
Defined in: objects/post/small.ts:17
#
shortUrl• get shortUrl(): string
Returns: string
Defined in: objects/post/submission/small.ts:10
#
Methods#
approveâ–¸ approve(): Promise<void>
Returns: Promise<void>
Inherited from: _Submission(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: _Submission(Post).award
Defined in: objects/post/small.ts:53
#
commentâ–¸ comment(body
: string): Promise<void>
#
ParametersName | Type |
---|---|
body | string |
Returns: Promise<void>
Inherited from: _Submission(Post).comment
Defined in: objects/post/small.ts:108
#
commentsâ–¸ comments(): Promise<CommentTree<Submission | FullComment>>
Returns: Promise<CommentTree<Submission | FullComment>>
Inherited from: _Submission(Post).comments
Defined in: objects/post/submission/small.ts:22
#
deleteâ–¸ delete(): Promise<void>
Delete this thing
Returns: Promise<void>
Inherited from: _Submission(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: _Submission(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: _Submission(Post).edit
Defined in: objects/post/small.ts:66
#
fetchâ–¸ fetch(): Promise<FullSubmission>
Returns: Promise<FullSubmission>
Inherited from: _Submission(Post).fetch
Defined in: objects/post/submission/small.ts:14
#
followâ–¸ follow(follow?
: boolean): Promise<void>
#
ParametersName | Type | Default value |
---|---|---|
follow | boolean | true |
Returns: Promise<void>
Inherited from: _Submission(Post).follow
Defined in: objects/post/submission/small.ts:30
#
hideâ–¸ hide(save?
: boolean): Promise<void>
#
ParametersName | Type | Default value |
---|---|---|
save | boolean | true |
Returns: Promise<void>
Inherited from: _Submission(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: _Submission(Post).lock
Defined in: objects/post/small.ts:88
#
markNsfwâ–¸ markNsfw(nsfw?
: boolean): Promise<void>
#
ParametersName | Type | Default value |
---|---|---|
nsfw | boolean | true |
Returns: Promise<void>
Inherited from: _Submission(Post).markNsfw
Defined in: objects/post/submission/small.ts:46
#
markOcâ–¸ markOc(oc?
: boolean): Promise<void>
#
ParametersName | Type | Default value |
---|---|---|
oc | boolean | true |
Returns: Promise<void>
Inherited from: _Submission(Post).markOc
Defined in: objects/post/submission/small.ts:38
#
markSpoilerâ–¸ markSpoiler(spoiler?
: boolean): Promise<void>
#
ParametersName | Type | Default value |
---|---|---|
spoiler | boolean | true |
Returns: Promise<void>
Inherited from: _Submission(Post).markSpoiler
Defined in: objects/post/submission/small.ts:53
#
markVisitedâ–¸ markVisited(): Promise<void>
Returns: Promise<void>
Inherited from: _Submission(Post).markVisited
Defined in: objects/post/submission/small.ts:60
#
saveâ–¸ save(save?
: boolean): Promise<void>
#
ParametersName | Type | Default value |
---|---|---|
save | boolean | true |
Returns: Promise<void>
Inherited from: _Submission(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: _Submission(Post).vote
Defined in: objects/post/small.ts:48