title: How can i check if a person has went online, offline, etc. in discord.js?
body: <pre><code>const channel = client.channels.cache.get('&lt;channelid&gt;');
  const person1 = client.users.cache.get('&lt;userid&gt;');
  const person = client.users.cache.get('&lt;userid&gt;');
  
  client.on('message', message =&gt;{
    client.on('presenceUpdate', () =&gt;{
  
      if(person1.user.presence.status === 'dnd' || person1.user.presence.status === 'online'){
        channelforstatus.send('person1 is now online');
      }
  
      else if(peron1.user.presence.status === 'offline' || person1.user.presence.status === 'idle'){
        channel.send('person1 is offline');
      }
  
  client.on('message', message =&gt; {
    client.on('presenceUpdate', () =&gt;{
  
      if(person.user.presence.status === 'dnd' || person.user.presence.status === 'online'){
        channel.send('person is now on');
      }
  
      else if(person.user.presence.status === 'offline' || person.user.presence.status === 'idle'){
        channel.send('person is now off');
      }
  
    });
  });
  
    });
  
  });
  </code></pre>
  
  <p>This is what I've tried and the <code>.send()</code> the function is not working. I've looked everywhere and found nothing that could help me with this problem. I just need it so it checks every time if a specific person has went online, offline, etc. And sends a message to a specific channel.</p>