Skip to content

Modnotes

JamesxX edited this page Apr 19, 2022 · 5 revisions

This page will cover the principles of mod notes on Reddit, as well as the functionality that TRAW exposes to interact and manipulate these.

About

In 2022, Reddit announced its plans to support "Mod notes" natively. These are bits of information available only to moderators of a given subreddit, about users on that subreddit, that contain raw text and optionally a category. These notes are made accessible to third-parties through the Reddit API, and therefore by extension, TRAW.

Getting a mod note about a user through TRAW

To get a mod note about a user, two things must first be known: The user in question (or specifically, their unprefixed display name), and the subreddit on which the desired mod note resides (again, its unprefixed display name). Optionally, the search can be refined by label. Using this information, a call can be made to traw.getModnotes(), which returns an object of type ModnoteResponse (see https://jamesxx.github.io/traw/classes/traw.html#getModnotes). Within this object is a property called mod_notes which is an array of returned mod notes (of type Modnote, if one is being repetitious).

Please see the following resources for more information:

Deleting a mod note

To delete a mod note, there are two options. Firstly, if the Modnote object you wish to delete is to hand, simply cally Modnote.delete() should do the trick. Internally, and relevant to the second method, this called traw.deleteModnote(), however, this requires knowing not only the user and subreddit of the modnote, but also its ID.

Please see the following resources for more information:

Creating a mod note

If instead you wish to create a mod note about a user, a call to traw.createModnote() will do the trick. Required to call this function are the parameters user (either a RedditUser object, or a string containing the unprefixed user's display name), subreddit (either a Subreddit object, or a string containing the unprefixed subreddit's display name), and note, a string of up to 250 characters to be stored. Optionally, you can also provide the label type of the mod note to be created, as well as link the new modnote to a pre-existing comment or submission (given to the function in the form of a string containing the prefixed RedditContent ID. Calling this function will return a Modnote object.

Please see the following resources for more information:

Clone this wiki locally