Skip to content

Commit

Permalink
feat: add a way to get the approved wiki contributors for a subreddit
Browse files Browse the repository at this point in the history
  • Loading branch information
thislooksfun committed Mar 27, 2022
1 parent c1edba2 commit aaf06e7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/reddit/subreddit/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,20 @@ export class SubredditControls extends BaseControls {
await this.unfriend(subreddit, username, "wikicontributor");
}

/**
* Get the list of approved wiki contributors for a subreddit.
*
* @note Due to the way Reddit implements Listings, this will only contain the
* first 1000 wiki contributors.
*
* @param subreddit The name of the subreddit to get wiki contributors for.
*
* @returns A listing of approved wiki contributors.
*/
getWikiContributors(subreddit: string): Listing<User> {
return this.getAboutListingUsers(subreddit, "wikicontributors");
}

/**
* Ban a user from a subreddit.
*
Expand Down
12 changes: 12 additions & 0 deletions src/reddit/subreddit/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,18 @@ export class Subreddit extends Content implements SubredditData {
return this.controls.removeWikiContributor(this.displayName, username);
}

/**
* Get the list of approved wiki contributors for a subreddit.
*
* @note Due to the way Reddit implements Listings, this will only contain the
* first 1000 wiki contributors.
*
* @returns A listing of approved wiki contributors.
*/
getWikiContributors(): Listing<User> {
return this.controls.getWikiContributors(this.displayName);
}

/**
* Ban a user from this subreddit.
*
Expand Down

0 comments on commit aaf06e7

Please sign in to comment.