def can_use_box():
def pred(ctx):
if ctx.guild is None:
return True
if ctx.author.id == ctx.bot.owner_id:
return True
has_perms = ctx.channel.permissions_for(ctx.author).manage_messages
if not has_perms:
raise UnableToUseBox()
return True
return commands.check(pred)
# The tag data is heavily duplicated (denormalized) and heavily indexed to speed up
# retrieval at the expense of making inserts a little bit slower. This is a fine trade-off
# because tags are retrieved much more often than created.
评论列表
文章目录