I have code in which you can type -giverole
e.g. -giverole @Soup Board of Executives
.
What I need now is a method tha
You can use discord.Member.roles to do something like
from discord.utils import get
@client.command(pass_context=True)
async def giverole(ctx, member: discord.Member, *, role: discord.Role):
check_role = get(ctx.message.server.roles, name='Board of Executives')
if check_role not in member.roles:
await client.say(f"You don't have the role '{str(role)}'")
else:
await client.add_roles(member, role)
await client.say(f"The role '{str(role)}' has been given to {member.mention}.")