(file)
| 1270 | } |
| 1271 | |
| 1272 | async 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 | |
| 1285 | function isMentionEvent(event) { |
| 1286 | const text = event.text ?? ""; |
nothing calls this directly
no outgoing calls
no test coverage detected