From 853c452a5a0e3c24ee72b3b05ffa0ce9495b1cd3 Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Thu, 23 Jun 2022 13:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E`ysda`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Paimon_Info/__init__.py | 19 ++++++++++++++++--- README.md | 9 ++++++--- UPDATE_LOG.md | 5 ++++- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Paimon_Info/__init__.py b/Paimon_Info/__init__.py index c90ed56..2ea2627 100644 --- a/Paimon_Info/__init__.py +++ b/Paimon_Info/__init__.py @@ -573,9 +573,14 @@ async def _(event: MessageEvent, state: T_State, msg: Message = CommandArg()): msg = msg.extract_plain_text().replace(state['uid'], '').strip() if not msg: await role_info.finish('请把要查询角色名给派蒙哦~') + if msg.startswith(('a', '全部', '所有', '查看')): + state['role'] = 'all' else: match_alias = get_match_alias(msg, 'roles', True) - state['role'] = match_alias if isinstance(match_alias, str) else tuple(match_alias.keys())[0] + if match_alias: + state['role'] = match_alias if isinstance(match_alias, str) else tuple(match_alias.keys())[0] + else: + await role_info.finish(MsgBd.Text(f'哪有名为{msg}的角色啊,别拿派蒙开玩笑!')) @role_info.got('uid', prompt='请把要查询的uid给派蒙哦~') @@ -590,8 +595,16 @@ async def _(event: MessageEvent, state: T_State): role = state['role'] player_info = PlayerInfo(uid) roles_list = player_info.get_roles_list() + if role == 'all': + if not roles_list: + await role_info.finish('你在派蒙这里没有角色面板信息哦,先用 更新角色信息 命令获取吧~', at_sender=True) + res = '目前已获取的角色面板有:\n' + for r in roles_list: + res += r + res += ' ' if (roles_list.index(r) + 1) % 4 else '\n' + await role_info.finish(res, at_sender=True) if role not in roles_list: - await role_info.finish(MsgBd.Text(f'派蒙还没有你{role}的信息哦,请先把该角色放在游戏内展柜中,然后使用 更新角色信息 命令更新~'), at_sender=True) + await role_info.finish(MsgBd.Text(f'派蒙还没有你{role}的信息哦,先用 更新角色信息 命令更新吧~'), at_sender=True) else: role_data = player_info.get_roles_info(role) img = await draw_role_card(uid, role_data) @@ -709,7 +722,7 @@ async def daily_update(): await reset_public_cookie() -@scheduler.scheduled_job('cron', hour=3, misfire_grace_time=10) +# @scheduler.scheduled_job('cron', hour=3, misfire_grace_time=10) async def all_update(): uid_list = await get_all_query() logger.info('派蒙开始更新用户角色信息,共{}个用户'.format(len(uid_list))) diff --git a/README.md b/README.md index a91b2ed..7a26d48 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,9 @@ ## 丨更新日志 -> README只展示最近2条更新,全部更新日志详见[这里](https://github.com/CMHopeSunshine/LittlePaimon/blob/nonebot2/UPDATE_LOG.md) +> README只展示最近3条更新,全部更新日志详见[这里](https://github.com/CMHopeSunshine/LittlePaimon/blob/nonebot2/UPDATE_LOG.md) + 6.21 - - 适配`nonebot2 beta4`插件元数据,请更新nb版本`pip install nonebot2 --upgrade` + - 适配`nonebot2 beta4`插件元数据,**请更新nb版本`pip install nonebot2 --upgrade`** - `Paimon_Chat`现在可以发图片、视频等,可自行添加 - 修复`Paimon_Wiki`搜索对象名结果只有一个时仍需要选择的bug - 对对联功能api更换 @@ -76,7 +76,10 @@ + 6.22 - 增加文本敏感词过滤 - fix `原神日历`和发送图片bug - ++ 6.23 + - 新增查看所有已获取面板信息的角色的列表`ysda` + - 暂时取消凌晨3点的自动更新角色面板操作 + ## 丨功能列表 详见我的博客[功能列表](https://blog.cherishmoon.fun/posts/nonebot2funclist.html)
diff --git a/UPDATE_LOG.md b/UPDATE_LOG.md index c4cd3d3..714a06a 100644 --- a/UPDATE_LOG.md +++ b/UPDATE_LOG.md @@ -45,4 +45,7 @@ - 添加`pyproject.toml`和`poetry.lock` + 6.22 - 增加文本敏感词过滤 - - fix `原神日历`和发送图片bug \ No newline at end of file + - fix `原神日历`和发送图片bug ++ 6.23 + - 新增查看所有已获取面板信息的角色的列表`ysda` + - 暂时取消凌晨3点的自动更新角色面板操作 \ No newline at end of file