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

Method init

outdated/gpt/gpt.ts:52–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51 // 初始化数据库
52 private static init(): void {
53 if (this.initialized) return;
54
55 try {
56 this.db = new Database(CONFIG_DB_PATH);
57 this.db.exec(`
58 CREATE TABLE IF NOT EXISTS config (
59 key TEXT PRIMARY KEY,
60 value TEXT NOT NULL,
61 updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
62 )
63 `);
64 this.initialized = true;
65 } catch (error) {
66 console.error("初始化配置数据库失败:", error);
67 }
68 }
69
70 static get(key: string, defaultValue?: string): string {
71 this.init();

Callers 4

getMethod · 0.95
setMethod · 0.95
getAllMethod · 0.95
deleteMethod · 0.95

Calls 2

execMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected