| 364 | const id = args[1]; |
| 365 | if (!id) return void (await this.edit(msg, `❌ 请指定目标ID:${PREFIX}checkin test [ID]`)); |
| 366 | const t = conf.targets.find((x) => x.id === id); |
| 367 | if (!t) return void (await this.edit(msg, `❌ 未找到目标: ${id}`)); |
| 368 | await this.edit(msg, `🚀 开始测试签到目标: ${this.escape(t.name)}...`); |
| 369 | const r = await this.runSingleSign(t); |
| 370 | await this.edit(msg, r.success ? `✅ <b>${this.escape(t.name)}</b> 测试成功\n\n结果: ${this.escape(r.message || "无")}` : `❌ <b>${this.escape(t.name)}</b> 测试失败\n\n错误: ${this.escape(r.error || "未知错误")}`); |
| 371 | return; |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | private async handleConfigCommand(action: string, args: string[], msg: Api.Message): Promise<void> { |
| 376 | const conf = this.cfg.get(); |
| 377 | |
| 378 | if (action === "settings" || action === "config" || action === "info") { |
| 379 | const enabled = conf.targets.filter((t) => t.enabled).length; |
| 380 | const timeRange = conf.runTimeEnd ? `${conf.runTime} ~ ${conf.runTimeEnd}` : conf.runTime; |
| 381 | const timeMode = conf.runTimeEnd ? "🔄 在设定时间段内随机执行" : "📌 按固定时间执行"; |
| 382 | |
| 383 | await this.edit( |
| 384 | msg, |
| 385 | `⚙️ <b>CheckIn 配置信息</b>\n\n` + |
| 386 | `${timeMode}\n` + |
| 387 | `⏰ 执行时间: ${this.escape(timeRange)}\n` + |
| 388 | `🎲 额外随机延迟: ${conf.randomDelay} 分钟\n` + |
| 389 | `🤖 Bot 通知: ${conf.botToken ? "已配置" : "未配置"}\n` + |
| 390 | `📱 通知目标: ${this.escape(conf.pushChatId || "未设置")}\n` + |
| 391 | `📅 最近执行日期: ${this.escape(conf.lastRunDate || "无")}\n` + |
| 392 | `🎯 已启用目标: ${enabled}/${conf.targets.length}` |
| 393 | ); |
| 394 | return; |