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

Method get

outdated/gpt/gpt.ts:70–85  ·  view source on GitHub ↗
(key: string, defaultValue?: string)

Source from the content-addressed store, hash-verified

68 }
69
70 static get(key: string, defaultValue?: string): string {
71 this.init();
72
73 try {
74 const stmt = this.db.prepare("SELECT value FROM config WHERE key = ?");
75 const row = stmt.get(key) as { value: string } | undefined;
76
77 if (row) {
78 return row.value;
79 }
80 } catch (error) {
81 console.error("读取配置失败:", error);
82 }
83
84 return defaultValue || DEFAULT_CONFIG[key] || "";
85 }
86
87 static set(key: string, value: string): void {
88 this.init();

Callers 3

downloadAndProcessImageFunction · 0.45
callGptApiFunction · 0.45
handleGptRequestFunction · 0.45

Calls 2

initMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected