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

Method init

im/im.ts:139–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137
138 static async init() {
139 if (this.db) return;
140 const dbPath = path.join(createDirectoryInAssets(PLUGIN_NAME), CONFIG_FILE);
141 this.db = await JSONFilePreset<Config>(dbPath, DEFAULT_CONFIG);
142 // 迁移与标准化
143 this.normalize();
144 }
145
146 static async getConfig(): Promise<Config> {
147 await this.init();
148 // 再次保证标准化(防止外部意外写入)

Callers 3

getConfigMethod · 0.95
saveConfigMethod · 0.95
initializeMethod · 0.45

Calls 1

normalizeMethod · 0.95

Tested by

no test coverage detected