Module: models
Table of contents
Enumerations
- AboutLocations
- FlairType
- ModMailActionType
- ModMailConversationState
- SocialLinkType
- WikiPagePermissionLevel
Classes
- AuthorFlairSettings
- ButtonWidget
- CalendarWidget
- Comment
- CommunityListWidget
- CustomWidget
- Flair
- FlairTemplate
- ImageWidget
- Listing
- ModMailService
- ModNote
- Post
- PostFlairSettings
- PostFlairWidget
- PrivateMessage
- Subreddit
- SubredditDescription
- SubredditRulesWidget
- SubredditWikiSettings
- TextAreaWidget
- User
- Widget
- WikiPage
- WikiPageRevision
- WikiPageSettings
Interfaces
Type Aliases
- AboutSubredditTypes
- AddRemovalNoteOptions
- AddWidgetData
- AllowableFlairContent
- BackgroundImagePosition
- BanUserOptions
- BanWikiContributorOptions
- BannerHeight
- CommentMediaTypes
- CommentSort
- CommentSubmissionOptions
- CommonSubmitPostOptions
- CommunityNameFormat
- ConversationData
- ConversationResponse
- ConversationStateFilter
- ConversationUserData
- CreateFlairTemplateOptions
- CreateModNoteOptions
- CreateRelationshipOptions
- CreateWikiPageOptions
- CrosspostOptions
- CustomPostRichTextFallback
- CustomPostTextFallbackOptions
- CustomizationFlag
- DeleteNotesOptions
- EditCommentOptions
- EditFlairTemplateOptions
- EnrichedThumbnail
- FlairBackgroundColor
- FlairSettings
- FlairTextColor
- GetCommentsByUserOptions
- GetCommentsOptions
- GetConversationResponse
- GetConversationsRequest
- GetConversationsResponse
- GetHotPostsOptions
- GetModNotesOptions
- GetModerationLogOptions
- GetPageRevisionsOptions
- GetPostsByUserOptions
- GetPostsOptions
- GetPostsOptionsWithTimeframe
- GetPrivateMessagesOptions
- GetSortedPostsOptions
- GetSubredditUsersByTypeOptions
- GetUserFlairBySubredditOptions
- GetUserFlairBySubredditResponse
- GetUserFlairOptions
- GetUserOverviewOptions
- ImagePosition
- InternalSetPostFlairOptions
- LinkFlair
- ListingFetchOptions
- ListingFetchResponse
- MenuPosition
- MessageData
- ModActionData
- ModActionTarget
- ModActionType
- ModLogOptions
- ModNoteType
- ModeratorPermission
- MoreObject
- OEmbed
- Participant
- PositionedImagePosition
- PostCapabilities
- PostSuggestedCommentSort
- PostTextOptions
- PostType
- RedditVideo
- RelationshipType
- RemovalReason
- RemoveRelationshipOptions
- ReplyToCommentOptions
- SecureMedia
- SendPrivateMessageAsSubredditOptions
- SendPrivateMessageOptions
- SetFlairOptions
- SetPostFlairOptions
- SetUserFlairOptions
- SubmitCustomPostOptions
- SubmitCustomPostTextFallbackOptions
- SubmitLinkOptions
- SubmitMediaOptions
- SubmitPostOptions
- SubmitSelfPostOptions
- SubredditData
- SubredditInfo
- SubredditLeaderboard
- SubredditLeaderboardSummary
- SubredditLeaderboardSummaryRow
- SubredditSettings
- SubredditStyles
- SubredditType
- UnreadCountResponse
- UpdatePageSettingsOptions
- UpdateWikiPageOptions
- UserFlair
- UserFlairPageOptions
- UserNote
- UserNoteLabel
- UserSocialLink
- Vault
- Visibility
- WikiEditMode
- WithUserData
Functions
- getModerationLog
- getSubredditInfoById
- getSubredditInfoByName
- getSubredditLeaderboard
- getSubredditStyles
- getVaultByAddress
- getVaultByUserId
Type Aliases
AboutSubredditTypes
Ƭ AboutSubredditTypes: "comment" | "post" | "all"
AddRemovalNoteOptions
Ƭ AddRemovalNoteOptions: Prettify<PostRemovalNoteRequest>
AddWidgetData
Ƭ AddWidgetData: AddImageWidgetRequest & { type: "image" } | AddCalendarWidgetRequest & { type: "calendar" } | AddTextAreaWidgetRequest & { type: "textarea" } | AddButtonWidgetRequest & { type: "button" } | AddCommunityListWidgetRequest & { type: "community-list" } | AddPostFlairWidgetRequest & { type: "post-flair" } | AddCustomWidgetRequest & { type: "custom" }
AllowableFlairContent
Ƭ AllowableFlairContent: "all" | "emoji" | "text"
BackgroundImagePosition
Ƭ BackgroundImagePosition: "cover" | "tiled" | "centered"
BanUserOptions
Ƭ BanUserOptions: Object
Type declaration
| Name | Type |
|---|---|
context? | string |
duration? | number |
message? | string |
note? | string |
reason? | string |
subredditName | string |
username | string |
BanWikiContributorOptions
Ƭ BanWikiContributorOptions: Object
Type declaration
| Name | Type |
|---|---|
duration? | number |
note? | string |
reason? | string |
subredditName | string |
username | string |
BannerHeight
Ƭ BannerHeight: "small" | "medium" | "large"
CommentMediaTypes
Ƭ CommentMediaTypes: "giphy" | "static" | "animated" | "expression"
CommentSort
Ƭ CommentSort: "confidence" | "top" | "new" | "controversial" | "old" | "random" | "qa" | "live"
CommentSubmissionOptions
Ƭ CommentSubmissionOptions: { text: string } | { richtext: object | RichTextBuilder }
CommonSubmitPostOptions
Ƭ CommonSubmitPostOptions: Object
Type declaration
| Name | Type |
|---|---|
flairId? | string |
flairText? | string |
nsfw? | boolean |
sendreplies? | boolean |
spoiler? | boolean |
title | string |
CommunityNameFormat
Ƭ CommunityNameFormat: "slashtag" | "pretty" | "hide"
ConversationData
Ƭ ConversationData: Object
Type declaration
| Name | Type | Description |
|---|---|---|
authors | Participant[] | The authors of each message in the modmail conversation. |
conversationType? | string | A ConversationType specifies whether a conversation is with a subreddit itself, with another user, or with another subreddit entirely. - internal - This is a conversation with another user outside of the subreddit. The participant ID is that user's ID. - sr_user - This is a Mod Discussion, internal to the subreddit. There is no other participant. - sr_sr - This is a conversation is with another subreddit. The participant will have a subreddit ID. |
id? | string | Conversation ID |
isAuto? | boolean | Is the conversation automatically generated e.g. from automod, u/reddit |
isHighlighted? | boolean | Is the conversation highlighted |
isInternal? | boolean | Is the conversation internal (i.e. mod only) |
lastModUpdate? | string | The last datetime a mod from the owning subreddit made any interaction with the conversation. (Note that if this is a subreddit to subreddit conversation, the mods of the participant subreddit are irrelevant and do not affect this field.) |
lastUnread? | string | The datetime of the last unread message within this conversation for the current viewer. |
lastUpdated? | string | The datetime of the last time the conversation was update. |
lastUserUpdate? | string | The last datetime a user made any interaction with the conversation |
messages | { [id: string]: MessageData; } | Conversation messages Example ts const arrayOfMessages = Object.values(conversation.messages); const messageById = conversation.messages[messageId]; |
modActions | { [id: string]: ModActionData; } | Conversation mod actions Example ts const arrayOfModActions = Object.values(conversation.modActions); const modActionById = conversation.modActions[modActionId]; |
numMessages? | number | Number of messages (not actions) in the conversation |
participant? | Participant | Participant. Is absent for mod discussions |
state? | ModMailConversationState | State of the conversation |
subject? | string | Suject of the conversation |
subreddit? | { displayName?: string ; id?: string } | Subreddit owning the modmail conversation |
subreddit.displayName? | string | - |
subreddit.id? | string | - |
ConversationResponse
Ƭ ConversationResponse: Object
Type declaration
| Name | Type |
|---|---|
conversation | ConversationData |
ConversationStateFilter
Ƭ ConversationStateFilter: "all" | "new" | "inprogress" | "archived" | "appeals" | "join_requests" | "highlighted" | "mod" | "notifications" | "inbox" | "filtered" | "default"
A Conversation State is a way in which conversations may be filtered within the UI.
A conversation can be in more than one state. For example, a conversation may be both 'highlighted' and 'inprogress'.
ConversationUserData
Ƭ ConversationUserData: Object
Type declaration
| Name | Type | Description |
|---|---|---|
approveStatus? | { isApproved?: boolean } | - |
approveStatus.isApproved? | boolean | - |
banStatus? | { endDate?: string ; isBanned?: boolean ; isPermanent?: boolean ; reason?: string } | - |
banStatus.endDate? | string | - |
banStatus.isBanned? | boolean | - |
banStatus.isPermanent? | boolean | - |
banStatus.reason? | string | - |
created? | string | When was created |
id? | string | User ID |
isShadowBanned? | boolean | - |
isSuspended? | boolean | - |
muteStatus? | { endDate?: string ; isMuted?: boolean ; muteCount?: number ; reason?: string } | - |
muteStatus.endDate? | string | - |
muteStatus.isMuted? | boolean | - |
muteStatus.muteCount? | number | - |
muteStatus.reason? | string | - |
name? | string | Username |
recentComments | { [id: string]: { comment?: string ; date?: string ; permalink?: string ; title?: string }; } | Recent comments |
recentConvos | { [id: string]: { date?: string ; id?: string ; permalink?: string ; subject?: string }; } | Recent conversations |
recentPosts | { [id: string]: { date?: string ; permalink?: string ; title?: string }; } | Recent posts |
CreateFlairTemplateOptions
Ƭ CreateFlairTemplateOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
allowUserEdits? | boolean | Whether or not users are allowed to edit this flair template before using it. |
allowableContent? | AllowableFlairContent | The flair template's allowable content. Either 'all', 'emoji', or 'text'. |
backgroundColor? | string | The background color of the flair. Either 'transparent' or a hex color code. e.g. #FFC0CB |
maxEmojis? | number | - |
modOnly? | boolean | Whether or not this flair template is only available to moderators. |
subredditName | string | The name of the subreddit to create the flair template in. |
text | string | The text to display in the flair. |
textColor? | FlairTextColor | Either 'dark' or 'light'. |
CreateModNoteOptions
Ƭ CreateModNoteOptions: Prettify<PostNotesRequest & { label?: UserNoteLabel ; redditId?: T1ID | T3ID }>
CreateRelationshipOptions
Ƭ CreateRelationshipOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
banContext? | string | The ID of the post or comment that caused the ban. |
banMessage? | string | - |
banReason? | string | - |
duration? | number | - |
note? | string | - |
permissions? | ModeratorPermission[] | - |
subredditName | string | - |
type | RelationshipType | - |
username | string | - |
CreateWikiPageOptions
Ƭ CreateWikiPageOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
content | string | The content of the page. |
page | string | The name of the page to create. |
reason? | string | The reason for creating the page. |
subredditName | string | The name of the subreddit to create the page in. |
CrosspostOptions
Ƭ CrosspostOptions: CommonSubmitPostOptions & { postId: string ; subredditName: string }
CustomPostRichTextFallback
Ƭ CustomPostRichTextFallback: RichTextBuilder | string
CustomPostTextFallbackOptions
Ƭ CustomPostTextFallbackOptions: { text: string } | { richtext: CustomPostRichTextFallback }
CustomizationFlag
Ƭ CustomizationFlag: "default" | "custom"
DeleteNotesOptions
Ƭ DeleteNotesOptions: Prettify<DeleteNotesRequest>
EditCommentOptions
Ƭ EditCommentOptions: CommentSubmissionOptions
EditFlairTemplateOptions
Ƭ EditFlairTemplateOptions: CreateFlairTemplateOptions & { id: string }
EnrichedThumbnail
Ƭ EnrichedThumbnail: Object
Contains data about a post's thumbnail. Also contains a blurred version if the thumbnail is NSFW.
Type declaration
| Name | Type | Description |
|---|---|---|
attribution? | string | Attribution text for the thumbnail |
image | { height: number ; url: string ; width: number } | The image used for the thumbnail. May have different resolution from Post.thumbnail |
image.height | number | - |
image.url | string | - |
image.width | number | - |
isObfuscatedDefault | boolean | Whether this thumbnail appears blurred by default |
obfuscatedImage? | { height: number ; url: string ; width: number } | The blurred image for NSFW thumbnails |
obfuscatedImage.height | number | - |
obfuscatedImage.url | string | - |
obfuscatedImage.width | number | - |
FlairBackgroundColor
Ƭ FlairBackgroundColor: `#${string}` | "transparent"
FlairSettings
Ƭ FlairSettings: Object
Type declaration
| Name | Type |
|---|---|
enabled | boolean |
userFlairBackgroundColor? | string |
userFlairTextColor? | string |
usersCanAssign | boolean |
FlairTextColor
Ƭ FlairTextColor: "light" | "dark"
GetCommentsByUserOptions
Ƭ GetCommentsByUserOptions: Object
Type declaration
| Name | Type |
|---|---|
after? | string |
before? | string |
limit? | number |
pageSize? | number |
sort? | "hot" | "new" | "top" | "controversial" |
timeframe? | "hour" | "day" | "week" | "month" | "year" | "all" |
username | string |
GetCommentsOptions
Ƭ GetCommentsOptions: Object
Type declaration
| Name | Type |
|---|---|
commentId? | string |
depth? | number |
limit? | number |
pageSize? | number |
postId | string |
sort? | CommentSort |
GetConversationResponse
Ƭ GetConversationResponse: { conversation?: ConversationData ; participantSubreddit?: ParticipantSubreddit } & WithUserData
GetConversationsRequest
Ƭ GetConversationsRequest: Object
Type declaration
| Name | Type | Description |
|---|---|---|
after? | string | modmail conversation id |
limit? | number | an integer between 1 and 100 (default: 25) |
sort? | "recent" | "mod" | "user" | "unread" | Sort by: - recent - Order by whenever anyone last updated the conversation, mod or participant - mod - Order by the last time a mod updated the conversation - user - Order by the last time a participant user updated the conversation - unread - Order by the most recent unread message in the conversation for this mod |
state? | ConversationStateFilter | Filter by conversation state A conversation can be in more than one state. For example, a conversation may be both 'highlighted' and 'inprogress'. |
subreddits? | string[] | array of subreddit names |
GetConversationsResponse
Ƭ GetConversationsResponse: Object
Type declaration
| Name | Type | Description |
|---|---|---|
conversationIds | string[] | Array of conversation ids, ordered by the sort parameter specified in GetConversationsRequest. |
conversations | { [id: string]: ConversationData; } | Conversations key-value map |
viewerId? | string | - |
GetHotPostsOptions
Ƭ GetHotPostsOptions: GetPostsOptions & { location?: "GLOBAL" | "US" | "AR" | "AU" | "BG" | "CA" | "CL" | "CO" | "HR" | "CZ" | "FI" | "FR" | "DE" | "GR" | "HU" | "IS" | "IN" | "IE" | "IT" | "JP" | "MY" | "MX" | "NZ" | "PH" | "PL" | "PT" | "PR" | "RO" | "RS" | "SG" | "ES" | "SE" | "TW" | "TH" | "TR" | "GB" | "US_WA" | "US_DE" | "US_DC" | "US_WI" | "US_WV" | "US_HI" | "US_FL" | "US_WY" | "US_NH" | "US_NJ" | "US_NM" | "US_TX" | "US_LA" | "US_NC" | "US_ND" | "US_NE" | "US_TN" | "US_NY" | "US_PA" | "US_CA" | "US_NV" | "US_VA" | "US_CO" | "US_AK" | "US_AL" | "US_AR" | "US_VT" | "US_IL" | "US_GA" | "US_IN" | "US_IA" | "US_OK" | "US_AZ" | "US_ID" | "US_CT" | "US_ME" | "US_MD" | "US_MA" | "US_OH" | "US_UT" | "US_MO" | "US_MN" | "US_MI" | "US_RI" | "US_KS" | "US_MT" | "US_MS" | "US_SC" | "US_KY" | "US_OR" | "US_SD" }
GetModNotesOptions
Ƭ GetModNotesOptions: Prettify<Pick<GetNotesRequest, "subreddit" | "user"> & { filter?: ModNoteType } & Pick<ListingFetchOptions, "limit" | "before">>
GetModerationLogOptions
Ƭ GetModerationLogOptions: ListingFetchOptions & { moderatorUsernames?: string[] ; subredditName: string ; type?: ModActionType }
GetPageRevisionsOptions
Ƭ GetPageRevisionsOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
after? | string | The ID of the revision to start at. |
limit? | number | The maximum number of revisions to get. |
page | string | The name of the page to get revisions for. |
pageSize? | number | The number of revisions to get per request. |
subredditName | string | The name of the subreddit the page is in. |
GetPostsByUserOptions
Ƭ GetPostsByUserOptions: Object
Type declaration
| Name | Type |
|---|---|
after? | string |
before? | string |
limit? | number |
pageSize? | number |
sort? | "hot" | "new" | "top" | "controversial" |
timeframe? | "hour" | "day" | "week" | "month" | "year" | "all" |
username | string |
GetPostsOptions
Ƭ GetPostsOptions: ListingFetchOptions & { subredditName?: string }
GetPostsOptionsWithTimeframe
Ƭ GetPostsOptionsWithTimeframe: GetPostsOptions & { timeframe?: "hour" | "day" | "week" | "month" | "year" | "all" }
GetPrivateMessagesOptions
Ƭ GetPrivateMessagesOptions: Prettify<{ type?: "inbox" | "unread" | "sent" } & ListingFetchOptions>
GetSortedPostsOptions
Ƭ GetSortedPostsOptions: GetPostsOptionsWithTimeframe & { sort: "top" | "controversial" }
GetSubredditUsersByTypeOptions
Ƭ GetSubredditUsersByTypeOptions: ListingFetchOptions & { subredditName: string ; type: "banned" | "muted" | "wikibanned" | "contributors" | "wikicontributors" | "moderators" ; username?: string }
GetUserFlairBySubredditOptions
Ƭ GetUserFlairBySubredditOptions: UserFlairPageOptions & { name?: string ; subreddit: string }
GetUserFlairBySubredditResponse
Ƭ GetUserFlairBySubredditResponse: Object
Type declaration
| Name | Type | Description |
|---|---|---|
next? | string | The user id of the last user flair in this slice. Its presence indicates that there are more items that can be fetched. Pass this into the "after" parameter in the next call to get the next slice of data |
prev? | string | The user id of the first user flair in this slice. Its presence indicates that there are items before this item that can be fetched. Pass this into the "before" parameter in the next call to get the previous slice of data |
users | UserFlair[] | The list of user flair |
GetUserFlairOptions
Ƭ GetUserFlairOptions: UserFlairPageOptions & { usernames?: string[] }
GetUserOverviewOptions
Ƭ GetUserOverviewOptions: Object
Type declaration
| Name | Type |
|---|---|
after? | string |
before? | string |
limit? | number |
pageSize? | number |
sort? | "hot" | "new" | "top" | "controversial" |
timeframe? | "hour" | "day" | "week" | "month" | "year" | "all" |
username | string |
ImagePosition
Ƭ ImagePosition: "cover" | "tiled"
InternalSetPostFlairOptions
Ƭ InternalSetPostFlairOptions: SetFlairOptions & { postId: T3ID }
LinkFlair
Ƭ LinkFlair: Object
Type declaration
| Name | Type | Description |
|---|---|---|
backgroundColor? | string | Flair background color as a hex color string (# prefixed) Example ts "#FF4500" |
cssClass? | string | Custom CSS classes from the subreddit's stylesheet to apply to the flair if rendered as HTML |
richtext | { elementType?: string ; emojiRef?: string ; text?: string ; url?: string }[] | RichText object representation of the flair |
templateId? | string | Flair template ID to use when rendering this flair |
text? | string | Plain text representation of the flair |
textColor? | string | One of: "light", "dark" |
type? | string | One of: "text", "richtext" |
ListingFetchOptions
Ƭ ListingFetchOptions: Object
Type declaration
| Name | Type |
|---|---|
after? | string |
before? | string |
limit? | number |
more? | MoreObject |
pageSize? | number |
ListingFetchResponse
Ƭ ListingFetchResponse<T>: Object
Type parameters
| Name |
|---|
T |
Type declaration
| Name | Type |
|---|---|
after? | string |
before? | string |
children | T[] |
more? | MoreObject |
MenuPosition
Ƭ MenuPosition: "default" | "overlay"
MessageData
Ƭ MessageData: Object
Type declaration
| Name | Type | Description |
|---|---|---|
author? | Participant | - |
body? | string | Message body |
bodyMarkdown? | string | - |
date? | string | When was created |
id? | string | Message ID |
isInternal? | boolean | - |
participatingAs? | string | - |
ModActionData
Ƭ ModActionData: Object
Type declaration
| Name | Type | Description |
|---|---|---|
actionType | ModMailActionType | Type of the action |
author? | { id?: number ; isAdmin?: boolean ; isDeleted?: boolean ; isHidden?: boolean ; isMod?: boolean ; name?: string } | Action author |
author.id? | number | User id |
author.isAdmin? | boolean | - |
author.isDeleted? | boolean | - |
author.isHidden? | boolean | - |
author.isMod? | boolean | - |
author.name? | string | User name |
date? | string | When the action happened |
id? | string | Action id |
ModActionTarget
Ƭ ModActionTarget: Object
Type declaration
| Name | Type |
|---|---|
author? | string |
body? | string |
id | string |
permalink? | string |
title? | string |
ModActionType
Ƭ ModActionType: "banuser" | "unbanuser" | "spamlink" | "removelink" | "approvelink" | "spamcomment" | "removecomment" | "approvecomment" | "addmoderator" | "showcomment" | "invitemoderator" | "uninvitemoderator" | "acceptmoderatorinvite" | "removemoderator" | "addcontributor" | "removecontributor" | "editsettings" | "editflair" | "distinguish" | "marknsfw" | "wikibanned" | "wikicontributor" | "wikiunbanned" | "wikipagelisted" | "removewikicontributor" | "wikirevise" | "wikipermlevel" | "ignorereports" | "unignorereports" | "setpermissions" | "setsuggestedsort" | "sticky" | "unsticky" | "setcontestmode" | "unsetcontestmode" | "lock" | "unlock" | "muteuser" | "unmuteuser" | "createrule" | "editrule" | "reorderrules" | "deleterule" | "spoiler" | "unspoiler" | "modmail_enrollment" | "community_styling" | "community_widgets" | "markoriginalcontent" | "collections" | "events" | "create_award" | "disable_award" | "delete_award" | "enable_award" | "mod_award_given" | "hidden_award" | "add_community_topics" | "remove_community_topics" | "create_scheduled_post" | "edit_scheduled_post" | "delete_scheduled_post" | "submit_scheduled_post" | "edit_post_requirements" | "invitesubscriber" | "submit_content_rating_survey" | "adjust_post_crowd_control_level" | "enable_post_crowd_control_filter" | "disable_post_crowd_control_filter" | "deleteoverriddenclassification" | "overrideclassification" | "reordermoderators" | "snoozereports" | "unsnoozereports" | "addnote" | "deletenote" | "addremovalreason" | "createremovalreason" | "updateremovalreason" | "deleteremovalreason" | "reorderremovalreason" | "dev_platform_app_changed" | "dev_platform_app_disabled" | "dev_platform_app_enabled" | "dev_platform_app_installed" | "dev_platform_app_uninstalled"
ModLogOptions
Ƭ ModLogOptions<T>: Omit<AboutSubredditHelperOptions<T>, "location">
Type parameters
| Name | Type |
|---|---|
T | extends AboutSubredditTypes |
ModNoteType
Ƭ ModNoteType: "NOTE" | "APPROVAL" | "REMOVAL" | "BAN" | "MUTE" | "INVITE" | "SPAM" | "CONTENT_CHANGE" | "MOD_ACTION" | "ALL"
ModeratorPermission
Ƭ ModeratorPermission: "all" | "wiki" | "posts" | "access" | "mail" | "config" | "flair" | "chat_operator" | "chat_config" | "channels" | "community_chat"
MoreObject
Ƭ MoreObject: Object
Type declaration
| Name | Type |
|---|---|
children | T1ID[] |
depth | number |
parentId | T1ID | T3ID |
OEmbed
Ƭ OEmbed: Object
oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly. See: https://oembed.com/
Type declaration
| Name | Type | Description |
|---|---|---|
authorName? | string | The name of the author/owner of the resource. E.g. "Reddit" |
authorUrl? | string | A URL for the author/owner of the resource. E.g. "https://www.youtube.com/@Reddit" |
height? | number | The width in pixels required to display the HTML. |
html | string | The HTML required to embed a video player. The HTML should have no padding or margins. Consumers may wish to load the HTML in an off-domain iframe to avoid XSS vulnerabilities. |
providerName? | string | A URL for the author/owner of the resource. E.g. "YouTube" |
providerUrl? | string | The name of the resource provider. E.g "https://www.youtube.com/" |
thumbnailHeight? | number | The height of the optional thumbnail in pixels |
thumbnailUrl? | string | A URL to a thumbnail image representing the resource. |
thumbnailWidth? | number | The width of the optional thumbnail in pixels |
title? | string | A text title, describing the resource. |
type | string | The resource type. Valid values, along with value-specific parameters, are described below. E.g. "video" |
version | string | The oEmbed version number. This must be 1.0. |
width? | number | The height in pixels required to display the HTML. |
Participant
Ƭ Participant: Object
Conversation participant
Type declaration
| Name | Type |
|---|---|
id? | number |
isAdmin? | boolean |
isApproved? | boolean |
isDeleted? | boolean |
isHidden? | boolean |
isMod? | boolean |
isOp? | boolean |
isParticipant? | boolean |
name? | string |
PositionedImagePosition
Ƭ PositionedImagePosition: "left" | "right" | "centered"
PostCapabilities
Ƭ PostCapabilities: "ama"
PostSuggestedCommentSort
Ƭ PostSuggestedCommentSort: "BLANK" | "CONFIDENCE" | "CONTROVERSIAL" | "LIVE" | "NEW" | "OLD" | "QA" | "RANDOM" | "TOP"
PostTextOptions
Ƭ PostTextOptions: { text: string } | { richtext: object | RichTextBuilder }
PostType
Ƭ PostType: "link" | "image" | "video" | "text" | "spoiler" | "poll" | "gallery" | "talk" | "prediction" | "videogif" | "streaming" | "crosspost"
RedditVideo
Ƭ RedditVideo: Object
Contains the data for a video hosted on Reddit that is in a post
Type declaration
| Name | Type | Description |
|---|---|---|
bitrateKbps? | number | The bitrate of the video in kilobits per second. E.g. 450 |
dashUrl? | string | The URL to the DASH playlist file. E.g. "https://v.redd.it/abc123/DASHPlaylist.mpd" |
duration? | number | The duration of the video in seconds. E.g. 30 |
fallbackUrl? | string | The direct URL to the video. E.g. "https://v.redd.it/abc123/DASH_1080.mp4?source=fallback" |
height? | number | The height of the video in pixels. E.g. 1080 |
hlsUrl? | string | The URL to the HLS playlist file. E.g. "https://v.redd.it/abc123/HLSPlaylist.m3u8" |
isGif? | boolean | If true, the video is a GIF |
scrubberMediaUrl? | string | The URL to the scrubber media file. E.g. "https://v.redd.it/abc123/DASH_96.mp4" |
transcodingStatus? | string | The status of the transcoding process. E.g. "completed" |
width? | number | The width of the video in pixels. E.g. 1920 |
RelationshipType
Ƭ RelationshipType: "moderator_invite" | "contributor" | "banned" | "muted" | "wikibanned" | "wikicontributor"
RemovalReason
Ƭ RemovalReason: Object
An individual Removal Reason object.
Type declaration
| Name | Type | Description |
|---|---|---|
id | string | The ID of the removal reason. |
message | string | The message associated with the removal reason. |
title | string | The title of the removal reason. |
RemoveRelationshipOptions
Ƭ RemoveRelationshipOptions: Object
Type declaration
| Name | Type |
|---|---|
subredditName | string |
type | RelationshipType | "moderator" |
username | string |
ReplyToCommentOptions
Ƭ ReplyToCommentOptions: CommentSubmissionOptions
SecureMedia
Ƭ SecureMedia: Object
Type declaration
| Name | Type | Description |
|---|---|---|
oembed? | OEmbed | - |
redditVideo? | RedditVideo | - |
type? | string | The type of the OEmbed media, if present (e.g. "youtube.com") |
SendPrivateMessageAsSubredditOptions
Ƭ SendPrivateMessageAsSubredditOptions: SendPrivateMessageOptions & { fromSubredditName: string }
SendPrivateMessageOptions
Ƭ SendPrivateMessageOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
subject | string | The subject of the message. |
text | string | The body of the message in markdown text format. |
to | string | Recipient username (without the leading u/), or /r/name for that subreddit's moderators. |
SetFlairOptions
Ƭ SetFlairOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
backgroundColor? | string | The flair background color. Either 'transparent' or a hex color code. e.g. #FFC0CB |
cssClass? | string | The flair CSS class |
flairTemplateId? | string | The flair template's ID |
subredditName | string | The name of the subreddit of the item to set the flair on |
text? | string | The flair text |
textColor? | FlairTextColor | The flair text color. Either 'dark' or 'light'. |
SetPostFlairOptions
Ƭ SetPostFlairOptions: SetFlairOptions & { postId: string }
SetUserFlairOptions
Ƭ SetUserFlairOptions: SetFlairOptions & { username: string }
SubmitCustomPostOptions
Ƭ SubmitCustomPostOptions: CommonSubmitPostOptions & SubmitCustomPostTextFallbackOptions & { preview: JSX.Element }
SubmitCustomPostTextFallbackOptions
Ƭ SubmitCustomPostTextFallbackOptions: Object
Type declaration
| Name | Type |
|---|---|
textFallback? | CustomPostTextFallbackOptions |
SubmitLinkOptions
Ƭ SubmitLinkOptions: CommonSubmitPostOptions & { resubmit?: boolean ; url: string }
SubmitMediaOptions
Ƭ SubmitMediaOptions: CommonSubmitPostOptions & { kind: "image" | "video" | "videogif" ; videoPosterUrl: string }
SubmitPostOptions
Ƭ SubmitPostOptions: SubmitLinkOptions | SubmitSelfPostOptions | SubmitCustomPostOptions | SubmitMediaOptions & { subredditName: string }
SubmitSelfPostOptions
Ƭ SubmitSelfPostOptions: PostTextOptions & CommonSubmitPostOptions
SubredditData
Ƭ SubredditData: Object
Type declaration
| Name | Type |
|---|---|
communityIcon? | string |
displayName? | string |
icon? | string |
id? | string |
keyColor? | string |
lastUpdated? | string |
name? | string |
primaryColor? | string |
subscribers? | number |
SubredditInfo
Ƭ SubredditInfo: Object
A class representing information about a Subreddit.
Type declaration
| Name | Type |
|---|---|
activeCount? | number |
allAllowedPostTypes? | PostType[] |
allowedMediaInComments? | CommentMediaTypes[] |
allowedPostCapabilities? | PostCapabilities[] |
authorFlairSettings? | AuthorFlairSettings |
createdAt? | Date |
description? | SubredditDescription |
detectedLanguage? | string |
id? | T5ID |
isArchivePostsEnabled? | boolean |
isChatPostCreationAllowed? | boolean |
isChatPostFeatureEnabled? | boolean |
isCommentingRestricted? | boolean |
isCrosspostingAllowed? | boolean |
isDiscoveryAllowed? | boolean |
isEmojisEnabled? | boolean |
isNsfw? | boolean |
isPostingRestricted? | boolean |
isPredictionAllowed? | boolean |
isPredictionContributorsAllowed? | boolean |
isPredictionsTournamentAllowed? | boolean |
isQuarantined? | boolean |
isSpoilerAvailable? | boolean |
name? | string |
postFlairSettings? | PostFlairSettings |
subscribersCount? | number |
title? | string |
type? | SubredditType |
wikiSettings? | SubredditWikiSettings |
SubredditLeaderboard
Ƭ SubredditLeaderboard: Object
An individual Leaderboard object.
Type declaration
| Name | Type |
|---|---|
id | string |
summary | SubredditLeaderboardSummary |
SubredditLeaderboardSummary
Ƭ SubredditLeaderboardSummary: Object
Type declaration
| Name | Type |
|---|---|
data | SubredditLeaderboardSummaryRow[] |
SubredditLeaderboardSummaryRow
Ƭ SubredditLeaderboardSummaryRow: Object
Type declaration
| Name | Type |
|---|---|
key | string |
title | string |
value | number |
SubredditSettings
Ƭ SubredditSettings: Object
Type declaration
| Name | Type | Description |
|---|---|---|
acceptFollowers | boolean | Whether the subreddit accepts followers or not. |
allOriginalContent | boolean | Whether all content posted on the subreddit is original. |
allowChatPostCreation | boolean | Whether users are allowed to create chat posts on the subreddit. |
allowDiscovery | boolean | Whether the subreddit can be discovered through search. |
allowGalleries | boolean | Whether the subreddit allows galleries. |
allowImages | boolean | Whether the subreddit allows images. |
allowPolls | boolean | Whether the subreddit allows polls. |
allowPredictionContributors | boolean | Whether contributors are allowed to make predictions on the subreddit. |
allowPredictions | boolean | Whether predictions are allowed on the subreddit. |
allowPredictionsTournament | boolean | Whether prediction tournaments are allowed on the subreddit. |
allowTalks | boolean | Whether talks are allowed on the subreddit. |
allowVideoGifs | boolean | Whether video GIFs are allowed on the subreddit. |
allowVideos | boolean | Whether videos are allowed on the subreddit. |
allowedMediaInComments | CommentMediaTypes[] | List of allowed media types in the comments made in the subreddit. |
allowedPostType | "any" | "link" | "self" | The types of post allowed in this subreddit. Either "any", "link", or "self". |
bannerBackgroundColor? | string | a 6-digit rgb hex color of the banner e.g. #AABBCC, |
bannerBackgroundImage? | string | The background image of the banner. |
bannerImage? | string | The URL of the banner image. |
chatPostEnabled | boolean | Whether chat posts are enabled on the subreddit. |
collectionsEnabled | boolean | Whether collections are enabled on the subreddit. |
communityIcon? | string | The URL of the community icon. |
crosspostable | boolean | Whether crossposts can be made to this subreddit. |
emojisEnabled | boolean | Whether emojis are enabled on the subreddit. |
eventPostsEnabled | boolean | Whether event posts are enabled on the subreddit. |
headerTitle? | string | The header title. |
keyColor? | string | The 6-digit rgb hex color of the subreddit's key color, e.g. #AABBCC, |
linkFlairEnabled | boolean | Whether link flairs are enabled on the subreddit. |
mobileBannerImage? | string | Banner image used on mobile apps. |
originalContentTagEnabled | boolean | Whether the Original Content tag is enabled. |
postFlairs | FlairSettings | The post flair settings for the subreddit. |
primaryColor? | string | The 6-digit rgb hex color of the subreddit's primary color, e.g. #AABBCC, |
restrictCommenting | boolean | Whether commenting is restricted in the subreddit. |
restrictPosting | boolean | Whether posting is restricted in the subreddit. |
shouldArchivePosts | boolean | Whether posts in the subreddit should be automatically archived after 6 months. |
spoilersEnabled | boolean | Whether the Spoiler tag is enabled. |
url | string | HTTP URL to the subreddit |
userFlairs | FlairSettings | The user flair settings for the subreddit. |
wikiEnabled | boolean | Whether the wiki is enabled for the subreddit. |
SubredditStyles
Ƭ SubredditStyles: Object
A class representing the styles of a Subreddit.
Type declaration
| Name | Type |
|---|---|
backgroundColor? | string |
backgroundImage? | string |
backgroundImagePosition? | BackgroundImagePosition |
bannerBackgroundColor? | string |
bannerBackgroundImage? | string |
bannerBackgroundImagePosition? | ImagePosition |
bannerCommunityName? | string |
bannerCommunityNameFormat? | CommunityNameFormat |
bannerHeight? | BannerHeight |
bannerOverlayColor? | string |
bannerPositionedImage? | string |
bannerPositionedImagePosition? | PositionedImagePosition |
bannerShowCommunityIcon? | Visibility |
highlightColor? | string |
icon? | string |
legacyBannerBackgroundImage? | string |
legacyPrimaryColor? | string |
menuBackgroundBlur? | number |
menuBackgroundColor? | string |
menuBackgroundImage? | string |
menuBackgroundOpacity? | number |
menuLinkColorActive? | string |
menuLinkColorHover? | string |
menuLinkColorInactive? | string |
menuPosition? | MenuPosition |
mobileBannerImage? | string |
mobileKeyColor? | string |
postBackgroundColor? | string |
postBackgroundImage? | string |
postBackgroundImagePosition? | ImagePosition |
postDownvoteCountColor? | string |
postDownvoteIconActive? | string |
postDownvoteIconInactive? | string |
postPlaceholderImage? | string |
postPlaceholderImagePosition? | ImagePosition |
postTitleColor? | string |
postUpvoteCountColor? | string |
postUpvoteIconActive? | string |
postUpvoteIconInactive? | string |
postVoteIcons? | CustomizationFlag |
primaryColor? | string |
secondaryBannerPositionedImage? | string |
sidebarWidgetBackgroundColor? | string |
sidebarWidgetHeaderColor? | string |
submenuBackgroundColor? | string |
submenuBackgroundStyle? | CustomizationFlag |
SubredditType
Ƭ SubredditType: "public" | "private" | "restricted" | "employees_only" | "gold_only" | "gold_restricted" | "archived" | "user"
UnreadCountResponse
Ƭ UnreadCountResponse: Object
Type declaration
| Name | Type |
|---|---|
appeals? | number |
archived? | number |
filtered? | number |
highlighted? | number |
inprogress? | number |
joinRequests? | number |
mod? | number |
new? | number |
notifications? | number |
UpdatePageSettingsOptions
Ƭ UpdatePageSettingsOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
listed | boolean | Whether the page should be listed in the wiki index. |
page | string | The name of the page to update settings for. |
permLevel | WikiPagePermissionLevel | The permission level for the page. |
subredditName | string | The name of the subreddit the page is in. |
UpdateWikiPageOptions
Ƭ UpdateWikiPageOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
content | string | The new content of the page. |
page | string | The name of the page to update. |
reason? | string | The reason for updating the page. |
subredditName | string | The name of the subreddit the page is in. |
UserFlair
Ƭ UserFlair: Object
Type declaration
| Name | Type | Description |
|---|---|---|
flairCssClass? | string | The CSS class applied to this flair in the UI. |
flairText? | string | The text displayed in the UI for this flair. |
user? | string | The username of the user to which this flair is assigned. |
UserFlairPageOptions
Ƭ UserFlairPageOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
after? | string | A user id optionally provided which will result in a slice of user flairs, starting after this user, to be returned. |
before? | string | A user id optionally provided which will result in a slice of user flairs, starting before this user, to be returned. |
limit? | number | A limit to the number of flairs that will be returned. Default: 25, Max: 1000 |
UserNote
Ƭ UserNote: Object
Type declaration
| Name | Type |
|---|---|
label? | UserNoteLabel |
note? | string |
redditId? | T1ID | T3ID | T5ID |
UserNoteLabel
Ƭ UserNoteLabel: "BOT_BAN" | "PERMA_BAN" | "BAN" | "ABUSE_WARNING" | "SPAM_WARNING" | "SPAM_WATCH" | "SOLID_CONTRIBUTOR" | "HELPFUL_USER"
UserSocialLink
Ƭ UserSocialLink: Object
Field
id: ID of the social link.
Field
handle: Display name of social media link.
Field
outboundUrl: Outbound url of social media link.
Field
type: Type of social media link i.e. Instagram, YouTube.
Field
title: Title or name of social media link.
Type declaration
| Name | Type |
|---|---|
handle? | string |
id | string |
outboundUrl | string |
title | string |
type | SocialLinkType |
Vault
Ƭ Vault: Object
A type representing a Vault (crypto wallet).
Type declaration
| Name | Type | Description |
|---|---|---|
address | string | The address of the Vault. Example ts '0x205ee28744456bDBf180A0Fa7De51e0F116d54Ed' |
createdAt | string | The date the Vault was created. |
isActive | boolean | Whether the Vault is active. |
provider | string | The provider of the Vault address. Example ts 'ethereum' |
userId | T2ID | The ID (starting with t2_) of the user owning the Vault. Example ts 't2_1w72' |
Visibility
Ƭ Visibility: "show" | "hide"
WikiEditMode
Ƭ WikiEditMode: "disabled" | "modonly" | "anyone"
WithUserData
Ƭ WithUserData: Object
Type declaration
| Name | Type |
|---|---|
user? | ConversationUserData |
Functions
getModerationLog
▸ getModerationLog(options, metadata): Listing<ModAction>
Parameters
| Name | Type |
|---|---|
options | GetModerationLogOptions |
metadata | undefined | Metadata |
Returns
getSubredditInfoById
▸ getSubredditInfoById(subredditId, metadata): Promise<SubredditInfo>
Gets a SubredditInfo object by ID
Parameters
| Name | Type | Description |
|---|---|---|
subredditId | string | - |
metadata | undefined | Metadata | Optional RPC metadata passed with every request. |
Returns
Promise<SubredditInfo>
A Promise that resolves a SubredditInfo object.
getSubredditInfoByName
▸ getSubredditInfoByName(subredditName, metadata): Promise<SubredditInfo>
Gets a SubredditInfo object by name
Parameters
| Name | Type | Description |
|---|---|---|
subredditName | string | - |
metadata | undefined | Metadata | Optional RPC metadata passed with every request. |
Returns
Promise<SubredditInfo>
A Promise that resolves a SubredditInfo object.
getSubredditLeaderboard
▸ getSubredditLeaderboard(subredditId, metadata): Promise<SubredditLeaderboard>
Parameters
| Name | Type |
|---|---|
subredditId | string |
metadata | undefined | Metadata |
Returns
Promise<SubredditLeaderboard>
getSubredditStyles
▸ getSubredditStyles(subredditId, metadata): Promise<SubredditStyles>
Parameters
| Name | Type |
|---|---|
subredditId | string |
metadata | undefined | Metadata |
Returns
Promise<SubredditStyles>
getVaultByAddress
▸ getVaultByAddress(address, metadata): Promise<Vault>
Parameters
| Name | Type |
|---|---|
address | string |
metadata | undefined | Metadata |
Returns
Promise<Vault>
getVaultByUserId
▸ getVaultByUserId(userId, metadata): Promise<Vault>
Parameters
| Name | Type |
|---|---|
userId | `t2_${string}` |
metadata | undefined | Metadata |
Returns
Promise<Vault>