Class: WikiPage

WikiPage

A class representing a wiki page on a subreddit.

Note: Due to a bug in reddit's CORS settings, it is not possible to fetch the contents of a wiki page on a private
subreddit while running snoowrap in a browser. (This issue does not apply when running snoowrap in Node.js.)

new WikiPage()

Example

// Get a wiki page on a given subreddit by name
r.getSubreddit('AskReddit').getWikiPage('rules')

editSettings(options)

Parameters:

Name

Type

Description

options

object

Properties

Name

Type

Description

listed

boolean

Determines whether this wiki page should appear on the public list of pages for this
subreddit.

permissionLevel

number

Determines who should be allowed to access and edit this page 0 indicates that
this subreddit's default wiki settings should get used, 1 indicates that only approved wiki contributors on this subreddit
should be able to edit this page, and 2 indicates that only mods should be able to view and edit this page.

Returns:

A Promise that fulfills with this WikiPage when the request is complete

Example

fetch()

Fetches this content from reddit.

This will not mutate the original content object; all Promise properties will remain as Promises after the content has
been fetched. However, the information on this object will be cached, so it may become out-of-date with the content on
reddit. To clear the cache and fetch this object from reddit again, use refresh().

If snoowrap is running in an environment that supports ES2015 Proxies (e.g. Chrome 49+), then fetch() will get
automatically called when an unknown property is accessed on an unfetched content object.

Returns:

A version of this object with all of its fetched properties from reddit. This will not mutate the
object. Once an object has been fetched once, its properties will be cached, so they might end up out-of-date if this
function is called again. To refresh an object, use refresh().