MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / updateBlockedProgress

Method updateBlockedProgress

clean/clean.ts:532–556  ·  view source on GitHub ↗
(msg: Api.Message, processed: number, total: number, 
                                    success: number, failed: number, skipped: number, includeAll: boolean)

Source from the content-addressed store, hash-verified

530
531 let errorMsg = `❌ <b>操作失败:</b> ${htmlEscape(error.message || "未知错误")}`;
532
533 if (error.message?.includes("FLOOD_WAIT")) {
534 const waitTime = parseInt(error.message.match(/\d+/)?.[0] || "60");
535 errorMsg = `⏳ <b>请求过于频繁</b>\n\n需要等待 ${waitTime} 秒后重试`;
536 } else if (error.message?.includes("CHAT_ADMIN_REQUIRED")) {
537 errorMsg = "🔒 <b>权限不足</b>\n\n需要管理员权限";
538 } else if (error.message?.includes("USER_NOT_PARTICIPANT")) {
539 errorMsg = "❌ <b>未加入群组</b>\n\n机器人需要先加入群组";
540 }
541
542 await this.editMessage(msg, errorMsg);
543 }
544
545 private async handleFloodWait(msg: Api.Message, error: any): Promise<void> {
546 const waitTime = parseInt(error.message.match(/\d+/)?.[0] || "60");
547 await this.editMessage(msg, `⏳ 需要等待 ${waitTime} 秒后继续`);
548 await sleep((waitTime + 1) * 1000);
549 }
550
551 private async safeDelete(msg: Api.Message): Promise<void> {
552 try {
553 await msg.delete({ revoke: true });
554 } catch (error) {
555 // 忽略删除错误
556 }
557 }
558
559 private getDynamicDelay(user: any, includeAll: boolean, consecutiveErrors: number): number {

Callers 1

cleanBlockedPMMethod · 0.95

Calls 2

estimateRemainingTimeMethod · 0.95
editMessageMethod · 0.95

Tested by

no test coverage detected