(msg: Api.Message, text: string)
| 1309 | } |
| 1310 | |
| 1311 | async function editProgress(msg: Api.Message, text: string): Promise<void> { |
| 1312 | try { |
| 1313 | if (typeof (msg as any).edit === "function") await withTimeout((msg as any).edit({ text }), QUOTE_RPC_TIMEOUT_MS, "editProgress.edit"); |
| 1314 | else await withTimeout((msg as any).client?.editMessage?.((msg as any).chatId ?? (msg as any).peerId, { message: msg.id, text }), QUOTE_RPC_TIMEOUT_MS, "editProgress.editMessage"); |
| 1315 | } catch (_) { |
| 1316 | // Progress text is best-effort. If editing stalls (e.g. connection drop) or |
| 1317 | // fails, fall back to a reply but never let it block / hang the command. |
| 1318 | try { await withTimeout(msg.reply({ message: text } as any), QUOTE_RPC_TIMEOUT_MS, "editProgress.reply"); } catch (_) {} |
| 1319 | } |
| 1320 | } |
| 1321 | |
| 1322 | export class QuotePlugin { |
| 1323 | description = "引用贴纸生成 (本地版)"; |
no test coverage detected