Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.94k stars 3.77k forks source link

Adding role error #1001

Closed 4lfonzo closed 6 years ago

4lfonzo commented 6 years ago

Hello, i am currently using a self bot and i am making a command that when you run it it should add a role to a user but its not adding the role. my code:

command 7

role = "399581540717428736" @client.command(pass_context = True) async def Blacklist(ctx, *, member : discord.Member = None): if not ctx.message.author.server_permissions.administrator: return

if not member:
    return await client.say(ctx.message.author.mention + "Specify a user to Blacklist!")
try:
    await client.add_roles(user, role)
except Exception as e:
    if 'Privilege is too low' in str(e):
        return await client.say(":x: Privilege too low!")

embed = discord.Embed(description = "**%s** has been Blacklisted!"%member.name, color = 0xFF0000)
return await client.say(embed = embed)
kittenswolf commented 6 years ago

Selfbots are banned: https://support.discordapp.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots- Also, try and fix up the formatting. It's kinda hard to read

4lfonzo commented 6 years ago

Sorry new to this