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

Method loadConfig

yvlu/yvlu.ts:534–558  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

532 return { width, height };
533 } else if (chunkHeader === "VP8X") {
534 // VP8X格式
535 const width = (imageBuffer.readUInt32LE(24) & 0xffffff) + 1;
536 const height = (imageBuffer.readUInt32LE(27) & 0xffffff) + 1;
537 return { width, height };
538 }
539
540 // 如果无法解析,返回默认尺寸
541 console.warn("Unknown WebP format, using default dimensions");
542 return { width: 512, height: 768 };
543 } catch (error) {
544 console.warn("Failed to parse WebP dimensions:", error);
545 return { width: 512, height: 768 };
546 }
547}
548
549const codeTag = (text: string): string => `<code>${htmlEscape(text)}</code>`;
550
551const getPeerNumericId = (peer?: Api.TypePeer): number | undefined => {
552 if (!peer) return undefined;
553 if (peer instanceof Api.PeerUser) return peer.userId;
554 if (peer instanceof Api.PeerChat) return -peer.chatId;
555 if (peer instanceof Api.PeerChannel) return -peer.channelId;
556 return undefined;
557};
558
559const resolveForwardSenderFromHeader = async (
560 forwardHeader: Api.MessageFwdHeader,
561 client: any,

Callers 3

onLoadMethod · 0.95
handleConfigCommandMethod · 0.95

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected