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

Method initDB

goodnight/goodnight.ts:59–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57
58 // 初始化数据库
59 private async initDB() {
60 // 规范路径 assets/goodnight/data.json(历史 greeting/ 自动迁移)
61 const dbPath = resolvePluginAssetFile({
62 plugin: "goodnight",
63 fileName: "data.json",
64 legacyDirs: ["greeting"],
65 legacyFiles: [{ dir: "greeting", fileName: "data.json" }],
66 });
67
68 // 设置默认值
69 this.db = await JSONFilePreset<DBData>(dbPath, { groups: {} });

Callers 4

setupMethod · 0.95
handleCommandMethod · 0.95
GreetingPluginClass · 0.95
processGreetingMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected