Skip to content
Discussion options

You must be logged in to vote

Hello!

Your first issue is caused by re-using the same variable multiple times in an unlucky configuration. You are correct that only the bot needs permissions to create and assign roles, rather than users using the commands. Let's step through the relevant part of the code:

@client.command(aliases=['location', 'loc'])
async def newlocation(ctx, role: str = None):
    ...

    # If no role matching the content of the `role` variable exists the variable will be set to `None` here
    role = discord.utils.get(ctx.guild.roles, name=role)

    if role is None:
        # A new role is being created, however the `name` argument being passed will always be `None`
        # As the `role` variable…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected by Rapptz
Comment options

You must be logged in to vote
2 replies
@LostLuma
Comment options

@ghost
Comment options

Comment options

You must be logged in to vote
4 replies
@LostLuma
Comment options

@ghost
Comment options

@LostLuma
Comment options

@ghost
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant