title: How would I filter the data returned from Slack to find active users?
body: <h2>Question</h2>
  
  <p>How would I filter the <a href="https://api.slack.com/types/user" rel="nofollow noreferrer">user data</a> returned from Slack to find <strong>Active</strong> Slack Users (e.g., users in our workgroup that we pay for)?</p>
  
  <p>If a user is inactive for some time, they no longer cost us (thanks slack!). Also, we can remove people from our workgroup.</p>
  
  <p>How do I filter down the <code>users.list</code> to a list of users we will be charged for? OR What elements from user.list will reveal active membership.</p>
  
  <h2>Issue</h2>
  
  <p>I was filtering for users <em>not</em> deleted:</p>
  
  <pre><code>        const slackActiveAccounts = slackMembers
            .filter(member =&gt; member.deleted == false);
  </code></pre>
  
  <p>But users that have stayed inactive and no longer count against our billing will be found as <code>member.deleted: false</code>. So inactive and deleted are different.</p>
  
  <h2><code>user.list</code> json example</h2>
  
  <p>From the <a href="https://api.slack.com/methods/users.list" rel="nofollow noreferrer">Slack API documentation</a></p>
  
  <pre><code>{
      "ok": true,
      "user": {
          "id": "W012A3CDE",
          "team_id": "T012AB3C4",
          "name": "spengler",
          "deleted": false,
          "color": "9f69e7",
          "real_name": "Egon Spengler",
          "tz": "America/Los_Angeles",
          "tz_label": "Pacific Daylight Time",
          "tz_offset": -25200,
          "profile": {
              "avatar_hash": "ge3b51ca72de",
              "status_text": "Print is dead",
              "status_emoji": ":books:",
              "status_expiration": 1502138999,
              "real_name": "Egon Spengler",
              "display_name": "spengler",
              "real_name_normalized": "Egon Spengler",
              "display_name_normalized": "spengler",
              "email": "spengler@ghostbusters.example.com",
              "image_24": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
              "image_32": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
              "image_48": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
              "image_72": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
              "image_192": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
              "image_512": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
              "team": "T012AB3C4"
          },
          "is_admin": true,
          "is_owner": false,
          "is_primary_owner": false,
          "is_restricted": false,
          "is_ultra_restricted": false,
          "is_bot": false,
          "is_stranger": false,
          "updated": 1502138686,
          "is_app_user": false,
          "has_2fa": false,
          "locale": "en-US"
      }
  }
  </code></pre>