pcrbot / clanrank Goto Github PK
View Code? Open in Web Editor NEWB服公会战排名查询插件
License: GNU General Public License v3.0
B服公会战排名查询插件
License: GNU General Public License v3.0
在clanrank.py的112行处,函数process里:
msg += "没有查询结果,仅能查询前20000名公会,排名信息30分钟更新一次,相比于游戏内更新有10分钟左右延迟\n"
这一句话会触发错误,需要将+=改成=。
不清楚是非会战期间关闭了fav接口还是镜华调整了接口数据,每天定时任务都会报这个错误
应在 process
函数开头加上 infoList = infoList.copy()
,否则 infoList.remove('ts')
会导致 'ts'
从 self_clan_query_list
中被删除,之后的所有查询都不会显示时间.
因为不是所有时间的数据都会保存在后台,所以可以查询的时间戳是被限制的,常规情况下可以通过/default读取historyV2获取可以查询的时间的时间戳。为了方便,这里提供两个接口。
只获取时间
GET /var-mixer/historyList/version/1
[1589785200,1594278000,1596697200,1591945200,1598216405,1598302806,1598389206]
单独获取/default接口的historyV2
GET /var-mixer/historyList/version/2
{"1589785200":"2020年白羊座公会战","1594278000":"2020年双子座公会战","1596697200":"2020年巨蟹座公会战","1591945200":"2020年金牛座公会战","1598216405":"","1598302806":"","1598389206":""}
修改 boss.py#24 行为 score_left = score / 100000
可以解决 但是源站也正在修改中,不知道是否会影响最终结果,故暂不提交PR,仅提交issue
复现:
绑定公会ID,在会战结束后更换会长或解散公会,则会战结束后每日会推送:
没有查询到本日5时的公会战排名信息, 可能已掉出前2W名
可能原因:
目前非会战期间不推送排名靠返回的时间戳实现,如果返回的更新时间和上次查询时间相差超过45分钟则不推送排名。原因是此公会已解散或更换会长后,fav接口查询的返回结果为0,首先触发以下部分:
elif result == 0:
msg += "没有查询到本日5时的公会战排名信息, 可能已掉出前2W名"
则不会触发时间戳判断,因此仍然会错误推送。
解决:
1, 从某个源处获取B服活动日历来判断是否是会战期间。
2,调整clanrank.py
第246~250行判断的先后顺序。(已推送)
重构中.,效率极低,尽量在下次会战前加入官方接口。
BOSS的进度和游戏里对不上,我查了一下是因为现在BOSS的得分倍率从
[1, 1, 1.1, 1.1, 1.2],
[1.2, 1.2, 1.5, 1.7, 2],
改成了
[1, 1, 1.3, 1.3, 1.5],
[1.3, 1.3, 1.8, 1.8, 2],
10:41:46 [INFO] [BOT 361233717] Group(823820675) <- 第1条信息:\n公会名称:上弦月\n总人数:30\n会长名:月见莉莉娅\n会长UID:1343040248366\n公会排名:114\nBOSS进度:9周目4王 [11411019/12000000] 95.09%\n\n第2条信息:\n公会名称:上弦花月醉伊人\n总人数:30\n会长名:叶秋痕(阿矿奥利给\n会长UID:1363342891538\n公会排名:3820\nBOSS进度:8周目3王 [9761706/10000000] 97.62%\n\n第3条信息:\n公会名称:上弦月\n总人数:30\n会长名:如沐丶秋枫\n会长UID:1234357880395\n公会排名:13475\nBOSS进度:5周目3王 [1545423/10000000] 15.45%\n\n查询有120秒冷却
查询公会的时候如果查到多个结果,机器人后台显示已经发送,但是群里没有显示消息,
如果只有一个结果群里就能正常显示出来
查询排名和分数线也没有问题
我是用的是mirai
发送 绑定公会+UID 无法绑定工会,会报错
报错日志如下
[2020-12-28 03:35:59,361 公会战排名推送] ERROR: <class 'TypeError'> occured when set_clan handling message 783578050.
[2020-12-28 03:35:59,362 公会战排名推送] ERROR: argument of type 'int' is not iterable
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\hoshinobot\hoshino\msghandler.py", line 28, in handle_message
await sf.func(bot, event)
File "C:\Users\Administrator\Desktop\hoshinobot\hoshino\modules\clanrank\clanrank.py", line 259, in set_clan
code = set_clanname(int(group_id),int(leader_id))
File "C:\Users\Administrator\Desktop\hoshinobot\hoshino\modules\clanrank\clanrank.py", line 191, in set_clanname
origin_info = get_rank(leader_id,"fav")
File "C:\Users\Administrator\Desktop\hoshinobot\hoshino\modules\clanrank\clanrank.py", line 93, in get_rank
if '[CQ:' in info and ']' in info and '=' in info:
TypeError: argument of type 'int' is not iterable
当前缓存数据函数,默认读写路径为./hoshino/modules/clanrank/clanrank.json
,且所有配置和查询都放在此文件内,可能有如下问题:
clanrank.json
,查询修改后再存入。如果两个群同时发起查询或者绑定请求(本质上也是查询),且网络状况不佳时,先查询的群的数据会被后来者覆盖。考虑中的改进方案:
~/.hoshino
,即采用和HoshinoBot一样的配置保存路径。A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.