trivia.py 文件源码

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

项目:Chiaki-Nanami 作者: Ikusaba-san 项目源码 文件源码
def convert(cls, ctx, arg):
        lowered = arg.lower()
        with contextlib.suppress(KeyError):
            return cls._default_categories[lowered]

        query = ctx.session.select.from_(cls).where((cls.guild_id == ctx.guild.id)
                                                    & (cls.name == lowered))
        result = await query.first()
        if result is None:
            raise commands.BadArgument(f"Category {lowered} doesn't exist... :(")

        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号