@devvit/public-api v0.13.2-dev
get approved():
boolean
boolean
get approvedAtUtc():
number
number
get archived():
boolean
boolean
get authorFlair():
undefined|CommonFlair
undefined | CommonFlair
get authorId():
undefined|`t2_${string}`
undefined | `t2_${string}`
get authorName():
string
string
get bannedAtUtc():
number
number
get body():
undefined|string
undefined | string
get bodyHtml():
undefined|string
undefined | string
get createdAt():
Date
Date
get crosspostParentId():
undefined|`t3_${string}`
The ID of the original post this was crossposted from. Undefined if this post is not a crosspost.
undefined | `t3_${string}`
get distinguishedBy():
undefined|string
undefined | string
get edited():
boolean
boolean
get flair():
undefined|CommonFlair
undefined | CommonFlair
get gallery():
GalleryMedia[]
Get the media in the post. Empty if the post doesn't have any media.
hidden
get hidden():
boolean
boolean
get id():
`t3_${string}`
`t3_${string}`
get ignoringReports():
boolean
boolean
get locked():
boolean
boolean
get modReportReasons():
string[]
string[]
get nsfw():
boolean
boolean
get numberOfComments():
number
number
get numberOfReports():
number
number
get permalink():
string
string
get pollData():
undefined|PollData
Poll data for the post, if the post is a poll. Undefined otherwise.
undefined | PollData
get quarantined():
boolean
boolean
get removed():
boolean
boolean
get removedBy():
undefined|string
Who removed this object (username)
undefined | string
get removedByCategory():
undefined|string
who/what removed this object. It will return one of the following:
- "anti_evil_ops": object is removed by a aeops member
- "author": object is removed by author of the post
- "automod_filtered": object is filtered by automod
- "community_ops": object is removed by a community team member
- "content_takedown": object is removed due to content violation
- "copyright_takedown": object is removed due to copyright violation
- "deleted": object is deleted
- "moderator": object is removed by a mod of the sub
- "reddit": object is removed by anyone else
- undefined: object is not removed
undefined | string
get score():
number
number
get secureMedia():
undefined|SecureMedia
undefined | SecureMedia
get spam():
boolean
boolean
get spoiler():
boolean
boolean
get stickied():
boolean
boolean
get subredditId():
`t5_${string}`
`t5_${string}`
get subredditName():
string
string
get thumbnail():
undefined| {height:number;url:string;width:number; }
undefined | { height: number; url: string; width: number; }
get title():
string
string
get url():
string
string
get userReportReasons():
string[]
string[]
addComment(
options):Promise<Comment>
Promise<Comment>
addRemovalNote(
options):Promise<void>
Add a mod note for why the post was removed
string
the reason for removal (maximum 100 characters) (optional)
string
id of a Removal Reason - you can leave this as an empty string if you don't have one
Promise<void>
approve():
Promise<void>
Promise<void>
crosspost(
options):Promise<Post>
Omit<CrosspostOptions, "postId">
Promise<Post>
delete():
Promise<void>
Promise<void>
distinguish():
Promise<void>
Promise<void>
distinguishAsAdmin():
Promise<void>
Promise<void>
edit(
options):Promise<void>
Promise<void>
getAuthor():
Promise<undefined|User>
Promise<undefined | User>
getCurrentUserPollOption():
Promise<undefined|PollOption>
Get the poll option the authenticated user selected for this post. Returns undefined if the post is not a poll or the user has not voted.
This method will get the poll option for the app account by default. To get the poll option for a user, please contact Reddit.
Promise<undefined | PollOption>
getDuplicates(
options):Listing<Post>
Omit<GetDuplicatesOptions, "postId"> = {}
Listing<Post>
getEnrichedThumbnail():
Promise<undefined|EnrichedThumbnail>
Get a thumbnail that contains a preview image and also contains a blurred preview for NSFW images. The thumbnail returned has higher resolution than Post.thumbnail. Returns undefined if the post doesn't have a thumbnail
Promise<undefined | EnrichedThumbnail>
Throws an error if the thumbnail could not be fetched
// from a menu action, form, scheduler, trigger, custom post click event, etc
const post = await context.reddit.getPostById(context.postId);
const enrichedThumbnail = await post.getEnrichedThumbnail();hide():
Promise<void>
Promise<void>
ignoreReports():
Promise<void>
Promise<void>
isApproved():
boolean
boolean
isArchived():
boolean
boolean
isDistinguishedBy():
undefined|string
undefined | string
isEdited():
boolean
boolean
isHidden()
isHidden():
boolean
boolean
isIgnoringReports():
boolean
boolean
isLocked():
boolean
boolean
isNsfw():
boolean
boolean
isQuarantined():
boolean
boolean
isRemoved():
boolean
boolean
isSpam():
boolean
boolean
isSpoiler():
boolean
boolean
isStickied():
boolean
boolean
lock():
Promise<void>
Promise<void>
markAsNsfw():
Promise<void>
Promise<void>
markAsSpoiler():
Promise<void>
Promise<void>
remove(
isSpam):Promise<void>
boolean = false
Promise<void>
setSuggestedCommentSort(
suggestedSort):Promise<void>
Set the suggested sort for comments on a Post.
Promise<void>
Throws an error if the suggested sort could not be set.
const post = await reddit.getPostById(context.postId);
await post.setSuggestedCommentSort("NEW");snoozeReports(
reason):Promise<void>
Snooze subsequent reports with the given reason from the same users for the next 7 days. Only works for free-form reports.
string
The report reason to snooze.
Promise<void>
sticky(
position?):Promise<void>
1 | 2 | 3 | 4
Promise<void>
toJSON():
Pick<Post,"subredditName"|"flair"|"id"|"score"|"subredditId"|"permalink"|"url"|"createdAt"|"title"|"nsfw"|"authorId"|"authorName"|"body"|"bodyHtml"|"thumbnail"|"numberOfComments"|"numberOfReports"|"approved"|"spam"|"stickied"|"removed"|"removedBy"|"removedByCategory"|"archived"|"edited"|"locked"|"quarantined"|"spoiler"|"hidden"|"ignoringReports"|"distinguishedBy"|"authorFlair"|"secureMedia"|"userReportReasons"|"modReportReasons"|"crosspostParentId">
Pick<Post, "subredditName" | "flair" | "id" | "score" | "subredditId" | "permalink" | "url" | "createdAt" | "title" | "nsfw" | "authorId" | "authorName" | "body" | "bodyHtml" | "thumbnail" | "numberOfComments" | "numberOfReports" | "approved" | "spam" | "stickied" | "removed" | "removedBy" | "removedByCategory" | "archived" | "edited" | "locked" | "quarantined" | "spoiler" | "hidden" | "ignoringReports" | "distinguishedBy" | "authorFlair" | "secureMedia" | "userReportReasons" | "modReportReasons" | "crosspostParentId">
undistinguish():
Promise<void>
Promise<void>
unhide():
Promise<void>
Promise<void>
unignoreReports():
Promise<void>
Promise<void>
unlock():
Promise<void>
Promise<void>
unmarkAsNsfw():
Promise<void>
Promise<void>
unmarkAsSpoiler():
Promise<void>
Promise<void>
unsnoozeReports(
reason):Promise<void>
Unsnooze reports with the given reason. Only works for free-form reports.
string
The report reason to unsnooze.
Promise<void>
unsticky():
Promise<void>
Promise<void>
updateCrowdControlLevel(
level):Promise<void>
Updates the crowd control level of the post to hide comments accordingly.
The crowd control level to set. See CrowdControlLevel for more information.
Promise<void>