590 Commits

Author SHA1 Message Date
42e8693463 🍱 更新xx用什么的数据集 2023-04-15 01:43:55 +08:00
92e032077c 🍱 更新收集的宝箱数据 2023-04-14 11:59:02 +08:00
00b1ebd71e 🍱 更新新圣遗物数据 2023-04-13 14:22:08 +08:00
de71e83be8 添加查询琦良良换xx圣遗物的支持 2023-04-13 01:09:38 +08:00
a398fcc0f3 🍱 更新原神3.6版本的metadata 2023-04-12 01:02:06 +08:00
11840e0f75 🍱 更新血量表等杂图资源 2023-04-09 00:56:25 +08:00
77a597cfca 🍱 更新原石预估素材 2023-04-02 00:28:44 +08:00
b128fd38b8 🍱 新增新角色的参考面板,优化体验 2023-04-01 00:49:53 +08:00
447b24dde9 🍱 更新参考面板版本深渊内容 2023-03-25 13:26:17 +08:00
72c36be0a9 🐛 修复材料 (#470) 2023-03-21 23:25:17 +08:00
2c07c490bb 🍱 更新原石预估 2023-03-14 00:23:47 +08:00
914ff0e83b 添加gsrc的图片版 (#467)
*  添加gsrc的图片版

* 🚨 auto fix by pre-commit-ci

*  添加`gsrc`的图片版

* 🚨 auto fix by pre-commit-ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-12 22:54:02 +08:00
a9eacfbe0c 🐛 修改bot_id为正确数值 2023-03-10 09:46:38 +08:00
91f0ee82b9 新增导出v3数据 2023-03-09 23:23:46 +08:00
8727fb0bc1 新增gsrc (#463) 2023-03-08 22:41:14 +08:00
6cb7bd7ab8 🐛 修复查询白术的数据异常 2023-03-02 22:24:34 +08:00
efa924c1a8 🍱 补充部分原神3.6的数据资料 2023-03-02 21:49:58 +08:00
01b9d48b38 ️ 支持查询白术查询卡维,修复几个BUG,优化体验 2023-03-02 21:18:40 +08:00
b84764d907 🎨 回退查询深渊的更改 (#462) 2023-03-02 09:49:40 +08:00
236fbebd3b 🎨 删除通用获取成功log (#461) 2023-03-02 02:34:07 +08:00
a9600d85b7 🐛 修补MetaData, 调整BUG(#461) 2023-03-02 00:04:21 +08:00
b087dd7f24 🍱 更新原神3.5版本MetaData 2023-03-01 01:22:22 +08:00
083f55d852 🎨 更新切换api的API地址 2023-02-15 21:07:31 +08:00
5aec15e9f4 🐛 修复下载全部资源的问题 2023-02-14 23:26:28 +08:00
d952e1bf78 下载全部资源将会检查版本差异 2023-02-14 22:30:06 +08:00
2e4120bf89 🎨 优化抽卡记录导入 (#451)
* 🎨 优化抽卡记录导入

* 🚨 auto fix by pre-commit-ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-14 14:09:13 +08:00
a325bfe4f2 🐛 修复部分情况下,扫码登陆无法获取正确UID 2023-02-11 16:17:46 +08:00
f9e84e5fdf 🎨 优化扫码登录流程 (#444)
* 🎨 优化扫码登录流程

* 🚨 auto fix by pre-commit-ci

* 🎨 优化扫码登录流程

* 🎨 优化扫码登录流程

* 🎨 优化扫码登录流程

* 🚨 auto fix by pre-commit-ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-11 00:30:12 +08:00
c8588a2848 新增强制刷新抽卡记录 2023-02-09 02:03:31 +08:00
79d1e86200 📝 合并雷神和薙刀效果 2023-02-08 00:31:00 +08:00
40217dba09 🚑️ 修复删除配置项错误的问题 2023-02-07 00:09:35 +08:00
2cb0ccd452 🎨 移除失效配置、新增随机图配置 2023-02-06 23:47:35 +08:00
52b1c06125 🐛 修复查询雷神的数值错误 2023-02-06 23:40:31 +08:00
1f54160e2b 📝 更新查询收集的最大值 2023-02-05 22:05:36 +08:00
15fc075878 👽️ 更换随机图接口地址 (#441) 2023-02-05 22:02:46 +08:00
2a03b056da 🐛 修复群聊内gs开启&签到群推送 (#440)
* 🐛 修复群聊内设置&签到推送

* 🐛 修复群聊内设置&签到推送
2023-02-05 20:23:33 +08:00
6bf9cef4f4 📝 更新攻略、gs帮助、修复伤害参考bug 2023-02-04 19:12:47 +08:00
c3562ae49e 🎨 适配adapter-ntchat-0.3.5 (#438) 2023-02-04 16:54:26 +08:00
de312d2314 🎨 微调强制刷新界面` 2023-02-03 00:30:18 +08:00
db96d23876 🎨 修改强制刷新界面 2023-02-02 00:29:38 +08:00
ecb286b33f 👽 更新ENKA_API 2023-01-29 22:52:36 +08:00
a93787bfea 🐛 修复了一些已知问题 (#436)
* 🚨 修复了一些已知问题

* 🚨 auto fix by pre-commit-ci

* 🐛 修复UID的查找方式

* 🚨 auto fix by pre-commit-ci

* Update Character.py

* Update Fight.py

* Update get_xk_data.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-29 21:58:15 +08:00
f93eb116f1 🐛 修复无法获取被@人问题 (#434)
* 🐛 修复无法获取被@人问题

* 🚨 auto fix by pre-commit-ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-28 11:47:29 +08:00
3265e2cf0d 🍱 更新3.4血量表抗性表 2023-01-27 23:44:57 +08:00
2c4c3589fc 🐛 修复注册时间 2023-01-26 20:28:33 +08:00
77ea5118a2 🚨 修复一部分flake8警告 2023-01-26 19:31:30 +08:00
a7e0477f72 新增原神注册时间命令 (#431)
* 🎨 图片调整

* 🐛修复查询命令报错

适配器问题,“原图”功能无法使用

* Update requirements.txt

* 🚨 auto fix by pre-commit-ci

* 🐛修复无法导入抽卡记录的问题

* 🐛修复无法导入抽卡记录的问题

* 🚨 auto fix by pre-commit-ci

* 🐛修复“导入抽卡记录”

* 🚨 auto fix by pre-commit-ci

* 🐛修复抽卡记录导入

* 🐛修复抽卡记录导入

* 🚨 auto fix by pre-commit-ci

* 🐛 修复公告图片推送

* 🐛 修复定时公告推送的图片发送问题

Co-authored-by: MingxuanGame <MingxuanGame@outlook.com>

* 🐛 修复定时公告推送的图片发送问题

Co-authored-by: MingxuanGame <MingxuanGame@outlook.com>

* 🎨 修改convert_img错误

* 🐛 修复公告异常报错问题

* 新增原神注册时间命令

* 🐛修复获取公告时报错

*  新增原神注册时间命令

* 🚨 auto fix by pre-commit-ci

*  新增原神注册时间命令

注释Debug~

* 🚨 auto fix by pre-commit-ci

* fix

* 🚨 auto fix by pre-commit-ci

* 🎨 修改一部分代码

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: MingxuanGame <MingxuanGame@outlook.com>
Co-authored-by: KimigaiiWuyi <444835641@qq.com>
2023-01-26 19:00:50 +08:00
fe59404ee9 🐛 修复查询心海的伤害计算和毕业度错误 2023-01-25 20:58:37 +08:00
402184496f 🎨扫码登陆增加风险提示 (#430) 2023-01-25 16:41:33 +08:00
6a3504026b 新增chbg文件夹以供查询角色的自定义图 2023-01-24 00:03:22 +08:00
59184adea7 新增查成就查委托 2023-01-23 15:56:28 +08:00
83fd57ec54 🍱 更新一部分成就资源 2023-01-23 15:21:41 +08:00
e6979b75be 🍱 更新艾尔海森瑶瑶的参考面板 2023-01-22 23:04:00 +08:00
7878f0e278 🍱 增加查询米卡的治疗量计算,修复旅行者BUG 2023-01-20 19:11:07 +08:00
e318984801 🐛 修复新角色基础数值错误的问题 2023-01-20 00:09:37 +08:00
d62ab6e341 🍱 更新3.5版本角色的别名和有效词条 2023-01-19 23:37:20 +08:00
d5a379d0ef 🍱 支持部分3.5版本的角色和武器的替换 2023-01-19 23:22:34 +08:00
02375b1284 🐛 修复签到 (#428) 2023-01-18 21:55:13 +08:00
2aaf5aa1c6 🍱 更新原神3.4版本MetaData 2023-01-18 02:00:31 +08:00
54701a448b 🐛 修复原神每日签到奖励物品名称获取错误的问题 (#428) 2023-01-17 22:25:39 +08:00
d74959b751 📝 修改ck帮助的说明 (#421) 2023-01-17 00:22:09 +08:00
d087e75e4e 🎨 补充_pass内容 2023-01-17 00:15:47 +08:00
79a4faf5c4 新增刷新全部CK(需SU用户) 2023-01-16 23:34:47 +08:00
38f08262d4 🐛 修复xx在哪的一部分使用体验 (#427) 2023-01-15 17:46:30 +08:00
13c5fe2eb0 新增刷新CK(需要用户绑定SK) 2023-01-15 00:53:54 +08:00
92844b1897 🎨 增加几个安柏计划API 2023-01-14 23:58:37 +08:00
2984f4e578 🐛 修复定时公告推送及深渊图片发送问题 (#426)
* 🎨 图片调整

* 🐛修复查询命令报错

适配器问题,“原图”功能无法使用

* Update requirements.txt

* 🚨 auto fix by pre-commit-ci

* 🐛修复无法导入抽卡记录的问题

* 🐛修复无法导入抽卡记录的问题

* 🚨 auto fix by pre-commit-ci

* 🐛修复“导入抽卡记录”

* 🚨 auto fix by pre-commit-ci

* 🐛修复抽卡记录导入

* 🐛修复抽卡记录导入

* 🚨 auto fix by pre-commit-ci

* 🐛 修复公告图片推送

* 🐛 修复定时公告推送的图片发送问题

Co-authored-by: MingxuanGame <MingxuanGame@outlook.com>

* 🐛 修复定时公告推送的图片发送问题

Co-authored-by: MingxuanGame <MingxuanGame@outlook.com>

* 🎨 修改convert_img错误

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: MingxuanGame <MingxuanGame@outlook.com>
2023-01-14 18:55:43 +08:00
8407d556ee 🔥 remove workflows 2023-01-11 15:28:10 +08:00
d68cbc24fa 🐛修复抽卡记录导入 (#425)
* 🎨 图片调整

* 🐛修复查询命令报错

适配器问题,“原图”功能无法使用

* Update requirements.txt

* 🚨 auto fix by pre-commit-ci

* 🐛修复无法导入抽卡记录的问题

* 🐛修复无法导入抽卡记录的问题

* 🚨 auto fix by pre-commit-ci

* 🐛修复“导入抽卡记录”

* 🚨 auto fix by pre-commit-ci

* 🐛修复抽卡记录导入

* 🐛修复抽卡记录导入

* 🚨 auto fix by pre-commit-ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-11 15:27:26 +08:00
8032841408 🐛 修正暴击率低于0%时期望伤害低于普通值的问题 (#422)
* 修正暴击率低于0%时期望伤害低于普通值的问题

* 🚨 auto fix by pre-commit-ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-10 22:54:49 +08:00
9eaf184f19 🍱 更新原始预估3.4 2023-01-10 22:51:56 +08:00
a215bc16cb 🎨 修改convert_img方法 2023-01-08 00:59:14 +08:00
ed412e890c 🐛 ntchat问题修复 (#419)
* 🎨 图片调整

* 🐛修复查询命令报错

适配器问题,“原图”功能无法使用

* Update requirements.txt

* 🚨 auto fix by pre-commit-ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-08 00:53:54 +08:00
99ea01d9e4 🐛 ntchat问题修复 (#418)
* 🐛 修复资源点地图发送

* 🎨 将默认头像改为项目图标

* 🚨 auto fix by pre-commit-ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-07 23:33:13 +08:00
ad385bd77c 🐛 修复错误的sp_base 2023-01-06 23:16:44 +08:00
18fd5e2cd0 🐛 修改部分call_apintchat 2023-01-06 21:32:13 +08:00
cd2303d37d 🐛 修复定时签到的私聊推送 2023-01-06 00:11:55 +08:00
6ba82d4d1b 🍱 同步查询艾尔海森的倍率,新增查询夜兰的蒸发伤害 2023-01-05 23:50:38 +08:00
96227fe4be 🐛 修复特殊情况下几种默认反应倍率 2023-01-04 00:00:09 +08:00
fa35be809f 🐛 修复原神公告的部分详情出现https错误 2023-01-02 23:50:49 +08:00
9f7db4e5b2 🐛 修复清除原神公告红点 2023-01-01 01:33:19 +08:00
5c6008381b 📝 更新gs帮助 2022-12-30 00:30:23 +08:00
461911e186 🐛 修复错误的适配器导致的原神公告异常 2022-12-29 23:40:32 +08:00
ef1d7eb997 🐛 修复查询绫人等几个角色的伤害异常(#413) 2022-12-29 23:38:16 +08:00
8f2d3ae8e5 🐛 修复SQLModel导包问题 2022-12-28 23:56:26 +08:00
21c40bcfe5 🚨 fix lint warnings 2022-12-28 23:30:19 +08:00
fbb1cec548 新增原神公告 (#409) 2022-12-28 22:15:36 +08:00
0371014fd6 🚑 fix bbs coin error 2022-12-28 14:22:26 +08:00
d367197838 📌 更新依赖qrcode 2022-12-28 00:32:47 +08:00
4cfd3537f0 新增扫码登陆 2022-12-28 00:13:27 +08:00
a221356da4 新增版本深渊,后可跟版本号 2022-12-22 00:27:40 +08:00
5bc15948fe 增加hhw_api的相关方法 2022-12-21 23:01:22 +08:00
a8040c7321 🎨 调整添加CK时候的判定顺序,修复几个BUG 2022-12-20 00:43:33 +08:00
5cb62671fc 新增数据文件夹内bg文件夹,用于存放自定义图片 2022-12-19 00:05:02 +08:00
9b959b0f2c 新增查询探索, 重绘的查询收集 2022-12-18 20:02:26 +08:00
bb2b19ec22 🎨 添加draw_bar绘图方法,重绘收集样式 2022-12-18 19:49:08 +08:00
c5e1d9e88a 🐛 修复已知BUG、修改参考数值和角色BUFF错误 2022-12-17 19:18:39 +08:00
82842b25fc 🐛 修复已知BUG,优化报错提示(#405) 2022-12-17 00:09:26 +08:00
56700bf420 🎨 为多条推送信息添加换行符 (#403) 2022-12-14 12:12:48 +08:00
c3e8aaa6fc 🐛 修正国际服七圣召唤api (#402) 2022-12-14 12:00:57 +08:00
8c53148488 🐛 下载全部资源时判断是否为空文件名 2022-12-14 09:45:22 +08:00
96b40242e8 🐛 查询时额外输出问题 2022-12-14 00:08:17 +08:00
7df0a67f8d 攻略换用本地攻略源 2022-12-13 23:26:54 +08:00
bf17cc3caf 🎨 更新深渊概览API,添加自动下载攻略 2022-12-13 23:18:35 +08:00
a1002d91ec 🍱 补充3.3新角色的参考面板毕业度 2022-12-12 22:56:05 +08:00
9ae5605af0 📝 限制绑定uid位数, 补充gs帮助 2022-12-11 17:17:15 +08:00
f79dbd03b4 🎨 一些响应方式的修改 2022-12-11 15:28:49 +08:00
8c08e1c2d6 🎨 修改资源文件名 (#400)
* 修改资源文件名

统一命名,去除卡牌资源文件结尾的符号

* 🚨 auto fix by pre-commit-ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-12-11 14:08:09 +08:00
6e76e909d3 新增七圣召唤命令,后可跟UID 2022-12-11 13:56:58 +08:00
a39e3c7365 🎨 添加七圣召唤的API,修复一部分BUG 2022-12-11 13:50:28 +08:00
46444af78c 🍱 补充一些遗漏资源,修复几个BUG 2022-12-09 23:15:41 +08:00
166d530f35 🍱 补充一部分3.4的资源文件 2022-12-09 20:25:26 +08:00
571b9bd97a 新增原牌功能, 例如原牌狼末 2022-12-08 23:33:06 +08:00
18e5c968ad 🍱 增加一些资源文件 2022-12-08 23:21:53 +08:00
142995766e 📝 提高原神版本至3.3 2022-12-07 01:08:58 +08:00
9db963ea18 🍱 新增原神3.3版本的元数据 2022-12-07 01:06:51 +08:00
996a4e8c29 🐛 修复低星圣遗物的错误 2022-12-05 23:40:20 +08:00
4a7f822b94 🐛 修复抽卡记录平均UP错误和提纳里的毕业度 2022-12-04 17:05:56 +08:00
f04e8ccc48 🎨 优化一部分API访问 2022-12-04 13:55:40 +08:00
98907c5671 🐛 修复截获CK字段的错误 2022-12-03 00:04:48 +08:00
f6e4f8c129 🍱 补充版本规划3.3 2022-12-02 22:50:06 +08:00
f20c0b7e1f 🐛 修复深渊概览刷新失败 2022-12-02 22:47:05 +08:00
9f9106d788 🐛 修复未绑定UID时签到指令异常返回 2022-11-30 23:53:37 +08:00
cdab68347c 🐛 修复查询妮露的不正确毕业度(#397) 2022-11-29 22:02:25 +08:00
87885db01e 🎨 强制刷新支持使用@别人查询(#396) 2022-11-29 21:13:03 +08:00
90ce5b77fe 🎨 优化毕业度的计算值 2022-11-29 21:09:57 +08:00
dc4ba1811f 🎨 重做的毕业度计算 2022-11-29 01:48:36 +08:00
32f391e629 🚑️ 补充错误获取的CK 2022-11-26 23:32:33 +08:00
46a176283d 新增深渊统计(深渊概览) 2022-11-26 15:18:13 +08:00
7b15e44f9d 🐛 修复缓存获取CK的BUG 2022-11-26 15:11:17 +08:00
1204b5a5e7 🐛 修复仅修改命座的报错 2022-11-24 11:58:23 +08:00
b0b09cdc70 🐛 修复查询六命散兵换xx无法生效的问题 2022-11-24 00:34:22 +08:00
eb17cebc28 支持查询公子换香菱沙类似用法,并可以任意组合 2022-11-24 00:23:40 +08:00
d9eeca0ba8 💥 修改PROXY配置至config.json 2022-11-23 21:56:40 +08:00
7c30452e15 🐛 兼容国际服的ID至UID的转换, 尝试从绑定UID读取 2022-11-12 17:01:08 +08:00
9c7a51e749 👽️ 判断v2版本的米游社CK(#383) 2022-11-12 16:19:46 +08:00
bc9af2b8d6 🎨 改进一部分错误提示 2022-11-12 00:29:51 +08:00
2a92081968 👽️ 增加mr出现验证码的错误提示(#379) 2022-11-11 23:44:02 +08:00
1f4322b769 🎨 修改部分角色BUFF,修改部分UI表现 2022-11-11 22:50:46 +08:00
bbb301d72a 🎉 adapter-ntchat现在可用 2022-11-10 22:01:17 +08:00
bcce62c85e 支持查询beta角色(数据从安柏计划获取) 2022-11-10 01:40:04 +08:00
f7fe9f9d63 📝 增加WeChat适配器的相关描述 2022-11-09 00:33:00 +08:00
2f972be222 为校验全部Cookies功能添加国际服支持 (#377) 2022-11-08 17:55:08 +08:00
a1a101425b 🍱 增加一部分提示, 更新血量表等资源(#364) 2022-11-07 00:08:25 +08:00
6dd162c3b7 🐛 修复纳西妲业障除的伤害计算错误 2022-11-06 20:33:59 +08:00
f769b8b99c 🚑强制刷新检查绑定的UID 2022-11-06 19:13:26 +08:00
f670dfa390 久岐忍,刻晴等角色添加更多的反应, 修复一些效果错误 2022-11-06 18:43:12 +08:00
e4457570d7 🍱 更新纳西妲的参考面板 2022-11-06 15:41:37 +08:00
adb056d09d 🎨 添加判断刻晴是不是up (#376) 2022-11-06 14:41:15 +08:00
751c7bb813 🐛 修复抽卡记录兜底值 2022-11-06 01:06:01 +08:00
8bb3dd89f2 重做的抽卡记录 2022-11-06 00:50:10 +08:00
ce46e947e4 🐛 暴力修复连接多个机器人实时便笺无法正常推送(#375)
* 🐛 修复连接多个机器人实时便笺无法正常推送(使用暴力方法)

* 添加`执行推送检查任务`来手动执行对便笺推送检查
2022-11-05 15:42:28 +08:00
bb90787f66 🐛 修复导入抽卡数据的ID错误 2022-11-05 01:50:21 +08:00
1bda35d1de 🐛 修复低星圣遗物面板刷新的问题(#360) 2022-11-05 01:17:30 +08:00
9bff5c32a6 添加几个角色的反应伤害, 修复*海量BUG 2022-11-04 23:36:55 +08:00
cf679eec07 🐛 修复防御力不正确加成, 优化使用体验 2022-11-03 05:12:05 +00:00
f08fb41a7e 🐛 圣遗物四件套情况少计算两件套效果 2022-11-03 00:45:05 +08:00
7cce007c35 支持查询六命莱依拉带精五月光换公子圣遗物类似用法 2022-11-03 00:00:25 +08:00
cb5fb92402 🐛 修复一些效果和标记问题 2022-11-02 22:12:33 +08:00
56ab7b7526 🐛 修正国际服ds生成规则 (#370) 2022-11-02 16:56:08 +08:00
2ee4c88e0c 🚑 向下兼容Python版本 2022-11-02 15:42:27 +08:00
dad448df15 🍱 更新原神3.2版本伤害数据 2022-11-02 13:24:49 +08:00
6e650a5cb8 🐛 临时对随机获取cookie过程进行服务器隔离防止互相污染 (#367) 2022-11-02 09:35:56 +08:00
04dabc83b5 🍱 新增原神3.2版本的元数据 2022-11-02 08:48:06 +08:00
bd6d3f68e9 🎨 统一角色面板处理文件 2022-11-01 22:54:08 +08:00
a2a14693c6 🐛 修复更新记录的绘图越界 2022-11-01 21:50:51 +08:00
9a3a4310ca ♻️ 重构部分伤害计算相关代码 2022-11-01 21:11:19 +08:00
233d6c9d32 为部分功能添加国际服支持 (#366)
Signed-off-by: Chino Kafuu <twfx1207@gmail.com>
2022-11-01 21:08:44 +08:00
50b4b085d0 🍱 更新参考面板妮露, 修复已知Bug 2022-10-24 21:18:02 +08:00
9af2948e32 🐛 向下兼容网页控制台 2022-10-23 22:20:24 +08:00
5f5617055d 网页控制台为无管理员权限用户新增添加CK功能(#347) 2022-10-23 21:41:01 +08:00
fb26df7402 🐛 修复替换武器时因未正确判断类型导致伤害错误 2022-10-22 00:47:39 +08:00
d4df7fe3aa 🎨 更新角色别名配置 (#359)
* 🎨 更新角色别名配置

* 🐛 修复角色别名识别

不再考虑输入为别名中字符串子串的情况
2022-10-22 00:16:21 +08:00
8be890316d 新增更新记录 2022-10-22 00:12:32 +08:00
6a67436cae 新增gs清除缓存(如查询相关异常可尝试) 2022-10-21 00:43:55 +08:00
5ad3cb3bf0 调整数据库缓存清除逻辑 2022-10-21 00:34:57 +08:00
a3689f53a6 查询妮露增加丰穰之核伤害计算(默认算上双水双草Buff) 2022-10-20 23:49:09 +08:00
b646c47762 🐛 查询甘雨伤害大招加成计算有误 2022-10-20 01:20:14 +08:00
44311e2fc2 🐛 修复一半的gs重启问题 2022-10-20 01:19:12 +08:00
9ef5d35ea2 🐛 修复原图功能(#355) 2022-10-19 00:12:15 +08:00
3dc89d9762 gs开启随机图的面板回复开启原图功能 2022-10-18 22:41:14 +08:00
64972b76f8 🚚 为资源文件夹添加TEMP目录 2022-10-18 22:32:18 +08:00
190a688767 🐛 修复一个面板抗性引发的问题; 更新伤害乘区 2022-10-18 21:01:05 +08:00
468314a874 📝 补充gs帮助文件 2022-10-18 00:55:38 +08:00
5d827ea8b2 🎨 利用fastapi_genshin_map重写地图逻辑 2022-10-18 00:36:00 +08:00
6929e05da0 🐛 修复一个导致CK死循环的错误(#354) 2022-10-17 22:50:10 +08:00
724c5ed2fc 🐛 修复查询满命妮露的问题 2022-10-16 13:47:17 +08:00
fabd1b6860 重做的活动列表和新增卡池列表 2022-10-14 22:35:09 +08:00
4c07ac3d36 🎨 更高容纳度的get_qq_avatar方法 2022-10-14 01:27:51 +08:00
78f35d5545 🐛 活动列表现在可以使用 2022-10-13 22:43:26 +08:00
30a55f8dcf 重做的毕业度统计 2022-10-13 00:02:03 +08:00
088c74e500 🎨 新增复用绘图方法, 更换默认背景图 2022-10-12 23:51:43 +08:00
ec2b508f2c ️ 增加gs帮助的内容 2022-10-10 23:52:49 +08:00
c561836a73 现在查询展柜角色以图片返回 2022-10-10 23:31:49 +08:00
6f5e098873 🎨 优化绘图方法, 从中间裁切, 更新部分默认背景 2022-10-10 23:27:35 +08:00
33709d90c9 🐛 修复旅行者ID问题 2022-10-10 09:58:02 +08:00
30978e619a 🐛 修复强制刷新旅行者无法显示 2022-10-10 08:45:36 +08:00
918625a2fa 🍱 更新3.1角色的参考面板 2022-10-10 00:40:33 +08:00
c4696df1c1 现在强制刷新以图片返回结果 2022-10-10 00:29:32 +08:00
8f213eade3 🎨 新增一些绘图方法, 简化代码 2022-10-10 00:16:37 +08:00
1c390d08d5 🐛 修复在高版本的依赖下插件报错 2022-10-07 22:31:12 +08:00
a2153a5898 新增清除无效用户(#206) 2022-10-07 21:50:27 +08:00
d7315d3ab3 🐛 尝试修复事件被hoshino截断 (#352)
* 尝试修复事件被hoshino截断
* 更改匹配的正则
2022-10-07 13:40:49 +08:00
aaf34f8018 🎨 修改网页控制台主页 2022-10-07 13:38:11 +08:00
e714a9e1ca 🐛 修复网页控制台的问题 2022-10-07 01:31:27 +08:00
91a716d455 🎨 拉大签到间隔时长 2022-10-06 23:38:54 +08:00
a13b70f57a 新增gs开启跳过无感验证 2022-10-06 23:15:25 +08:00
c7a69ec603 🐛 网页控制台的HTML修改 2022-10-06 19:29:28 +08:00
8296c1cd6c 🐛 修复当前信息(#350) 2022-10-05 21:54:12 +08:00
2e16de59b4 🙈 update .gitignore 2022-10-05 18:30:16 +08:00
3fc66a8513 🎨 why not use Chinese? 2022-10-05 18:28:35 +08:00
25447ee622 🐛 fix creating map 2022-10-05 18:28:30 +08:00
10b2ddde15 improve downloading files 2022-10-05 18:26:13 +08:00
9be4447a24 新增查询公子成长曲线类似用法 2022-10-05 18:25:40 +08:00
ef87a6b4f7 新增各种缺失的曲线数据,修复大量面板Bug 2022-10-05 18:21:58 +08:00
c2a2d31254 🐛 fix unsupported format 2022-10-04 16:30:51 +08:00
52e465ea7e support changing primary key 2022-10-04 00:15:12 +08:00
1303cb391e 新增gs开启多彩面板 2022-10-04 00:10:31 +08:00
357579046b 🎨 限制触发条件 2022-10-02 22:53:57 +08:00
d44e5044d9 新增血量排行 2022-10-02 22:39:18 +08:00
30269eb214 🎨 更新收集数据,血量表,抗性表 2022-10-02 22:38:15 +08:00
624c9e7b3f 🐛 面板查询的几个遗留问题 2022-10-02 22:15:42 +08:00
3bd8cb5373 🐛 remove logger for settings
sync 245121b318
2022-10-02 22:00:47 +08:00
b33297a03c mount WebConsole to nonebot(Quart)
sync bac4d7061c, path: /genshinuid
2022-10-02 20:32:42 +08:00
bc6d56da0b 🎨 修改收集的数据和生成地图相关问题 2022-10-02 16:28:12 +08:00
67fb636d3e ⬆️ update genshinmap from MingxuanGame/GenshinMap 2022-10-02 16:06:51 +08:00
22899cb9fe 🎨 更新gs帮助以及补漏其他功能 2022-10-02 01:56:01 +08:00
b755593b59 🐛 原石札记中分母为0的情况(#346) 2022-10-02 01:17:32 +08:00
40e4a97a42 🍱 角色成长曲线数据 2022-10-02 01:14:13 +08:00
ecfc1695f5 新增御神签(#344) 2022-10-02 00:13:38 +08:00
d7369bc79c 新增抽表情(#344) 2022-10-01 22:02:40 +08:00
ea7e78eb3b 🐛 原石札记的一些UI问题 2022-10-01 20:40:42 +08:00
cd96ddbea8 新增当前信息(#337) 2022-10-01 19:55:10 +08:00
bc61e2e112 增加draw_note_img方法(#337) 2022-10-01 19:06:27 +08:00
44385d3104 🎨 原石预估现在将会输出当前原神版本的对应图片 2022-09-29 22:11:34 +08:00
fff4ec1c84 新增赛诺E渡荒之雷伤害计算及超激化, 修复大量bug 2022-09-29 21:49:36 +08:00
8973de82f9 🎨 计算基础天赋时,如果没有则跳过 2022-09-29 08:40:27 +08:00
b0c30e0489 🐛 每日空值忽略世界等级(#342) 2022-09-28 22:32:22 +08:00
bff3185cb8 🐛 每日如果收到空值则忽略签名处理(#342) 2022-09-28 21:16:59 +08:00
04f4e77973 🐛 一部分武器的效果异常 2022-09-28 10:45:51 +08:00
560b3f8f8f 🍱 新增原神3.1版本的角色和武器数据 2022-09-28 10:14:37 +08:00
e0c4f3c5cc 🎨 修改mask.png的所在位置 2022-09-26 22:57:35 +08:00
02e295b1f0 🍱 新增原神3.1版本的元数据 2022-09-26 22:35:16 +08:00
127573b353 🐛 伤害值增加的错误计算 2022-09-26 21:36:29 +08:00
8f79f3d5de 🐛 修复磐岩结绿攻击力转化效果 (#338) 2022-09-26 09:57:14 +08:00
3b5008c13b 🐛 修复查询旅行者的问题 2022-09-24 22:49:40 +08:00
aa8e09d131 支持查询六命公子换精五飞雷类似用法 2022-09-24 19:01:02 +08:00
76d7ed3524 支持查询雷神换精三弓藏类似用法 2022-09-22 23:46:11 +08:00
d6a1099a76 🐛 现在可以更换低星武器 2022-09-22 23:28:47 +08:00
5fa33b8f60 🐛 修复抽卡记录中可能获取到空字典的情况 2022-09-22 23:18:08 +08:00
6415280014 🐛 修复查询公子换月华时生命不正确以及部分角色天赋问题 2022-09-22 23:02:22 +08:00
814536fb15 支持查询公子换冬极类似用法 2022-09-22 01:43:07 +08:00
7f67d17829 🎨 改进一些奇怪的问题 2022-09-22 01:39:38 +08:00
5fefcc7cd4 使用计算替代读取面板, 也可使用gs开启旧面板返回 2022-09-22 01:09:03 +08:00
1bc24ded0f 🐛 修复琴位于探索中每日失效的问题 2022-09-21 01:58:03 +08:00
48c252aaf4 新增原石统计3.1 2022-09-20 21:32:58 +08:00
43f17cea2f 🐛 修复在Hoshino分支存在的问题 2022-09-19 21:20:47 +08:00
883c0443b1 🎨 gs重启将会杀死windows进程 2022-09-19 21:18:53 +08:00
ce72a4eb96 🐛 修复nonebot错误导入 (#335) 2022-09-19 09:26:28 +08:00
2268efd9dc 🐛 更新gs帮助 2022-09-18 18:32:36 +08:00
f057f7e213 📝 更新gs帮助 2022-09-18 18:29:06 +08:00
84f8285760 📝 优化gs更新提示 2022-09-18 16:56:34 +08:00
5a1c07986c 🎨 优化的gs重启 2022-09-18 01:51:31 +08:00
5de1084b6f gs重启 2022-09-17 22:15:50 +08:00
406d91bf71 🎨 优化gs更新返回提醒 2022-09-17 11:19:39 +08:00
ea3d0273e7 gs更新,gs强制更新,gs强行强制更新 2022-09-17 01:31:18 +08:00
d0a3be1646 🎨 分离添加时发送的消息类型 2022-09-17 00:17:49 +08:00
645e2c0035 🐛 修复五郎位于探索中每日失效的问题(#334) 2022-09-17 00:14:35 +08:00
17caf6bedf 🔧 增加GitPython,fastapi_user_auth,fastapi_amis_admin依赖 2022-09-17 00:10:26 +08:00
68a62e2aaa 新增gs开启网页控制台 2022-09-16 23:59:29 +08:00
d629eaacbb 🐛 查询云堇时毕业度不正确显示 2022-09-12 16:05:16 +08:00
b9f716d84e 🐛 强制刷新至错误地方(#331) 2022-09-12 15:14:54 +08:00
e26bebabdf 🍱 毕业度计算增加多莉,钟离E总护盾量 2022-09-12 15:02:35 +08:00
d6155898ce 🎨 修正新角色的有效词条 2022-09-12 12:10:05 +08:00
db7eb0fc60 🐛 使用绝对路径导出抽卡记录 2022-09-12 00:44:55 +08:00
e4dc7f8f41 抽卡记录中角色祈愿将新增up标识 2022-09-12 00:27:07 +08:00
d9643dc0f1 🐛 查询角色时因随机图API导致的错误 2022-09-11 23:10:50 +08:00
4b97ef858c 🎨 调整并发任务超时时间 2022-09-11 20:50:51 +08:00
6417d470b8 增加删除CK的数据库方法(#206) 2022-09-11 19:08:40 +08:00
a7499054ed 🐛 修复消息段类型不匹配导致无法发送消息(#329) 2022-09-11 17:59:47 +08:00
1e107e36fe 使用sqlmodel替换base基类(#319) 2022-09-11 17:57:53 +08:00
7c0fff9da4 🐛 修复伤害计算因暴击率造成的数值错误(#328) 2022-09-11 14:50:02 +08:00
04d197f6b4 🔀 从hoshino-git分支合并 2022-09-11 14:31:34 +08:00
7294f1d15f 🐛 fix #326 (#327) 2022-09-10 22:50:32 +08:00
5de4d63cc5 📝 更新README.md 2022-09-09 11:33:08 +08:00
27cf8c2f3b 🐛 修复新匹配算法带来的问题 2022-09-09 00:28:09 +08:00
d4166edaf6 添加CK和SK时转为图片回复(#320) 2022-09-09 00:12:50 +08:00
04a615cf85 🎨 增加添加CK的返回图片 2022-09-09 00:11:53 +08:00
c438f54668 🎨 降低精通带来的毕业度提升 2022-09-08 23:17:07 +08:00
099f375e2e 🎨 增加gs帮助内容 2022-09-08 21:48:32 +08:00
09cc494672 🐛 修复计算毕业度时香菱的攻击加成 2022-09-08 13:00:41 +08:00
ec95a3934d gs帮助现在可用 2022-09-08 02:32:22 +08:00
21703b4984 draw_help_card.py 2022-09-08 02:30:32 +08:00
fad0f6521d 🐛 fix some obvious error in hoshino branch (#321)
* use service logger

* fix requirements

* add aliases of gs帮助

* fix import error in genshinuid_mys
2022-09-07 21:33:00 +08:00
520bec43fb 👽️ 修复Enka的返回值增加 2022-09-07 10:50:04 +08:00
ecdd35b853 🐛 角色伤害加成获取有误 2022-09-07 10:22:36 +08:00
c886522b49 💬 增加制作帮助图所需资源 2022-09-07 00:52:34 +08:00
0f53f9ba17 🐛 小鹿的英文简称错误 2022-09-06 19:53:28 +08:00
66981b91eb 🐛 神里绫华Q+3不生效 2022-09-06 15:05:31 +08:00
0741c25741 🐛 伤害计算减防不生效 2022-09-06 15:04:17 +08:00
3f524a7251 📝 更新须弥宝箱数量(#318) 2022-09-06 09:33:48 +08:00
4a718ff5ed 🎨 补充遗漏内容 2022-09-05 21:43:45 +08:00
940b93f851 新增gs开启催命模式 2022-09-05 21:41:57 +08:00
5d497294c2 🍱 更新血量表,抗性表, 增加雷神E协同攻击超激化 2022-09-04 14:08:19 +08:00
161cc8ba69 新增任务<任务名>,任务<地区名> 2022-09-04 14:02:13 +08:00
4afde3744f 🔥 删除无用代码 2022-09-04 01:39:35 +08:00
2262798ade 改进的毕业度计算 2022-09-04 01:21:44 +08:00
5b2703fa24 🎨 修复空UID仍然输出log(#316) 2022-09-03 17:47:44 +08:00
7ff9c3896f 🎨 增加几个角色的反应伤害;移除雷神A的超激化反应 2022-09-03 17:30:37 +08:00
6c58a98aa5 新增gs配置,gs开启定时签到,gs开启定时米游币 2022-09-03 11:10:37 +08:00
d1cac471f6 draw_config_card.py 2022-09-03 11:03:43 +08:00
ceb2ee9082 🐛 值错误 2022-09-02 01:25:25 +08:00
789ae23773 🍻 修复之前bug造成的影响 2022-09-02 01:23:25 +08:00
45d375ca49 🐛 uigf_gacha_type映射关系 2022-09-02 01:18:55 +08:00
08f78df595 支持导出抽卡记录和导入抽卡记录 2022-09-02 00:45:31 +08:00
6cb4817827 👷 auto run pre-commit in pull requests 2022-09-02 00:19:04 +08:00
26acc0850b 🐛 返回字段错误 2022-09-02 00:02:58 +08:00
34a7497b1d 改进的导入导出方法 2022-09-01 23:41:38 +08:00
5d31805c49 export and import.py 2022-09-01 00:22:03 +08:00
87debcd6ad 📝 新增xx用什么的须弥角色信息 2022-08-31 21:00:24 +08:00
4e3798bb7c 🐛 修复每月统计(#315) 2022-08-31 20:46:51 +08:00
50b2bc1e56 🐛 修复一些问题 2022-08-31 20:40:55 +08:00
d68d3c3ff7 🐛 首次刷新抽卡记录可能失败 2022-08-31 02:44:40 +00:00
72a2bdc454 🐛 查询柯莱的蔓激化 2022-08-31 02:20:47 +00:00
f5931ac77f 新增gs开启随机图 2022-08-31 01:38:49 +00:00
2ef7e72dfd 🐛 修复刷新抽卡记录 2022-08-30 23:55:13 +08:00
a6f092a7b4 📝 增加更多的角色别名 2022-08-30 23:30:30 +08:00
f9a8d99257 🐛 尝试修复刷新抽卡记录的数据错误 2022-08-30 22:45:43 +08:00
4d377306ef 📝 修改收集命令数据为3.0版本 2022-08-30 22:25:36 +08:00
61293fb072 增加切换api 2022-08-30 22:20:57 +08:00
27bc2a6aa5 🐛 现在可以使用草主推荐等旅行者攻略 2022-08-30 22:16:18 +08:00
634cb616ed 新增刻晴, 提纳里, 柯莱, 北斗的草系反应 2022-08-30 22:13:42 +08:00
8ed0bb9c8f 🍱 增加新角色参考面板 2022-08-30 21:47:17 +08:00
3c48903335 🐛 fix req.json() error 2022-08-30 21:35:59 +08:00
490528b716 🎨 签到改为gs签到或者米游社签到(#302) 2022-08-30 14:20:42 +08:00
11a5da22ef 🔥 删除状态,避免冲突(#312) 2022-08-30 12:16:26 +08:00
752e6b8d40 🐛 猎人之径的效果错误问题 2022-08-30 10:31:23 +08:00
9ef8b4000b 🐛 修复b64转码的问题 2022-08-30 01:55:35 +08:00
ebb6b8f3d2 🔥 删除多余文件 2022-08-30 00:25:25 +08:00
d11d79ab80 🔀Nonebot2-beta1分支合并 2022-08-29 23:26:46 +08:00
7b9d06fd2f 🎉 GenshinUID 3.1 beta 2022-08-29 23:12:44 +08:00
e5bf2e088c 🎨 更换API地址, 去除自动刷新 2022-08-22 05:21:57 +00:00
0683a4240f 👽️ 修复因为米游社API变动导致的开始获取米游币失败 2022-08-19 01:47:04 +08:00
c8035ddbd2 🐛 fix 2022-08-08 11:58:20 +08:00
271d29c8ef 🐛 修复 2022-08-08 11:55:28 +08:00
2e0a2df4a2 🐛 Enka UA 2022-08-08 11:47:01 +08:00
12ad30f44f 👽️ 修复原神签到 2022-08-05 08:40:32 +08:00
3bfc5d1d19 👽️ 修复开始获取米游币 2022-08-05 00:37:53 +08:00
6c63d87e28 修复: 米游币获取问题 2022-08-05 00:27:46 +08:00
73c49de621 🐛 UI_Talent_S_Heizo_04.png 2022-07-22 20:01:01 +08:00
36c5cf910c 🐛 修复伤害计算 2022-07-20 21:05:48 +08:00
5e117556ae 更新:查询收集的max_data 2022-07-20 16:58:28 +08:00
f62a53ef5e 优化:伤害计算 2022-07-16 19:28:13 +08:00
b70a9a01f6 修复:EnkaAPI 2022-07-16 14:11:01 +08:00
62b4593ef9 更新:用什么, 给谁用 2022-07-15 00:26:45 +08:00
facbfde165 修复:活动列表 2022-07-15 00:14:59 +08:00
919f33449a 修复:鹿野院平藏资源问题 2022-07-14 09:00:17 +08:00
3207c02eab 更新:2.8相关资源 2022-07-13 23:30:52 +08:00
48c3f05af0 修改:avatarCardOffsetMap.json 2022-07-11 10:32:50 +08:00
434106c933 修改:base64前缀匹配 2022-07-11 10:28:08 +08:00
024a1debd7 修复:毕业度统计 2022-07-11 10:21:25 +08:00
71bc1135d1 优化:伤害计算区域对齐 2022-07-10 02:00:16 +08:00
3156e18083 修复:event修改为ev 2022-07-10 01:19:51 +08:00
77586e0a08 新增:毕业度统计 2022-07-09 21:04:12 +08:00
2b6e03505d 修改:UI贴图 2022-07-09 21:00:23 +08:00
019308146f 新增:查询展柜角色的伤害计算 2022-07-09 20:51:56 +08:00
8deea2a879 修复:bot替换为hoshino_bot 2022-07-05 00:56:49 +08:00
2afc633f64 修复:命座影响天赋的map引入 2022-07-03 00:22:50 +08:00
46d672fc2c 修复:遗漏的图片 2022-07-03 00:08:42 +08:00
70a2eee1c0 修复:班尼特的元素充能效率计算为有效词条 2022-07-02 23:14:19 +08:00
011d158b7d 修改:查询角色面板的背景上色方式 2022-07-02 22:30:20 +08:00
ec9e51dc35 修复:因为地脉活动导致的活动列表错误问题 2022-07-02 17:10:22 +08:00
99820423c3 新增:每日自动米游币任务结束后向SUPERUSER发送报告 2022-07-02 01:18:53 +08:00
d454fe5bfe 新增:校验全部Stoken 2022-07-02 00:57:36 +08:00
5e1555ff21 优化:命座显示天赋+3 2022-07-01 22:34:17 +08:00
6d8ddf5033 修复:特殊情况下查询深渊角色显示头像异常 2022-07-01 13:06:01 +08:00
cfb19604cc 新增:谁能用可以模糊查询圣遗物匹配信息 2022-07-01 00:10:24 +08:00
4126bfc48a 修复:推荐表内的换行问题 2022-06-30 23:43:07 +08:00
c246a5165f 修复:能用啥的三星武器丢失问题 2022-06-30 23:20:16 +08:00
8b59b9f371 修复:查询展柜角色中旅行者无法正常显示 2022-06-30 23:05:07 +08:00
0caf3c605a 优化:查询失败返回语句优化 2022-06-27 00:10:53 +08:00
1308dc7ec9 Merge branch 'main' of github.com:KimigaiiWuyi/GenshinUID 2022-06-26 21:30:40 +08:00
10a2cc7bc7 优化:全新的活动列表界面 2022-06-26 21:29:17 +08:00
f77195dee6 修复:天赋的tag问题 2022-06-25 11:45:28 +08:00
c11d79e672 优化:天赋的数字类型判断 2022-06-25 01:25:50 +08:00
2df9eef519 更新:gs帮助 2022-06-25 01:04:31 +08:00
4cbb7afacb 修复:查询词云 2022-06-25 00:48:47 +08:00
9b73ea2ebf 修复:天赋中存在数字错乱的问题 2022-06-25 00:14:40 +08:00
719779f226 修复:查询展柜角色 元素充能效率 -> 充能效率 2022-06-24 19:35:51 +08:00
b3e85d04c8 修复:久岐忍的探索派遣状态问题 2022-06-24 00:35:49 +08:00
35b06d2b1d 更新:gs帮助内容 2022-06-24 00:29:47 +08:00
5a469cc46c 修复:烟绯的毕业度计算问题 2022-06-23 19:33:06 +08:00
595cf50af4 新增:完善dmgMap.json的制作方式 2022-06-22 21:57:16 +08:00
cd7ad11fc3 修复:typing 2022-06-22 10:05:37 +08:00
65c705cddf 新增:久岐忍有效词条的计算 2022-06-22 01:10:53 +08:00
d4667a7446 优化:圣遗物评分将变为有效词条计数 2022-06-22 01:04:04 +08:00
70438d55f0 修改:强制刷新返回字段,减少风控 2022-06-21 13:02:20 +08:00
1eb0592d0e 修复:抗性区的计算问题 2022-06-21 12:52:56 +08:00
24611c63e9 修复:伤害计算错误 2022-06-19 21:02:52 +08:00
6d6ec3b8f1 优化:查询展柜角色优化整体UI 2022-06-19 15:52:05 +08:00
872d39dbf5 修复:部分文案重叠 2022-06-19 14:46:16 +08:00
1af2565237 修复:完善全角色查询展柜角色毕业度的计算 2022-06-18 20:32:23 +08:00
70f3a7a513 查询展柜角色中完善角色立绘偏移 2022-06-17 00:26:52 +08:00
5bcdd57bfe Merge branch 'main' of github.com:KimigaiiWuyi/GenshinUID 2022-06-14 00:27:43 +08:00
5dc2154073 新增:引入avatarOffsetMap.json 2022-06-14 00:27:28 +08:00
4bc1f15335 修改:开始获取米游币的回复描述 2022-06-13 19:45:17 +08:00
24349d5e24 '修改:发送消息为b64' 2022-06-13 08:25:41 +08:00
8d2959544b '修复:霄宫- 2022-06-13 00:03:36 +08:00
696034acc2 '修复:计算毕业度时,绫人,绫华,迪奥娜,霄宫,九条的异常问题' 2022-06-13 00:01:08 +08:00
8530e690fd '新增:查询xx页面新增角色毕业度' 2022-06-12 22:58:43 +08:00
a370d65ecb 修复:强制刷新造成的安柏数据错误;新增:equipSets字段 2022-06-11 17:26:14 +08:00
5eccdc246a 更新:参考面板水新增夜兰 2022-06-07 19:21:36 +08:00
3ea4f0898a 修改:角色推荐文件指向目录 2022-06-07 19:15:16 +08:00
e7f992491d Update README.md 2022-06-07 12:56:48 +08:00
e462ccf60e 优化:武器命令(防止两个Bot互刷) 2022-06-06 13:05:11 +08:00
a5c6f9c260 新增:数据库将保留五天备份 2022-06-05 22:27:06 +08:00
e7d6a709d4 修复:查询收集小数问题 & 更新数据 2022-06-05 20:24:29 +08:00
4805e306b1 优化:查询攻略图片前校验URL是否存在 2022-06-05 18:29:14 +08:00
86b95f0891 支持通过uid方式查询其他玩家的展柜信息 2022-06-05 16:48:25 +08:00
ce3c1e7b07 修复若水和落霞的武器map 2022-06-05 16:28:39 +08:00
b8358b064c 完善查询展柜信息的错误提示 2022-06-05 13:59:08 +08:00
3cfec0e799 优化&更新 xx能用啥 命令的推荐表 2022-06-04 22:03:14 +08:00
7a5380e27f 完善Map制作方式 2022-06-04 14:39:30 +08:00
2e70e18b2d 完善Map制作方式 2022-06-04 14:39:04 +08:00
56ae609c94 fix 2022-06-03 22:40:35 +08:00
c4669d72ec 去除UI线框,换用默认大图 2022-06-03 19:17:36 +08:00
1c2b80cba5 修复:命座数据问题 2022-06-02 11:36:02 +08:00
172b4ef263 添加:夜兰 2022-06-02 09:47:44 +08:00
f3c94c2b4d 添加:夜兰 2022-06-02 09:44:31 +08:00
e552b8b89d ev 2022-06-02 09:12:34 +08:00
e6f3d61995 ev 后遗症 2022-06-02 08:40:40 +08:00
7c9a901d00 Update requirements.txt 2022-06-02 01:43:20 +08:00
b5a67757fc 修复:神里绫华的面板问题 2022-06-02 01:35:03 +08:00
c658ec1f2c ev 2022-06-02 00:38:38 +08:00
515ee27ab2 删除多余 2022-06-02 00:27:14 +08:00
df317e5183 ev! 2022-06-02 00:23:03 +08:00
23a9d47961 补充文件 2022-06-01 23:11:09 +08:00
eb8411fa3a 新增:查询展柜角色 2022-06-01 22:23:22 +08:00
53a6358c20 新增:查询收集 2022-06-01 00:04:34 +08:00
38cfe192e7 新增:gs关闭米游币推送 2022-05-28 21:34:55 +08:00
88cf977de4 权限修改 2022-05-22 19:57:57 +08:00
ee0270cc08 修复:At不生效 2022-05-22 19:53:07 +08:00
eb24ca088a 修复:gs开启&关闭At问题 2022-05-22 17:13:03 +08:00
f3d958f555 修复:新api接口(-record) 2022-05-18 19:37:10 +08:00
46e9654870 修改路径 2022-05-03 23:20:30 +08:00
fb41af1183 老忘加ev 2022-04-27 00:04:31 +08:00
7c6f3811ae 修复:语音问题 2022-04-26 23:42:27 +08:00
d06c586325 新增:参考面板(eg.参考面板火) 2022-04-26 23:28:09 +08:00
525c6791f9 修复:语音问题 2022-04-26 23:13:42 +08:00
ae0c66b056 当ck数量大于9条时,[校验全部Cookies]命令输出精简 2022-04-26 22:10:35 +08:00
2a864fb118 修复:当前信息补空格 & 给谁用 2022-04-08 22:29:00 +08:00
a0874f0077 修改自动米游币私聊api调用方式 2022-04-08 11:45:17 +08:00
40bd69f6ba 尝试修复gs开启自动米游币 2022-04-08 00:58:56 +08:00
acf6e7ead3 哪里多出来的 2022-04-07 10:21:01 +08:00
97381b916d 适应新返回数据 2022-04-07 10:05:31 +08:00
218a35e24d 修复:未探索地下造成的查询错误 & gs帮助错别字 2022-04-06 23:15:12 +08:00
622cbdda8c 修复:米游社新命名造成的查询错误 & 优化:更深的颜色遮罩 2022-04-06 21:04:29 +08:00
bdb3e6287d 修复 2022-04-06 09:27:49 +08:00
9e33e21f5b 引号问题 2022-04-06 00:32:04 +08:00
3a0c6c44af 新增:gs帮助 & xx推荐|攻略 2022-04-06 00:18:15 +08:00
d823089dfc Merge pull request #180 from lgc2333/main
规范引号
2022-04-03 22:36:34 +08:00
cfc755dc0a 规范引号 2022-04-03 21:47:42 +08:00
8fd1ad6e8f 向下兼容Python 3.8 2022-04-02 23:22:28 +08:00
02f3595ede Merge pull request #165 from chenchenriver/main
Update get_mihoyo_bbs_data.py
2022-04-01 14:14:56 +08:00
22c54fafe6 Update get_mihoyo_bbs_data.py 2022-04-01 13:59:12 +08:00
cd134222e2 修复:路径问题导致的角色/武器推荐无法使用2 2022-04-01 11:28:26 +08:00
a2313d7f93 修复:路径问题导致的角色/武器推荐无法使用 2022-04-01 00:36:31 +08:00
017333c05d 更新:推荐表格信息 2022-04-01 00:33:53 +08:00
969d306b64 新增:当前状态 & 当前信息添加参量质变仪信息 2022-04-01 00:26:49 +08:00
d98d95e53a 同步修复(closed #130) 2022-03-31 14:50:27 +08:00
8cfeafc85a 更新依赖 2022-03-31 13:42:53 +08:00
bd7e96524e 修改路径 2022-03-31 12:26:32 +08:00
7cb518f9b6 修改路径 2022-03-31 12:26:01 +08:00
73e128c082 修复:多角色UI重叠 2022-03-31 11:08:34 +08:00
02d6e85756 修复:八角色UI重叠 2022-03-31 09:38:02 +08:00
3f561b0e88 新增:层岩巨渊的适配 2022-03-31 01:21:38 +08:00
a110618754 紧急修复名称和id顺序错误导致天赋错乱的问题 2022-03-30 21:05:11 +08:00
3faf460b50 修复导包问题 2022-03-30 14:59:45 +08:00
4e326368a2 修复网络IO堵塞导致图片丢失问题(fix #152) 2022-03-30 13:07:12 +08:00
b80464a8ca 修复:御神签偶发性输出空字符串 2022-03-29 23:15:16 +08:00
d26849207a 同步 2022-03-29 23:13:03 +08:00
a2b1f47256 修改:开启/关闭为gs开启/gs关闭 2022-03-29 00:34:48 +08:00
60cb1943fc re: 2022-03-29 00:30:30 +08:00
d652a96f9e fix 2022-03-28 00:15:27 +08:00
dbe8ebf6bc Merge branch 'main' of github.com:KimigaiiWuyi/GenshinUID 2022-03-26 00:17:31 +08:00
f762d81105 新增:开启自动米游币 & 当前信息(当前状态图片版)& 全部重获取;优化:新的查询样式 2022-03-26 00:17:17 +08:00
f90bc5d658 Merge pull request #139 from chenchenriver/main
修复hoshino版本中成功绑定ck后因无法使用私聊绑定uid导致的描述问题
2022-03-14 16:54:32 +08:00
8b7aff98cd 修复hoshino版本中成功绑定ck后因无法使用私聊绑定uid导致的描述问题
278行添加描述需要在群聊中使用该命令
2022-03-14 16:16:45 +08:00
7a508c505b 根据PaimonBot的角色别名添加更多别名
https://github.com/XiaoMiku01/PaimonBot/blob/main/src/data/character/nickname.json
2022-03-11 18:03:24 +08:00
b919491339 Merge pull request #129 from Zoe-Wh1t3zZ/patch-1
fix
2022-03-11 01:22:02 +08:00
20e14ec7b3 fix 2022-03-11 01:20:26 +08:00
3be56e5e2c fix 2022-03-11 00:47:55 +08:00
db5d4d46f6 准备:角色别名json的加入 2022-03-10 23:52:20 +08:00
e439cd9f58 新增:开始获取米游币 & 添加Stokne;修复:活动列表 2022-03-10 23:50:35 +08:00
7e63649a55 米游币自动获取前提:Stoken获取指南fix 2022-03-09 09:52:03 +08:00
1367222266 Merge pull request #127 from 3273576540/main
相对改绝对
2022-03-09 09:36:38 +08:00
fd0a04e052 Update get_mihoyo_bbs_coin.py 2022-03-09 09:05:24 +08:00
9d1716b82d 米游币自动获取前提:Stoken获取指南 2022-03-09 00:22:10 +08:00
033eed619d fix 2022-03-09 00:18:47 +08:00
d25b05e802 Merge branch 'main' of github.com:KimigaiiWuyi/GenshinUID 2022-03-09 00:03:06 +08:00
afb9a61be2 准备:当前状态图片版 & 自动米游币获取 2022-03-09 00:00:56 +08:00
e3b8e9b8ca 修改导包问题 2022-03-07 11:54:02 +08:00
287e861d06 fix 2022-03-06 23:50:49 +08:00
41bcb89a38 修改结构 2022-03-06 23:34:05 +08:00
4edf1ccb49 fix:on_rex 2022-03-06 15:41:13 +08:00
4bb0faa49e 新增:xxx用什么|能用啥|怎么养&xxx能给谁|给谁用|要给谁|谁能用 2022-03-06 00:04:24 +08:00
4664fa805d 同步代码 2022-03-05 22:03:50 +08:00
4c9f0d9f3f 同步:新的贴图 2022-03-05 21:54:34 +08:00
d614b0bf8b 同步:接口 2022-03-05 21:53:27 +08:00
c365d7bce9 优化:统一深渊生成图 & 统一返回 (添加大量冗余代码 2022-03-05 21:50:14 +08:00
919c55adb1 ReadMe 2022-02-22 23:57:08 +08:00
2c21f035d4 优化:天赋wiki的显示(合并转发) 2022-02-22 23:49:25 +08:00
d10d9dd982 Merge branch 'main' of github.com:KimigaiiWuyi/GenshinUID 2022-02-22 23:46:49 +08:00
21607fe2a7 更新接口 2022-02-22 23:46:27 +08:00
49fdecfa25 修复:深渊查询问题 2022-02-16 16:15:46 +08:00
5d11ec7998 修复:活动列表时间 fix #116 2022-02-14 23:52:20 +08:00
47a9595785 格式化提交 2022-02-14 19:18:20 +08:00
5ca303c2f9 格式化提交(事件响应部分) 2022-02-12 19:19:48 +08:00
42bc1d68b9 修复:活动列表时间问题 2022-02-12 18:41:10 +08:00
fa143d4bf5 Fix 2022-02-12 03:32:07 +08:00
a4d948563e 修复:活动列表时间的问题 2022-02-12 00:32:36 +08:00
25bbede003 Update README.md 2022-02-09 18:20:06 +08:00
4d687770ef 修复一个bug 2022-02-09 18:18:17 +08:00
8cf1dd6b37 requirements 2022-02-06 23:27:33 +08:00
ec39704b72 优化:报错 2022-02-04 19:25:04 +08:00
e99928687c Readme 2022-02-03 20:07:00 +08:00
c7b2b14703 Readme 2022-02-03 20:05:48 +08:00
a4f8b3f12b 优化:武器的数值显示 2022-02-03 19:33:35 +08:00
a79c139077 优化:定时任务log 2022-02-03 00:07:16 +08:00
365f5eb7e3 优化:校验全部Cookies现在会私聊已失效CK的QQ账号提醒ck过期 2022-02-02 11:01:14 +08:00
0b3595f9c3 README! 2022-02-01 19:05:54 +08:00
899f0e7ce9 readme 2022-02-01 19:02:03 +08:00
b7100af0f0 优化:八角色UI信息内容 2022-02-01 18:40:12 +08:00
5ca4013639 优化:自动签到报告&新增:开启简洁签到报告 2022-02-01 00:15:09 +08:00
83b548c2f2 修复:同步新的WikiAPI接口;优化:错误提示. 2022-01-26 23:59:29 +08:00
5f3d37852a 优化:每日签到&树脂提醒 2022-01-24 00:41:12 +08:00
76b010a1bb 同步语音重试:PR #81 2022-01-23 01:49:42 +08:00
02ee0427b8 优化:添加Cookies之后的缓存问题 2022-01-23 01:29:26 +08:00
41efadd0a3 新增:食物/圣遗物命令,支持模糊查询;修复&优化:签到/添加Ck指令;移除:数据库优化命令 2022-01-23 01:12:05 +08:00
b0392fc4c7 Create LICENSE 2022-01-11 19:39:01 +08:00
8a81f51679 添加:报错信息 2022-01-08 20:58:05 +08:00
e8f4b23741 修复:补全缺失的Texture2D 2022-01-06 00:41:08 +08:00
f06a3baff9 新增:语音命令;修复:渊下宫带来的查询错误问题;新增:当前状态命令查询洞天宝钱数量 2022-01-06 00:33:49 +08:00
eadd9656b3 修复:角色命令可能出错的问题 2022-01-01 15:30:03 +08:00
12f7f2f77d 新增:开启&关闭自动签到/推送服务,可由超级管理员操作 2021-12-30 23:08:12 +08:00
089e69799f 新增:命座查询的模糊匹配;优化:代码结构 2021-12-30 22:26:08 +08:00
a95b27c181 新增:武器已支持查询某个固定等级属性 & 支持模糊查询;修复:角色查等级时元素精通数值不正确显示。 2021-12-30 00:41:24 +08:00
3d8c4b8ba2 修复:角色命令现已支持模糊查询(修复之前直接输出Json) 2021-12-30 00:01:34 +08:00
dc93f9e962 修复&优化:数据获取方式 & 推送树脂可能造成的Bug;新增:原魔、天赋指令。 2021-12-29 23:57:02 +08:00
d2ab169128 修复:活动列表可能导致的bug 2021-12-26 22:17:34 +08:00
97260c8696 Merge pull request #61 from wudifeixue/patch-1
HoshinoBot版本修复米哈游api改变导致的插件损坏
2021-12-24 13:45:08 +08:00
1b14f7986d 修复米哈游api改变导致的插件损坏 2021-12-23 22:42:20 -07:00
2a8e54d1f0 修复:不刷新活动图的bug 2021-12-20 23:01:04 +08:00
6e92ed1daf 修复:些许错误 2021-12-20 01:07:04 +08:00
d3c69bf2b1 修复:Readme 2021-12-20 01:03:28 +08:00
93eba1e036 修复:些许错误 2021-12-20 00:53:56 +08:00
4d911c31ec 修复:轻微bug 2021-12-20 00:36:29 +08:00
d81d3db719 新增:若干功能 2021-12-20 00:19:43 +08:00
e9d4ae58be 修复:原神wiki相关功能 2021-12-11 00:29:34 +08:00
2c7148410f 修复:原神wiki相关功能 2021-12-11 00:26:43 +08:00
0a8d936839 修复:原神wiki相关功能 2021-12-11 00:24:28 +08:00
64915421eb Merge pull request #50 from wudifeixue/main
添加了更详细的错误信息
2021-12-10 09:36:50 +08:00
3ca8a28a02 补齐缺失的心海头像 2021-12-09 18:16:05 -07:00
711a7ed943 修正心海头像
以前的老版本是侧脸,而且是4星
2021-12-09 18:15:20 -07:00
56ad8f5f33 添加了更详细的错误信息 2021-12-09 16:35:07 -07:00
3f5cf907d3 更新错误反馈信息 2021-12-09 16:34:07 -07:00
56e99ec00c Merge branch 'main' of github.com:KimigaiiWuyi/GenshinUID 2021-12-10 02:07:38 +08:00
b32ff63d6e fix 2021-12-10 02:07:17 +08:00
88f2f66377 Merge pull request #49 from wudifeixue/patch-1
添加全部重签相关文档
2021-12-10 01:28:09 +08:00
5fd0bbf27a 添加全部重签相关文档 2021-12-09 10:23:39 -07:00
29567d22ee fix 2021-12-10 00:49:48 +08:00
0462f28d76 fix 2021-12-10 00:47:51 +08:00
644c825e2f !!fix!! 2021-12-04 23:59:24 +08:00
1e89b72e0d !!fix!! 2021-12-04 19:18:45 +08:00
f8a7e1c34b !!fix!! 2021-12-04 19:12:19 +08:00
ed7e5c5b79 fix 2021-11-25 22:13:31 +08:00
82ad1efb19 fix 2021-11-25 21:58:02 +08:00
fb555a9595 fix 2021-11-23 23:11:21 +08:00
9a5fdd6690 fix 2021-11-22 00:16:25 +08:00
8c8cb29cc4 fix 2021-11-21 02:19:41 +08:00
012981f566 readme 2021-11-21 00:29:56 +08:00
fb43d02c5a fix and feat 2021-11-21 00:26:58 +08:00
ac6631b9cd fix 2021-11-18 00:50:02 +08:00
5ac8e61da1 fix 2021-11-18 00:48:23 +08:00
b7e7a4e5e9 Merge pull request #18 from lgc2333/main
优化札记格式 优化实时便笺格式 添加实时便笺显示数据 修复百科无法使用的bug
2021-11-15 12:55:35 +08:00
39c1ee24c7 优化札记格式 优化实时便笺格式 添加实时便笺显示数据 修复百科无法使用的bug 2021-11-15 01:00:38 +08:00
60523102d2 up 2021-11-15 00:11:14 +08:00
035496965f up 2021-11-15 00:04:04 +08:00
f9701195a0 Update getDB.py 2021-11-11 11:32:27 +08:00
0ecb4b4b26 Update getDB.py 2021-11-11 11:31:47 +08:00
64 changed files with 1110 additions and 937 deletions

View File

@ -1,42 +0,0 @@
name: Unittest
on:
push:
branches:
- nonebot2-beta1
pull_request:
jobs:
test:
name: Test
strategy:
matrix:
version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
shell: bash
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
architecture: "x64"
cache: "poetry"
- name: Install dependencies
run: poetry install --with test --without dev
shell: bash
- name: Run Pytest
run: |
cd tests
poetry run pytest

View File

@ -1,7 +1,5 @@
ci:
autofix_commit_msg: ":rotating_light: auto fix by pre-commit-ci"
skip:
- "poetry-lock"
autofix_prs: true
autoupdate_branch: master
autoupdate_schedule: monthly

View File

@ -1,25 +1,39 @@
from pathlib import Path
from pkgutil import iter_modules
from nonebot.log import logger
from nonebot import require, load_all_plugins, get_plugin_by_module_name
from .config import config as _config
require('nonebot_plugin_apscheduler')
if get_plugin_by_module_name("GenshinUID"):
logger.info("推荐直接加载 GenshinUID 仓库文件夹")
load_all_plugins(
[
f"GenshinUID.{module.name}"
for module in iter_modules([str(Path(__file__).parent)])
if module.ispkg
and (
(name := module.name[11:]) == "meta"
or name not in _config.disabled_plugins
)
# module.name[:11] == genshinuid_
'GenshinUID.genshinuid_abyss',
'GenshinUID.genshinuid_adv',
'GenshinUID.genshinuid_ann',
'GenshinUID.genshinuid_gcg',
'GenshinUID.genshinuid_xkdata',
'GenshinUID.genshinuid_check',
'GenshinUID.genshinuid_collection',
'GenshinUID.genshinuid_config',
'GenshinUID.genshinuid_enka',
'GenshinUID.genshinuid_etcimg',
'GenshinUID.genshinuid_eventlist',
'GenshinUID.genshinuid_gachalog',
'GenshinUID.genshinuid_guide',
'GenshinUID.genshinuid_help',
'GenshinUID.genshinuid_map',
'GenshinUID.genshinuid_meta',
'GenshinUID.genshinuid_mhybbscoin',
'GenshinUID.genshinuid_mys',
'GenshinUID.genshinuid_note',
'GenshinUID.genshinuid_resin',
'GenshinUID.genshinuid_resource',
'GenshinUID.genshinuid_roleinfo',
'GenshinUID.genshinuid_signin',
'GenshinUID.genshinuid_user',
'GenshinUID.genshinuid_wikitext',
'GenshinUID.genshinuid_webconsole',
'GenshinUID.genshinuid_update',
],
[],
)

View File

@ -1,15 +1,5 @@
from typing import Set
from nonebot import get_driver
from pydantic import Field, BaseModel
class Config(BaseModel):
disabled_plugins: Set[str] = Field(
default_factory=set, alias="genshinuid_disabled_plugins"
)
priority: int = Field(2, alias="genshinuid_priority")
config = Config.parse_obj(get_driver().config)
priority = config.priority
config = get_driver().config
SUPERUSERS = {x for x in config.superusers}
priority = 2

View File

@ -1,22 +1,18 @@
from typing import Any, Tuple, Union
from typing import Any, Tuple
from nonebot import on_regex
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.params import Depends, RegexGroup
from nonebot.adapters.onebot.v11 import (
MessageSegment,
GroupMessageEvent,
PrivateMessageEvent,
)
from nonebot.params import RegexGroup
from nonebot.adapters.ntchat import MessageSegment, TextMessageEvent
from ..genshinuid_meta import register_menu
from .draw_abyss_card import draw_abyss_img
from ..utils.message.error_reply import UID_HINT
from ..utils.db_operation.db_operation import select_db
from ..utils.message.get_image_and_at import ImageAndAt
from ..utils.mhy_api.convert_mysid_to_uid import convert_mysid
from ..utils.exception.handle_exception import handle_exception
from ..utils.draw_image_tools.send_image_tool import convert_img
get_abyss_info = on_regex(
r'^(\[CQ:at,qq=[0-9]+\])?( )?'
@ -25,6 +21,7 @@ get_abyss_info = on_regex(
r'(\[CQ:at,qq=[0-9]+\])?( )?$',
block=True,
)
# 恢复了查询二字,和其他的查询打架下次解决
@get_abyss_info.handle()
@ -56,15 +53,19 @@ get_abyss_info = on_regex(
),
)
async def send_abyss_info(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
args: Tuple[Any, ...] = RegexGroup(),
custom: ImageAndAt = Depends(),
):
logger.info('开始执行[查询深渊信息]')
logger.info(f'[查询深渊信息]参数: {args}')
at = custom.get_first_at()
qid = at or event.user_id
qid = event.from_wxid
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "":
qid = user
if args[2] == 'mys':
uid = await convert_mysid(args[3])
elif args[3] is None:
@ -97,6 +98,7 @@ async def send_abyss_info(
if isinstance(im, str):
await matcher.finish(im)
elif isinstance(im, bytes):
im = await convert_img(im)
await matcher.finish(MessageSegment.image(im))
else:
await matcher.finish('发生了未知错误,请联系管理员检查后台输出!')

View File

@ -2,7 +2,7 @@ from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.params import CommandArg
from nonebot.adapters.onebot.v11 import Message
from nonebot.adapters.ntchat import Message
from ..config import priority
from .get_achi_desc import get_achi, get_daily_achi

View File

@ -1,3 +1,4 @@
import base64
import random
import asyncio
@ -7,11 +8,11 @@ from nonebot.params import CommandArg
from nonebot import get_bot, on_command
from nonebot.permission import SUPERUSER
from nonebot_plugin_apscheduler import scheduler
from nonebot.adapters.onebot.v11 import (
Message,
from nonebot.adapters.ntchat.message import Message
from nonebot.adapters.ntchat import (
MessageEvent,
MessageSegment,
GroupMessageEvent,
TextMessageEvent,
)
from .util import black_ids
@ -61,19 +62,19 @@ async def send_ann_pic(
@reg_ann.handle()
@handle_exception('设置原神公告', '设置原神公告失败')
async def send_reg_ann(
event: GroupMessageEvent,
event: TextMessageEvent,
matcher: Matcher,
):
await matcher.finish(sub_ann(event.group_id))
await matcher.finish(sub_ann(event.room_wxid))
@unreg_ann.handle()
@handle_exception('取消原神公告', '取消设置原神公告失败')
async def send_unreg_ann(
event: GroupMessageEvent,
event: TextMessageEvent,
matcher: Matcher,
):
await matcher.finish(unsub_ann(event.group_id))
await matcher.finish(unsub_ann(event.room_wxid))
@consume_ann.handle()
@ -82,7 +83,7 @@ async def send_consume_ann(
event: MessageEvent,
matcher: Matcher,
):
qid = event.user_id
qid = event.from_wxid
uid = await select_db(qid, mode='uid')
uid = str(uid)
if '未找到绑定的UID' in uid:
@ -99,11 +100,9 @@ async def check_ann_state():
logger.info('[原神公告] 定时任务: 原神公告查询..')
ids = string_config.get_config('Ann_Ids')
sub_list = string_config.get_config('Ann_Groups')
if not sub_list:
logger.info('没有群订阅, 取消获取数据')
return
if not ids:
ids = await ann().get_ann_ids()
if not ids:
@ -111,10 +110,9 @@ async def check_ann_state():
string_config.set_config('Ann_Ids', ids)
logger.info('初始成功, 将在下个轮询中更新.')
return
new_ids = await ann().get_ann_ids()
new_ann = set(ids) ^ set(new_ids)
new_ann = set(ids) ^ set(new_ids)
if not new_ann:
logger.info('[原神公告] 没有最新公告')
return
@ -125,18 +123,20 @@ async def check_ann_state():
try:
img = await ann_detail_card(ann_id) # 防止抛出异常报错
bot = get_bot()
b64img = base64.b64encode(img)
for group in sub_list:
try:
await bot.call_api(
api='send_group_msg',
group_id=group,
message=MessageSegment.image(img),
api='send_image',
to_wxid=str(group),
file_path="base64://" + b64img.decode(),
)
await asyncio.sleep(random.uniform(1, 3))
except Exception as e:
logger.exception(e)
except Exception as e:
logger.exception(str(e))
logger.exception(e)
logger.info('[原神公告] 推送完毕, 更新数据库')
string_config.set_config('Ann_Ids', new_ids)

View File

@ -1,17 +1,12 @@
import random
import asyncio
from typing import Union
from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.permission import SUPERUSER
from nonebot_plugin_apscheduler import scheduler
from nonebot.adapters.onebot.v11 import (
Bot,
GroupMessageEvent,
PrivateMessageEvent,
)
from nonebot.adapters.ntchat import Bot, TextMessageEvent
from ..config import priority
from .backup_data import data_backup
@ -25,11 +20,17 @@ from ..utils.message.get_cqhttp_data import (
get_group_member_list,
)
backup = on_command('gs清除缓存', rule=FullCommand(), priority=priority)
check = on_command('校验全部Cookies', rule=FullCommand(), priority=priority)
check_stoken = on_command('校验全部Stoken', rule=FullCommand(), priority=priority)
backup = on_command(
'gs清除缓存', rule=FullCommand(), priority=priority, permission=SUPERUSER
)
check = on_command(
'校验全部Cookies', rule=FullCommand(), priority=priority, permission=SUPERUSER
)
check_stoken = on_command(
'校验全部Stoken', rule=FullCommand(), priority=priority, permission=SUPERUSER
)
remove_invalid_user = on_command(
'清除无效用户', rule=FullCommand(), priority=priority
'清除无效用户', rule=FullCommand(), priority=priority, permission=SUPERUSER
)
backup_scheduler = scheduler
@ -57,7 +58,7 @@ async def daily_refresh_charData():
)
async def send_backup_msg(
bot: Bot,
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
):
if not await SUPERUSER(bot, event):
@ -84,7 +85,7 @@ async def send_backup_msg(
)
async def send_remove_invalid_user_msg(
bot: Bot,
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
):
if not await SUPERUSER(bot, event):

View File

@ -1,20 +1,13 @@
from typing import Union
from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.params import Depends, CommandArg
from nonebot.adapters.onebot.v11 import (
Message,
MessageSegment,
GroupMessageEvent,
PrivateMessageEvent,
)
from nonebot.params import CommandArg
from nonebot.adapters.ntchat.message import Message
from nonebot.adapters.ntchat import MessageSegment, TextMessageEvent
from ..genshinuid_meta import register_menu
from ..utils.data_convert.get_uid import get_uid
from ..utils.message.error_reply import UID_HINT
from ..utils.message.get_image_and_at import ImageAndAt
from ..utils.exception.handle_exception import handle_exception
from .draw_collection_card import draw_explora_img, draw_collection_img
@ -49,23 +42,20 @@ get_explora_info = on_command('查询探索', aliases={'探索', 'ts'}, block=Tr
),
)
async def send_collection_info(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
args: Message = CommandArg(),
custom: ImageAndAt = Depends(),
):
logger.info('开始执行[查询收集信息]')
logger.info('[查询收集信息]参数: {}'.format(args))
raw_mes = args.extract_plain_text().strip()
at = custom.get_first_at()
if at:
qid = at
if event.at_user_list:
qid = event.at_user_list[0]
else:
qid = event.user_id
qid = event.from_wxid
# 获取uid
uid = await get_uid(qid, raw_mes)
logger.info('[查询角色面板]uid: {}'.format(uid))
logger.info('[查询收集信息]uid: {}'.format(uid))
if '未找到绑定的UID' in uid:
await matcher.finish(UID_HINT)
@ -82,23 +72,20 @@ async def send_collection_info(
@get_explora_info.handle()
@handle_exception('查询探索信息')
async def send_explora_info(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
args: Message = CommandArg(),
custom: ImageAndAt = Depends(),
):
logger.info('开始执行[查询探索信息]')
logger.info('[查询探索信息]参数: {}'.format(args))
raw_mes = args.extract_plain_text().strip()
at = custom.get_first_at()
if at:
qid = at
if event.at_user_list:
qid = event.at_user_list[0]
else:
qid = event.user_id
qid = event.from_wxid
# 获取uid
uid = await get_uid(qid, raw_mes)
logger.info('[查询角色面板]uid: {}'.format(uid))
logger.info('[查询探索信息]uid: {}'.format(uid))
if '未找到绑定的UID' in uid:
await matcher.finish(UID_HINT)

View File

@ -1,23 +1,17 @@
from typing import Any, Tuple, Union
from typing import Any, Tuple
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.params import RegexGroup
from nonebot import on_regex, on_command
from nonebot.permission import SUPERUSER
from nonebot.params import Depends, CommandArg, RegexGroup
from nonebot.adapters.onebot.v11 import (
Bot,
Message,
MessageSegment,
GroupMessageEvent,
PrivateMessageEvent,
)
from nonebot.adapters.ntchat import Bot, MessageSegment, TextMessageEvent
from ..genshinuid_meta import register_menu
from ..utils.nonebot2.rule import FullCommand
from .draw_config_card import draw_config_img
from ..utils.message.error_reply import UID_HINT
from ..utils.db_operation.db_operation import select_db
from ..utils.message.get_image_and_at import ImageAndAt
from .set_config import set_push_value, set_config_func
from ..utils.exception.handle_exception import handle_exception
@ -33,7 +27,7 @@ push_config = on_regex(
r'(\[CQ:at,qq=[0-9]+\])?( )?$'
)
config_card = on_command('gs配置')
config_card = on_command('gs配置', rule=FullCommand())
@config_card.handle()
@ -50,9 +44,7 @@ config_card = on_command('gs配置')
'- <ft color=(238,120,0)>gs配置</ft>'
),
)
async def send_config_card(matcher: Matcher, args: Message = CommandArg()):
if args:
await matcher.finish()
async def send_config_card(matcher: Matcher):
logger.info('开始执行[gs配置]')
im = await draw_config_img()
if isinstance(im, str):
@ -85,38 +77,59 @@ async def send_config_card(matcher: Matcher, args: Message = CommandArg()):
)
async def send_config_msg(
bot: Bot,
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
args: Tuple[Any, ...] = RegexGroup(),
custom: ImageAndAt = Depends(),
):
logger.info('开始执行[设置阈值信息]')
logger.info('[设置阈值信息]参数: {}'.format(args))
qid = event.user_id
at = custom.get_first_at()
wxid_list = []
wxid_list.append(event.from_wxid)
qid = event.from_wxid
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "" and await SUPERUSER(bot, event):
qid = user
else:
await matcher.finish(
MessageSegment.room_at_msg(
content="{$@}你没有权限操作别人的状态噢~", at_list=wxid_list
)
)
if at and await SUPERUSER(bot, event):
qid = at
elif at and at != qid:
await matcher.finish('你没有权限操作别人的状态噢~', at_sender=True)
logger.info('[设置阈值信息]qid: {}'.format(qid))
try:
uid = await select_db(qid, mode='uid')
except TypeError:
await matcher.finish(UID_HINT)
await matcher.finish(
MessageSegment.room_at_msg(
content='{$@}' + UID_HINT, at_list=wxid_list
)
)
func = args[4].replace('阈值', '')
if args[5]:
try:
value = int(args[5])
except ValueError:
await matcher.finish('请输入数字哦~', at_sender=True)
await matcher.finish(
MessageSegment.room_at_msg(
content="{$@}请输入数字哦~", at_list=wxid_list
)
)
else:
await matcher.finish('请输入正确的阈值数字!', at_sender=True)
await matcher.finish(
MessageSegment.room_at_msg(
content="{$@}请输入正确的阈值数字!", at_list=wxid_list
)
)
logger.info('[设置阈值信息]func: {}, value: {}'.format(func, value))
im = await set_push_value(func, str(uid), value)
await matcher.finish(im, at_sender=True)
await matcher.finish(
MessageSegment.room_at_msg(content="{$@}" + f"{im}", at_list=wxid_list)
)
# 开启 自动签到 和 推送树脂提醒 功能
@ -141,38 +154,49 @@ async def send_config_msg(
)
async def open_switch_func(
bot: Bot,
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
args: Tuple[Any, ...] = RegexGroup(),
at: ImageAndAt = Depends(),
):
qid = event.user_id
atqq = at.get_first_at() if at else None
wxid_list = []
wxid_list.append(event.from_wxid)
qid = event.from_wxid
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "" and await SUPERUSER(bot, event):
qid = user
else:
await matcher.finish(
MessageSegment.room_at_msg(
content="{$@}你没有权限操作别人的状态噢~", at_list=wxid_list
)
)
config_name = args[4]
logger.info(f'[{qid}]尝试[{args[3]}]了[{config_name}]功能')
fake_seession = f'group_{event.room_wxid}_{event.from_wxid}'
if args[3] == '开启':
query = 'OPEN'
gid = (
event.get_session_id().split('_')[1]
if len(event.get_session_id().split('_')) == 3
fake_seession.split('_')[1]
if len(fake_seession.split('_')) == 3
else 'on'
)
else:
query = 'CLOSED'
gid = 'off'
is_admin = await SUPERUSER(bot, event)
if atqq:
if is_admin:
qid = atqq
elif atqq != qid:
await matcher.finish('你没有权限操作别人的状态噢~', at_sender=True)
uid = await select_db(qid, mode='uid')
if uid is None or not isinstance(uid, str) or not uid.isdecimal():
await matcher.finish(UID_HINT)
await matcher.finish(
MessageSegment.room_at_msg(
content='{$@}' + UID_HINT, at_list=wxid_list
)
)
im = await set_config_func(
config_name=config_name,
@ -180,6 +204,8 @@ async def open_switch_func(
qid=str(qid),
option=gid,
query=query,
is_admin=is_admin,
is_admin=await SUPERUSER(bot, event),
)
await matcher.finish(
MessageSegment.room_at_msg(content="{$@}" + f"{im}", at_list=wxid_list)
)
await matcher.finish(im, at_sender=True)

View File

@ -5,7 +5,7 @@ from ..utils.download_resource.RESOURCE_PATH import MAIN_PATH
from ..utils.db_operation.db_operation import get_all_bind, get_user_bind_data
DATA_PATH = MAIN_PATH / 'v3_data.json'
BOT_ID = 'onebot'
BOT_ID = 'ntchat'
RECOGNIZE_SERVER = {
'1': 'cn_gf01',
'2': 'cn_gf01',

View File

@ -1,20 +1,21 @@
import re
import random
import asyncio
from typing import Tuple, Union
from typing import Tuple
from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.params import CommandArg
from nonebot.permission import SUPERUSER
from nonebot.params import Depends, CommandArg
from nonebot_plugin_apscheduler import scheduler
from nonebot.adapters.onebot.v11 import (
from nonebot.adapters.ntchat.message import Message
from nonebot.adapters.ntchat import (
Bot,
Message,
MessageEvent,
MessageSegment,
GroupMessageEvent,
PrivateMessageEvent,
TextMessageEvent,
QuoteMessageEvent,
)
from ..config import priority
@ -26,14 +27,13 @@ from ..utils.message.error_reply import UID_HINT
from ..utils.enka_api.get_enka_data import switch_api
from ..utils.enka_api.enka_to_card import enka_to_card
from ..utils.enka_api.enka_to_data import enka_to_data
from ..utils.message.get_image_and_at import ImageAndAt
from ..utils.download_resource.RESOURCE_PATH import TEMP_PATH
from ..utils.exception.handle_exception import handle_exception
from ..utils.db_operation.db_operation import select_db, get_all_uid
refresh = on_command('强制刷新')
original_pic = on_command('原图', rule=FullCommand())
change_api = on_command('切换api')
change_api = on_command('切换api', rule=FullCommand())
get_charcard_list = on_command('毕业度统计')
get_char_info = on_command(
'查询',
@ -60,11 +60,10 @@ refresh_scheduler = scheduler
)
async def send_change_api_info(
bot: Bot,
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: MessageEvent,
matcher: Matcher,
args: Message = CommandArg(),
):
if args or not await SUPERUSER(bot, event):
if not await SUPERUSER(bot, event):
return
im = await switch_api()
@ -87,11 +86,10 @@ async def send_change_api_info(
),
)
async def send_original_pic(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: QuoteMessageEvent,
matcher: Matcher,
):
if event.reply:
msg_id = event.reply.message_id
msg_id = event.quote_message_id
path = TEMP_PATH / f'{msg_id}.jpg'
if path.exists():
logger.info('[原图]访问图片: {}'.format(path))
@ -147,28 +145,33 @@ async def send_original_pic(
),
)
async def send_char_info(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
args: Message = CommandArg(),
custom: ImageAndAt = Depends(),
):
raw_mes = args.extract_plain_text().strip()
name = ''.join(re.findall('[\u4e00-\u9fa5]', raw_mes))
# 如果输入中(查询之后的内容)没有其他字符串(如角色名等)则忽略。
if not name:
return
# 若查询中有@则排除@后内容,排除后若@前没有 其他内容则不继续运行下方代码 防止与roleinfo查询打架
# 修改后@人应该在命令末尾 如:查询万叶@XXXX
if "@" in raw_mes:
raw_mes = raw_mes.split("@")[0]
if not raw_mes:
return
logger.info('开始执行[查询角色面板]')
at = custom.get_first_at()
img = custom.get_first_image()
if at:
qid = at
else:
qid = event.user_id
logger.info('[查询角色面板]QQ: {}'.format(qid))
# 获取被@的Wxid排除""
qid = event.from_wxid
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "":
qid = user
logger.info('[查询角色面板]WXID: {}'.format(qid))
# 获取uid
uid = re.findall(r'\d+', raw_mes)
uid = re.findall(r'\d+', raw_mes.split("@")[0])
if uid:
uid = uid[0]
else:
@ -179,15 +182,15 @@ async def send_char_info(
if '未找到绑定的UID' in uid:
await matcher.finish(UID_HINT)
im = await draw_enka_img(raw_mes, uid, img)
im = await draw_enka_img(raw_mes, uid, None)
if isinstance(im, str):
await matcher.finish(im)
elif isinstance(im, Tuple):
req = await matcher.send(MessageSegment.image(im[0]))
msg_id = req['message_id']
await matcher.send(MessageSegment.image(im[0]))
# msg_id = req['message_id']
if im[1]:
with open(TEMP_PATH / f'{msg_id}.jpg', 'wb') as f:
with open(TEMP_PATH / f'{uid}.jpg', 'wb') as f:
f.write(im[1])
else:
await matcher.finish('发生了未知错误,请联系管理员检查后台输出!')
@ -245,17 +248,19 @@ async def daily_refresh_charData():
async def send_card_info(
bot: Bot,
matcher: Matcher,
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
args: Message = CommandArg(),
custom: ImageAndAt = Depends(),
):
message = args.extract_plain_text().strip().replace(' ', '')
uid = re.findall(r'\d+', message) # str
uid = re.findall(r'\d+', message.split("@")[0]) # str
m = ''.join(re.findall('[\u4e00-\u9fa5]', message))
qid = event.user_id
at = custom.get_first_at()
if at:
qid = at
# 获取被@的Wxid排除""
qid = event.from_wxid
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "":
qid = user
if len(uid) >= 1:
uid = uid[0]
@ -301,19 +306,21 @@ async def send_card_info(
),
)
async def send_charcard_list(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
args: Message = CommandArg(),
custom: ImageAndAt = Depends(),
):
raw_mes = args.extract_plain_text().strip()
qid = event.user_id
at = custom.get_first_at()
if at:
qid = at
# 获取被@的Wxid排除""
qid = event.from_wxid
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "":
qid = user
# 获取uid
uid = re.findall(r'\d+', raw_mes)
uid = re.findall(r'\d+', raw_mes.split("@")[0])
if uid:
uid = uid[0]
else:

View File

@ -5,7 +5,8 @@ from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot import on_regex, on_command
from nonebot.params import CommandArg, RegexGroup
from nonebot.adapters.onebot.v11 import Message, MessageSegment
from nonebot.adapters.ntchat import MessageSegment
from nonebot.adapters.ntchat.message import Message
from ..version import Genshin_version
from ..genshinuid_meta import register_menu

View File

@ -1,7 +1,7 @@
from nonebot import on_command
from nonebot.matcher import Matcher
from nonebot_plugin_apscheduler import scheduler
from nonebot.adapters.onebot.v11 import MessageSegment
from nonebot.adapters.ntchat import MessageSegment
from ..config import priority
from ..genshinuid_meta import register_menu

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 KiB

View File

@ -1,13 +1,15 @@
from typing import Union
import os
import asyncio
from nonebot.log import logger
from nonebot.rule import is_type
from nonebot.matcher import Matcher
from nonebot import get_bot, on_notice, on_command
from nonebot.adapters.onebot.v11 import (
NoticeEvent,
from nonebot import get_bot, on_command, on_message
from nonebot.adapters.ntchat.permission import GROUP
from nonebot.adapters.ntchat import (
MessageSegment,
GroupMessageEvent,
PrivateMessageEvent,
FileMessageEvent,
TextMessageEvent,
)
from .get_gachalogs import save_gachalogs
@ -21,8 +23,8 @@ from .export_and_import import export_gachalogs, import_gachalogs
get_gacha_log = on_command('刷新抽卡记录', aliases={'强制刷新抽卡记录'}, rule=FullCommand())
get_gacha_log_card = on_command('抽卡记录', rule=FullCommand())
import_gacha_log = on_notice()
export_gacha_log = on_command('导出抽卡记录', rule=FullCommand())
import_gacha_log = on_message(block=False, rule=(is_type(FileMessageEvent)))
export_gacha_log = on_command('导出抽卡记录', rule=FullCommand(), permission=GROUP)
@export_gacha_log.handle()
@ -41,12 +43,12 @@ export_gacha_log = on_command('导出抽卡记录', rule=FullCommand())
),
)
async def export_gacha_log_info(
event: GroupMessageEvent,
event: TextMessageEvent,
matcher: Matcher,
):
logger.info('开始执行[导出抽卡记录]')
qid = event.user_id
gid = event.group_id
qid = event.from_wxid
gid = event.room_wxid
uid = await select_db(qid, mode='uid')
bot = get_bot()
if not isinstance(uid, str) or '未找到绑定的UID' in uid:
@ -54,10 +56,9 @@ async def export_gacha_log_info(
raw_data = await export_gachalogs(uid)
if raw_data['retcode'] == 'ok':
await bot.call_api(
'upload_group_file',
group_id=gid,
name=raw_data['name'],
file=raw_data['url'],
'send_file',
to_wxid=gid,
file_path=raw_data['url'],
)
logger.info(f'[导出抽卡记录] UID{uid}成功!')
await matcher.finish('上传成功!')
@ -81,21 +82,22 @@ async def export_gacha_log_info(
'- <ft color=(238,120,0)>私聊发送json格式的离线文件</ft>'
),
)
async def import_gacha_log_info(event: NoticeEvent, matcher: Matcher):
args = event.dict()
if args['notice_type'] != 'offline_file':
await matcher.finish()
url = args['file']['url']
name: str = args['file']['name']
if not name.endswith('.json'):
return
qid = args['user_id']
uid = await select_db(qid, mode='uid')
async def import_gacha_log_info(event: FileMessageEvent, matcher: Matcher):
await asyncio.sleep(2) # 等待下载文件,避免占用
# 检测文件是否存在并小于8MB
if (
os.path.exists(event.file)
and os.path.getsize(event.file) <= 8 * 1024 * 1024
and event.file_name.endswith(".json")
):
uid = await select_db(event.from_wxid, mode='uid')
if not isinstance(uid, str) or '未找到绑定的UID' in uid:
await matcher.finish(UID_HINT)
logger.info('开始执行[导入抽卡记录]')
im = await import_gachalogs(url, uid)
im = await import_gachalogs(event.file, uid)
await matcher.finish(im)
else:
await matcher.finish()
@get_gacha_log_card.handle()
@ -114,14 +116,14 @@ async def import_gacha_log_info(event: NoticeEvent, matcher: Matcher):
),
)
async def send_gacha_log_card_info(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
):
logger.info('开始执行[抽卡记录]')
uid = await select_db(event.user_id, mode='uid')
uid = await select_db(event.from_wxid, mode='uid')
if isinstance(uid, str):
im = await draw_gachalogs_img(uid, event.user_id)
im = await draw_gachalogs_img(uid, event.from_wxid) # type: ignore
if isinstance(im, bytes):
await matcher.finish(MessageSegment.image(im))
else:
@ -146,15 +148,21 @@ async def send_gacha_log_card_info(
),
)
async def send_daily_info(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
):
logger.info('开始执行[刷新抽卡记录]')
uid = await select_db(event.user_id, mode='uid')
wxid_list = []
wxid_list.append(event.from_wxid)
uid = await select_db(event.from_wxid, mode='uid')
if isinstance(uid, str):
is_force = False
if event.raw_message.startswith('强制'):
if event.msg.startswith('强制'):
is_force = True
tip = '正在刷新抽卡记录,请耐心等待,不要重复发送命令。'
await matcher.send(
MessageSegment.room_at_msg(content=tip, at_list=wxid_list)
)
im = await save_gachalogs(uid, None, is_force)
await matcher.finish(im)
else:

View File

@ -16,7 +16,13 @@ INT_TO_TYPE = {
async def import_gachalogs(history_url: str, uid: str) -> str:
history_data: dict = json.loads(get(history_url).text)
# 是否Json文件检测
try:
if not history_url.startswith(('http', 'https')):
with open(history_url, 'r', encoding='utf-8') as history_url_files:
history_data = json.load(history_url_files)
else:
history_data: dict = get(history_url).json()
data_uid = history_data['info']['uid']
if data_uid != uid:
return f'该抽卡记录UID{data_uid}与你绑定UID{uid}不符合!'
@ -32,6 +38,8 @@ async def import_gachalogs(history_url: str, uid: str) -> str:
result[INT_TO_TYPE[item['gacha_type']]].append(item)
im = await save_gachalogs(uid, result)
return im
except Exception:
return '导入失败请检查你的Json文件'
async def export_gachalogs(uid: str) -> dict:

View File

@ -1,43 +0,0 @@
from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.adapters.onebot.v11 import Bot, GroupMessageEvent
from .gacha_url import post_url
from ..genshinuid_meta import register_menu
from ..utils.nonebot2.rule import FullCommand
from ..utils.message.error_reply import UID_HINT
from ..utils.db_operation.db_operation import select_db
from ..utils.exception.handle_exception import handle_exception
get_gacha_url = on_command(
'获取抽卡记录链接', aliases={'抽卡链接', '抽卡记录链接'}, rule=FullCommand()
)
@get_gacha_url.handle()
@handle_exception('获取抽卡记录链接')
@register_menu(
'获取抽卡记录链接',
'获取抽卡记录链接',
'获取用户的抽卡记录链接',
trigger_method='群聊指令',
detail_des=(
'介绍:\n'
'导出抽卡记录的链接以用于原神小程序\n'
' \n'
'指令:\n'
'- <ft color=(238,120,0)>抽卡链接</ft>'
),
)
async def _(
bot: Bot,
event: GroupMessageEvent,
matcher: Matcher,
):
await get_gacha_url.send("正在获取抽卡记录链接")
logger.info('开始执行[获取抽卡记录链接]')
uid = await select_db(event.user_id, mode='uid')
if not isinstance(uid, str) or '未找到绑定的UID' in uid:
await matcher.finish(UID_HINT)
await post_url(bot, uid, str(event.group_id), str(event.user_id))

View File

@ -1,53 +0,0 @@
import time
from urllib.parse import quote
from nonebot.adapters.onebot.v11 import Bot
from ..utils.message.error_reply import SK_HINT
from ..utils.message.send_msg import send_forward_msg
from ..utils.mhy_api.get_mhy_data import get_authkey_by_cookie
async def post_url(bot: Bot, uid: str, group_id: str, qid: str):
async def send_group_msg(msg: str):
await bot.call_api(
api='send_group_msg',
group_id=group_id,
message=msg,
)
return ''
authkey = await get_authkey_by_cookie(uid)
if authkey == {}:
return await send_group_msg(SK_HINT)
authkey = authkey['data']['authkey']
now = time.time()
region = ""
if uid[0] == "1" or uid[0] == "2":
region = 'cn_gf01'
elif uid[0] == "5":
region = "'cn_qd01'"
elif uid[0] == "6":
region = "'os_usa'"
elif uid[0] == "7":
region = "'os_euro'"
elif uid[0] == "8":
region = "'os_asia'"
elif uid[0] == "9":
region = "'os_cht'"
else:
region = 'cn_gf01'
msgs = []
msgs.append(f"uid{uid}的抽卡记录链接为:")
url = (
f"https://hk4e-api.mihoyo.com/event/gacha_info/api/getGachaLog?"
f"authkey_ver=1&sign_type=2&auth_appid=webview_gacha&init_type=301&"
f"gacha_id=fecafa7b6560db5f3182222395d88aaa6aaac1bc"
f"&timestamp={str(int(now))}"
f"&lang=zh-cn&device_type=mobile&plat_type=ios&region={region}"
f"&authkey={quote(authkey,'utf-8')}"
f"&game_biz=hk4e_cn&gacha_type=301&page=1&size=5&end_id=0"
)
msgs.append(url)
await send_forward_msg(bot, group_id, "抽卡链接", qid, msgs)
return "成功执行"

View File

@ -3,13 +3,13 @@ import re
from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.params import Depends, CommandArg
from nonebot.adapters.onebot.v11 import Message, MessageEvent, MessageSegment
from nonebot.params import CommandArg
from nonebot.adapters.ntchat.message import Message
from nonebot.adapters.ntchat import MessageSegment, TextMessageEvent
from ..config import priority
from .draw_gcginfo import draw_gcg_info
from ..utils.db_operation.db_operation import select_db
from ..utils.message.get_image_and_at import ImageAndAt
from ..utils.message.error_reply import CK_HINT, UID_HINT
from ..utils.exception.handle_exception import handle_exception
@ -20,26 +20,30 @@ get_gcg_info = on_command('七圣召唤', aliases={'七圣', '召唤'}, priority
@get_gcg_info.handle()
@handle_exception('七圣召唤', '获取/发送七圣召唤失败', '@未找到绑定信息\n' + CK_HINT)
async def send_gcg_pic(
event: MessageEvent,
event: TextMessageEvent,
matcher: Matcher,
args: Message = CommandArg(),
custom: ImageAndAt = Depends(),
):
raw_mes = args.extract_plain_text().strip().replace(' ', '')
name = ''.join(re.findall('[\u4e00-\u9fa5]', raw_mes))
if "@" in raw_mes:
name = ''.join(re.findall('^[\u4e00-\u9fa5]+', raw_mes.split("@")[0]))
if name:
return
at = custom.get_first_at()
logger.info('开始执行[七圣召唤]')
if at:
qid = at
else:
qid = event.user_id
logger.info('[七圣召唤]QQ: {}'.format(qid))
name = ''.join(re.findall('^[\u4e00-\u9fa5]+', raw_mes))
if name:
return
logger.info('开始执行[七圣召唤]')
qid = event.from_wxid
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "":
qid = user
logger.info('[七圣召唤]WXID: {}'.format(qid))
# 获取uid
uid = re.findall(r'\d+', raw_mes)
uid = re.findall(r'\d+', raw_mes.split("@")[0])
if uid:
uid = uid[0]
else:

View File

@ -7,12 +7,8 @@ from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot import on_regex, on_command
from nonebot.params import CommandArg, RegexGroup
from nonebot.adapters.onebot.v11 import (
Bot,
Message,
MessageSegment,
GroupMessageEvent,
)
from nonebot.adapters.ntchat import MessageSegment
from nonebot.adapters.ntchat.message import Message
from .get_card import get_gs_card
from .get_guide import get_gs_guide
@ -27,7 +23,6 @@ get_bluekun_pic = on_command('参考面板')
get_card = on_command('原牌')
get_abyss = on_command('版本深渊')
IMG_PATH = Path(__file__).parent / 'img'
@ -115,10 +110,8 @@ async def send_gscard_pic(matcher: Matcher, args: Message = CommandArg()):
@get_abyss.handle()
@handle_exception('原牌')
@handle_exception('版本深渊')
async def send_abyss_review(
bot: Bot,
event: GroupMessageEvent,
matcher: Matcher,
args: Message = CommandArg(),
):
@ -128,22 +121,8 @@ async def send_abyss_review(
version = str(args[0])
im = await get_review(version)
if isinstance(im, List):
mes = []
for msg in im:
mes.append(
{
'type': 'node',
'data': {
'name': '小仙',
'uin': '3399214199',
'content': msg,
},
}
)
await bot.call_api(
'send_group_forward_msg', group_id=event.group_id, messages=mes
)
await matcher.finish()
im = '\n'.join(im)
await matcher.finish(im)
elif isinstance(im, str):
await matcher.finish(im)
elif isinstance(im, bytes):

View File

@ -5,7 +5,7 @@ from pathlib import Path
from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.adapters.onebot.v11 import MessageSegment
from nonebot.adapters.ntchat import MessageSegment
from .draw_help_card import draw_help_img
from ..genshinuid_meta import register_menu

View File

@ -1,16 +1,11 @@
from typing import Any, Dict, Union
from typing import Any, Dict
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.params import RegexDict
from nonebot import on_regex, on_command
from nonebot.permission import SUPERUSER
from nonebot.adapters.onebot.v11 import (
Bot,
MessageSegment,
GroupMessageEvent,
PrivateMessageEvent,
)
from nonebot.adapters.ntchat import Bot, MessageSegment, TextMessageEvent
from ..config import priority
from ..genshinuid_meta import register_menu
@ -60,7 +55,7 @@ MAP_CHN_NAME = {
)
async def send_change_map_msg(
bot: Bot,
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
):
if not await SUPERUSER(bot, event):
@ -129,7 +124,6 @@ async def send_find_map_msg(
logger.info('本地未缓存,正在渲染...')
im = await draw_genshin_map(name, map_id, map_name)
if isinstance(im, str):
# 如果无结果,直接不返回
await matcher.finish()
elif isinstance(im, bytes):
await matcher.finish(MessageSegment.image(im))

View File

@ -6,12 +6,11 @@ from nonebot.matcher import Matcher
from nonebot import get_bot, on_command
from nonebot.permission import SUPERUSER
from nonebot_plugin_apscheduler import scheduler
from nonebot.adapters.onebot.v11 import MessageEvent
from nonebot.adapters.ntchat import Bot, MessageEvent, MessageSegment
from ..config import priority
from ..config import SUPERUSERS, priority
from ..genshinuid_meta import register_menu
from ..utils.nonebot2.rule import FullCommand
from ..utils.nonebot2.utils import get_superusers
from ..utils.db_operation.db_operation import config_check
from ..utils.exception.handle_exception import handle_exception
from .daily_mihoyo_bbs_coin import mihoyo_coin, all_daily_mihoyo_bbs_coin
@ -20,7 +19,7 @@ bbscoin_scheduler = scheduler
get_mihoyo_coin = on_command('开始获取米游币', priority=priority, rule=FullCommand())
all_bbscoin_recheck = on_command(
'全部重获取', permission=SUPERUSER, priority=priority, rule=FullCommand()
'全部重获取', priority=priority, rule=FullCommand()
)
@ -40,10 +39,16 @@ all_bbscoin_recheck = on_command(
),
)
async def send_mihoyo_coin(event: MessageEvent, matcher: Matcher):
await matcher.send('开始操作……', at_sender=True)
qid = event.user_id
wxid_list = []
wxid_list.append(event.from_wxid)
await matcher.send(
MessageSegment.room_at_msg(content='{$@}开始操作……', at_list=wxid_list)
)
qid = event.from_wxid
im = await mihoyo_coin(qid)
await matcher.finish(im, at_sender=True)
await matcher.finish(
MessageSegment.room_at_msg(content="{$@}" + f'{im}', at_list=wxid_list)
)
@all_bbscoin_recheck.handle()
@ -60,12 +65,13 @@ async def send_mihoyo_coin(event: MessageEvent, matcher: Matcher):
'- <ft color=(238,120,0)>全部重获取</ft>'
),
)
async def bbs_recheck(
matcher: Matcher,
):
async def bbs_recheck(bot: Bot, event: MessageEvent, matcher: Matcher):
if await SUPERUSER(bot, event):
await matcher.send('已开始执行!可能需要较久时间!')
await send_daily_mihoyo_bbs_sign()
await matcher.finish('执行完成!')
else:
return
# 每日一点十六分进行米游币获取
@ -80,12 +86,12 @@ async def send_daily_mihoyo_bbs_sign():
im, im_private = await all_daily_mihoyo_bbs_coin()
if im_private:
for user_id in im_private:
await bot.send_private_msg(
user_id=user_id, message=im_private[user_id]
await bot.call_api(
'send_text', to_wxid=user_id, content=im_private[user_id]
)
await asyncio.sleep(5 + random.randint(1, 3))
if await config_check('PrivateReport'):
for qid in get_superusers():
await bot.call_api(api='send_private_msg', user_id=qid, message=im)
for qid in SUPERUSERS:
await bot.call_api(api='send_text', to_wxid=qid, content=im)
await asyncio.sleep(5 + random.randint(1, 3))
logger.info('米游币获取已结束。')

View File

@ -1,23 +1,22 @@
import asyncio
from typing import Any, Tuple
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.params import RegexGroup
from nonebot import on_regex, on_command
from nonebot.adapters.onebot.v11 import (
from nonebot.adapters.ntchat import (
Bot,
MessageEvent,
MessageSegment,
GroupMessageEvent,
TextMessageEvent,
)
from ..config import priority
from .get_lots_data import get_lots_msg
from .get_meme_card import get_meme_img
from .get_mys_data import get_task_detail
from ..genshinuid_meta import register_menu
from ..utils.nonebot2.rule import FullCommand
from .get_mys_data import get_region_task, get_task_detail
from ..utils.exception.handle_exception import handle_exception
get_task_adv = on_regex(
@ -50,10 +49,11 @@ get_lots = on_command('御神签', priority=priority, rule=FullCommand())
)
async def send_task_adv(
bot: Bot,
event: GroupMessageEvent,
event: TextMessageEvent,
matcher: Matcher,
args: Tuple[Any, ...] = RegexGroup(),
):
'''
if str(args[2]) in ['须弥', '层岩', '海岛']:
im = await get_region_task(str(args[2]))
for i in im:
@ -63,6 +63,7 @@ async def send_task_adv(
await asyncio.sleep(1)
await matcher.finish()
else:
'''
im = await get_task_detail(str(args[2]))
await matcher.finish(im)
@ -98,7 +99,7 @@ async def send_meme_card(matcher: Matcher):
),
)
async def send_lots_data(matcher: Matcher, event: MessageEvent):
qid = event.user_id
qid = event.from_wxid
logger.info('开始执行[御神签]')
im = await get_lots_msg(qid)
await matcher.finish(im)

View File

@ -1,7 +1,7 @@
from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.adapters.onebot.v11 import MessageEvent, MessageSegment
from nonebot.adapters.ntchat import MessageEvent, MessageSegment
from .note_text import award
from ..config import priority
@ -33,15 +33,23 @@ async def send_monthly_data(
event: MessageEvent,
matcher: Matcher,
):
qid = event.user_id
qid = event.from_wxid
wxid_list = []
wxid_list.append(event.from_wxid)
uid = await select_db(qid, mode='uid')
if isinstance(uid, str):
if '未找到绑定的UID' in uid:
await matcher.finish(UID_HINT)
await matcher.finish(
MessageSegment.room_at_msg(
content='{$@}' + UID_HINT, at_list=wxid_list
)
)
else:
await matcher.finish('发生未知错误...')
im = await award(uid)
await matcher.finish(im, at_sender=True)
await matcher.finish(
MessageSegment.room_at_msg(content="{$@}" + f'{im}', at_list=wxid_list)
)
# 群聊内 每月统计 功能
@ -65,11 +73,17 @@ async def send_monthly_pic(
event: MessageEvent,
matcher: Matcher,
):
qid = event.user_id
qid = event.from_wxid
wxid_list = []
wxid_list.append(event.from_wxid)
uid = await select_db(qid, mode='uid')
if isinstance(uid, str):
if '未找到绑定的UID' in uid:
await matcher.finish(UID_HINT)
await matcher.finish(
MessageSegment.room_at_msg(
content='{$@}' + UID_HINT, at_list=wxid_list
)
)
else:
await matcher.finish('发生未知错误...')
logger.info(f'[原石札记] 开始绘制,UID: {uid}')

View File

@ -1,16 +1,10 @@
import asyncio
from typing import Union
from nonebot.log import logger
from nonebot.params import Depends
from nonebot.matcher import Matcher
from nonebot import get_bot, on_command
from nonebot_plugin_apscheduler import scheduler
from nonebot.adapters.onebot.v11 import (
MessageSegment,
GroupMessageEvent,
PrivateMessageEvent,
)
from nonebot.adapters.ntchat import MessageSegment, TextMessageEvent
from .notice import get_notice_list
from .resin_text import get_resin_text
@ -19,7 +13,6 @@ from ..genshinuid_meta import register_menu
from ..utils.nonebot2.rule import FullCommand
from ..utils.message.error_reply import UID_HINT
from ..utils.db_operation.db_operation import select_db
from ..utils.message.get_image_and_at import ImageAndAt
from ..utils.exception.handle_exception import handle_exception
notice_scheduler = scheduler
@ -47,16 +40,17 @@ get_daily_info = on_command('当前状态', rule=FullCommand())
),
)
async def send_daily_info(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
custom: ImageAndAt = Depends(),
):
logger.info('开始执行[每日信息文字版]')
at = custom.get_first_at()
qid = event.user_id
if at:
qid = at
qid = event.from_wxid
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "":
qid = user
logger.info('[每日信息文字版]QQ号: {}'.format(qid))
uid: str = await select_db(qid, mode='uid') # type: ignore
@ -119,19 +113,19 @@ async def notice_job():
),
)
async def send_uid_info(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
custom: ImageAndAt = Depends(),
):
logger.info('开始执行[每日信息]')
at = custom.get_first_at()
qid = event.user_id
if at:
qid = at
qid = event.from_wxid
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "":
qid = user
logger.info('[每日信息]QQ号: {}'.format(qid))
im = await get_resin_img(qid)
im = await get_resin_img(qid) # type:ignore
if isinstance(im, str):
await matcher.finish(im)
elif isinstance(im, bytes):

View File

@ -1,16 +1,11 @@
import asyncio
import threading
from typing import Union
from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.permission import SUPERUSER
from nonebot.adapters.onebot.v11 import (
Bot,
GroupMessageEvent,
PrivateMessageEvent,
)
from nonebot.adapters.ntchat import Bot, TextMessageEvent
from ..genshinuid_meta import register_menu
from ..utils.nonebot2.rule import FullCommand
@ -39,7 +34,7 @@ download_resource = on_command('下载全部资源', rule=FullCommand())
)
async def send_download_resource_msg(
bot: Bot,
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
):
if not await SUPERUSER(bot, event):

View File

@ -1,16 +1,11 @@
import re
from typing import Union
from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.params import Depends, CommandArg
from nonebot.adapters.onebot.v11 import (
Message,
MessageSegment,
GroupMessageEvent,
PrivateMessageEvent,
)
from nonebot.params import CommandArg
from nonebot.adapters.ntchat.message import Message
from nonebot.adapters.ntchat import MessageSegment, TextMessageEvent
from .get_regtime import calc_reg_time
from .draw_roleinfo_card import draw_pic
@ -18,7 +13,6 @@ from ..genshinuid_meta import register_menu
from ..utils.nonebot2.rule import FullCommand
from ..utils.message.error_reply import UID_HINT
from ..utils.db_operation.db_operation import select_db
from ..utils.message.get_image_and_at import ImageAndAt
from ..utils.exception.handle_exception import handle_exception
get_role_info = on_command('uid', aliases={'查询'})
@ -53,22 +47,31 @@ get_reg_time = on_command(
),
)
async def send_role_info(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
args: Message = CommandArg(),
custom: ImageAndAt = Depends(),
):
raw_mes = args.extract_plain_text().strip().replace(' ', '')
name = ''.join(re.findall('[\u4e00-\u9fa5]', raw_mes))
# 若@在文本中 先无视@后面内容 如果@前面有内容则无视并停止执行下方命令 避免与enka查询打架
if "@" in raw_mes:
name = ''.join(re.findall('^[\u4e00-\u9fa5]+', raw_mes.split("@")[0]))
if name:
return
qid = event.user_id
at = custom.get_first_at()
if at:
qid = at
else:
name = ''.join(re.findall('^[\u4e00-\u9fa5]+', raw_mes))
if name:
return
qid = event.from_wxid
# 识别@的人 排除空
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "":
qid = user
# 获取uid
uid = re.findall(r'\d+', raw_mes)
uid = re.findall(r'\d+', raw_mes.split("@")[0])
if uid:
uid = uid[0]
else:
@ -94,14 +97,16 @@ async def send_role_info(
@get_reg_time.handle()
async def regtime(
event: Union[GroupMessageEvent, PrivateMessageEvent],
event: TextMessageEvent,
matcher: Matcher,
custom: ImageAndAt = Depends(),
):
qid = event.user_id
at = custom.get_first_at()
if at:
qid = at
qid = event.from_wxid
# 识别@的人 排除空
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "":
qid = user
uid = await select_db(qid, mode='uid')
uid = str(uid)

View File

@ -5,7 +5,8 @@ from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot import get_bot, on_command
from nonebot.permission import SUPERUSER
from nonebot.adapters.onebot.v11 import MessageEvent
from nonebot_plugin_apscheduler import scheduler
from nonebot.adapters.ntchat import Bot, MessageEvent, MessageSegment
from ..config import priority
@ -14,8 +15,6 @@ try:
except ImportError:
from .sign import sign_in, daily_sign
from nonebot_plugin_apscheduler import scheduler
from ..genshinuid_meta import register_menu
from ..utils.nonebot2.rule import FullCommand
from ..utils.exception.handle_exception import handle_exception
@ -24,9 +23,7 @@ from ..utils.db_operation.db_operation import select_db, config_check
sign_scheduler = scheduler
get_sign = on_command('签到', priority=priority, rule=FullCommand())
all_recheck = on_command(
'全部重签', permission=SUPERUSER, priority=priority, rule=FullCommand()
)
all_recheck = on_command('全部重签', priority=priority, rule=FullCommand())
# 每日零点半执行米游社原神签到
@ -56,12 +53,16 @@ async def get_sign_func(
matcher: Matcher,
):
logger.info('开始执行[签到]')
qid = event.user_id
qid = event.from_wxid
wxid_list = []
wxid_list.append(event.from_wxid)
logger.info('[签到]QQ号: {}'.format(qid))
uid = await select_db(qid, mode='uid')
logger.info('[签到]UID: {}'.format(uid))
im = await sign_in(uid)
await matcher.finish(im, at_sender=True)
await matcher.finish(
MessageSegment.room_at_msg(content="{$@}" + f'{im}', at_list=wxid_list)
)
@all_recheck.handle()
@ -78,7 +79,9 @@ async def get_sign_func(
'- <ft color=(238,120,0)>全部重签</ft>'
),
)
async def recheck(matcher: Matcher):
async def recheck(bot: Bot, event: MessageEvent, matcher: Matcher):
if not await SUPERUSER(bot, event):
return
logger.info('开始执行[全部重签]')
await matcher.send('已开始执行')
await send_daily_sign()
@ -98,9 +101,9 @@ async def send_daily_sign():
for qid in private_msg_list:
try:
await bot.call_api(
api='send_private_msg',
user_id=qid,
message=private_msg_list[qid],
api='send_text',
to_wxid=qid,
content=private_msg_list[qid],
)
except Exception:
logger.warning(f'[每日全部签到] QQ {qid} 私聊推送失败!')
@ -122,13 +125,16 @@ async def send_daily_sign():
report,
)
else:
msg_title = group_msg_list[gid]['push_message']
msg_title = group_msg_list[gid]['push_message'].rstrip()
# 发送群消息
at_wxid = []
at_wxid.append(group_msg_list[gid]['wxid'])
try:
await bot.call_api(
api='send_group_msg',
group_id=gid,
message=msg_title,
api='send_room_at_msg',
to_wxid=gid,
at_list=at_wxid,
content=msg_title,
)
except Exception:
logger.warning(f'[每日全部签到]群 {gid} 推送失败!')

View File

@ -139,16 +139,18 @@ async def single_daily_sign(uid: str, gid: str, qid: str):
# 如果失败, 则添加到推送列表
if im.startswith('签到失败') or im.startswith('网络有点忙'):
# 不用MessageSegment.at(row[2]),因为不方便移植
message = f'[CQ:at,qq={qid}] {im}'
message = f'UID:{uid} | {im}'
group_msg_list[gid]['failed'] += 1
group_msg_list[gid]['push_message'] += '\n' + message
group_msg_list[gid]['push_message'] += message + '\n'
else:
group_msg_list[gid]['success'] += 1
# 没有开启简洁签到, 则每条消息都要携带@信息
else:
# 不用MessageSegment.at(row[2]),因为不方便移植
message = f'[CQ:at,qq={qid}] {im}'
group_msg_list[gid]['push_message'] += '\n' + message
# message = '{$@}' + f'UID:{uid} | {im}'
message = f'UID:{uid} | {im}'
group_msg_list[gid]['wxid'] = qid
group_msg_list[gid]['push_message'] += message + '\n'
group_msg_list[gid]['success'] -= 1

View File

@ -5,7 +5,7 @@ from nonebot.matcher import Matcher
from nonebot.params import RegexGroup
from nonebot.permission import SUPERUSER
from nonebot import get_bot, on_regex, get_driver, on_command
from nonebot.adapters.onebot.v11 import Bot, MessageEvent, MessageSegment
from nonebot.adapters.ntchat import Bot, MessageEvent, MessageSegment
from ..genshinuid_meta import register_menu
from ..utils.nonebot2.rule import FullCommand
@ -32,15 +32,15 @@ async def _():
return
if update_log['send_type'] == 'group':
await bot.call_api(
api='send_group_msg',
group_id=update_log['send_to'],
message=update_log['msg'],
api='send_room_at_msg',
to_wxid=update_log['send_to'],
content=update_log['msg'],
)
else:
await bot.call_api(
api='send_private_msg',
user_id=update_log['send_to'],
message=update_log['msg'],
api='send_text',
to_wxid=update_log['send_to'],
content=update_log['msg'],
)
logger.info('遗留信息检查完毕!')
@ -89,7 +89,7 @@ async def send_restart_msg(
if not await SUPERUSER(bot, event):
return
logger.warning('开始执行[重启]')
qid = event.user_id
qid = event.from_wxid
if len(event.get_session_id().split('_')) == 3:
send_id = event.get_session_id().split('_')[1]
send_type = 'group'

View File

@ -1,3 +1,4 @@
import asyncio
from typing import Any, Tuple
from nonebot.log import logger
@ -5,33 +6,39 @@ from nonebot.matcher import Matcher
from nonebot import on_regex, on_command
from nonebot.permission import SUPERUSER
from nonebot.params import CommandArg, RegexGroup
from nonebot.adapters.onebot.v11 import (
PRIVATE_FRIEND,
from nonebot.adapters.ntchat.message import Message
from nonebot.adapters.ntchat.permission import PRIVATE
from nonebot.adapters.ntchat import (
Bot,
Message,
MessageEvent,
MessageSegment,
GroupMessageEvent,
TextMessageEvent,
)
from .topup import topup_
from ..config import priority
from .topup import GOODS, topup_
from .qrlogin import qrcode_login
from .get_ck_help_msg import get_ck_help
from .draw_user_card import get_user_card
from ..genshinuid_meta import register_menu
from ..utils.nonebot2.rule import FullCommand
from .get_ck_help_msg import get_ck_help, get_qr_help
from ..utils.exception.handle_exception import handle_exception
from .add_ck import deal_ck, get_ck_by_stoken, get_ck_by_all_stoken
from ..utils.db_operation.db_operation import bind_db, delete_db, switch_db
add_cookie = on_command('添加', permission=PRIVATE_FRIEND)
add_cookie = on_command('添加', permission=PRIVATE)
get_ck_msg = on_command(
'绑定ck说明',
aliases={'ck帮助', '绑定ck'},
block=True,
rule=FullCommand(),
)
get_qr_msg = on_command(
'扫码登录说明',
aliases={'扫码帮助', '登录帮助', '登陆帮助'},
block=True,
rule=FullCommand(),
)
bind_info = on_command(
'绑定信息', priority=priority, block=True, rule=FullCommand()
)
@ -58,19 +65,40 @@ get_qrcode_login = on_command(
aliases={'扫码登陆', '扫码登入'},
rule=FullCommand(),
)
get_topup = on_command('gsrc', priority=priority, block=True, aliases={'原神充值'})
get_topup = on_command(
'gsrc', priority=priority, block=True, aliases={'原神充值', 'pay'}
)
@get_topup.handle()
async def send_topup(bot: Bot, event: GroupMessageEvent):
qid = event.user_id
goods_id = event.raw_message.replace('原神充值', '').replace('gsrc', '')
if goods_id == "":
goods_id = 0
else:
goods_id = int(goods_id)
group_id = event.group_id
await topup_(bot, qid, group_id, goods_id)
async def send_topup(
matcher: Matcher, event: TextMessageEvent, args: Message = CommandArg()
):
# 获取被@的Wxid排除""
qid = event.from_wxid
if event.at_user_list:
for user in event.at_user_list:
user = user.strip()
if user != "":
qid = user
goods_id, method = 0, "alipay"
for s in str(args).split():
# 支持指定支付方式
if "微信" in s or "wx" in s:
method = "weixin"
continue
if "支付宝" in s or "zfb" in s:
method = "alipay"
# 输入物品别名识别
for gId, gData in GOODS.items():
if (s == gId) or (s in gData["aliases"]):
goods_id = gId
break
group_id = event.room_wxid
await matcher.finish(
await topup_(matcher, qid, group_id, goods_id, method)
)
@refresh_all_ck.handle()
@ -90,7 +118,7 @@ async def send_refresh_ck_msg(
matcher: Matcher,
):
logger.info('开始执行[刷新CK]')
qid = event.user_id
qid = event.from_wxid
im = await get_ck_by_stoken(qid)
if isinstance(im, str):
await matcher.finish(im)
@ -100,13 +128,12 @@ async def send_refresh_ck_msg(
@get_qrcode_login.handle()
async def send_qrcode_login(
bot: Bot,
event: GroupMessageEvent,
event: MessageEvent,
matcher: Matcher,
):
logger.info('开始执行[扫码登陆]')
qid = event.user_id
groupid = event.group_id
im = await qrcode_login(bot, groupid, qid)
qid = event.from_wxid
im = await qrcode_login(matcher, qid)
if not im:
return
im = await deal_ck(im, qid)
@ -131,7 +158,7 @@ async def send_bind_card(
matcher: Matcher,
):
logger.info('开始执行[查询用户绑定状态]')
qid = event.user_id
qid = event.from_wxid
im = await get_user_card(qid)
logger.info('[查询用户绑定状态]完成!等待图片发送中...')
await matcher.finish(MessageSegment.image(im))
@ -157,7 +184,7 @@ async def send_add_ck_msg(
event: MessageEvent, matcher: Matcher, args: Message = CommandArg()
):
mes = args.extract_plain_text().strip().replace(' ', '')
qid = event.user_id
qid = event.from_wxid
im = await deal_ck(mes, qid)
if isinstance(im, str):
await matcher.finish(im)
@ -218,7 +245,9 @@ async def send_link_uid_msg(
):
logger.info('开始执行[绑定/解绑用户信息]')
logger.info('[绑定/解绑]参数: {}'.format(args))
qid = event.user_id
qid = event.from_wxid
wxid_list = []
wxid_list.append(event.from_wxid)
logger.info('[绑定/解绑]UserID: {}'.format(qid))
if args[0] in ('绑定'):
@ -236,20 +265,23 @@ async def send_link_uid_msg(
im = await delete_db(qid, {'UID': args[2]})
else:
im = await delete_db(qid, {'MYSID': args[2]})
await matcher.finish(im, at_sender=True)
await matcher.finish(
MessageSegment.room_at_msg(content="{$@}" + f'{im}', at_list=wxid_list)
)
@get_ck_msg.handle()
async def send_ck_help(bot: Bot, event: GroupMessageEvent):
async def send_ck_help(matcher: Matcher):
msg_list = await get_ck_help()
forward_msg = []
for msg in msg_list:
forward_msg.append(
{
"type": "node",
"data": {"name": "小冰", "uin": "2854196306", "content": msg},
}
)
await bot.call_api(
'send_group_forward_msg', group_id=event.group_id, messages=forward_msg
)
await matcher.send(msg)
await asyncio.sleep(0.5)
@get_qr_msg.handle()
async def send_qr_help(matcher: Matcher):
msg_list = await get_qr_help()
for msg in msg_list:
await matcher.send(msg)
await asyncio.sleep(0.5)
await asyncio.sleep(0.5)

View File

@ -55,7 +55,7 @@ async def get_ck_by_all_stoken():
return im
async def get_ck_by_stoken(qid: int):
async def get_ck_by_stoken(qid: str):
uid_list: List = await select_db(qid, mode='list') # type: ignore
uid_dict = {uid: qid for uid in uid_list}
im = await refresh_ck_by_uid_list(uid_dict)

View File

@ -0,0 +1,241 @@
from io import BytesIO
from time import strftime, localtime
from httpx import AsyncClient
from PIL import Image, ImageDraw, ImageFont
from ..utils.genshin_fonts.genshin_fonts import FONT_ORIGIN_PATH
def font(size: int) -> ImageFont.FreeTypeFont:
"""Pillow 绘制字体设置"""
return ImageFont.truetype(str(FONT_ORIGIN_PATH), size=size)
# 支付宝充值图片绘制
async def draw_ali(
uid,
item_info: str,
item_price: str,
item_order_no: str,
qrcode,
item_icon: str,
item_create_time: int,
item_id: str,
) -> bytes:
"""充值图片绘制"""
async with AsyncClient() as client:
_img = await client.get(item_icon, timeout=10.0)
itemImg = Image.open(BytesIO(_img.content)).convert("RGBA")
themeColor = "#1678ff"
warning = 20 if item_id == 'ys_chn_blessofmoon_tier5' else 0
res = Image.new("RGBA", (450, 530), themeColor)
drawer = ImageDraw.Draw(res)
resample = getattr(Image, "Resampling", Image).LANCZOS
# 头部矩形背景
drawer.rectangle(
(75, 50 - warning, 375 - 1, 150 - warning), fill="#E5F9FF", width=0
)
# 商品图片
item = itemImg.resize((90, 90), resample=resample)
res.paste(item, (80, 55 - warning), item)
# 二维码图片
qrcode = Image.open(qrcode)
qrcode = qrcode.resize((300, 300), resample=resample)
res.paste(qrcode, (75, 150 + warning), qrcode)
# 商品名称
drawer.text(
(
int(175 + (195 - font(25).getlength(item_info)) / 2),
int(70 - warning + (30 - font(25).getbbox(item_info)[-1]) / 2),
),
item_info,
fill="#000000",
font=font(25),
)
# 价格
drawer.text(
(
int(175 + (195 - font(25).getlength(item_price)) / 2),
int(105 - warning + (30 - font(25).getbbox(item_price)[-1]) / 2),
),
item_price,
fill="#000000",
font=font(25),
)
# 商品充值 UID
drawer.text(
(
int((460 - font(15).getlength(f"充值到 UID{uid}")) / 2),
int(
155
+ warning
+ (20 - font(15).getbbox(f"充值到 UID{uid}")[-1]) / 2
),
),
f"充值到 UID{uid}",
fill="#333333",
font=font(15),
)
# 月卡相关商品警告
if warning:
# 首部矩形背景
drawer.rectangle((75, 130, 375 - 1, 170), fill="#eeeeee", width=0)
# 转换警告文字
warning_text = "特殊情况将直接返还 330 创世结晶"
drawer.text(
(
int((450 - font(15).getlength(warning_text)) / 2),
int(130 + (40 - font(15).getbbox(warning_text)[-1]) / 2),
),
warning_text,
fill="#ff5652",
font=font(15),
)
# 图片生成时间
timestamp = strftime("%Y-%m-%d %H:%M:%S", localtime(int(item_create_time)))
drawer.text(
(int((460 - font(15).getlength(timestamp)) / 2), 425 + warning),
timestamp,
fill="#1678ff",
font=font(15),
)
# 账单信息
ticket = f"支付宝账单编号 {item_order_no}"
drawer.text(
(int((450 - font(15).getlength(ticket)) / 2), 460 + warning),
ticket,
fill="#ffffff",
font=font(15),
)
# 免责声明
drawer.text(
(
int(
(
410
- font(15).getlength(
"免责声明:该充值接口由米游社提供,不对充值结果负责。\n请在充值前仔细阅读米哈游的充值条款。"
)
/ 2
)
),
490 + warning,
),
"免责声明:该充值接口由米游社提供,不对充值结果负责。\n 请在充值前仔细阅读米哈游的充值条款。",
fill="#FFA500",
font=font(12),
)
buf = BytesIO()
res.convert("RGB").save(buf, format="PNG")
return buf.getvalue()
# 微信充值图片绘制
async def draw_wx(
uid,
item_info: str,
item_price: str,
item_order_no: str,
item_icon: str,
item_create_time: int,
item_id: str,
) -> bytes:
"""充值图片绘制"""
async with AsyncClient() as client:
_img = await client.get(item_icon, timeout=10.0)
itemImg = Image.open(BytesIO(_img.content)).convert("RGBA")
themeColor = "#29ac66"
warning = 20 if item_id == 'ys_chn_blessofmoon_tier5' else 0
res = Image.new("RGBA", (450, 200), themeColor)
drawer = ImageDraw.Draw(res)
resample = getattr(Image, "Resampling", Image).LANCZOS
left = (450 - 370) / 2 # (图片宽度 - 矩形宽度) / 2
top = (200 - 130) / 2 # (图片高度 - 矩形高度) / 2
# 头部矩形背景
drawer.rectangle(
(
left,
top - warning,
left + 370,
top + 130 - warning,
), # 使用新的左上角和右下角的坐标
fill="#E5F9FF", # 保留原有的填充色
width=0, # 保留原有的边框宽度
)
# 商品图片
item = itemImg.resize((110, 110), resample=resample)
res.paste(item, (55, 50 - warning), item)
# 商品名称
drawer.text(
(
int(175 + (215 - font(25).getlength(item_info)) / 2),
int(50 - warning + (30 - font(25).getbbox(item_info)[-1]) / 2),
),
item_info,
fill="#000000",
font=font(25),
)
# 价格
drawer.text(
(
int(180 + (195 - font(25).getlength(item_price)) / 2),
int(80 - warning + (30 - font(25).getbbox(item_price)[-1]) / 2),
),
item_price,
fill="#000000",
font=font(25),
)
# 商品充值 UID
drawer.text(
(
int(185 + (195 - font(15).getlength(f"充值到 UID{uid}")) / 2),
int(
120
- warning
+ (20 - font(15).getbbox(f"充值到 UID{uid}")[-1]) / 2
),
),
f"充值到 UID{uid}",
fill="#000000",
font=font(15),
)
# 图片生成时间
timestamp = strftime("%Y-%m-%d %H:%M:%S", localtime(int(item_create_time)))
drawer.text(
(int(185 + (195 - font(15).getlength(timestamp)) / 2), 140 - warning),
timestamp,
fill="#29ac66",
font=font(15),
)
if warning:
# 首部矩形背景
drawer.rectangle(
(left, top + 110, left + 370, top + 130), fill="#eeeeee", width=0
)
# 转换警告文字
warning_text = "特殊情况将直接返还 330 创世结晶"
drawer.text(
(
int((450 - font(15).getlength(warning_text)) / 2),
int(135 + (40 - font(15).getbbox(warning_text)[-1]) / 2),
),
warning_text,
fill="#ff5652",
font=font(15),
)
# 账单信息
ticket = f"微信支付账单编号 {item_order_no}"
drawer.text(
(int((450 - font(15).getlength(ticket)) / 2), 170),
ticket,
fill="#ffffff",
font=font(15),
)
buf = BytesIO()
res.convert("RGB").save(buf, format="PNG")
return buf.getvalue()

View File

@ -29,7 +29,7 @@ gs_font_15 = genshin_font_origin(15)
gs_font_26 = genshin_font_origin(26)
async def get_user_card(qid: int) -> bytes:
async def get_user_card(qid: str) -> bytes:
uid_list: List = await select_db(qid, 'list') # type: ignore
w, h = 500, len(uid_list) * 210 + 330
img = await get_simple_bg(w, h)

View File

@ -26,6 +26,10 @@ http://user.mihoyo.com/(国服)
然后在和机器人的私聊窗口,粘贴发送即可
'''
QRL = '''请在群里发送【扫码登录】并用米游社/原神进行扫码绑定
如果使用该功能请先绑定UID后再进行登录
注意不要乱扫他人二维码'''
async def get_ck_help() -> List:
msg_list = []
@ -34,3 +38,9 @@ async def get_ck_help() -> List:
msg_list.append(CK_URL)
msg_list.append(SK_URL)
return msg_list
async def get_qr_help() -> List:
msg_list = []
msg_list.append(QRL)
return msg_list

View File

@ -3,13 +3,15 @@ import json
import base64
import asyncio
from http.cookies import SimpleCookie
from typing import Any, Tuple, Union, Literal
from typing import Any, List, Tuple, Union, Literal, NoReturn
import qrcode
from nonebot.log import logger
from nonebot.matcher import Matcher
from qrcode.constants import ERROR_CORRECT_L
from nonebot.adapters.ntchat import MessageSegment
from ..utils.message.send_msg import send_forward_msg
from ..utils.message.error_reply import UID_HINT
from ..utils.db_operation.db_operation import select_db
from ..utils.mhy_api.get_mhy_data import (
check_qrcode,
@ -20,12 +22,13 @@ from ..utils.mhy_api.get_mhy_data import (
get_cookie_token_by_stoken,
)
disnote = '''免责声明:您将通过扫码完成获取米游社sk以及ck。
本Bot将不会保存您的登录状态
我方仅提供米游社查询及相关游戏内容服务
disnote = '''免责声明您将通过扫码完成获取米游社sk以及ck。
登录米游社相当于将账号授权于机器人,可能会带来未知的账号风险
若您的账号封禁、被盗等处罚与我方无关。
害怕风险请勿扫码!
'''
登录后即代表您同意机器人使用协议并知晓会带来未知的账号风险!
若想取消授权,请到米游社退出登录以清除机器人绑定的登录状态。
请用米游社/原神扫描下方二维码登录:'''
def get_qrcode_base64(url):
@ -63,41 +66,36 @@ async def refresh(
continue
if status_data['data']['stat'] == 'Confirmed':
logger.info('二维码已确认')
# print(status_data['data']['payload']['raw'])
break
return True, json.loads(status_data['data']['payload']['raw'])
async def qrcode_login(bot, group_id, user_id) -> str:
async def send_group_msg(msg: str):
await bot.call_api(
api='send_group_msg',
group_id=group_id,
message=msg,
async def qrcode_login(matcher: Matcher, user_id) -> str:
async def send_group_msg(msg: str, at_list: List) -> NoReturn:
await matcher.finish(
MessageSegment.room_at_msg(content=msg, at_list=at_list)
)
return ''
wxid_list = []
wxid_list.append(user_id)
code_data = await create_qrcode_url()
try:
im = []
im.append('请使用米游社扫描下方二维码登录:')
im.append(
f'[CQ:image,file=base64://{get_qrcode_base64(code_data["url"])}]'
await matcher.send(
MessageSegment.image(
f'base64://{get_qrcode_base64(code_data["url"])}'
)
)
await matcher.send(
MessageSegment.room_at_msg(
content='{$@}' + disnote, at_list=wxid_list
)
im.append(
'免责声明:您将通过扫码完成获取米游社sk以及ck。\n'
'本Bot将不会保存您的登录状态。\n'
'我方仅提供米游社查询及相关游戏内容服务,\n'
'若您的账号封禁、被盗等处罚与我方无关。\n'
'害怕风险请勿扫码~'
)
await send_forward_msg(bot, group_id, "扫码小助手", str(user_id), im)
except Exception:
logger.warning(f'[扫码登录] {user_id} 图片发送失败')
logger.warning('[扫码登录] {user_id} 图片发送失败')
status, game_token_data = await refresh(code_data)
if status:
assert game_token_data is not None # 骗过 pyright
logger.info('game_token获取成功')
logger.info('[扫码登录]game_token获取成功')
cookie_token = await get_cookie_token(**game_token_data)
stoken_data = await get_stoken_by_game_token(
account_id=int(game_token_data['uid']),
@ -111,7 +109,6 @@ async def qrcode_login(bot, group_id, user_id) -> str:
ck = ck['data']['cookie_token']
cookie_check = f'account_id={account_id};cookie_token={ck}'
get_uid = await get_mihoyo_bbs_info(account_id, cookie_check)
# 剔除除了原神之外的其他游戏
im = None
if get_uid:
for i in get_uid['data']['list']:
@ -120,18 +117,15 @@ async def qrcode_login(bot, group_id, user_id) -> str:
break
else:
im = f'你的米游社账号{account_id}尚未绑定原神账号,请前往米游社操作!'
return await send_group_msg(im)
await send_group_msg(im, wxid_list)
else:
im = '请求失败, 请稍后再试...'
return await send_group_msg(im)
await send_group_msg(im, wxid_list)
uid_bind = await select_db(user_id, mode='uid')
# 没有在gsuid绑定uid的情况
if uid_bind == "未找到绑定的UID~":
logger.warning('game_token获取失败')
im = '你还没有绑定uid请输入[绑定uid123456]绑定你的uid再发送[扫码登录]进行绑定'
return await send_group_msg(im)
# 比对gsuid数据库和扫码登陆获取到的uid
await matcher.finish(UID_HINT)
if str(uid_bind) == uid_check or str(uid_bind) == account_id:
return SimpleCookie(
{
@ -142,9 +136,12 @@ async def qrcode_login(bot, group_id, user_id) -> str:
}
).output(header='', sep=';')
else:
logger.warning('game_token获取失败')
im = 'game_token获取失败被非绑定指定uid用户扫取取消绑定请重新发送[扫码登录]登录账号'
logger.warning('game_token获取失败:非触发者本人扫码')
im = (
'{$@}' + f'检测到扫码登录UID{uid_check}与绑定UID{uid_bind}不同,'
'gametoken获取失败请重新发送[扫码登录]进行登录'
)
await send_group_msg(im, wxid_list)
else:
logger.warning('game_token获取失败')
im = 'game_token获取失败二维码已过期'
return await send_group_msg(im)
await send_group_msg('{$@}game_token获取失败二维码已过期', wxid_list)

View File

@ -2,19 +2,73 @@ import io
import base64
import asyncio
import traceback
from typing import List, NoReturn
import qrcode
from nonebot.log import logger
from nonebot.matcher import Matcher
from qrcode.constants import ERROR_CORRECT_L
from nonebot.adapters.ntchat import MessageSegment
from ..utils.message.send_msg import send_forward_msg
from .draw_topup_img import draw_wx, draw_ali
from ..utils.message.error_reply import UID_HINT
from ..utils.db_operation.db_operation import select_db
from ..utils.mhy_api.get_mhy_data import topup, checkorder, fetchgoods
disnote = '''免责声明:
该充值接口由米游社提供,不对充值结果负责。
请在充值前仔细阅读米哈游的充值条款。
'''
disnote = '''免责声明:该充值接口由米游社提供,不对充值结果负责。
请在充值前仔细阅读米哈游的充值条款。'''
GOODS = {
0: {
"title": "创世结晶×60",
"aliases": ["创世结晶x60", "结晶×60", "结晶x60", "创世结晶60", "结晶60"],
},
1: {
"title": "创世结晶×300",
"aliases": ["创世结晶x300", "结晶×300", "结晶x300", "创世结晶300", "结晶300", "30"],
},
2: {
"title": "创世结晶×980",
"aliases": ["创世结晶x980", "结晶×980", "结晶x980", "创世结晶980", "结晶980", "98"],
},
3: {
"title": "创世结晶×1980",
"aliases": [
"创世结晶x1980",
"结晶×1980",
"结晶x1980",
"创世结晶1980",
"结晶1980",
"198",
],
},
4: {
"title": "创世结晶×3280",
"aliases": [
"创世结晶x3280",
"结晶×3280",
"结晶x3280",
"创世结晶3280",
"结晶3280",
"328",
],
},
5: {
"title": "创世结晶×6480",
"aliases": [
"创世结晶x6480",
"结晶×6480",
"结晶x6480",
"创世结晶6480",
"结晶6480",
"648",
],
},
6: {
"title": "空月祝福",
"aliases": ["空月", "祝福", "月卡", "小月卡"],
},
}
def get_qrcode_base64(url):
@ -33,7 +87,7 @@ def get_qrcode_base64(url):
return base64.b64encode(img_byte).decode()
async def refresh(order, uid):
async def refresh(order, uid, oid):
times = 0
while True:
await asyncio.sleep(5)
@ -41,53 +95,91 @@ async def refresh(order, uid):
if order_status != 900:
pass
else:
return "支付成功"
return "{$@}" + f"支付成功!\nUID:{uid}\n订单号:{oid}"
times += 1
if times > 60:
return "支付超时"
return "{$@}" + f"支付超时!\nUID:{uid}\n订单号:{oid}"
async def topup_(bot, qid, group_id, goods_id):
async def send_group_msg(msg: str):
await bot.call_api(
api='send_group_msg',
group_id=group_id,
message=msg,
async def topup_(matcher: Matcher, qid, group_id, goods_id, method):
async def send_group_msg(msg: str, at_list: List) -> NoReturn:
await matcher.finish(
MessageSegment.room_at_msg(content=msg, at_list=at_list)
)
return ''
wxid_list = []
wxid_list.append(qid)
uid = await select_db(qid, mode="uid")
if uid is None:
await send_group_msg("未绑定米游社账号")
return
await send_group_msg("{$@}" + UID_HINT, wxid_list)
fetchgoods_data = await fetchgoods()
try:
goods_data = fetchgoods_data[goods_id]
except Exception:
await send_group_msg("商品不存在,最大为" + str(len(fetchgoods_data) - 1))
return
try:
order = await topup(uid, goods_data)
except Exception:
await send_group_msg("出错了,可能是cookie过期或接口出错")
logger.warning(f"[充值] {group_id} {qid}")
return
try:
im = []
b64_data = get_qrcode_base64(order["encode_order"])
qrc = f'[CQ:image,file=base64://{b64_data}]'
im.append(f"充值uid{uid}")
im.append(
f"商品名称:{goods_data['goods_name']}×{str(goods_data['goods_unit'])}"
if int(goods_data['goods_unit']) > 0
else goods_data["goods_name"],
except Exception as e:
logger.warning(f'[充值]错误 {e}')
await send_group_msg(
"{$@}商品不存在,最大为" + str(len(fetchgoods_data) - 1), wxid_list
)
im.append(f'商品价格:{int(order["amount"])/100}')
im.append(f"订单号:{order['order_no']}")
im.append(disnote)
im.append(qrc)
await send_forward_msg(bot, group_id, "小助手", str(qid), im)
except Exception:
try:
order = await topup(uid, goods_data, method)
except Exception as e:
logger.warning(f"[充值] {group_id} {qid} 错误:{e}")
await send_group_msg("{$@}出错了,可能是Cookie过期或接口出错。", wxid_list)
try:
b64_data = get_qrcode_base64(order["encode_order"])
img_b64decode = base64.b64decode(b64_data)
qrimage = io.BytesIO(img_b64decode) # 二维码
item_icon_url: str = goods_data['goods_icon'] # 图标
item_id: str = goods_data['goods_id'] # 商品内部id
item_pay_url: str = order['encode_order'] # 支付链接
item_name_full = (
f"{goods_data['goods_name']}×{str(goods_data['goods_unit'])}"
)
# 物品名字(非月卡)
item_name: str = (
item_name_full
if int(goods_data['goods_unit']) > 0
else goods_data["goods_name"]
)
# 物品名字
item_price: str = order["currency"] + str(
int(order["amount"]) / 100
) # 价格
item_order_no: str = order['order_no'] # 订单号
item_create_time: int = order['create_time'] # 创建时间
if method == 'alipay':
img_data = await draw_ali(
uid,
item_name,
item_price,
item_order_no,
qrimage,
item_icon_url,
item_create_time,
item_id,
)
return MessageSegment.image(img_data)
else:
img_data = await draw_wx(
uid,
item_name,
item_price,
item_order_no,
item_icon_url,
item_create_time,
item_id,
)
msg_text = '{$@}' + f' UID{uid}\n{item_name}\n{item_create_time}'
msg_text2 = msg_text + f'\n\nZF{item_pay_url}\n\n{disnote}'
at_msg = MessageSegment.room_at_msg(
content=msg_text2, at_list=wxid_list
)
return MessageSegment.image(img_data) + at_msg
except Exception as e:
traceback.print_exc()
logger.warning(f"[充值] {group_id} 图片发送失败")
await send_group_msg(await refresh(order, uid))
logger.warning(f"[充值] {group_id} 图片发送失败: {e}")
await send_group_msg(
await refresh(order, uid, order['order_no']), wxid_list
)

View File

@ -3,19 +3,13 @@ import re
from nonebot import on_command
from nonebot.matcher import Matcher
from nonebot.params import CommandArg
from nonebot.adapters.onebot.v11 import (
Bot,
Message,
MessageSegment,
GroupMessageEvent,
)
from nonebot.adapters.ntchat.message import Message
from ..config import priority
from ..genshinuid_meta import register_menu
from ..utils.exception.handle_exception import handle_exception
from .get_wiki_text import (
char_wiki,
audio_wiki,
foods_wiki,
weapon_wiki,
enemies_wiki,
@ -32,7 +26,8 @@ get_audio = on_command('语音', priority=priority)
get_artifacts = on_command('圣遗物', priority=priority)
get_food = on_command('食物', priority=priority)
# 语音暂时不支持
'''
@get_audio.handle()
@handle_exception('语音', '语音发送失败可能是FFmpeg环境未配置。')
@register_menu(
@ -61,6 +56,7 @@ async def send_audio(matcher: Matcher, args: Message = CommandArg()):
await matcher.finish(im)
else:
await matcher.finish(MessageSegment.record(im))
'''
@get_enemies.handle()
@ -153,6 +149,8 @@ async def send_weapon(matcher: Matcher, args: Message = CommandArg()):
await matcher.finish(im)
# 天赋暂时不支持
'''
@get_talents.handle()
@handle_exception('天赋')
@register_menu(
@ -173,7 +171,6 @@ async def send_weapon(matcher: Matcher, args: Message = CommandArg()):
)
async def send_talents(
bot: Bot,
event: GroupMessageEvent,
matcher: Matcher,
args: Message = CommandArg(),
):
@ -187,10 +184,10 @@ async def send_talents(
'send_group_forward_msg', group_id=event.group_id, messages=im
)
await matcher.finish()
return
else:
im = '参数不正确。'
await matcher.finish(im)
'''
@get_char.handle()

View File

@ -6,7 +6,7 @@ from nonebot import on_command
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot_plugin_apscheduler import scheduler
from nonebot.adapters.onebot.v11 import MessageSegment
from nonebot.adapters.ntchat import MessageSegment
from .draw_abyss_total import TOTAL_IMG, draw_xk_abyss_img
from ..utils.exception.handle_exception import handle_exception

View File

@ -11,7 +11,7 @@ class UidDataDAL:
def __init__(self, db_session: Session):
self.db_session = db_session
async def get_user_data(self, userid: int) -> Optional[UidData]:
async def get_user_data(self, userid: str) -> Optional[UidData]:
"""
:说明:
获取用户的绑定信息
@ -37,7 +37,7 @@ class UidDataDAL:
bind_list.append(item.__dict__)
return bind_list
async def user_exists(self, userid: int) -> bool:
async def user_exists(self, userid: str) -> bool:
"""
:说明:
是否存在用户的绑定信息
@ -67,7 +67,7 @@ class UidDataDAL:
uid_list.extend(item.UID.split("_"))
return uid_list
async def get_uid_list(self, userid: int) -> List[str]:
async def get_uid_list(self, userid: str) -> List[str]:
"""
:说明:
获得用户的绑定UID列表
@ -83,7 +83,7 @@ class UidDataDAL:
return uid_list
return []
async def get_uid(self, userid: int) -> str:
async def get_uid(self, userid: str) -> str:
"""
:说明:
获得用户绑定的UID
@ -98,14 +98,14 @@ class UidDataDAL:
else:
return '未找到绑定的UID~'
async def switch_uid(self, userid: int, uid: Optional[str] = None) -> str:
async def switch_uid(self, userid: str, uid: Optional[str] = None) -> str:
"""
:说明:
切换绑定的UID列表,绑定一个UID的情况下返回无法切换
切换前 -> 12_13_14
切换后 -> 13_12_14
:参数:
* userid (int): QQ号。
* userid (int): WX号。
* uid (str): 切换的UID, 可选, 不传入的话自动切换下一个。
:返回:
* msg (str): 回调信息。
@ -126,7 +126,7 @@ class UidDataDAL:
else:
return '你还没有绑定过UID噢~'
async def get_mysid_list(self, userid: int) -> List[str]:
async def get_mysid_list(self, userid: str) -> List[str]:
"""
:说明:
获得用户的绑定MYSID列表
@ -142,7 +142,7 @@ class UidDataDAL:
return mys_list
return []
async def get_mysid(self, userid: int) -> str:
async def get_mysid(self, userid: str) -> str:
"""
:说明:
获得用户绑定的MYSID
@ -157,7 +157,7 @@ class UidDataDAL:
else:
return "未找到绑定的MYSID~"
async def get_anyid(self, userid: int) -> str:
async def get_anyid(self, userid: str) -> str:
"""
:说明:
获得用户绑定的ID信息
@ -176,7 +176,7 @@ class UidDataDAL:
else:
return '未找到绑定的ID信息~'
async def bind_db(self, userid: int, data: dict) -> str:
async def bind_db(self, userid: str, data: dict) -> str:
"""
:说明:
绑定UID或者MYSID
@ -229,7 +229,7 @@ class UidDataDAL:
await self.db_session.flush() # type: ignore
return _bind
async def delete_db(self, userid: int, data: Optional[dict]) -> str:
async def delete_db(self, userid: str, data: Optional[dict]) -> str:
"""
:说明:
删除用户的绑定UID或者MYSID
@ -284,7 +284,7 @@ class UidDataDAL:
async def update_db(
self,
userid: int,
userid: str,
data: Optional[dict],
):
"""

View File

@ -33,7 +33,7 @@ class PushData(SQLModel, table=True):
class UidData(SQLModel, table=True):
__table_args__ = {'keep_existing': True}
USERID: int = Field(default=100000000, primary_key=True, title='QQ')
USERID: str = Field(default='WX_100001', primary_key=True, title='WX')
UID: Optional[str] = Field(title='UID')
MYSID: Optional[str] = Field(title='米游社通行证(废弃)')
@ -42,7 +42,7 @@ class NewCookiesTable(SQLModel, table=True):
__table_args__ = {'keep_existing': True}
UID: int = Field(default=100000000, primary_key=True, title='UID')
Cookies: str = Field(title='CK')
QID: int = Field(title='QQ号')
QID: str = Field(title='QQ号')
StatusA: str = Field(title='全局推送开关')
StatusB: str = Field(title='自动签到')
StatusC: str = Field(title='自动米游币')

View File

@ -92,7 +92,7 @@ async def get_all_stoken() -> List:
async def select_db(
userid: int, mode: str = 'auto'
userid: str, mode: str = 'auto'
) -> Union[List[str], str, None]:
"""
:说明:
@ -126,14 +126,14 @@ async def select_db(
return im
async def switch_db(userid: int, uid: Optional[str] = None) -> str:
async def switch_db(userid: str, uid: Optional[str] = None) -> str:
"""
:说明:
切换绑定的UID列表,绑定一个UID的情况下返回无法切换
切换前 -> 12_13_14
切换后 -> 13_14_12
:参数:
* userid (str): QQ号。
* userid (str): WX号。
:返回:
* im (str): 回调信息。
"""
@ -144,7 +144,7 @@ async def switch_db(userid: int, uid: Optional[str] = None) -> str:
return im
async def delete_db(userid: int, data: dict) -> str:
async def delete_db(userid: str, data: dict) -> str:
"""
:说明:
删除当前绑定的UID信息

View File

@ -184,10 +184,7 @@ async def get_level_pic(level: int) -> Image.Image:
async def get_qq_avatar(
qid: Optional[Union[int, str]] = None, avatar_url: Optional[str] = None
) -> Image.Image:
if qid:
avatar_url = f'http://q1.qlogo.cn/g?b=qq&nk={qid}&s=640'
elif avatar_url is None:
avatar_url = 'https://q1.qlogo.cn/g?b=qq&nk=3399214199&s=640'
avatar_url = 'https://s2.loli.net/2022/01/31/kwCIl3cF1Z2GxnR.png'
char_pic = Image.open(BytesIO(get(avatar_url).content)).convert('RGBA')
return char_pic

View File

@ -52,4 +52,4 @@ async def convert_img(
else:
async with aiofiles.open(img, 'rb') as fp:
img = await fp.read()
return f'[CQ:image,file=base64://{b64encode(img).decode()}]'
return f'base64://{b64encode(img).decode()}'

View File

@ -4,7 +4,6 @@ from typing import Optional
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.exception import FinishedException
from nonebot.adapters.onebot.v11 import ActionFailed
def handle_exception(
@ -30,10 +29,6 @@ def handle_exception(
matcher: Matcher = kwargs['matcher']
try:
await func(**kwargs)
except ActionFailed as e:
# 此为bot本身由于风控或网络问题发不出消息并非代码本身出问题
await matcher.send(f'发送消息失败{e.info["wording"]}')
logger.exception(f'发送{name}消息失败')
except FinishedException:
# `finish` 会抛出此异常,应予以抛出而不处理
raise
@ -46,9 +41,7 @@ def handle_exception(
if not fail_msg:
fail_msg = log_msg
if fail_msg[0] == '@':
await matcher.send(
f'{fail_msg[1:]}\n错误信息为{e}', at_sender=True
)
await matcher.send(f'{fail_msg[1:]}\n错误信息为{e}')
else:
await matcher.send(f'{fail_msg}\n错误信息为{e}')
if log_msg[0] == '@':

View File

@ -1,11 +1,11 @@
from typing import List
from nonebot.adapters.onebot.v11 import Bot
from nonebot.adapters.ntchat import Bot
async def get_all_friend_list(bot: Bot) -> List[int]:
friend_list = []
friend_dict_list = await bot.call_api('get_friend_list')
friend_dict_list = await bot.call_api('get_contacts')
for friend in friend_dict_list:
friend_list.append(friend['user_id'])
return friend_list
@ -14,7 +14,7 @@ async def get_all_friend_list(bot: Bot) -> List[int]:
async def get_group_member_list(bot: Bot, group_id: int) -> List[int]:
member_list = []
group_member_list = await bot.call_api(
'get_group_member_list', group_id=group_id
'get_room_members', group_id=group_id
)
for group_member in group_member_list:
member_list.append(group_member['user_id'])

View File

@ -1,12 +1,12 @@
from typing import List
from nonebot.adapters.onebot.v11 import Bot
from nonebot.adapters.qqguild import Bot
# 发送聊天记录
async def send_forward_msg(
bot: Bot,
groupid: int,
userid: int,
name: str,
uin: str,
msgs: List[str],
@ -19,5 +19,5 @@ async def send_forward_msg(
messages = [to_json(msg) for msg in msgs]
await bot.call_api(
"send_group_forward_msg", group_id=groupid, messages=messages
"send_private_forward_msg", user_id=userid, messages=messages
)

View File

@ -877,7 +877,7 @@ async def fetchgoods():
return goodslist["data"]["goods_list"]
async def topup(uid, goods):
async def topup(uid, goods, method):
device_id = str(uuid.uuid4())
HEADER = copy.deepcopy(_HEADER)
HEADER["Cookie"] = await owner_cookies(uid)
@ -902,7 +902,7 @@ async def topup(uid, goods):
"price_tier": goods["tier_id"],
# "price_tier": "Tier_1",
"currency": "CNY",
"pay_plat": "alipay",
"pay_plat": method,
}
data = {"order": order, "sign": gen_payment_sign(order)}
HEADER["x-rpc-device_id"] = device_id

View File

@ -1,6 +1,6 @@
from nonebot.rule import Rule
from nonebot.params import Depends, CommandArg
from nonebot.adapters.onebot.v11 import Message
from nonebot.adapters.ntchat.message import Message
async def full_command(arg: Message = CommandArg()) -> bool:

124
poetry.lock generated
View File

@ -889,32 +889,32 @@ test = ["objgraph", "psutil"]
[[package]]
name = "h11"
version = "0.14.0"
version = "0.12.0"
description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
category = "main"
optional = false
python-versions = ">=3.7"
python-versions = ">=3.6"
files = [
{file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"},
{file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"},
{file = "h11-0.12.0-py3-none-any.whl", hash = "sha256:36a3cb8c0a032f56e2da7084577878a035d3b61d104230d4bd49c0c6b555a9c6"},
{file = "h11-0.12.0.tar.gz", hash = "sha256:47222cb6067e4a307d535814917cd98fd0a57b6788ce715755fa2b6c28b56042"},
]
[[package]]
name = "httpcore"
version = "0.16.3"
version = "0.15.0"
description = "A minimal low-level HTTP client."
category = "main"
optional = false
python-versions = ">=3.7"
files = [
{file = "httpcore-0.16.3-py3-none-any.whl", hash = "sha256:da1fb708784a938aa084bde4feb8317056c55037247c787bd7e19eb2c2949dc0"},
{file = "httpcore-0.16.3.tar.gz", hash = "sha256:c5d6f04e2fc530f39e0c077e6a30caa53f1451096120f1f38b954afd0b17c0cb"},
{file = "httpcore-0.15.0-py3-none-any.whl", hash = "sha256:1105b8b73c025f23ff7c36468e4432226cbb959176eab66864b8e31c4ee27fa6"},
{file = "httpcore-0.15.0.tar.gz", hash = "sha256:18b68ab86a3ccf3e7dc0f43598eaddcf472b602aba29f9aa6ab85fe2ada3980b"},
]
[package.dependencies]
anyio = ">=3.0,<5.0"
anyio = ">=3.0.0,<4.0.0"
certifi = "*"
h11 = ">=0.13,<0.15"
h11 = ">=0.11,<0.13"
sniffio = ">=1.0.0,<2.0.0"
[package.extras]
@ -923,19 +923,19 @@ socks = ["socksio (>=1.0.0,<2.0.0)"]
[[package]]
name = "httpx"
version = "0.23.3"
version = "0.23.0"
description = "The next generation HTTP client."
category = "main"
optional = false
python-versions = ">=3.7"
files = [
{file = "httpx-0.23.3-py3-none-any.whl", hash = "sha256:a211fcce9b1254ea24f0cd6af9869b3d29aba40154e947d2a07bb499b3e310d6"},
{file = "httpx-0.23.3.tar.gz", hash = "sha256:9818458eb565bb54898ccb9b8b251a28785dd4a55afbc23d0eb410754fe7d0f9"},
{file = "httpx-0.23.0-py3-none-any.whl", hash = "sha256:42974f577483e1e932c3cdc3cd2303e883cbfba17fe228b0f63589764d7b9c4b"},
{file = "httpx-0.23.0.tar.gz", hash = "sha256:f28eac771ec9eb4866d3fb4ab65abd42d38c424739e80c08d8d20570de60b0ef"},
]
[package.dependencies]
certifi = "*"
httpcore = ">=0.15.0,<0.17.0"
httpcore = ">=0.15.0,<0.16.0"
rfc3986 = {version = ">=1.3,<2", extras = ["idna2008"]}
sniffio = "*"
@ -1174,79 +1174,6 @@ files = [
{file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"},
]
[[package]]
name = "msgpack"
version = "1.0.5"
description = "MessagePack serializer"
category = "main"
optional = false
python-versions = "*"
files = [
{file = "msgpack-1.0.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:525228efd79bb831cf6830a732e2e80bc1b05436b086d4264814b4b2955b2fa9"},
{file = "msgpack-1.0.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4f8d8b3bf1ff2672567d6b5c725a1b347fe838b912772aa8ae2bf70338d5a198"},
{file = "msgpack-1.0.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cdc793c50be3f01106245a61b739328f7dccc2c648b501e237f0699fe1395b81"},
{file = "msgpack-1.0.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5cb47c21a8a65b165ce29f2bec852790cbc04936f502966768e4aae9fa763cb7"},
{file = "msgpack-1.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e42b9594cc3bf4d838d67d6ed62b9e59e201862a25e9a157019e171fbe672dd3"},
{file = "msgpack-1.0.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:55b56a24893105dc52c1253649b60f475f36b3aa0fc66115bffafb624d7cb30b"},
{file = "msgpack-1.0.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:1967f6129fc50a43bfe0951c35acbb729be89a55d849fab7686004da85103f1c"},
{file = "msgpack-1.0.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:20a97bf595a232c3ee6d57ddaadd5453d174a52594bf9c21d10407e2a2d9b3bd"},
{file = "msgpack-1.0.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d25dd59bbbbb996eacf7be6b4ad082ed7eacc4e8f3d2df1ba43822da9bfa122a"},
{file = "msgpack-1.0.5-cp310-cp310-win32.whl", hash = "sha256:382b2c77589331f2cb80b67cc058c00f225e19827dbc818d700f61513ab47bea"},
{file = "msgpack-1.0.5-cp310-cp310-win_amd64.whl", hash = "sha256:4867aa2df9e2a5fa5f76d7d5565d25ec76e84c106b55509e78c1ede0f152659a"},
{file = "msgpack-1.0.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9f5ae84c5c8a857ec44dc180a8b0cc08238e021f57abdf51a8182e915e6299f0"},
{file = "msgpack-1.0.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9e6ca5d5699bcd89ae605c150aee83b5321f2115695e741b99618f4856c50898"},
{file = "msgpack-1.0.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5494ea30d517a3576749cad32fa27f7585c65f5f38309c88c6d137877fa28a5a"},
{file = "msgpack-1.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ab2f3331cb1b54165976a9d976cb251a83183631c88076613c6c780f0d6e45a"},
{file = "msgpack-1.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28592e20bbb1620848256ebc105fc420436af59515793ed27d5c77a217477705"},
{file = "msgpack-1.0.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fe5c63197c55bce6385d9aee16c4d0641684628f63ace85f73571e65ad1c1e8d"},
{file = "msgpack-1.0.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ed40e926fa2f297e8a653c954b732f125ef97bdd4c889f243182299de27e2aa9"},
{file = "msgpack-1.0.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:b2de4c1c0538dcb7010902a2b97f4e00fc4ddf2c8cda9749af0e594d3b7fa3d7"},
{file = "msgpack-1.0.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bf22a83f973b50f9d38e55c6aade04c41ddda19b00c4ebc558930d78eecc64ed"},
{file = "msgpack-1.0.5-cp311-cp311-win32.whl", hash = "sha256:c396e2cc213d12ce017b686e0f53497f94f8ba2b24799c25d913d46c08ec422c"},
{file = "msgpack-1.0.5-cp311-cp311-win_amd64.whl", hash = "sha256:6c4c68d87497f66f96d50142a2b73b97972130d93677ce930718f68828b382e2"},
{file = "msgpack-1.0.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a2b031c2e9b9af485d5e3c4520f4220d74f4d222a5b8dc8c1a3ab9448ca79c57"},
{file = "msgpack-1.0.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f837b93669ce4336e24d08286c38761132bc7ab29782727f8557e1eb21b2080"},
{file = "msgpack-1.0.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1d46dfe3832660f53b13b925d4e0fa1432b00f5f7210eb3ad3bb9a13c6204a6"},
{file = "msgpack-1.0.5-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:366c9a7b9057e1547f4ad51d8facad8b406bab69c7d72c0eb6f529cf76d4b85f"},
{file = "msgpack-1.0.5-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:4c075728a1095efd0634a7dccb06204919a2f67d1893b6aa8e00497258bf926c"},
{file = "msgpack-1.0.5-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:f933bbda5a3ee63b8834179096923b094b76f0c7a73c1cfe8f07ad608c58844b"},
{file = "msgpack-1.0.5-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:36961b0568c36027c76e2ae3ca1132e35123dcec0706c4b7992683cc26c1320c"},
{file = "msgpack-1.0.5-cp36-cp36m-win32.whl", hash = "sha256:b5ef2f015b95f912c2fcab19c36814963b5463f1fb9049846994b007962743e9"},
{file = "msgpack-1.0.5-cp36-cp36m-win_amd64.whl", hash = "sha256:288e32b47e67f7b171f86b030e527e302c91bd3f40fd9033483f2cacc37f327a"},
{file = "msgpack-1.0.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:137850656634abddfb88236008339fdaba3178f4751b28f270d2ebe77a563b6c"},
{file = "msgpack-1.0.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c05a4a96585525916b109bb85f8cb6511db1c6f5b9d9cbcbc940dc6b4be944b"},
{file = "msgpack-1.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56a62ec00b636583e5cb6ad313bbed36bb7ead5fa3a3e38938503142c72cba4f"},
{file = "msgpack-1.0.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef8108f8dedf204bb7b42994abf93882da1159728a2d4c5e82012edd92c9da9f"},
{file = "msgpack-1.0.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1835c84d65f46900920b3708f5ba829fb19b1096c1800ad60bae8418652a951d"},
{file = "msgpack-1.0.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:e57916ef1bd0fee4f21c4600e9d1da352d8816b52a599c46460e93a6e9f17086"},
{file = "msgpack-1.0.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:17358523b85973e5f242ad74aa4712b7ee560715562554aa2134d96e7aa4cbbf"},
{file = "msgpack-1.0.5-cp37-cp37m-win32.whl", hash = "sha256:cb5aaa8c17760909ec6cb15e744c3ebc2ca8918e727216e79607b7bbce9c8f77"},
{file = "msgpack-1.0.5-cp37-cp37m-win_amd64.whl", hash = "sha256:ab31e908d8424d55601ad7075e471b7d0140d4d3dd3272daf39c5c19d936bd82"},
{file = "msgpack-1.0.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:b72d0698f86e8d9ddf9442bdedec15b71df3598199ba33322d9711a19f08145c"},
{file = "msgpack-1.0.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:379026812e49258016dd84ad79ac8446922234d498058ae1d415f04b522d5b2d"},
{file = "msgpack-1.0.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:332360ff25469c346a1c5e47cbe2a725517919892eda5cfaffe6046656f0b7bb"},
{file = "msgpack-1.0.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:476a8fe8fae289fdf273d6d2a6cb6e35b5a58541693e8f9f019bfe990a51e4ba"},
{file = "msgpack-1.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9985b214f33311df47e274eb788a5893a761d025e2b92c723ba4c63936b69b1"},
{file = "msgpack-1.0.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:48296af57cdb1d885843afd73c4656be5c76c0c6328db3440c9601a98f303d87"},
{file = "msgpack-1.0.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:addab7e2e1fcc04bd08e4eb631c2a90960c340e40dfc4a5e24d2ff0d5a3b3edb"},
{file = "msgpack-1.0.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:916723458c25dfb77ff07f4c66aed34e47503b2eb3188b3adbec8d8aa6e00f48"},
{file = "msgpack-1.0.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:821c7e677cc6acf0fd3f7ac664c98803827ae6de594a9f99563e48c5a2f27eb0"},
{file = "msgpack-1.0.5-cp38-cp38-win32.whl", hash = "sha256:1c0f7c47f0087ffda62961d425e4407961a7ffd2aa004c81b9c07d9269512f6e"},
{file = "msgpack-1.0.5-cp38-cp38-win_amd64.whl", hash = "sha256:bae7de2026cbfe3782c8b78b0db9cbfc5455e079f1937cb0ab8d133496ac55e1"},
{file = "msgpack-1.0.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:20c784e66b613c7f16f632e7b5e8a1651aa5702463d61394671ba07b2fc9e025"},
{file = "msgpack-1.0.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:266fa4202c0eb94d26822d9bfd7af25d1e2c088927fe8de9033d929dd5ba24c5"},
{file = "msgpack-1.0.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:18334484eafc2b1aa47a6d42427da7fa8f2ab3d60b674120bce7a895a0a85bdd"},
{file = "msgpack-1.0.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:57e1f3528bd95cc44684beda696f74d3aaa8a5e58c816214b9046512240ef437"},
{file = "msgpack-1.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:586d0d636f9a628ddc6a17bfd45aa5b5efaf1606d2b60fa5d87b8986326e933f"},
{file = "msgpack-1.0.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a740fa0e4087a734455f0fc3abf5e746004c9da72fbd541e9b113013c8dc3282"},
{file = "msgpack-1.0.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:3055b0455e45810820db1f29d900bf39466df96ddca11dfa6d074fa47054376d"},
{file = "msgpack-1.0.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:a61215eac016f391129a013c9e46f3ab308db5f5ec9f25811e811f96962599a8"},
{file = "msgpack-1.0.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:362d9655cd369b08fda06b6657a303eb7172d5279997abe094512e919cf74b11"},
{file = "msgpack-1.0.5-cp39-cp39-win32.whl", hash = "sha256:ac9dd47af78cae935901a9a500104e2dea2e253207c924cc95de149606dc43cc"},
{file = "msgpack-1.0.5-cp39-cp39-win_amd64.whl", hash = "sha256:06f5174b5f8ed0ed919da0e62cbd4ffde676a374aba4020034da05fab67b9164"},
{file = "msgpack-1.0.5.tar.gz", hash = "sha256:c075544284eadc5cddc70f4757331d99dcbc16b2bbd4849d15f8aae4cf36d31c"},
]
[[package]]
name = "multidict"
version = "6.0.4"
@ -1359,20 +1286,19 @@ files = [
setuptools = "*"
[[package]]
name = "nonebot-adapter-onebot"
version = "2.2.1"
description = "OneBot(CQHTTP) adapter for nonebot2"
name = "nonebot-adapter-ntchat"
version = "0.3.5"
description = "a wechat adapter for nonebot2"
category = "main"
optional = false
python-versions = ">=3.8,<4.0"
python-versions = ">=3.8"
files = [
{file = "nonebot_adapter_onebot-2.2.1-py3-none-any.whl", hash = "sha256:db22c92a541f243ef427a7080096fb28751fec213bc75b111e2c9ed89e121d94"},
{file = "nonebot_adapter_onebot-2.2.1.tar.gz", hash = "sha256:2f77ff2345cc98e493c3bf00a5fd7112cf20e66ebeac062bbb8de56b4d07040e"},
{file = "nonebot-adapter-ntchat-0.3.5.tar.gz", hash = "sha256:52a19d9eeb71a534e5543f3804c5cb68997411f309d9b3c848f27f39de25301e"},
{file = "nonebot_adapter_ntchat-0.3.5-py3-none-any.whl", hash = "sha256:ee8851ac28b6463413066dc32ccae08f478df68c6b37e117d48c43698f5e5881"},
]
[package.dependencies]
msgpack = ">=1.0.3,<2.0.0"
nonebot2 = ">=2.0.0-beta.3,<3.0.0"
httpx = "0.23.0"
[[package]]
name = "nonebot-plugin-apscheduler"
@ -1420,20 +1346,20 @@ websockets = ["websockets (>=10.0,<11.0)"]
[[package]]
name = "nonebug"
version = "0.3.1"
version = "0.2.3"
description = "nonebot2 test framework"
category = "dev"
optional = false
python-versions = ">=3.8,<4.0"
files = [
{file = "nonebug-0.3.1-py3-none-any.whl", hash = "sha256:b33e93d486e3f187e890a516ad8d9432ea736e50b0270341ddc78fecfe080d5f"},
{file = "nonebug-0.3.1.tar.gz", hash = "sha256:96637bbdc406e7673e625492fbe928a9db467cd630d6fd04cfde0999f58f9a7a"},
{file = "nonebug-0.2.3-py3-none-any.whl", hash = "sha256:5c83bd885899b2857323fa19eff6bbc3f160729453b2f289d8305a99b7b95fc9"},
{file = "nonebug-0.2.3.tar.gz", hash = "sha256:3e59757b32b6b96cd8c36c4c9fd6050e611b1ffad058ec5fa82cba3f86495c61"},
]
[package.dependencies]
asgiref = ">=3.4.0,<4.0.0"
async-asgi-testclient = ">=1.4.8,<2.0.0"
nonebot2 = ">=2.0.0-rc.2,<3.0.0"
nonebot2 = ">=2.0.0-beta.1,<3.0.0"
pytest = ">=7.0.0,<8.0.0"
typing-extensions = ">=4.0.0,<5.0.0"
@ -2452,4 +2378,4 @@ multidict = ">=4.0"
[metadata]
lock-version = "2.0"
python-versions = "^3.8.1"
content-hash = "5de28f6fa03c9bf7e2207a3d3688e379c2c4aa7ed672718583c99f7f0907bc1c"
content-hash = "c2a8ce5e8f1cc95b81fb90639eb323995941dd9bbd60372327e7e7067572e8c7"

View File

@ -18,7 +18,7 @@ extra_standard_library = ["typing_extensions"]
asyncio_mode = "auto"
[build-system]
requires = ["poetry-core>=1.2.0"]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
@ -28,7 +28,7 @@ description = "基于HoshinoBot/NoneBot2/QQ官方频道/微信Bot的原神面板
authors = ["KimigaiiWuyi <444835641@qq.com>"]
license = "GPL-3.0-or-later"
readme = "README.md"
homepage = "https://github.com/KimigaiiWuyi/GenshinUID/tree/nonebot2-beta1"
homepage = "https://github.com/KimigaiiWuyi/GenshinUID/tree/ntchat"
repository = "https://github.com/KimigaiiWuyi/GenshinUID"
documentation = "https://github.com/KimigaiiWuyi/GenshinUID/wiki"
packages = [
@ -42,7 +42,7 @@ exclude = ["tests", "deploy"]
[tool.poetry.dependencies]
python = "^3.8.1"
nonebot2 = ">=2.0.0b4"
nonebot-adapter-onebot = ">=2.1.1"
nonebot-adapter-ntchat = ">=0.3.4"
httpx = ">=0.23.0"
beautifulsoup4 = ">=4.11.1"
lxml = ">=4.9.2"
@ -70,9 +70,7 @@ flake8 = "^6.0.0"
black = "^22.12.0"
isort = "^5.11.5"
pre-commit = "^2.21.0"
pycln = "^2.1.2"
[tool.poetry.group.test.dependencies]
nonebug = "^0.3.0"
nonebug = "^0.2.2"
pytest = "^7.2.0"
pytest-asyncio = "^0.20.3"
pycln = "^2.1.2"

View File

@ -22,15 +22,14 @@ frozenlist==1.3.3 ; python_full_version >= "3.8.1" and python_full_version < "4.
gitdb==4.0.10 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
gitpython==3.1.31 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
greenlet==2.0.2 ; python_full_version >= "3.8.1" and (platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32") and python_full_version < "4.0.0"
h11==0.14.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
httpcore==0.16.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
httpx==0.23.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
h11==0.12.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
httpcore==0.15.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
httpx==0.23.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
idna==3.4 ; python_full_version >= "3.8.1" and python_version < "4.0"
loguru==0.6.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
lxml==4.9.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
msgpack==1.0.5 ; python_full_version >= "3.8.1" and python_version < "4.0"
multidict==6.0.4 ; python_full_version >= "3.8.1" and python_version < "4.0"
nonebot-adapter-onebot==2.2.1 ; python_full_version >= "3.8.1" and python_version < "4.0"
nonebot-adapter-ntchat==0.3.5 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
nonebot-plugin-apscheduler==0.2.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
nonebot2==2.0.0rc3 ; python_full_version >= "3.8.1" and python_version < "4.0"
openpyxl==3.1.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"

View File

@ -1,5 +1,4 @@
LOG_LEVEL=TRACE
NICKNAME=["test"]
SUPERUSERS=["onebot:10000","10001","other:10002","abcdef"]
SUPERUSERS=["10000"]
COMMAND_START=["", "/"]
DRIVER="~none"

View File

@ -1,23 +1,34 @@
from typing import TYPE_CHECKING, Optional
import pytest
if TYPE_CHECKING:
from nonebot.plugin import Plugin
@pytest.fixture
def load_metadata(nonebug_init: None) -> Optional["Plugin"]:
import nonebot
from nonebug import NONEBOT_INIT_KWARGS
from nonebot.adapters.onebot.v11 import Adapter
PLUGINS = ["meta", "adv", "etcimg", "guide"]
return nonebot.load_plugin("GenshinUID.genshinuid_meta")
@pytest.fixture(scope="session", autouse=True)
def load_bot():
driver = nonebot.get_driver()
driver.register_adapter(Adapter)
@pytest.fixture
def load_adv(nonebug_init: None) -> Optional["Plugin"]:
import nonebot
nonebot.load_all_plugins(
[f"GenshinUID.genshinuid_{name}" for name in PLUGINS], []
)
return nonebot.load_plugin("GenshinUID.genshinuid_adv")
def pytest_configure(config: pytest.Config):
config.stash[NONEBOT_INIT_KWARGS] = {
"genshinuid_disabled_plugins": {"xkdata", "abyss", "adv"},
"genshinuid_priority": 5,
}
@pytest.fixture
def load_etc(nonebug_init: None) -> Optional["Plugin"]:
import nonebot
return nonebot.load_plugin("GenshinUID.genshinuid_etcimg")
@pytest.fixture
def load_guide(nonebug_init: None) -> Optional["Plugin"]:
import nonebot
return nonebot.load_plugin("GenshinUID.genshinuid_guide")

View File

@ -6,18 +6,12 @@ MESSAGE = """「安柏」
推荐5★武器阿莫斯之弓、天空之翼、终末嗟叹之诗
推荐4★武器绝弦
推荐圣遗物搭配:
[昔日宗室之仪]四件套
-=-=-=-=-=-=-=-=-=-
备注:
原神御三家之一,必胜客联动看板角色之一;
身份西风骑士团侦查骑士,蒙德飞行冠军,柏菈图的拼图(误);
人送外号解谜点火真君/打火姬
通常情况下,安柏的大世界解谜意义大于其深渊实战意义,建议根据实际需求选择投入资源培养"""
[昔日宗室之仪]四件套"""
@pytest.mark.asyncio
@pytest.mark.parametrize(argnames="alias", argvalues=["安柏用什么", "安柏怎么养"])
async def test_adv_char_chat(app: App, alias):
async def test_adv_char_chat(app: App, alias, load_adv: None):
from utils import make_event
from nonebot.adapters.onebot.v11 import Bot, Message

View File

@ -1,8 +0,0 @@
from nonebug import App
def test_config(app: App):
from GenshinUID import config
assert config.config.disabled_plugins == {"xkdata", "abyss", "adv"}
assert config.priority == 5

View File

@ -6,7 +6,7 @@ from nonebug import App
@pytest.mark.asyncio
@pytest.mark.parametrize(argnames="alias", argvalues=["版本规划", "原石预估"])
async def test_get_primogems_data(app: App, alias):
async def test_get_primogems_data(app: App, alias, load_etc: None):
from utils import make_event
from nonebot.adapters.onebot.v11 import Bot, Message, MessageSegment
@ -37,7 +37,7 @@ async def test_get_primogems_data(app: App, alias):
@pytest.mark.asyncio
async def test_primogems_version(app: App):
async def test_primogems_version(app: App, load_etc: None):
from utils import make_event
from nonebot.adapters.onebot.v11 import Bot, Message, MessageSegment
@ -68,7 +68,7 @@ async def test_primogems_version(app: App):
@pytest.mark.asyncio
async def test_primogems_failed(app: App):
async def test_primogems_failed(app: App, load_etc: None):
from utils import make_event
from nonebot.adapters.onebot.v11 import Bot, Message
@ -100,7 +100,7 @@ async def test_primogems_failed(app: App):
"伤害乘区",
],
)
async def test_get_img_data(app: App, alias):
async def test_get_img_data(app: App, alias, load_etc: None):
from utils import make_event
from nonebot.adapters.onebot.v11 import Bot, Message, MessageSegment

View File

@ -3,72 +3,72 @@ from pathlib import Path
import pytest
from nonebug import App
# TODO: update guide tests
# @pytest.mark.asyncio
# @pytest.mark.parametrize(
# argnames="alias",
# argvalues=[
# "钟离推荐",
# "钟离攻略",
# "岩王爷攻略", # alias
# ],
# )
# async def test_get_guide_pic(app: App, alias ):
# from utils import make_event
# from nonebot.adapters.onebot.v11 import Bot, Message, MessageSegment
# from GenshinUID.genshinuid_guide import get_guide_pic
@pytest.mark.asyncio
@pytest.mark.parametrize(
argnames="alias",
argvalues=[
"钟离推荐",
"钟离攻略",
"岩王爷攻略", # alias
],
)
async def test_get_guide_pic(app: App, alias, load_guide: None):
from utils import make_event
from nonebot.adapters.onebot.v11 import Bot, Message, MessageSegment
# async with app.test_matcher(get_guide_pic) as ctx:
# bot = ctx.create_bot(base=Bot)
from GenshinUID.genshinuid_guide import get_guide_pic
# event = make_event(message=Message(alias))
# ctx.receive_event(bot, event)
# ctx.should_call_send(
# event,
# MessageSegment.image(
# "https://file.microgg.cn/MiniGG/guide/钟离.jpg"
# ),
# True,
# )
# ctx.should_finished()
async with app.test_matcher(get_guide_pic) as ctx:
bot = ctx.create_bot(base=Bot)
event = make_event(message=Message(alias))
ctx.receive_event(bot, event)
ctx.should_call_send(
event,
MessageSegment.image(
"https://file.microgg.cn/MiniGG/guide/钟离.jpg"
),
True,
)
ctx.should_finished()
# @pytest.mark.asyncio
# async def test_get_guide_pic_traveler(app: App ):
# from utils import make_event
# from nonebot.adapters.onebot.v11 import Bot, Message, MessageSegment
@pytest.mark.asyncio
async def test_get_guide_pic_traveler(app: App, load_guide: None):
from utils import make_event
from nonebot.adapters.onebot.v11 import Bot, Message, MessageSegment
# from GenshinUID.genshinuid_guide import get_guide_pic
from GenshinUID.genshinuid_guide import get_guide_pic
# async with app.test_matcher(get_guide_pic) as ctx:
# bot = ctx.create_bot(base=Bot)
async with app.test_matcher(get_guide_pic) as ctx:
bot = ctx.create_bot(base=Bot)
# event = make_event(message=Message("旅行者风推荐"))
# ctx.receive_event(bot, event)
# ctx.should_call_send(
# event,
# MessageSegment.image(
# "https://file.microgg.cn/MiniGG/guide/旅行者-风.jpg"
# ),
# True,
# )
# ctx.should_finished()
event = make_event(message=Message("旅行者风推荐"))
ctx.receive_event(bot, event)
ctx.should_call_send(
event,
MessageSegment.image(
"https://file.microgg.cn/MiniGG/guide/旅行者-风.jpg"
),
True,
)
ctx.should_finished()
# @pytest.mark.asyncio
# async def test_get_guide_pic_failed(app: App ):
# from utils import make_event
# from nonebot.adapters.onebot.v11 import Bot, Message
@pytest.mark.asyncio
async def test_get_guide_pic_failed(app: App, load_guide: None):
from utils import make_event
from nonebot.adapters.onebot.v11 import Bot, Message
# from GenshinUID.genshinuid_guide import get_guide_pic
from GenshinUID.genshinuid_guide import get_guide_pic
# async with app.test_matcher(get_guide_pic) as ctx:
# bot = ctx.create_bot(base=Bot)
async with app.test_matcher(get_guide_pic) as ctx:
bot = ctx.create_bot(base=Bot)
# event = make_event(message=Message("蔡徐坤攻略"))
# ctx.receive_event(bot, event)
# ctx.should_finished()
event = make_event(message=Message("蔡徐坤攻略"))
ctx.receive_event(bot, event)
ctx.should_finished()
@pytest.mark.asyncio
@ -79,7 +79,7 @@ from nonebug import App
"参考面板岩王爷", # alias
],
)
async def test_get_bluekun_pic(app: App, alias):
async def test_get_bluekun_pic(app: App, alias, load_guide: None):
from utils import make_event
from nonebot.adapters.onebot.v11 import Bot, Message, MessageSegment
@ -104,7 +104,7 @@ async def test_get_bluekun_pic(app: App, alias):
"",
],
)
async def test_get_bluekun_pic_element(app: App, alias):
async def test_get_bluekun_pic_element(app: App, alias, load_guide: None):
from utils import make_event
from nonebot.adapters.onebot.v11 import Bot, Message, MessageSegment

View File

@ -3,7 +3,7 @@ from nonebug import App
@pytest.mark.asyncio
async def test_metadata(app: App):
async def test_metadata(app: App, load_metadata: None):
from GenshinUID.genshinuid_meta import __plugin_meta__
assert __plugin_meta__.name == 'GenshinUID'
@ -13,7 +13,7 @@ async def test_metadata(app: App):
@pytest.mark.asyncio
async def test_register_menu(app: App):
async def test_register_menu(app: App, load_metadata: None):
from GenshinUID.genshinuid_meta import sub_menus, register_menu
@register_menu(
@ -26,11 +26,10 @@ async def test_register_menu(app: App):
async def _example() -> None:
pass
menu = {
"func": "test",
"trigger_condition": "trigger",
"trigger_method": "114514",
"brief_des": "test register_menu",
"detail_des": "test register_menu",
}
assert menu in sub_menus
assert len(sub_menus) == 1
menu = sub_menus[0]
assert menu['func'] == 'test'
assert menu['trigger_condition'] == 'trigger'
assert menu['trigger_method'] == '114514'
assert menu['brief_des'] == 'test register_menu'
assert menu['detail_des'] == 'test register_menu'

View File

@ -1,9 +0,0 @@
from nonebug import App
def test_get_superusers(app: App):
from GenshinUID.utils.nonebot2.utils import get_superusers
superusers = get_superusers()
assert len(superusers) == 2
assert set(superusers) == {10000, 10001}

View File

@ -104,5 +104,6 @@ def make_event(
"anonymous": anonymous,
**kwargs,
},
str(self_id),
),
)