def remove_(self, ctx, role: Role):
"""
Removes a role.
Available Roles List:
- ping
- battlenet
If the argument given is not a valid role in the guild, it will safely ignore it.
If the argument is a valid role in the guild and is not in the available roles list, it will flag it as invalid.
"""
whitelisted_roles = [
utils.get(ctx.guild.roles, name="ping"),
utils.get(ctx.guild.roles, name="battlenet")
]
if role in whitelisted_roles:
await ctx.author.remove_roles(role, reason="Used role command")
await ctx.send(f"Removed `{role}` from {ctx.author.mention}.")
else:
await ctx.send(
f"""
`{role}` is not a valid role!
Do `{ctx.prefix}help role remove` for more information. {ctx.author.mention}
"""
)
评论列表
文章目录