MCPcopy Create free account
hub / github.com/Xchristech2/Zenitsu-Bot / readFromFile

Function readFromFile

lib/lightweight_store.js:22–36  ·  view source on GitHub ↗
(filePath = STORE_FILE)

Source from the content-addressed store, hash-verified

20 chats: {},
21
22 readFromFile(filePath = STORE_FILE) {
23 try {
24 if (fs.existsSync(filePath)) {
25 const data = JSON.parse(fs.readFileSync(filePath, 'utf-8'))
26 this.contacts = data.contacts || {}
27 this.chats = data.chats || {}
28 this.messages = data.messages || {}
29
30 // Clean up any existing data to match new format
31 this.cleanupData()
32 }
33 } catch (e) {
34 console.warn('Failed to read store file:', e.message)
35 }
36 },
37
38 writeToFile(filePath = STORE_FILE) {
39 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected