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

Function set

pmcaptcha/pmcaptcha.ts:256–267  ·  view source on GitHub ↗
(key: string, value: any)

Source from the content-addressed store, hash-verified

254 return v !== undefined ? v : def;
255}
256
257function set(key: string, value: any) {
258 if (!dbReady) return;
259 if (key in DEFAULT_DATA) {
260 if (!dataDb) return;
261 dataDb.data[key] = value;
262 dataDb.write().catch(e => log(LogLevel.ERROR, `data write failed: ${key}`, e));
263 } else {
264 if (!configDb) return;
265 configDb.data[key] = value;
266 configDb.write().catch(e => log(LogLevel.ERROR, `config write failed: ${key}`, e));
267 }
268}
269
270const cfg = {

Callers 2

pmcaptcha.tsFile · 0.85
pmcaptchaFunction · 0.85

Calls 2

logFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected