MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / replyPreview

Function replyPreview

quote/quote.ts:1174–1188  ·  view source on GitHub ↗
(msg: Api.Message, includeReply: boolean, args: QuoteArgs)

Source from the content-addressed store, hash-verified

1172 console.warn("quote animated frame extract failed", err?.message || err);
1173 return [];
1174 } finally {
1175 try { if (fs.existsSync(input)) fs.unlinkSync(input); } catch (_) {}
1176 try { if (fs.existsSync(dir)) fs.rmSync(dir, { recursive: true, force: true }); } catch (_) {}
1177 }
1178}
1179
1180async function bufferToCanvas(buffer: Buffer): Promise<any | undefined> {
1181 try {
1182 const { createCanvas, loadImage } = await getCanvas();
1183 const img = await loadImage(buffer);
1184 const canvas = createCanvas(img.width, img.height);
1185 const ctx = canvas.getContext("2d");
1186 ctx.clearRect(0, 0, canvas.width, canvas.height);
1187 ctx.drawImage(img, 0, 0);
1188 return canvas;
1189 } catch (_) {
1190 return undefined;
1191 }

Callers 1

toQuoteMessageFunction · 0.85

Calls 7

senderEntityFunction · 0.85
displayNameFunction · 0.85
senderIdNumberFunction · 0.85
emojiStatusPayloadFunction · 0.85
prepareQuoteMediaFunction · 0.85
messageTextFunction · 0.70
convertEntitiesFunction · 0.70

Tested by

no test coverage detected