Hi, im making a bot for my server in discord.py and ive ran into trouble with my role command. I can't find or think of a way to allow you to enter in multiple users at once to receive the role instead of having to do the command one by one, can anyone help with this? im new to discord.py so im still working stuff out.
here is my current command, im not averse to completely changing the logic of the command or anything:
@bot.command()
async def role(ctx, user : discord.Member, *, role : discord.Role):
if role.position > ctx.author.top_role.position:
return await ctx.send('That role is too high.')
if role in user.roles:
await user.remove_roles(role)
await ctx.send(f"Removed {role} from {user}")
else:
await user.add_roles(role)
await ctx.send(f"Added {role} to {user}")