Skip to content

Commit 76f8780

Browse files
committed
fix GroupClearLimit
修复单次清群上限实际并无作用的bug
1 parent de3f9aa commit 76f8780

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Dice/DiceJob.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ void clear_group(DiceJob& job) {
191191
if (tLast < grpline)GrpDelete.push_back(id);
192192
grp.leave(getMsg("strLeaveNoPower"));
193193
intCnt++;
194+
if (console["GroupClearLimit"] > 0 && intCnt >= console["GroupClearLimit"])break;
194195
this_thread::sleep_for(3s);
195196
}
196197
}
@@ -214,7 +215,8 @@ void clear_group(DiceJob& job) {
214215
res << printGroup(id) + ":" + to_string(intDay) + "\n";
215216
grp.leave(getMsg("strLeaveUnused", job.strVar));
216217
intCnt++;
217-
this_thread::sleep_for(2s);
218+
if (console["GroupClearLimit"] > 0 && intCnt >= console["GroupClearLimit"])break;
219+
this_thread::sleep_for(3s);
218220
}
219221
}
220222
job.note(GlobalMsg["strSelfName"] + "已筛除潜水" + strDayLim + "天群聊" + to_string(intCnt) + "个√" + res.show(), 0b10);
@@ -245,6 +247,10 @@ void clear_group(DiceJob& job) {
245247
intCnt++;
246248
break;
247249
}
250+
else if (console["GroupClearLimit"] > 0 && intCnt >= console["GroupClearLimit"]) {
251+
if(intCnt == console["GroupClearLimit"])res << "*单次清退已达上限*";
252+
res << printChat(grp) + "" + printQQ(eachQQ);
253+
}
248254
else if (console["LeaveBlackQQ"]) {
249255
if (grp.tUpdated < grpline)GrpDelete.push_back(id);
250256
res << printChat(grp) + "" + printQQ(eachQQ);
@@ -278,6 +284,7 @@ void clear_group(DiceJob& job) {
278284
res << printChat(grp);
279285
grp.leave(getMsg("strPreserve"));
280286
intCnt++;
287+
if (console["GroupClearLimit"] > 0 && intCnt >= console["GroupClearLimit"])break;
281288
this_thread::sleep_for(3s);
282289
}
283290
job.note(GlobalMsg["strSelfName"] + "筛除无许可群聊" + to_string(intCnt) + "个:" + res.show(), 1);

0 commit comments

Comments
 (0)