(msg: Api.Message, param?: string)
| 276 | await msg.edit({ |
| 277 | text: `❌ <b>请指定要删除的序号</b>\n💡 例如:<code>${mainPrefix}aff remove 1</code>`, |
| 278 | parseMode: "html" |
| 279 | }); |
| 280 | return; |
| 281 | } |
| 282 | |
| 283 | const index = parseInt(param); |
| 284 | if (isNaN(index)) { |
| 285 | await msg.edit({ |
| 286 | text: "❌ <b>无效的序号</b>", |
| 287 | parseMode: "html" |
| 288 | }); |
| 289 | return; |
| 290 | } |
| 291 | |
| 292 | const success = await this.removeAff(index - 1); |
| 293 | |
| 294 | if (success) { |
| 295 | await msg.edit({ |
| 296 | text: `✅ <b>已删除序号 ${index} 的Aff信息</b>`, |
| 297 | parseMode: "html" |
| 298 | }); |
| 299 | } else { |
| 300 | await msg.edit({ |
| 301 | text: `❌ <b>删除失败:找不到序号 ${index}</b>`, |
| 302 | parseMode: "html" |
| 303 | }); |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | // 错误处理 |
| 308 | private async handleError(msg: Api.Message, error: any): Promise<void> { |
| 309 | console.error(`[${this.PLUGIN_NAME}] Error:`, error); |
| 310 | |
| 311 | const errorMsg = htmlEscape(error?.message || String(error) || "未知错误"); |
| 312 |
no test coverage detected