def _check_role(ctx, role, thing):
if role.managed:
raise commands.BadArgument("This is an integration role, I can't assign this to anyone!")
# Assigning people with the @everyone role is not possible
if role.is_default():
message = ("Wow, good job. I'm just gonna grab some popcorn now..."
if ctx.message.mention_everyone else
"You're lucky that didn't do anything...")
raise commands.BadArgument(message)
if role.permissions.administrator:
message = ("This role has the Administrator permission. "
"It's very dangerous and can lead to terrible things. "
f"Are you sure you wanna make this {thing} role?")
try:
result = await ctx.ask_confirmation(message)
except asyncio.TimeoutError:
raise commands.BadArgument("Took too long. Aborting...")
else:
if not result:
raise commands.BadArgument("Aborted.")
评论列表
文章目录