Skip to main content

Class: Submission

Hierarchy#

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

    ↳ Submission

Implemented by#

Constructors#

constructor#

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

Parameters#

NameType
rReddit
idstring

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>

Parameters#

NameType
awardAward
anonymousboolean

Returns: Promise<void>

Inherited from: _Submission(Post).award

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


comment#

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

Parameters#

NameType
bodystring

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>

Parameters#

NameTypeDefault value
kindDistinguishKinds"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

Parameters#

NameTypeDescription
bodystringThe 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>

Parameters#

NameTypeDefault value
followbooleantrue

Returns: Promise<void>

Inherited from: _Submission(Post).follow

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


hide#

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

Parameters#

NameTypeDefault value
savebooleantrue

Returns: Promise<void>

Inherited from: _Submission(Post).hide

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


lock#

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

Parameters#

NameTypeDefault value
lockbooleantrue

Returns: Promise<void>

Inherited from: _Submission(Post).lock

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


markNsfw#

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

Parameters#

NameTypeDefault value
nsfwbooleantrue

Returns: Promise<void>

Inherited from: _Submission(Post).markNsfw

Defined in: objects/post/submission/small.ts:46


markOc#

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

Parameters#

NameTypeDefault value
ocbooleantrue

Returns: Promise<void>

Inherited from: _Submission(Post).markOc

Defined in: objects/post/submission/small.ts:38


markSpoiler#

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

Parameters#

NameTypeDefault value
spoilerbooleantrue

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>

Parameters#

NameTypeDefault value
savebooleantrue

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.

Parameters#

NameTypeDescription
dirVoteDirectionThe 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