profile.py 文件源码

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

项目:PyMiki 作者: TheGrammarJew 项目源码 文件源码
def convert(self, ctx, argument):
        cog = ctx.bot.get_cog('Splatoon')
        if cog is None:
            raise commands.BadArgument('Splatoon related commands seemingly disabled.')

        query = argument.strip('"')
        if len(query) < 4:
            raise commands.BadArgument('Weapon name to query must be over 4 characters long.')

        weapons = cog.get_weapons_named(query)

        try:
            weapon = await ctx.disambiguate(weapons, lambda w: w['name'])
        except ValueError as e:
            raise commands.BadArgument(str(e)) from None
        else:
            return weapon
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号