import * as fs from "node:fs"; import * as os from "node:os"; import * as path from "node:path"; import { debugLog } from "./log.js"; import {
getHomeDir,
getTempDir,
getQQBotDataDir,
getPlatform,
isWindows,
detectFfmpeg,
checkSilkWasmAvailable,
} from "./platform.js";
const ffmpegPath = await detectFfmpeg(); if (!ffmpegPath) {
warnings.push(
isWindows()
? "⚠️ ffmpeg is not installed. Audio/video conversion will be limited. Install it with choco install ffmpeg, scoop install ffmpeg, or from https://ffmpeg.org."
: getPlatform() === "darwin"
? "⚠️ ffmpeg is not installed. Audio/video conversion will be limited. Install it with brew install ffmpeg."
: "⚠️ ffmpeg is not installed. Audio/video conversion will be limited. Install it with sudo apt install ffmpeg or sudo yum install ffmpeg.",
);
}
const silkWasm = await checkSilkWasmAvailable(); if (!silkWasm) {
warnings.push( "⚠️ silk-wasm is unavailable. QQ voice send/receive will not work. Ensure Node.js >= 16 and WASM support are available.",
);
}
try { const testFile = path.join(dataDir, ".write-test");
fs.writeFileSync(testFile, "test");
fs.unlinkSync(testFile);
} catch {
warnings.push(`⚠️ Data directory is not writable: ${dataDir}. Check filesystem permissions.`);
}
if (isWindows()) { if (/[\u4e00-\u9fa5]/.test(homeDir) || homeDir.includes(" ")) {
warnings.push(
`⚠️ Home directory contains Chinese characters or spaces: ${homeDir}. Some tools may fail. Consider setting QQBOT_DATA_DIR to an ASCII-only path.`,
);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.