Skip to content

Commit

Permalink
feat: add join_requests state to new modmail
Browse files Browse the repository at this point in the history
  • Loading branch information
Venefilyn committed May 15, 2021
1 parent 498a8d5 commit f99e984
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/snoowrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1183,9 +1183,11 @@ can get a post and a comment * @returns {Promise<Listing<Submission|Comment>>
*
* r.getUnreadNewModmailConversationsCount().then(console.log)
* // => {
* // highlighted: 1,
* // archived: 1,
* // appeals: 1,
* // highlighted: 0,
* // notifications: 0,
* // archived: 0,
* // join_requests: 0,
* // new: 2,
* // inprogress: 5,
* // mod: 1,
Expand All @@ -1198,7 +1200,7 @@ can get a post and a comment * @returns {Promise<Listing<Submission|Comment>>
/**
* @summary Mark Modmail conversations as read given the subreddit(s) and state.
* @param {Subreddit[]|String[]} subreddits
* @param {('new'|'inprogress'|'mod'|'notifications'|'archived'|'highlighted'|'all')} state selected state to mark as read
* @param {('archived'|'appeals'|'highlighted'|'notifications'|'join_requests'|'new'|'inprogress'|'mod'|'all')} state selected state to mark as read
* @returns {Promise<Listing<ModmailConversation>>} a Listing of ModmailConversations marked as read
* @example
*
Expand Down
5 changes: 3 additions & 2 deletions test/snoowrap.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2155,10 +2155,11 @@ describe('snoowrap', function () {
it('can retrieve amount of of unread Modmail conversations', async () => {
const count = await r.getUnreadNewModmailConversationsCount();
expect(Object.keys(count)).to.have.members([
'highlighted',
'notifications',
'archived',
'appeals',
'highlighted',
'join_requests',
'notifications',
'new',
'inprogress',
'mod'
Expand Down

0 comments on commit f99e984

Please sign in to comment.