Skip to content

Commit

Permalink
Merge pull request #2 from martijnpoppen/main
Browse files Browse the repository at this point in the history
OPT: specify dir
  • Loading branch information
andresayac committed Jul 30, 2023
2 parents fc36c6c + 43f5029 commit 08149cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/baileys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export class BaileysClass extends EventEmitter {
super()
this.vendor = null;
this.store = null;
this.globalVendorArgs = { name: `bot`, gifPlayback: false, ...args };
this.NAME_DIR_SESSION = `${this.globalVendorArgs.name}_sessions`;
this.globalVendorArgs = { name: `bot`, gifPlayback: false, dir: './', ...args };
this.NAME_DIR_SESSION = `${this.globalVendorArgs.dir}${this.globalVendorArgs.name}_sessions`;
this.initBailey();

// is plugin?
Expand Down Expand Up @@ -99,9 +99,9 @@ export class BaileysClass extends EventEmitter {
if (this.globalVendorArgs.debug) console.log(`using WA v${version.join('.')}, isLatest: ${isLatest}`)

this.store = makeInMemoryStore({ logger })
this.store.readFromFile(`./${this.NAME_DIR_SESSION}/baileys_store.json`)
this.store.readFromFile(`${this.NAME_DIR_SESSION}/baileys_store.json`)
setInterval(() => {
this.store.writeToFile(`./${this.NAME_DIR_SESSION}/baileys_store.json`)
this.store.writeToFile(`${this.NAME_DIR_SESSION}/baileys_store.json`)
}, 10_000)

try {
Expand Down

0 comments on commit 08149cc

Please sign in to comment.