MCPcopy Index your code
hub / github.com/TeleBoxOrg/TeleBox_Plugins / editProgress

Function editProgress

quote/quote.ts:1311–1320  ·  view source on GitHub ↗
(msg: Api.Message, text: string)

Source from the content-addressed store, hash-verified

1309}
1310
1311async 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
1322export class QuotePlugin {
1323 description = "引用贴纸生成 (本地版)";

Callers 1

handleQuoteMethod · 0.85

Calls 3

withTimeoutFunction · 0.85
editMessageMethod · 0.80
editMethod · 0.45

Tested by

no test coverage detected