import type { JsonStatus } from '@devvit/protos/json/devvit/plugin/redditapi/common/common_msg.js'; import type { FlairCsvResult } from '@devvit/protos/json/devvit/plugin/redditapi/flair/flair_msg.js'; import type { CustomPostStylesInput } from '@devvit/protos/json/devvit/plugin/redditapi/linksandcomments/linksandcomments_msg.js'; import type { GetUserKarmaForSubredditResponse } from '@devvit/protos/json/devvit/plugin/redditapi/users/users_msg.js'; import type { PostData } from '@devvit/shared-types/PostData.js'; import { T1, T2, T3, T5 } from '@devvit/shared-types/tid.js'; import { type FilterOptions } from './helpers/filterThing.js'; import type { AddRemovalNoteOptions, AddWidgetData, BanUserOptions, BanWikiContributorOptions, CommentSubmissionOptions, CreateFlairTemplateOptions, CreateModNoteOptions, CreateRuleOptions, CreateWikiPageOptions, CrosspostOptions, DeleteNotesOptions, EditFlairTemplateOptions, GetBestPostsOptions, GetCommentsByUserOptions, GetCommentsOptions, GetDuplicatesOptions, GetHotPostsOptions, GetModerationLogOptions, GetModNotesOptions, GetPageRevisionsOptions, GetPostsByUserOptions, GetPostsOptions, GetPostsOptionsWithTimeframe, GetPrivateMessagesOptions, GetSubredditUsersByTypeOptions, GetSubscribedSubredditsForCurrentUserOptions, GetUserOverviewOptions, GetWikiPageOptions, Listing, ModAction, ModeratorPermission, ModLogOptions, RemovalReason, SearchPostsOptions, SendPrivateMessageAsSubredditOptions, SendPrivateMessageOptions, SetPostFlairOptions, SetUserFlairBatchConfig, SetUserFlairOptions, SubmitCustomPostOptions, SubmitPostOptions, SubredditBannedUser, SubredditContributorUser, SubredditInfo, SubredditLeaderboard, SubredditModeratorUser, SubredditMutedUser, SubredditOptions, SubredditStyles, SubredditWikiBannedUser, SubredditWikiContributorUser, UpdatePageSettingsOptions, UpdateWidgetData, UpdateWikiPageOptions, Vault, WikiPageRevision, WikiPageRevisionId, WikiPageSettings, WikiVersionOptions } from './models/index.js'; import { Comment, FlairTemplate, ModMailService, ModNote, Post, PrivateMessage, Rule, Subreddit, User, Widget, WikiPage } from './models/index.js'; type GetSubredditUsersOptions = Omit; export type InviteModeratorOptions = { /** The name of the subreddit to invite the user to moderate */ subredditName: string; /** The name of the user to invite as a moderator */ username: string; /** The permissions to grant the user */ permissions?: ModeratorPermission[]; }; export type MuteUserOptions = { /** The name of the subreddit to mute the user in */ subredditName: string; /** The name of the user to mute */ username: string; /** A mod note on why the user was muted. (optional) */ note?: string; }; type StrictRequired = { [K in keyof T]-?: Exclude; }; export type CustomPostStyles = StrictRequired; /** * The Reddit API Client * * To use the Reddit API Client, add it to the plugin configuration at the top of the file. * * @example * ```ts * * Devvit.configure({ * redditAPI: true, * // other plugins * }) * // use within one of our capability handlers e.g. Menu Actions, Triggers, Scheduled Job Type, etc * async (event, context) => { * const subreddit = await context.reddit.getSubredditById(context.subredditId); * context.reddit.submitPost({ * subredditName: subreddit.name, * title: 'test post', * text: 'test body', * }) * // additional code * } * ``` */ export declare class RedditClient { #private; constructor(); /** * Get ModMail API object * * @example * ```ts * await reddit.modMail.reply({ * body: "Here is my message", * conversationId: "abcd42"; * }) * ``` */ get modMail(): ModMailService; /** Returns {@link PostData}, if any, for the post specified by ID. */ getPostData(id: T3): Promise; /** * Get the custom styles for a custom post. * @experimental * @param id The ID of the post to get styles for. */ getPostStyles(id: T3): Promise; /** * Set the custom styles for a custom post. * @experimental * @param id The ID of the post to set styles for. * @param styles The styles to set for the post. If a value isn't specified, its previous value * will be preserved. If `undefined` is passed, all styles will be removed and reset to defaults. */ setPostStyles(id: T3, styles: CustomPostStylesInput | undefined): Promise; /** * Gets a {@link Subreddit} object by ID * * @deprecated Use {@link getSubredditInfoById} instead. * @param {string} id - The ID (starting with t5_) of the subreddit to retrieve. e.g. t5_2qjpg * @returns {Promise} A Promise that resolves a Subreddit object. * @example * ```ts * const memes = await reddit.getSubredditById('t5_2qjpg'); * ``` */ getSubredditById(id: T5): Promise; /** * Gets a {@link SubredditInfo} object by ID * * @param {string} id - The ID (starting with t5_) of the subreddit to retrieve. e.g. t5_2qjpg * @returns {Promise} A Promise that resolves a SubredditInfo object. * @example * ```ts * const memes = await reddit.getSubredditInfoById('t5_2qjpg'); * ``` */ getSubredditInfoById(id: T5): Promise; /** * Gets a {@link Subreddit} object by name * * @deprecated Use {@link getSubredditInfoByName} instead. * @param {string} name The name of a subreddit omitting the r/. This is case insensitive. * @returns {Promise} A Promise that resolves a Subreddit object. * @example * ```ts * const askReddit = await reddit.getSubredditByName('askReddit'); * ``` */ getSubredditByName(name: string): Promise; /** * Gets a {@link SubredditInfo} object by name * * @param {string} name The name of a subreddit omitting the r/. This is case insensitive. * @returns {Promise} A Promise that resolves a SubredditInfo object. * @example * ```ts * const askReddit = await reddit.getSubredditInfoByName('askReddit'); * ``` */ getSubredditInfoByName(name: string): Promise; /** * Add a removal reason to a subreddit. * * @param subredditName Name of the subreddit (the 'r/' prefix is optional). * @param options Options. * @param options.title The title of the removal reason. * @param options.message The message associated with the removal reason. * @example * ```ts * const newReason = await reddit.addSubredditRemovalReasons( * 'askReddit', * { * title: 'Spam', * message: 'This is spam!' * } * ); * console.log(newReason.id) * ``` * * @returns {string} Removal Reason ID */ addSubredditRemovalReason(subredditName: string, options: { title: string; message: string; }): Promise; /** * Get the list of subreddit's removal reasons (ordered). * * @param subredditName Name of the subreddit (the 'r/' prefix is optional). * @example * ```ts * const reasons = await reddit.getSubredditRemovalReasons('askReddit'); * * for (let reason of reasons) { * console.log(reason.id, reason.message, reason.title) * } * ``` * * @returns Ordered array of Removal Reasons */ getSubredditRemovalReasons(subredditName: string): Promise; /** * Update an existing removal reason in a subreddit. * * @param subredditName Name of the subreddit (the 'r/' prefix is optional). * @param reasonId ID of the removal reason (from get or add). * @param options Options. * @param options.title The title of the removal reason. * @param options.message The message associated with the removal reason. * @example * ```ts * await reddit.updateSubredditRemovalReason('askReddit', 'uuid-abc', { * title: 'Spam', * message: 'This post was removed for spam.' * }); * ``` */ updateSubredditRemovalReason(subredditName: string, reasonId: string, options: { title: string; message: string; }): Promise; /** * Delete a removal reason from a subreddit. * * @param subredditName Name of the subreddit (the 'r/' prefix is optional). * @param reasonId ID of the removal reason (from get or add). * @example * ```ts * await reddit.deleteSubredditRemovalReason('askReddit', 'uuid-abc'); * ``` */ deleteSubredditRemovalReason(subredditName: string, reasonId: string): Promise; /** * Get the rules for a subreddit. * * @param subredditName - The name of the subreddit to get the rules for. * @returns An array of Rule objects. */ getRules(subredditName: string): Promise; /** * Create a new rule in a subreddit. * * @param subredditName - The name of the subreddit to add the rule to. * @param options.shortName - Name for the rule. The rule name must be unique within this subreddit. * @param options.description - Full description of the rule. This appears on your subreddit's sidebar. * @param options.kind - Which Reddit objects this rule applies to. One of "all", "link", "comment". * @param options.violationReason - Text to show users when reporting content due to this rule. It appears in the report submission form. * If empty, it will default to the shortName. */ createRule(subredditName: string, options: CreateRuleOptions): Promise; /** * Reorder the rules in a subreddit. * * @param subredditName - The name of the subreddit to reorder the rules for. * @param rules - Array of Rule objects in the desired order (order is determined by array position). */ reorderRules(subredditName: string, rules: Rule[]): Promise; /** * Retrieves the current subreddit. * * @returns {Promise} A Promise that resolves a Subreddit object. * @example * ```ts * const currentSubreddit = await reddit.getCurrentSubreddit(); * ``` */ getCurrentSubreddit(): Promise; /** * Gets a {@link Post} object by ID * * @param id * @returns A Promise that resolves to a Post object. */ getPostById(id: T3): Promise; /** * Submits a new post to a subreddit. * * @example * ```ts * const post = await reddit.submitPost({ * subredditName: 'devvit', * title: 'Hello World', * richtext: new RichTextBuilder() * .heading({ level: 1 }, (h) => { * h.rawText('Hello world'); * }) * .codeBlock({}, (cb) => cb.rawText('This post was created via the Devvit API')) * .build() * }); * ``` * * @see {@link RedditClient.submitCustomPost()|submitCustomPost()} * @see {@link RedditClient.crosspost()|crosspost()} */ submitPost(opts: Readonly): Promise; /** * Submits a new custom post to a subreddit. * * @example * ```ts * const post = await reddit.submitCustomPost({ * subredditName: 'devvit', * title: 'Hello World', * }); * ``` * * By default, `submitCustomPost()` creates a Post on behalf of the App account, but it may be called on behalf of the User making the request by setting the option `runAs: 'USER'`. * When using `runAs: 'USER'` to create an experience Post, you must specify the `userGeneratedContent` option. For example: * @example * ```ts * const post = await reddit.submitCustomPost({ * title: 'My Devvit Post', * runAs: 'USER', * userGeneratedContent: { * text: "hello there", * imageUrls: ["https://styles.redditmedia.com/t5_5wa5ww/styles/communityIcon_wyopomb2xb0a1.png", "https://styles.redditmedia.com/t5_49fkib/styles/bannerBackgroundImage_5a4axis7cku61.png"] }, * subredditName: context.subredditName, * textFallback: { * text: 'This is a Devvit post!', * }, * }); * ``` * * @see {@link RedditClient.submitPost()|submitPost()} * @see {@link RedditClient.crosspost()|crosspost()} */ submitCustomPost(opts: Readonly): Promise; /** * Crossposts a post to a subreddit. * * @param opts - Options for crossposting a post * @param opts.subredditName - The name of the subreddit to crosspost to * @param opts.postId - The ID of the post to crosspost * @param opts.title - The title of the crosspost * @returns - A Promise that resolves to a Post object. * * @see {@link RedditClient.submitPost()|submitPost()} * @see {@link RedditClient.submitCustomPost()|submitCustomPost()} */ crosspost(opts: Readonly): Promise; /** * Gets a {@link User} object by ID * * @param id - The ID (starting with t2_) of the user to retrieve. e.g. t2_1qjpg * @returns A Promise that resolves to a User object. * @example * ```ts * const user = await reddit.getUserById('t2_1qjpg'); * ``` */ getUserById(id: T2): Promise; /** * Gets a {@link User} object by username * * @param username - The username of the user omitting the u/. e.g. 'devvit' * @returns A Promise that resolves to a User object or undefined if user is * not found (user doesn't exist, account suspended, etc). * @example * ```ts * const user = await reddit.getUserByUsername('devvit'); * if (user) { * console.log(user) * } * ``` */ getUserByUsername(username: string): Promise; /** * Get the current calling user's username. * Resolves to undefined for logged-out custom post renders. * * @returns A Promise that resolves to a string representing the username or undefined * @example * ```ts * const username = await reddit.getCurrentUsername(); * ``` */ getCurrentUsername(): Promise; /** * Get the current calling user. * Resolves to undefined for logged-out custom post renders. * * @returns A Promise that resolves to a User object or undefined * @example * ```ts * const user = await reddit.getCurrentUser(); * ``` */ getCurrentUser(): Promise; /** * Get the user that the app runs as on the provided metadata. * * @returns A Promise that resolves to a User object. * @example * ```ts * const user = await reddit.getAppUser(metadata); * ``` */ getAppUser(): Promise; /** * Get the snoovatar URL for a given username. * * @param username - The username of the snoovatar to retrieve * @returns A Promise that resolves to a URL of the snoovatar image if it exists. */ getSnoovatarUrl(username: string): Promise; /** * Get a {@link Comment} object by ID * * @param id - The ID (starting with t1_) of the comment to retrieve. e.g. t1_1qjpg * @returns A Promise that resolves to a Comment object. * @example * ```ts * const comment = await reddit.getCommentById('t1_1qjpg'); * ``` */ getCommentById(id: T1): Promise; /** * Get a list of comments from a specific post or comment. * * @param options - Options for the request * @param options.postId - The ID of the post e.g. 't3_1qjpg' * @param options.commentId - The ID of the comment e.g. 't1_1qjpg' * @param options.limit - The maximum number of comments to return. e.g. 1000 * @param options.pageSize - The number of comments to return per request. e.g. 100 * @param options.sort - The sort order of the comments. e.g. 'new' * @returns A Listing of Comment objects. * @example * ```ts * const comments = await reddit.getComments({ * postId: 't3_1qjpg', * limit: 1000, * pageSize: 100 * }).all(); * ``` */ getComments(options: GetCommentsOptions): Listing; /** * Get a list of comments by a specific user. * * @param options - Options for the request * @param options.username - The username of the user omitting the u/. e.g. 'spez' * @param options.sort - The sort order of the comments. e.g. 'new' * @param options.timeframe - The timeframe of the comments. e.g. 'all' * @param options.limit - The maximum number of comments to return. e.g. 1000 * @param options.pageSize - The number of comments to return per request. e.g. 100 * @returns A Listing of Comment objects. */ getCommentsByUser(options: GetCommentsByUserOptions): Listing; /** * Submit a new comment to a post or comment. * * @param options - You must provide either `options.text` or `options.richtext` but not both. * @param options.id - The ID of the post or comment to comment on. e.g. 't3_1qjpg' for post and 't1_1qgif' for comment * @param options.text - The text of the comment * @param options.richtext - The rich text of the comment * @param options.runAs - The user type to submit the comment as, eg 'APP' or 'USER' * @returns A Promise that resolves to a Comment object. * @example * ```ts * const comment = await reddit.submitComment({ * id: 't1_1qgif', * text: 'Hello world!', * runAs: 'APP', * }) * ``` */ submitComment(options: CommentSubmissionOptions & { id: T1 | T3; }): Promise; /** * Get a list of controversial posts from a specific subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get posts from. e.g. 'memes' * @param options.timeframe - The timeframe to get posts from. e.g. 'day' * @param options.limit - The maximum number of posts to return. e.g. 1000 * @param options.pageSize - The number of posts to return per request. e.g. 100 * @returns A Listing of Post objects. * @example * ```ts * const posts = await reddit.getControversialPosts({ * subredditName: 'memes', * timeframe: 'day', * limit: 1000, * pageSize: 100 * }).all(); * ``` */ getControversialPosts(options: GetPostsOptionsWithTimeframe): Listing; /** * Get a list of controversial posts from a specific subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get posts from. e.g. 'memes' * @param options.timeframe - The timeframe to get posts from. e.g. 'day' * @param options.limit - The maximum number of posts to return. e.g. 1000 * @param options.pageSize - The number of posts to return per request. e.g. 100 * @returns A Listing of Post objects. * @example * ```ts * const posts = await reddit.getControversialPosts({ * subredditName: 'memes', * timeframe: 'day', * limit: 1000, * pageSize: 100 * }).all(); * ``` */ getTopPosts(options: GetPostsOptionsWithTimeframe): Listing; /** * Get a list of best posts from the front page. * This method will get the front page for the app account by default. * To get the front page for a user, please contact Reddit. * * @param options - Options for the request * @param options.limit - The maximum number of posts to return. e.g. 1000 * @param options.pageSize - The number of posts to return per request. e.g. 100 * @returns A Listing of Post objects. * @example * ```ts * const posts = await reddit.getBestPosts({ * limit: 1000, * pageSize: 100 * }).all(); * ``` */ getBestPosts(options: GetBestPostsOptions): Listing; /** * Get posts that shared the same link as the given post. * * @param options - Options for the request. Post ID is required, eveything else is optional. * @param options.postId - (required) The ID of the post to get duplicates for. e.g. 't3_1qjpg'. * @param options.sort - Sort duplicates by new or number of comments. * @param options.subredditName - Limit the search to the given subreddit. * @param options.crosspostsOnly - Only return duplicates that are crossposting this post. * @returns A Listing of Post objects. * @example * ```ts * const duplicates = await reddit.getDuplicatesForPost({ * postId: 't3_abc123', * sort: 'num_comments', * limit: 100 * }).all(); * ``` */ getDuplicatesForPost(options: GetDuplicatesOptions): Listing; /** * Get a list of hot posts from a specific subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get posts from. e.g. 'memes' * @param options.timeframe - The timeframe to get posts from. e.g. 'day' * @param options.limit - The maximum number of posts to return. e.g. 1000 * @param options.pageSize - The number of posts to return per request. e.g. 100 * @returns A Listing of Post objects. * @example * ```ts * const posts = await reddit.getHotPosts({ * subredditName: 'memes', * timeframe: 'day', * limit: 1000, * pageSize: 100 * }).all(); * ``` */ getHotPosts(options: GetHotPostsOptions): Listing; /** * Get a list of new posts from a specific subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get posts from. e.g. 'memes' * @param options.limit - The maximum number of posts to return. e.g. 1000 * @param options.pageSize - The number of posts to return per request. e.g. 100 * @returns A Listing of Post objects. * @example * ```ts * const posts = await reddit.getNewPosts({ * subredditName: 'memes', * limit: 1000, * pageSize: 100 * }).all(); * ``` */ getNewPosts(options: GetPostsOptions): Listing; /** * Get a list of hot posts from a specific subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get posts from. e.g. 'memes' * @param options.timeframe - The timeframe to get posts from. e.g. 'day' * @param options.limit - The maximum number of posts to return. e.g. 1000 * @param options.pageSize - The number of posts to return per request. e.g. 100 * @returns A Listing of Post objects. * @example * ```ts * const posts = await reddit.getRisingPosts({ * subredditName: 'memes', * timeframe: 'day', * limit: 1000, * pageSize: 100 * }).all(); * ``` */ getRisingPosts(options: GetPostsOptions): Listing; /** * Search for posts in a subreddit. * * @param options - Options for the search * @param options.query - The search query. e.g. 'developer platform' * @param options.subredditName - The subreddit to search without 'r/' prefix. If specified, will restrict the search to posts in this subreddit * @param options.sort - How to sort the results. Defaults to 'relevance'. * @param options.timeframe - Limit results to a timeframe. Defaults to 'all'. * @param options.limit - The maximum number of posts to return. * @param options.pageSize - The number of posts to return per request. * @returns A Listing of Post objects. * @example * ```ts * const posts = await reddit.searchPosts({ * query: 'developer platform', * subredditName: 'devvit', * sort: 'new', * timeframe: 'month', * limit: 100, * }).all(); * ``` */ searchPosts(options: SearchPostsOptions): Listing; /** * Get a list of posts from a specific user. * * @param options - Options for the request * @param options.username - The username of the user omitting the u/. e.g. 'spez' * @param options.sort - The sort method to use. e.g. 'new' * @param options.timeframe - The timeframe to get posts from. e.g. 'day' * @param options.limit - The maximum number of posts to return. e.g. 1000 * @param options.pageSize - The number of posts to return per request. e.g. 100 * @returns A Listing of Post objects. */ getPostsByUser(options: GetPostsByUserOptions): Listing; /** * Get a list of posts and comments from a specific user. * * @param options - Options for the request * @param options.username - The username of the user omitting the u/. e.g. 'spez' * @param options.sort - The sort method to use. e.g. 'new' * @param options.timeframe - The timeframe to get posts from. e.g. 'day' * @param options.limit - The maximum number of posts to return. e.g. 1000 * @param options.pageSize - The number of posts to return per request. e.g. 100 * @returns A Listing of `Post` and `Comment` objects. */ getCommentsAndPostsByUser(options: GetUserOverviewOptions): Listing; /** * Returns the karma for a given user in the current subreddit. * The user making the request must be a moderator of the subreddit to read another user's karma in the subreddit. * An exception is if the specified user is the same as the user making the request. * * @param username - The username of the user to get the karma for. e.g. 'spez' * @returns The GetUserKarmaForSubredditResponse, containing the user's karma for posts and comments in the subreddit. */ getUserKarmaFromCurrentSubreddit(username: string): Promise; /** * Get the moderation log for a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get the moderation log from. e.g. 'memes' * @param options.moderatorUsernames (optional) A moderator filter. Accepts an array of usernames * @param options.type (optional) Filter the entries by the type of the Moderator action * @param options.limit - (optional) The maximum number of ModActions to return. e.g. 1000 * @param options.pageSize - (optional) The number of ModActions to return per request. e.g. 100 * @returns A Listing of ModAction objects. * @example * ```ts * const modActions = await reddit.getModerationLog({ * subredditName: 'memes', * moderatorUsernames: ['spez'], * type: 'banuser', * limit: 1000, * pageSize: 100 * }).all(); * ``` */ getModerationLog(options: GetModerationLogOptions): Listing; /** * Get a list of users who have been approved to post in a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get the approved users from. e.g. 'memes' * @param options.username - Use this to see if a user is approved to post in the subreddit. * @param options.limit - The maximum number of users to return. e.g. 1000 * @param options.pageSize - The number of users to return per request. e.g. 100 * @returns A Listing of SubredditContributorUser objects. */ getApprovedUsers(options: GetSubredditUsersOptions): Listing; /** * Approve a user to post in a subreddit. * * @param username - The username of the user to approve. e.g. 'spez' * @param subredditName - The name of the subreddit to approve the user in. e.g. 'memes' */ approveUser(username: string, subredditName: string): Promise; /** * Remove a user's approval to post in a subreddit. * * @param username - The username of the user to remove approval from. e.g. 'spez' * @param subredditName - The name of the subreddit to remove the user's approval from. e.g. 'memes' */ removeUser(username: string, subredditName: string): Promise; /** * Get a list of users who are wiki contributors of a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get the wiki contributors from. e.g. 'memes' * @param options.username - Use this to see if a user is a wiki contributor for the subreddit. * @param options.limit - The maximum number of users to return. e.g. 1000 * @param options.pageSize - The number of users to return per request. e.g. 100 * @returns A Listing of SubredditWikiContributorUser objects. */ getWikiContributors(options: GetSubredditUsersOptions): Listing; /** * Add a user as a wiki contributor for a subreddit. * * @param username - The username of the user to add as a wiki contributor. e.g. 'spez' * @param subredditName - The name of the subreddit to add the user as a wiki contributor. e.g. 'memes' */ addWikiContributor(username: string, subredditName: string): Promise; /** * Remove a user's wiki contributor status for a subreddit. * * @param username - The username of the user to remove wiki contributor status from. e.g. 'spez' * @param subredditName - The name of the subreddit to remove the user's wiki contributor status from. e.g. 'memes' */ removeWikiContributor(username: string, subredditName: string): Promise; /** * Get a list of users who are banned from a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get the banned users from. e.g. 'memes' * @param options.username - Use this to see if a user is banned from the subreddit. * @param options.limit - The maximum number of users to return. e.g. 1000 * @param options.pageSize - The number of users to return per request. e.g. 100 * @returns A Listing of SubredditBannedUser objects. */ getBannedUsers(options: GetSubredditUsersOptions): Listing; /** * Ban a user from a subreddit. * * @param options - Options for the request * @param options.username - The username of the user to ban. e.g. 'spez' * @param options.subredditName - The name of the subreddit to ban the user from. e.g. 'memes' * @param options.note - A mod note for the ban. (optional) * @param options.duration - The number of days the user should be banned for. (optional) * @param options.message - A message to send to the user when they are banned. (optional) * @param options.context - The ID of the post or comment that caused the ban. (optional) * @param options.reason - The reason for the ban. (optional) */ banUser(options: BanUserOptions): Promise; /** * Unban a user from a subreddit. * * @param username - The username of the user to unban. e.g. 'spez' * @param subredditName - The name of the subreddit to unban the user from. e.g. 'memes' */ unbanUser(username: string, subredditName: string): Promise; /** * Get a list of users who are banned from contributing to the wiki on a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get the banned wiki contributors from. e.g. 'memes' * @param options.username - Use this to see if a user is banned from contributing to the wiki on a subreddit. * @param options.limit - The maximum number of users to return. e.g. 1000 * @param options.pageSize - The number of users to return per request. e.g. 100 * @returns A Listing of SubredditWikiBannedUser objects. */ getBannedWikiContributors(options: GetSubredditUsersOptions): Listing; /** * Ban a user from contributing to the wiki on a subreddit. * * @param options - Options for the request * @param options.username - The username of the user to ban. e.g. 'spez' * @param options.subredditName - The name of the subreddit to ban the user from contributing to the wiki on. e.g. 'memes' * @param options.reason - The reason for the ban. (optional) * @param options.duration - The number of days the user should be banned for. (optional) * @param options.note - A mod note for the ban. (optional) */ banWikiContributor(options: BanWikiContributorOptions): Promise; /** * * @param username - The username of the user to unban. e.g. 'spez' * @param subredditName - The name of the subreddit to unban the user from contributing to the wiki on. e.g. 'memes' */ unbanWikiContributor(username: string, subredditName: string): Promise; /** * Get a list of users who are moderators for a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get the moderators from. e.g. 'memes' * @param options.username - Use this to see if a user is a moderator of the subreddit. * @param options.limit - The maximum number of users to return. e.g. 1000 * @param options.pageSize - The number of users to return per request. e.g. 100 * @returns A Listing of SubredditModeratorUser objects. */ getModerators(options: GetSubredditUsersOptions): Listing; /** * Invite a user to become a moderator of a subreddit. * * @param options - Options for the request * @param options.username - The username of the user to invite. e.g. 'spez' * @param options.subredditName - The name of the subreddit to invite the user to moderate. e.g. 'memes' * @param options.permissions - The permissions to give the user. (optional) Defaults to 'all'. */ inviteModerator(options: InviteModeratorOptions): Promise; /** * Revoke a moderator invite for a user to a subreddit. * * @param username - The username of the user to revoke the invite for. e.g. 'spez' * @param subredditName - The name of the subreddit to revoke the invite for. e.g. 'memes' */ revokeModeratorInvite(username: string, subredditName: string): Promise; /** * Remove a user as a moderator of a subreddit. * * @param username - The username of the user to remove as a moderator. e.g. 'spez' * @param subredditName - The name of the subreddit to remove the user as a moderator from. e.g. 'memes' */ removeModerator(username: string, subredditName: string): Promise; /** * Update the permissions of a moderator of a subreddit. * * @param username - The username of the user to update the permissions for. e.g. 'spez' * @param subredditName - The name of the subreddit. e.g. 'memes' * @param permissions - The permissions to give the user. e.g ['posts', 'wiki'] */ setModeratorPermissions(username: string, subredditName: string, permissions: ModeratorPermission[]): Promise; /** * Get a list of users who are muted in a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to get the muted users from. e.g. 'memes' * @param options.username - Use this to see if a user is muted in the subreddit. * @param options.limit - The maximum number of users to return. e.g. 1000 * @param options.pageSize - The number of users to return per request. e.g. 100 * @returns A listing of SubredditMutedUser objects. */ getMutedUsers(options: GetSubredditUsersOptions): Listing; /** * Mute a user in a subreddit. Muting a user prevents them from sending modmail. * * @param options - Options for the request * @param options.username - The username of the user to mute. e.g. 'spez' * @param options.subredditName - The name of the subreddit to mute the user in. e.g. 'memes' * @param options.note - A mod note on why the user was muted. (optional) */ muteUser(options: MuteUserOptions): Promise; /** * Unmute a user in a subreddit. Unmuting a user allows them to send modmail. * * @param username - The username of the user to unmute. e.g. 'spez' * @param subredditName - The name of the subreddit to unmute the user in. e.g. 'memes' */ unmuteUser(username: string, subredditName: string): Promise; /** * Get a user's moderation notes within a subreddit. * * @example * ```ts * const notes = await reddit * .getModNotes({ * subreddit: 'wallstreetbets', * user: 'spez', * filter: 'NOTE', * }) * .get(25); * ``` */ getModNotes(options: GetModNotesOptions): Listing; /** Deletes a moderation note. Returns true if successful. */ deleteModNote(options: DeleteNotesOptions): Promise; /** * Adds a moderation note to a user and returns the created note. * * @example * ```ts * const modNote = await reddit.addModNote({ * subreddit: 'wallstreetbets', * user: 'spez', * note: 'Repeated rule 1 violations', * label: 'ABUSE_WARNING', * }); * ``` */ addModNote(options: CreateModNoteOptions): Promise; /** * Adds a removal note to each specified post or comment. * * @example * ```ts * await reddit.addRemovalNote({ * itemIds: ['t1_abc123', 't3_def456'], * reasonId: '', * modNote: 'Removed for breaking rule 1', * }); * ``` */ addRemovalNote(options: AddRemovalNoteOptions): Promise; /** * Sends a private message to a user. * * @param options - The options for sending the message. * @returns A Promise that resolves if the private message was successfully sent. */ sendPrivateMessage(options: SendPrivateMessageOptions): Promise; /** * Sends a private message to a user on behalf of a subreddit. * @deprecated No longer working as expected. Use {@link modMail.createConversation} with `isAuthorHidden: true` instead * @param options - The options for sending the message as a subreddit. * @returns A Promise that resolves if the private message was successfully sent. */ sendPrivateMessageAsSubreddit(options: SendPrivateMessageAsSubredditOptions): Promise; /** * Approve a post or comment. * * @param id - The id of the post (t3_) or comment (t1_) to approve. * @example * ```ts * await reddit.approve('t3_123456'); * await reddit.approve('t1_123456'); * ``` */ approve(id: T1 | T3): Promise; /** * Remove a post or comment. * * @param id - The id of the post (t3_) or comment (t1_) to remove. * @param isSpam - Is the post or comment being removed because it's spam? * @example * ```ts * await reddit.remove('t3_123456', false); * await reddit.remove('t1_123456', true); * ``` */ remove(id: T1 | T3, isSpam: boolean): Promise; /** * Filters a post or comment. When a post or comment is filtered, it is added to the ModQueue for review, and in addition: * - if @param options.keep is `false`, the post/comment stops being in displayed the subreddit * - if @param options.keep is `true`, the post/comment is still displayed in the subreddit * * @param id - The id of the post (t3_) or comment (t1_) to filter. * @param options - The options for this filter action. * @returns A Promise that resolves if the post or comment was filtered successfully. * @experimental */ filter(id: T1 | T3, options?: FilterOptions): Promise; /** * Get the list of post flair templates for a subreddit. * * @param subredditName - The name of the subreddit to get the post flair templates for. * @returns A Promise that resolves with an array of FlairTemplate objects. */ getPostFlairTemplates(subredditName: string): Promise; /** * Get the list of user flair templates for a subreddit. * * @param subredditName - The name of the subreddit to get the user flair templates for. * @returns A Promise that resolves with an array of FlairTemplate objects. */ getUserFlairTemplates(subredditName: string): Promise; /** * Create a post flair template for a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to create the flair template for. * @param options.allowableContent - The content that is allowed to be used with this flair template. e.g. 'all' or 'text' or 'emoji' * @param options.backgroundColor - The background color of the flair template. e.g. '#ff0000' or 'transparent' * @param options.maxEmojis - The maximum number of emojis that can be used with this flair template. * @param options.modOnly - Whether or not this flair template is only available to mods. * @param options.text - The text of the flair template. * @param options.textColor - The text color of the flair template. Either 'dark' or 'light'. * @param options.allowUserEdits - Whether or not users can edit the flair template when selecting a flair. * @returns The created FlairTemplate object. */ createPostFlairTemplate(options: CreateFlairTemplateOptions): Promise; /** * Create a user flair template for a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to create the flair template for. * @param options.allowableContent - The content that is allowed to be used with this flair template. e.g. 'all' or 'text' or 'emoji' * @param options.backgroundColor - The background color of the flair template. e.g. '#ff0000' or 'transparent' * @param options.maxEmojis - The maximum number of emojis that can be used with this flair template. * @param options.modOnly - Whether or not this flair template is only available to mods. * @param options.text - The text of the flair template. * @param options.textColor - The text color of the flair template. Either 'dark' or 'light'. * @param options.allowUserEdits - Whether or not users can edit the flair template when selecting a flair. * @returns The created FlairTemplate object. */ createUserFlairTemplate(options: CreateFlairTemplateOptions): Promise; /** * Edit a flair template for a subreddit. This can be either a post or user flair template. * Note: If you leave any of the options fields as undefined, they will reset to their default values. * * @param options - Options for the request * @param options.id - The ID of the flair template to edit. * @param options.subredditName - The name of the subreddit to create the flair template for. * @param options.allowableContent - The content that is allowed to be used with this flair template. e.g. 'all' or 'text' or 'emoji' * @param options.backgroundColor - The background color of the flair template. e.g. '#ff0000' or 'transparent' * @param options.maxEmojis - The maximum number of emojis that can be used with this flair template. * @param options.modOnly - Is this flair template only available to mods? * @param options.text - The text of the flair template. * @param options.textColor - The text color of the flair template. Either 'dark' or 'light'. * @param options.allowUserEdits - Can users can edit the flair template when selecting a flair? * @returns The edited FlairTemplate object. */ editFlairTemplate(options: EditFlairTemplateOptions): Promise; /** * Delete a flair template from a subreddit. * * @param subredditName - The name of the subreddit to delete the flair template from. * @param flairTemplateId - The ID of the flair template to delete. */ deleteFlairTemplate(subredditName: string, flairTemplateId: string): Promise; /** * Set the flair for a user in a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to set the flair for. * @param options.username - The username of the user to set the flair for. * @param options.flairTemplateId - The ID of the flair template to use. * @param options.text - The text of the flair. * @param options.cssClass - The CSS class of the flair. * @param options.backgroundColor - The background color of the flair. * @param options.textColor - The text color of the flair. */ setUserFlair(options: SetUserFlairOptions): Promise; /** * Set the flair of multiple users in the same subreddit with a single API call. * Can process up to 100 entries at once. * * @param subredditName - The name of the subreddit to edit flairs in. * @param {SetUserFlairBatchConfig[]} flairs - Array of user flair configuration objects. If both text and cssClass are empty for a given user the flair will be cleared. * @param flairs[].username - The username of the user to edit the flair for. * @param flairs[].text - The text of the flair. * @param flairs[].cssClass - The CSS class of the flair. * @returns {FlairCsvResult[]} - Array of statuses for each entry provided. */ setUserFlairBatch(subredditName: string, flairs: SetUserFlairBatchConfig[]): Promise; /** * Remove the flair for a user in a subreddit. * * @param subredditName - The name of the subreddit to remove the flair from. * @param username - The username of the user to remove the flair from. */ removeUserFlair(subredditName: string, username: string): Promise; /** * Set the flair for a post in a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit to set the flair for. * @param options.postId - The ID of the post to set the flair for. * @param options.flairTemplateId - The ID of the flair template to use. * @param options.text - The text of the flair. * @param options.cssClass - The CSS class of the flair. * @param options.backgroundColor - The background color of the flair. * @param options.textColor - The text color of the flair. */ setPostFlair(options: SetPostFlairOptions): Promise; /** * Remove the flair for a post in a subreddit. * * @param subredditName - The name of the subreddit to remove the flair from. * @param postId - The ID of the post to remove the flair from. */ removePostFlair(subredditName: string, postId: T3): Promise; /** * Get the widgets for a subreddit. * * @param subredditName - The name of the subreddit to get the widgets for. * @returns - An array of Widget objects. */ getWidgets(subredditName: string): Promise; /** * Delete a widget from a subreddit. * * @param subredditName - The name of the subreddit to delete the widget from. * @param widgetId - The ID of the widget to delete. */ deleteWidget(subredditName: string, widgetId: string): Promise; /** * Add a widget to a subreddit. * * @param widgetData - The data for the widget to add. * @returns - The added Widget object. */ addWidget(widgetData: AddWidgetData): Promise; /** * Update a widget for a subreddit. * * @param widgetData - The data for the widget to update. * @returns - The updated Widget object. */ updateWidget(widgetData: UpdateWidgetData): Promise; /** * Reorder the widgets for a subreddit. * * @param subredditName - The name of the subreddit to reorder the widgets for. * @param orderByIds - An array of widget IDs in the order that they should be displayed. */ reorderWidgets(subredditName: string, orderByIds: string[]): Promise; /** * Check whether Wiki V2 is enabled for a subreddit. * * @param subredditName - The name of the subreddit to check. * @returns Whether Wiki V2 is enabled for the subreddit. */ isWikiV2Enabled(subredditName: string): Promise; /** * Get a specific revision of a wiki page from a subreddit. * * @param subredditName - The name of the subreddit to get the wiki page from. * @param page - The name of the wiki page to get. * @param revisionId - The revision ID of the wiki page version to get. Leaving it empty returns the latest version. * @returns The requested WikiPage object. * @deprecated Pass a {@link GetWikiPageOptions} object as the third argument instead. */ getWikiPage(subredditName: string, page: string, revisionId: WikiPageRevisionId | undefined): Promise; /** * Get a wiki page from a subreddit. * * @param subredditName - The name of the subreddit to get the wiki page from. * @param page - The name of the wiki page to get. * @param options - Options for the request. * @param options.revisionId - The revision ID of the wiki page version to get. Defaults to the latest version. * @param options.wikiVersion - Which wiki version to target. Defaults to `'v1'`. * @returns The requested WikiPage object. */ getWikiPage(subredditName: string, page: string, options?: GetWikiPageOptions | undefined): Promise; /** * Get the wiki pages for a subreddit. * * @param subredditName - The name of the subreddit to get the wiki pages from. * @param options - Options for the request. * @param options.wikiVersion - Which wiki version to target. Defaults to `'v1'`. * @returns A list of the wiki page names for the subreddit. */ getWikiPages(subredditName: string, options?: WikiVersionOptions): Promise; /** * Create a new wiki page for a subreddit. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit the wiki is in. * @param options.page - The name of the wiki page to create. * @param options.content - The Markdown content of the wiki page. * @param options.reason - The reason for creating the wiki page. * @param options.wikiVersion - Which wiki version to target. Defaults to `'v1'`. * @returns - The created WikiPage object. */ createWikiPage(options: CreateWikiPageOptions): Promise; /** * Update a wiki page. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit the wiki is in. * @param options.page - The name of the wiki page to update. * @param options.content - The Markdown content of the wiki page. * @param options.reason - The reason for updating the wiki page. * @param options.wikiVersion - Which wiki version to target. Defaults to `'v1'`. * @returns The updated WikiPage object. */ updateWikiPage(options: UpdateWikiPageOptions): Promise; /** * Get the revisions for a wiki page. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit the wiki is in. * @param options.page - The name of the wiki page to get the revisions for. * @param options.limit - The maximum number of revisions to return. * @param options.after - The ID of the revision to start after. * @param options.wikiVersion - Which wiki version to target. Defaults to `'v1'`. * @returns A Listing of WikiPageRevision objects. */ getWikiPageRevisions(options: GetPageRevisionsOptions): Listing; /** * Revert a wiki page to a previous revision. * * @param subredditName - The name of the subreddit the wiki is in. * @param page - The name of the wiki page to revert. * @param revisionId - The ID of the revision to revert to. * @param options - Options for the request. * @param options.wikiVersion - Which wiki version to target. Defaults to `'v1'`. */ revertWikiPage(subredditName: string, page: string, revisionId: string, options?: WikiVersionOptions): Promise; /** * Get the settings for a wiki page. * * @param subredditName - The name of the subreddit the wiki is in. * @param page - The name of the wiki page to get the settings for. * @param options - Options for the request. * @param options.wikiVersion - Which wiki version to target. Defaults to `'v1'`. * @returns A WikiPageSettings object. */ getWikiPageSettings(subredditName: string, page: string, options?: WikiVersionOptions): Promise; /** * Update the settings for a wiki page. * * @param options - Options for the request * @param options.subredditName - The name of the subreddit the wiki is in. * @param options.page - The name of the wiki page to update the settings for. * @param options.listed - Whether the wiki page should be listed in the wiki index. * @param options.permLevel - The permission level required to edit the wiki page. * @param options.wikiVersion - Which wiki version to target. Defaults to `'v1'`. * @returns A WikiPageSettings object. */ updateWikiPageSettings(options: UpdatePageSettingsOptions): Promise; /** * Add an editor to a wiki page. * * @param subredditName - The name of the subreddit the wiki is in. * @param page - The name of the wiki page to add the editor to. * @param username - The username of the user to add as an editor. * @param options - Options for the request. * @param options.wikiVersion - Which wiki version to target. Defaults to `'v1'`. */ addEditorToWikiPage(subredditName: string, page: string, username: string, options?: WikiVersionOptions): Promise; /** * Remove an editor from a wiki page. * * @param subredditName - The name of the subreddit the wiki is in. * @param page - The name of the wiki page to remove the editor from. * @param username - The username of the user to remove as an editor. * @param options - Options for the request. * @param options.wikiVersion - Which wiki version to target. Defaults to `'v1'`. */ removeEditorFromWikiPage(subredditName: string, page: string, username: string, options?: WikiVersionOptions): Promise; /** * Get private messages sent to the currently authenticated user. * * @param options - Options for the request * @param options.type - The type of messages to get. */ getMessages(options: GetPrivateMessagesOptions): Promise>; /** * Mark all private messages as read. */ markAllMessagesAsRead(): Promise; /** * Report a Post or Comment * * The report is sent to the moderators of the subreddit for review. * * @param thing Post or Comment * @param options Options * @param options.reason Why the thing is reported * * @example * ```ts * await reddit.report(post, { * reason: 'This is spam!', * }) * ``` */ report(thing: Post | Comment, options: { reason: string; }): Promise; /** * Return a listing of things requiring moderator review, such as reported things and items. * * @param options * * @example * ```ts * const subreddit = await reddit.getSubredditByName("mysubreddit") * let listing = await subreddit.getModQueue(); * console.log("Posts and Comments: ", await listing.all()) * listing = await subreddit.getModQueue({ type: "post"}); * console.log("Posts: ", await listing.all()) * ``` */ getModQueue(options: ModLogOptions<'comment'>): Listing; getModQueue(options: ModLogOptions<'post'>): Listing; getModQueue(options: ModLogOptions<'all'>): Listing; /** * Return a listing of things that have been reported. * * @param options * * @example * ```ts * const subreddit = await reddit.getSubredditByName("mysubreddit") * let listing = await subreddit.getReports(); * console.log("Posts and Comments: ", await listing.all()) * listing = await subreddit.getReports({ type: "post"}); * console.log("Posts: ", await listing.all()) * ``` */ getReports(options: ModLogOptions<'comment'>): Listing; getReports(options: ModLogOptions<'post'>): Listing; getReports(options: ModLogOptions<'all'>): Listing; /** * Return a listing of things that have been marked as spam or otherwise removed. * * @param options * * @example * ```ts * const subreddit = await reddit.getSubredditByName("mysubreddit") * let listing = await subreddit.getSpam(); * console.log("Posts and Comments: ", await listing.all()) * listing = await subreddit.getSpam({ type: "post"}); * console.log("Posts: ", await listing.all()) * ``` */ getSpam(options: ModLogOptions<'comment'>): Listing; getSpam(options: ModLogOptions<'post'>): Listing; getSpam(options: ModLogOptions<'all'>): Listing; /** * Return a listing of things that have yet to be approved/removed by a mod. * * @param options * * @example * ```ts * const subreddit = await reddit.getSubredditByName("mysubreddit") * let listing = await subreddit.getUnmoderated(); * console.log("Posts and Comments: ", await listing.all()) * listing = await subreddit.getUnmoderated({ type: "post"}); * console.log("Posts: ", await listing.all()) * ``` */ getUnmoderated(options: ModLogOptions<'comment'>): Listing; getUnmoderated(options: ModLogOptions<'post'>): Listing; getUnmoderated(options: ModLogOptions<'all'>): Listing; /** * Return a listing of things that have been edited recently. * * @param options * * @example * ```ts * const subreddit = await reddit.getSubredditByName("mysubreddit") * let listing = await subreddit.getEdited(); * console.log("Posts and Comments: ", await listing.all()) * listing = await subreddit.getEdited({ type: "post"}); * console.log("Posts: ", await listing.all()) * ``` */ getEdited(options: ModLogOptions<'comment'>): Listing; getEdited(options: ModLogOptions<'post'>): Listing; getEdited(options: ModLogOptions<'all'>): Listing; /** * Gets a {@link Vault} for the specified address. * * @param {string} address - The address (starting with 0x) of the Vault. * @example * ```ts * const vault = await reddit.getVaultByAddress('0x205ee28744456bDBf180A0Fa7De51e0F116d54Ed'); * ``` */ getVaultByAddress(address: string): Promise; /** * Gets a {@link Vault} for the specified user. * * @param {string} userId - The ID (starting with t2_) of the Vault owner. * @example * ```ts * const vault = await reddit.getVaultByUserId('t2_1w72'); * ``` */ getVaultByUserId(userId: T2): Promise; /** * Returns a leaderboard for a given subreddit ID. * * @param subredditId ID of the subreddit for which the leaderboard is being queried. * * @returns {SubredditLeaderboard} Leaderboard for the given subreddit. */ getSubredditLeaderboard(subredditId: T5): Promise; /** * Returns the styles for a given subreddit ID. * * @param subredditId ID of the subreddit from which to retrieve the styles. * * @returns {SubredditStyles} Styles for the given subreddit. */ getSubredditStyles(subredditId: T5): Promise; /** * Create a short share URL for a Reddit location. * * Valid inputs: * - Absolute Reddit URLs without a query string (e.g., https://reddit.com/r/gamesonreddit) * - URLs with a query string limited to: utm_source, utm_medium, devvitshare * * @note old.reddit.com URLs can be shortened but they will redirect to reddit.com. * * @param url Full Reddit URL to shorten. Must be absolute and either have no query string or only the allowed query params. * * @returns The shortened share URL (e.g., 'https://reddit.com/s/abc123'). * * @throws If the input URL is invalid, contains unsupported query parameters, or the share URL cannot be created. */ createShareUrl(url: string): Promise; /** * Returns a listing of subreddits that the current user is subscribed to. * This method will execute as the app account by default. * To execute this on behalf of a user, please contact Reddit. */ getSubscribedSubredditsForCurrentUser(options: GetSubscribedSubredditsForCurrentUserOptions): Listing; /** * Subscribes to the subreddit in which the app is installed. No-op if the user is already subscribed. * This method will run as user by default. Therefore, you must include SUBSCRIBE_TO_SUBREDDIT * in `permissions.reddit.asUser` in your devvit.json file. */ subscribeToCurrentSubreddit(): Promise; /** * Unsubscribes from the subreddit in which the app is installed. No-op if the user isn't subscribed. * This method will execute as the app account by default. * To unsubscribe on behalf of a user, please contact Reddit. */ unsubscribeFromCurrentSubreddit(): Promise; /** * Set the postData for a custom post. This will replace the existing postData with the postData specified in the input. * * @param postId - The ID of the post to set the postData for. * @param postData - Represents the postData to be set, eg: { currentScore: 55, secretWord: 'barbeque' } * @throws {Error} Throws an error if the postData could not be set. * @example * ```ts * const post = await reddit.getPostById(context.postId); * * // Existing postData: { settings: { theme: 'dark', fontSize: 12 } } * * await post.setPostData({ * currentScore: 55, * secretWord: 'barbeque', * }); * // Result: { currentScore: 55, secretWord: 'barbeque' } * ``` */ setPostData(postId: T3, postData: PostData): Promise; /** * Merge the postData on a custom post with the postData specified in the input. This performs a shallow merge. * * @param postData - Represents the postData to be merged with the existing postData. * @throws {Error} Throws an error if the postData could not be merged. * @example * ```ts * const post = await reddit.getPostById(context.postId); * * // Existing postData: { currentScore: 55, settings: { theme: 'dark', fontSize: 12 } } * * await post.mergePostData({ settings: { fontSize: 14 } }); * // Result: { currentScore: 55, settings: { fontSize: 14 } } * ``` */ mergePostData(postId: T3, postData: PostData): Promise; } export {}; //# sourceMappingURL=RedditClient.d.ts.map