title: Trying to add a warning role when a user says something
body: <p><s>Title pretty much says it all, I'm trying add the roles 'Warning 1' or 'Warning 2' when a user says something that is contained within <code>bannedWords</code>. I've seen people use <code>await bot.add_roles()</code> and just <code>await add_roles()</code> but both of those return an error. They give an <code>AttributeError</code> and <code>NameError</code> respectively. Am I missing an import or is there something that I did wrong?</s> Fixed</p>
  <p><s>Alright so I found the answer to my first problem but am now getting a <code>discord.errors.NotFound: 404 Not Found (error code: 10011): Unknown Role</code> error.</s></p>
  <p>Discord was trying to add the role <code>message.author</code> when using <code>await message.author.add_roles(message.author,role,reason='Reason: Used \'%s\' in \'%s\ , on %s/%s/%s (day,month,year) at %s' % (word, str(message.channel),day,month,year,time))</code> removing the second <code>message.author</code> fixes this, so it should be:</p>
  <pre><code>await message.author.add_roles(role,reason='Reason: Used \'%s\' in \'%s\ , on %s/%s/%s (day,month,year) at %s' % (word, str(message.channel),day,month,year,time))
  </code></pre>
  <p>Attribute Error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\Me\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\client.py&quot;, line 312, in _run_event
      await coro(*args, **kwargs)
    File &quot;C:\Users\Me\Desktop\Productive\Programming Projects\Python 3\Other\MyBot\bot.py&quot;, line 41, in on_message
      await bot.add_roles(message.author,role,reason='Reason: Used \'%s\' in \'%s\ , on %s/%s/%s (day,month,year) at %s' % (word, str(message.channel),day,month,year,time))
  AttributeError: 'Client' object has no attribute 'add_roles'
  </code></pre>
  <p>NameError:</p>
  <pre><code>Ignoring exception in on_message
  Traceback (most recent call last):
    File &quot;C:\Users\Me\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\client.py&quot;, line 312, in _run_event
      await coro(*args, **kwargs)
    File &quot;C:\Users\Me\Desktop\Productive\Programming Projects\Python 3\Other\MyBot\bot.py&quot;, line 41, in on_message
      await add_roles(message.author,role,reason='Reason: Used \'%s\' in \'%s\ , on %s/%s/%s (day,month,year) at %s' % (word, str(message.channel),day,month,year,time))
  NameError: name 'add_roles' is not defined
  </code></pre>
  <p>All Relevant Code</p>
  <pre class="lang-py prettyprint-override"><code>import discord;from discord.utils import get
  from datetime import datetime
  bot=discord.Client()
  
  @bot.event
  async def on_ready():
      print('Logged in')
      print('Username: %s' % (bot.user.name))
      print('Userid: %s' % (bot.user.id))
  
  @bot.event
  async def on_message(message):
      if message.author.id == bot.user.id:
          return
      # delete messages with banned words
      bannedWords=['chink','dyke','fag','ook','molest','nig','rape','retard','spic','zipperhead','tranny']
      if str(message.channel)!='no-rules-lol':
          for word in bannedWords:
              if word in message.content.lower():
                  await message.channel.send('{0.author.mention}, you have used a word that is black-listed please read &lt;#754763230169006210&gt; to get a full list of black-listed words'.format(message))
                  await message.delete()
  
                  #guild=bot.get_guild(id=754064902611796008)
                  #role=discord.utils.get(guild.roles,name='Warning 1')
                  #member=guild.get_member(message.author.id)
                  # get the time the warning was applied.
                  currentTime,_=str(datetime.now()).split('.')
                  date,time=currentTime.split(' ')
                  year,month,day=date.split('-')
                  print('message = ' + str(message))
                  role=get(message.guild.roles,name=&quot;Warning 1&quot;)
                  await message.author.add_roles(message.author,role,reason='Reason: Used \'%s\' in \'%s\ , on %s/%s/%s (day,month,year) at %s' % (word, str(message.channel),day,month,year,time))
  
  bot.run(Token)
  
  </code></pre>