This commit is contained in:
2026-01-16 00:32:23 +08:00
parent 7e8c3784c1
commit 64707768f8
4 changed files with 273 additions and 20 deletions

View File

@@ -61,19 +61,19 @@ class ProgressTracker:
bar = make_progress_bar(self.current, self.total, 12)
lines = [
f"<b>Processing: {self.team_name}</b>",
f"<b>正在处理: {self.team_name}</b>",
"",
f"Progress: {bar}",
f"Accounts: {self.current}/{self.total}",
f"Success: {self.success} | Failed: {self.failed}",
f"进度: {bar}",
f"账号: {self.current}/{self.total}",
f"成功: {self.success} | 失败: {self.failed}",
]
if self.current_account:
lines.append("")
lines.append(f"Current: <code>{self.current_account}</code>")
lines.append(f"当前: <code>{self.current_account}</code>")
if self.current_step:
lines.append(f"Step: {self.current_step}")
lines.append(f"步骤: {self.current_step}")
return "\n".join(lines)
@@ -145,7 +145,7 @@ class ProgressTracker:
def finish(self):
"""完成进度跟踪,发送最终状态"""
self.current_step = "Completed!"
self.current_step = "已完成!"
if self._loop:
asyncio.run_coroutine_threadsafe(self._update_messages(), self._loop)
@@ -253,25 +253,25 @@ class BotNotifier:
async def notify_task_started(self, team_name: str):
"""通知任务开始"""
await self.notify(f"<b>Task Started</b>\nTeam: {team_name}")
await self.notify(f"<b>🚀 任务开始</b>\nTeam: {team_name}")
async def notify_task_completed(self, team_name: str, success: int, failed: int):
"""通知任务完成"""
if not TELEGRAM_NOTIFY_ON_COMPLETE:
return
status = "All Success" if failed == 0 else f"{failed} Failed"
status = "全部成功" if failed == 0 else f"{failed} 个失败"
await self.notify(
f"<b>Task Completed</b>\n"
f"<b>✅ 任务完成</b>\n"
f"Team: {team_name}\n"
f"Success: {success}\n"
f"Status: {status}"
f"成功: {success}\n"
f"状态: {status}"
)
async def notify_error(self, message: str, details: str = ""):
"""通知错误"""
if not TELEGRAM_NOTIFY_ON_ERROR:
return
text = f"<b>Error</b>\n{message}"
text = f"<b>❌ 错误</b>\n{message}"
if details:
text += f"\n<code>{details[:500]}</code>"
await self.notify(text)