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