helpers.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:kitsuchan-2 作者: n303p4 项目源码 文件源码
def role_by_substring(ctx: commands.Context, substring: str):
    """This searches for a role by substrings."""
    try:
        return await roleconverter.convert(ctx, substring)
    except commands.CommandError:
        pass
    substring = substring.lower()
    for role in ctx.guild.roles:
        if substring in role.name.lower():
            return role
    raise commands.BadArgument(f"No role with substring `{substring}` was found.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号