提交 ed081b09 编辑于 作者: yuudi's avatar yuudi
浏览文件

fix: statistics2 compatibility

上级 2ceaf42b
{
"stable": {
"version": 3487,
"url": "http://img.yobot.xyz/yobot/yobot3487.zip"
"version": 3493,
"url": "http://img.yobot.xyz/yobot/yobot3493.zip"
}
}
\ No newline at end of file
......@@ -1078,7 +1078,7 @@ var vm = new Vue({
},
getPlayer: function(qqid) {
return this.members.find(o => o.qqid === qqid) ?? {nickname:'未加入',qqid:qqid,sl:null};
return this.members.find(o => o.qqid === qqid) || {nickname:'未加入',qqid:qqid,sl:null};
},
playerDamage: function(playerQQid) {
......
......@@ -121,8 +121,8 @@
</td>
</tr>
<tr>
<td>SL</td>
<td>挑战boss强制取消后用,记录本日SL<sup class="footnote">2</sup></td>
<td>SL [?]</td>
<td>挑战boss强制取消后用,记录本日SL<sup class="footnote">2</sup>,用“?”查询今日是否已 SL</td>
</tr>
<tr>
<td>撤销</td>
......
......@@ -95,7 +95,7 @@
const temp_form = document.createElement("form");
temp_form.action = url;
//如需打开新窗口,form的target属性要设置为'_blank'
temp_form.target = "_blank";
// temp_form.target = "_blank";
temp_form.method = "post";
temp_form.style.display = "none";
//添加参数
......
......@@ -950,7 +950,7 @@ class ClanBattle:
self._boss_status[group_id] = asyncio.get_event_loop().create_future()
return status
def save_slot(self, group_id: Groupid, qqid: QQid, todaystatus: Optional[bool] = True):
def save_slot(self, group_id: Groupid, qqid: QQid, todaystatus: bool = True, only_check: bool = False):
"""
record today's save slot
......@@ -966,6 +966,8 @@ class ClanBattle:
if membership is None:
raise UserNotInGroup
today, _ = pcr_datetime(group.game_server)
if only_check:
return (membership.last_save_slot == today)
if todaystatus:
if membership.last_save_slot == today:
raise UserError('您今天已经存在SL记录了')
......@@ -990,7 +992,7 @@ class ClanBattle:
# refresh
self.get_member_list(group_id, nocache=True)
return
return todaystatus
@timed_cached_func(max_len=64, max_age_seconds=10, ignore_self=True)
def get_report(self,
......@@ -1398,15 +1400,21 @@ class ClanBattle:
)
return f'公会战面板:\n{url}\n建议添加到浏览器收藏夹或桌面快捷方式'
elif match_num == 16: # SL
if len(cmd) != 2:
return
try:
self.save_slot(group_id, user_id)
except ClanBattleError as e:
_logger.info('群聊 失败 {} {} {}'.format(user_id, group_id, cmd))
return str(e)
_logger.info('群聊 成功 {} {} {}'.format(user_id, group_id, cmd))
return '已记录SL'
if len(cmd) == 2:
try:
self.save_slot(group_id, user_id)
except ClanBattleError as e:
_logger.info('群聊 失败 {} {} {}'.format(
user_id, group_id, cmd))
return str(e)
_logger.info('群聊 成功 {} {} {}'.format(user_id, group_id, cmd))
return '已记录SL'
elif cmd[2:].strip() in ['?', '?']:
sl_ed = self.save_slot(group_id, user_id, only_check=True)
if sl_ed:
return '今日已使用SL'
else:
return '今日未使用SL'
elif 20 <= match_num <= 25:
if len(cmd) != 2:
return
......
......@@ -169,6 +169,8 @@ class Gacha:
if today != last_day:
last_day = today
day_times = 0
if day_limit != 0 and day_times+20 > day_limit:
return "{}今天剩余抽卡次数不足30次,不能抽一井".format(nickname, day_times)
reply = ""
result = ""
flag_fully_30_times = True
......
......@@ -33,8 +33,8 @@ else:
class Yobot:
Version = "[v3.6.3-beta.1]"
Version_id = 189
Version = "[v3.6.3-beta.2]"
Version_id = 193
# "git rev-list --count HEAD"
def __init__(self, *,
......
Supports Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册