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

Method set

sticker/sticker.ts:58–70  ·  view source on GitHub ↗
(key: string, value: string)

Source from the content-addressed store, hash-verified

56
57 // 直接从顶级键读取
58 const value = this.db.data[key];
59 return value ?? defaultValue ?? DEFAULT_CONFIG[key] ?? "";
60 }
61
62 static async set(key: string, value: string): Promise<boolean> {
63 await this.init();
64 if (!this.db) return false;
65
66 try {
67 this.db.data[key] = value;
68 await this.db.write();
69 return true;
70 } catch (error) {
71 console.error(`[sticker] 设置配置失败 ${key}:`, error);
72 return false;
73 }

Callers 1

handleConfigurationMethod · 0.45

Calls 3

initMethod · 0.95
writeMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected