title: How to send a DM to new members of a discord server using a discord bot (python 3)
body: <p>I have tried using a few ways all of which did not cause any error messages (or if they did they were easy to fix) but they still did not send the DM.</p>
  <p>the way that I'm most confident of is:</p>
  <pre><code>@client.event
  async def on_member_join(member):
      await member.create_dm()
      await member.dm_channel.send(
          f'Hi {member.name}, welcome to my Discord server!'
      )
  </code></pre>
  <p>There could be multiple issues with this but for the moment I'm stuck on the second line; it doesn't actually activate if a user joins my server (I tested this by just shoving a print command straight after it and watching the output as I joined the server on an alt). Any ideas would be appreciated. :)</p>
  <p>oh yeah I tried another way that might work but I couldn't get to: <a href="https://stackoverflow.com/questions/50427182/how-to-make-discord-bot-send-a-new-user-dm">how to make discord bot send a new user DM?</a></p>