MCPcopy Create free account
hub / github.com/Epic0522/Codex-Remote-Contact / fetchOneBotImage

Function fetchOneBotImage

src/server.js:1272–1283  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

1270}
1271
1272async function fetchOneBotImage(file) {
1273 const response = await fetch(`${oneBotApiBase}/get_image`, {
1274 method: "POST",
1275 headers: { "content-type": "application/json" },
1276 body: JSON.stringify({ file: String(file || ""), download: true })
1277 });
1278 const body = await response.json().catch(() => ({}));
1279 if (!response.ok || (body.status != null && body.status !== "ok")) {
1280 throw new Error(`Unable to fetch QQ image ${file}`);
1281 }
1282 return body.data || body;
1283}
1284
1285function isMentionEvent(event) {
1286 const text = event.text ?? "";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected