moderator-toolbox-nxg-for-reddit / modules/removalreasons/moduleapi
modules/removalreasons/moduleapi¶
Functions¶
getNativeReasons()¶
getNativeReasons(
subreddit,options?):Promise<NativeRemovalReason[]>
Defined in: extension/data/modules/removalreasons/moduleapi.ts:41
Fetches a subreddit’s native (Reddit-configured) removal reasons, used both as a
fallback for the removal overlay when the subreddit has no Toolbox reasons configured
and as the source for the opt-in native reason sync. Kept here so dom.tsx and the
sync runner read native reasons through the module’s api layer rather than importing
an api/resources module directly.
Parameters¶
subreddit¶
string
The bare subreddit name.
options?¶
Fetch options. fresh bypasses the cache and refreshes it.
fresh?¶
boolean
Returns¶
Promise<NativeRemovalReason[]>
getRemovalReasons()¶
getRemovalReasons(
subreddit,allowNonModerated?):Promise<false|RemovalReasonsConfig>
Defined in: extension/data/modules/removalreasons/moduleapi.ts:16
Recursively resolves removal reasons for a subreddit, following getfrom redirects.
Returns the removalReasons config object, or false if not configured.
Parameters¶
subreddit¶
string
The bare subreddit name.
allowNonModerated?¶
boolean = false
Read even when the viewer doesn’t moderate the sub. A getfrom
redirect can point at a different subreddit the viewer doesn’t moderate (shared removal
reasons), which must still resolve; the acting sub keeps the default mod-gate.
Returns¶
Promise<false | RemovalReasonsConfig>
saveRemovalConfig()¶
saveRemovalConfig(
subreddit,config,reason):Promise<ConfigSaveResult>
Defined in: extension/data/modules/removalreasons/moduleapi.ts:54
Saves the full toolbox wiki config for a subreddit.
Parameters¶
subreddit¶
string
The bare subreddit name.
config¶
The full toolbox config object.
reason¶
string
The wiki revision note.
Returns¶
Promise<ConfigSaveResult>