title: Discord BOT - DM someone that leaves server
body: <p>I know that it is possible to DM someone with the bot if you have their ID, but how can I get the users ID's when they enter the server?</p>
  <p>I was thinking:</p>
  <pre><code>@client.event
  async def on_member_leave(member):
  or
  async def on_guild_remove(guild):
     user = await client.fetch_user(**the id**) 
     await user.send(&quot;Your message&quot;)
  </code></pre>