tags.py 文件源码

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

项目:PyMiki 作者: TheGrammarJew 项目源码 文件源码
def box_put(self, ctx, name: TagName, *, content: commands.clean_content):
        """Puts a tag in the tag box.

        These are global tags that anyone can opt-in to receiving
        via the "tag box take" subcommand.
        """

        query = "INSERT INTO tags (name, content, owner_id) VALUES ($1, $2, $3);"

        try:
            await ctx.db.execute(query, name, content, ctx.author.id)
        except asyncpg.UniqueViolationError:
            await ctx.send('A tag with this name exists in the box already.')
        else:
            await ctx.send('Successfully put tag in the box.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号