def convert(self, ctx, arg):
if not ctx.guild:
raise commands.NoPrivateMessage
self_roles = await _get_self_roles(ctx)
if not self_roles:
message = ("This server has no self-assignable roles. "
f"Use `{ctx.prefix}asar` to add one.")
raise commands.BadArgument(message)
temp_guild = copy.copy(ctx.guild)
temp_guild.roles = self_roles
with temp_attr(ctx, 'guild', temp_guild):
try:
return await super().convert(ctx, arg)
except commands.BadArgument:
raise commands.BadArgument(f'{arg} is not a self-assignable role...')
评论列表
文章目录