(msg: Api.Message, text: string)
| 475 | |
| 476 | // 工具函数 |
| 477 | private async editMessage(msg: Api.Message, text: string): Promise<void> { |
| 478 | try { |
| 479 | await msg.edit({ text, parseMode: "html" }); |
| 480 | } catch (error) { |
| 481 | console.error("编辑消息失败:", error); |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | private async sendError(msg: Api.Message, errorMsg: string): Promise<void> { |
| 486 | await this.editMessage(msg, `❌ <b>错误:</b> ${htmlEscape(errorMsg)}`); |
no test coverage detected