tools.py 文件源码

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

项目:Harmonbot 作者: Harmon758 项目源码 文件源码
def tag_search(self, ctx, *, search : str):
        '''Search your tags'''
        if (await self.check_no_tags(ctx)): return
        tags = self.tags_data[ctx.message.author.id]["tags"]
        results = [t for t in tags.keys() if search in t]
        if results:
            await self.bot.embed_reply("{} tags found: {}".format(len(results), ", ".join(results)))
            return
        close_matches = difflib.get_close_matches(search, tags.keys())
        close_matches = "\nDid you mean:\n{}".format('\n'.join(close_matches)) if close_matches else ""
        await self.bot.embed_reply("No tags found{}".format(close_matches))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号