(key: string, defaultValue?: string)
| 47 | this.initialized = true; |
| 48 | } catch (error) { |
| 49 | console.error("[sticker] 初始化配置失败:", error); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | static async get(key: string, defaultValue?: string): Promise<string> { |
| 54 | await this.init(); |
| 55 | if (!this.db) return defaultValue || DEFAULT_CONFIG[key] || ""; |
| 56 | |
| 57 | // 直接从顶级键读取 |
| 58 | const value = this.db.data[key]; |
| 59 | return value ?? defaultValue ?? DEFAULT_CONFIG[key] ?? ""; |
no test coverage detected