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))
评论列表
文章目录