tags.py 文件源码

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

项目:PyMiki 作者: TheGrammarJew 项目源码 文件源码
def box_search(self, ctx, *, query: commands.clean_content):
        """Searches for a tag in the tag box.

        The query must be at least 3 characters long.
        """

        if len(query) < 3:
            return await ctx.send('Query must be 3 characters or longer.')

        sql = "SELECT name FROM tags WHERE name % $1 AND location_id IS NULL LIMIT 100;"
        data = await ctx.db.fetch(sql, query)

        if len(data) == 0:
            return await ctx.send('No tags found.')

        await ctx.release()

        data = [r[0] for r in data]
        data.sort()

        try:
            p = Pages(ctx, entries=data, per_page=20)
            await p.paginate()
        except Exception as e:
            await ctx.send(e)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号