def __error(self, ctx, error):
if isinstance(error, (UnavailableTagCommand, UnableToUseBox)):
await ctx.send(error)
elif isinstance(error, commands.UserInputError):
if ctx.command.qualified_name == 'tag':
await ctx.acquire()
await ctx.show_help()
else:
await ctx.send(error)
# @cache.cache()
# async def get_tag_config(self, guild_id, *, connection=None):
# # tag config is stored as a special server-wide tag, 'config'
# # this 'config' value is serialised as JSON in the content
# query = """SELECT content FROM tags WHERE name = 'config' AND location_id = $1;"""
# con = connection if connection else self.bot.pool
# record = await con.fetchrow(query, guild_id)
# if record is None:
# return TagConfig({})
# return TagConfig(json.loads(record['content']))
评论列表
文章目录