tags.py 文件源码

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

项目:PyMiki 作者: TheGrammarJew 项目源码 文件源码
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']))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号