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

Function forwardPreview

quote/quote.ts:1190–1209  ·  view source on GitHub ↗
(msg: Api.Message)

Source from the content-addressed store, hash-verified

1188 return canvas;
1189 } catch (_) {
1190 return undefined;
1191 }
1192}
1193
1194function collectAnimatedEmojiIds(messages: any[]): string[] {
1195 const ids = new Set<string>();
1196 const scanEntity = (entity: any) => {
1197 const id = entity?.custom_emoji_id;
1198 if (id && animatedCustomEmojiCache.get(String(id))) ids.add(String(id));
1199 };
1200 const scanMessage = (message: any) => {
1201 if (!message) return;
1202 (message.entities || []).forEach(scanEntity);
1203 (message.caption_entities || []).forEach(scanEntity);
1204 // Do not let sender emoji_status alone turn a pure-text quote into animated WebM.
1205 // It is already rendered from customEmojiCache as a static first frame.
1206 if (message.replyMessage) scanMessage(message.replyMessage);
1207 if (message.forward) scanMessage(message.forward);
1208 };
1209 messages.forEach(scanMessage);
1210 return Array.from(ids);
1211}
1212

Callers

nothing calls this directly

Calls 4

forwardedSourceFunction · 0.85
downloadEntityAvatarFunction · 0.85
peerIdNumberFunction · 0.85
emojiStatusPayloadFunction · 0.85

Tested by

no test coverage detected