title: Why error - AttributeError: 'NoneType' object has no attribute
body: <p>I just coding discord bot, and need help with adding roles to users.</p>
  <p>I used script :</p>
  <pre><code>import discord #first script line
  
  bot = discord.Client()
  
  
  @bot.event
  async def on_ready():
  await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name=&quot; //help&quot;))
  guild_count = 0
  
  for guild in bot.guilds:
      print(f&quot;- {guild.id} (name: {guild.name})&quot;)
  
      guild_count = guild_count + 1
  print(&quot;Verify bot is in &quot; + str(guild_count) + &quot; guilds.&quot;)
  
  @bot.event
  async def on_message(message):
  if message.content == &quot;//verify&quot;: #first command
      member = message.author
      wait_until_ready()
      var = discord.utils.get(message.guild.roles, name=&quot;verifyed&quot;)
      await member.add_roles(var)
      await message.author.send(&quot;You are verifyed on server! Thanks for using!&quot;)
      await message.author.send(&quot;Vote for our bot : **we are not in bot list already**&quot;)
      embed = discord.Embed(title='Verify',description='User verifyed! Use **//verify to verify your self!')
      await message.add_reaction('✅')
      embed.set_footer(text=&quot;Coded by Puk3l YT#2657&quot;)
      await message.channel.send(message.channel, embed=embed)
  </code></pre>
  <p>Then I just tested the code, and get error message :</p>
  <pre><code>Ignoring exception in on_message
  Traceback (most recent call last):
    File &quot;C:\Users\mykem\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\client.py&quot;, line 343, in _run_event
  await coro(*args, **kwargs)
    File &quot;C:\Users\mykem\Desktop\bot\online_bot.py&quot;, line 23, in on_message
      await member.add_roles(var)
    File &quot;C:\Users\mykem\AppData\Local\Programs\Python\Python38-32\lib\site- packages\discord\member.py&quot;, line 676, in add_roles
  await req(guild_id, user_id, role.id, reason=reason)
  AttributeError: 'NoneType' object has no attribute 'id'
  </code></pre>
  <p>What can I do? Can someone help me? Thank you for all answers</p>