MCPcopy
hub / github.com/stephengpope/thepopebot / getConfigValue

Function getConfigValue

lib/db/config.js:17–26  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

15 * @returns {string|null}
16 */
17export function getConfigValue(key) {
18 const db = getDb();
19 const row = db
20 .select()
21 .from(settings)
22 .where(and(eq(settings.type, 'config'), eq(settings.key, key)))
23 .get();
24 if (!row) return null;
25 return JSON.parse(row.value);
26}
27
28/**
29 * Set a plain config value (upsert: delete + insert).

Callers 5

getConfigFunction · 0.90
getGeneralSettingsFunction · 0.85
getTelegramStatusFunction · 0.85
registerTelegramWebhookFunction · 0.85
getChatSettingsFunction · 0.85

Calls 2

getDbFunction · 0.90
parseMethod · 0.80

Tested by

no test coverage detected