title: How can I make on_member_update only trigger once even though the member and bot share multiple Discord servers?
body: <p>I'm trying to use <code>async def on_member_update(before, after)</code> to detect when a member's status becomes &quot;online&quot; (without needing ANY input from a user) and send a single message. This technically does the job but gets triggered multiple times, so it sends multiple messages. As I understand it, it's because the member and bot share multiple Discord servers. I need to know how to get the function to only trigger once because I don't need the bot to send multiple messages when a single user comes online.</p>
  <pre class="lang-py prettyprint-override"><code>@client.event 
  async def on_member_update(before, after):
       print(after)    
  
       if (str(before.status) == &quot;offline&quot;):         `
       
       if (str(after.status) == &quot;online&quot;)):             `
  
        await client.get_channel(id = 925882783509934161).send(&quot;Yo?&quot;)                     
  
        print(&quot;online&quot;)             
  
        print(after)`
  </code></pre>
  <p>I tried making the if statement include a bool, then if that bool was true, it would change it to false, then another part of the code would change it back to true to be run again. This still resulted in the function being called multiple times with no change in behaviour at all. That was the only idea I had. Any ideas?</p>