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

Method get

aitc/aitc.ts:77–90  ·  view source on GitHub ↗
(key: string, fallback?: string)

Source from the content-addressed store, hash-verified

75 throw error;
76 }
77 }
78
79 static get(key: string, fallback?: string): string {
80 this.ensureInit();
81 try {
82 const stmt = this.db!.prepare("SELECT value FROM config WHERE key = ?");
83 const row = stmt.get(key) as { value: string } | undefined;
84 if (row && typeof row.value === "string") {
85 return row.value;
86 }
87 } catch (error) {
88 console.error("aitc plugin failed to read config", error);
89 }
90 if (fallback !== undefined) return fallback;
91 return DEFAULT_CONFIG[key] ?? "";
92 }
93

Callers 3

getPromptMapMethod · 0.95
getHandlerMethod · 0.45
handleAitcCommandFunction · 0.45

Calls 2

ensureInitMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected