MCPcopy Index your code
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 if (consecutiveErrors > 0) delay = delay * (1 + consecutiveErrors * 0.5);
531
532 return Math.min(delay, 5000);
533 }
534
535 private async updateBlockedProgress(msg: Api.Message, processed: number, total: number,
536 success: number, failed: number, skipped: number, includeAll: boolean): Promise<void> {
537 try {
538 const percentage = total > 0 ? Math.round((processed / total) * 100) : 0;
539 const progressBar = '█'.repeat(Math.round((percentage / 100) * 20)) + '░'.repeat(20 - Math.round((percentage / 100) * 20));
540
541 const progressText = `🧹 <b>清理拉黑用户进行中</b>
542
543📊 <b>进度:</b> ${percentage}% (${processed}/${total})
544${progressBar}
545
546📈 <b>统计:</b>
547• ✅ 成功: ${success}
548• ❌ 失败: ${failed}
549• ⏭️ 跳过: ${skipped}
550
551⚙️ <b>模式:</b> ${includeAll ? '全量清理' : '智能清理'}
552
553⏱️ <b>剩余时间:</b> ${this.estimateRemainingTime(processed, total, Date.now() - this.blockedCleanupStartTime)}`;
554
555 await this.editMessage(msg, progressText);
556 } catch (e) {
557 // 忽略编辑错误
558 }
559 }

Callers 1

cleanBlockedPMMethod · 0.95

Calls 2

estimateRemainingTimeMethod · 0.95
editMessageMethod · 0.95

Tested by

no test coverage detected