注意到MIRAI在手动关闭后会发送下线通知,但仍能响应HTTP请求,将下线待机时长延长10s
这个提交包含在:
8
CGI.js
8
CGI.js
@ -199,7 +199,7 @@ var Active = ((force=false)=>{
|
|||||||
})
|
})
|
||||||
},(err2,res2)=>{
|
},(err2,res2)=>{
|
||||||
console.log("["+new Date().toString()+"][./Core.js]Session激活成功.");
|
console.log("["+new Date().toString()+"][./Core.js]Session激活成功.");
|
||||||
console.log(Session);
|
console.log(`得到Session[${Session}]`);
|
||||||
exports.HOOK = HOOK;
|
exports.HOOK = HOOK;
|
||||||
var STHandle = setInterval(()=>{
|
var STHandle = setInterval(()=>{
|
||||||
if(Session == ""){return}
|
if(Session == ""){return}
|
||||||
@ -218,9 +218,11 @@ var Active = ((force=false)=>{
|
|||||||
}else{
|
}else{
|
||||||
if(data_obj["type"]=="BotOfflineEventActive"){
|
if(data_obj["type"]=="BotOfflineEventActive"){
|
||||||
Session = "";
|
Session = "";
|
||||||
console.log("[CGI.JS]MIRAI端掉线")
|
console.log("[CGI.JS]MIRAI端掉线,十秒后重连")
|
||||||
clearInterval(STHandle);
|
clearInterval(STHandle);
|
||||||
Active();
|
setTimeout(()=>{
|
||||||
|
Active(true)
|
||||||
|
},10000)
|
||||||
}
|
}
|
||||||
Core.frame.CGI("",data_obj);
|
Core.frame.CGI("",data_obj);
|
||||||
last = data_obj;
|
last = data_obj;
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户