title: Discord.py | How to assign someone a role?
body: <p>I am trying to mute someone using a role <code>Muted</code>
  The Code:</p>
  <pre><code>@bot.command()
  async def mute(ctx, member:commands.MemberConverter):
      role = discord.utils.find(lambda r: r.name == 'Muted', ctx.guild.roles)
      await member.edit(roles=[role])
  </code></pre>
  <p>But I get this weird error:</p>
  <pre><code>Ignoring exception in command mute:
  Traceback (most recent call last):
    File &quot;C:\Users\gathi\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py&quot;, line 85, in wrapped
      ret = await coro(*args, **kwargs)
    File &quot;C:\Users\gathi\Vscode\Discord_Bot\tutorial.py&quot;, line 61, in mute
      await member.edit(roles=[role]) # 848410518154117130
    File &quot;C:\Users\gathi\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\member.py&quot;, line 681, in edit
      await http.edit_member(guild_id, self.id, reason=reason, **payload)
    File &quot;C:\Users\gathi\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\http.py&quot;, line 248, in request
      raise Forbidden(r, data)
  discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File &quot;C:\Users\gathi\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py&quot;, line 939, in invoke
      await ctx.command.invoke(ctx)
    File &quot;C:\Users\gathi\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py&quot;, line 863, in invoke
      await injected(*ctx.args, **ctx.kwargs)
    File &quot;C:\Users\gathi\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py&quot;, line 94, in wrapped
      raise CommandInvokeError(exc) from exc
  discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
  </code></pre>
  <p>I don't understand what to do.</p>
  <p>Here is the perms of the bot:
  <a href="https://i.stack.imgur.com/lroXO.png" rel="nofollow noreferrer">The bots perms</a></p>