title: discord.py 1.7.2 - How to private message user
body: <p>discord.py 1.7.2</p>
  <p>use case:</p>
  <blockquote>
  <p>When a user joins my channel, I save their discord id in my database.
  If a user sent a message with the word <code>$sub foo</code> they subscribe to one
  of my services. When they subscribe to this service. They idea is for
  them to get a private message every now and again based on the type</p>
  </blockquote>
  <p>Code</p>
  <pre><code>import discord,os,asyncio
  from discord.ext import commands, tasks
  from Entity.notifications import Notification
  from dotenv import load_dotenv
  
  from discord.utils import get
  bot = commands.Bot(command_prefix='$')
  
  @bot.event
  async def on_ready():
      print('Bot is ready')
  
  @tasks.loop(seconds=10)
  async def user_notification():
      print(&quot;foo&quot;) ##terminal shows the word foo
      await bot.wait_until_ready()
      user_sub_notifications= Notification().get_active_user_sub_notification()
  
      if user_sub_notifications:
          for notification in user_sub_notifications:
              if &quot;user_discord_id&quot; in notification:
                  #get user
                  user = get(bot.get_all_members(), id=notification['user_discord_id'])
                  #get the message to sent to the user
                  message = notification['message']
                  #private message the user
                  #bot.send_message(user, message)
                  
      await asyncio.sleep(10)
  
  load_dotenv() 
  user_notificarion.start()
  bot.run(os.getenv('DISCORD_TOKEN'))
  </code></pre>
  <p>I have tried the follow</p>
  <pre><code>user = get(bot.get_all_members(), id=notification['discord_id']) #got NONE
  bot.send_message(notification['user_discord_id'], message) ##bot has not attribute send_message
  </code></pre>
  <p>how can I private message the user? Thank you</p>