title: How do I make my bot remove/delete roles in discord.py?
body: <pre><code>@client.command()
  async def removerole(ctx, *, role: discord.Role = None):
      if ctx.author.guild_permissions.administrator and role:
          guild = ctx.guild
          await guild.delete_role(role.guild, name=role)
          await ctx.send(f&quot;&quot;&quot;{ctx.author.mention} The role has been deleted&quot;&quot;&quot;)
      else:
          await ctx.send(f&quot;&quot;&quot;Sorry {ctx.author.mention}, you either don't have the administrator permissions or you misspelled or did not include the name of the role you would like to remove.&quot;&quot;&quot;)
  </code></pre>
  <p>This is the current code I have for a removerole command. I've either done my code wrong or maybe delete_role has been removed in the latest version of discord.py rewrite because I'm getting this error</p>
  <pre><code>discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Guild' object has no attribute 'delete_role'
  </code></pre>
  <p>I hope someone will be able to help me :&gt;</p>