catto.js 1.4.4 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/Bot.js +6 -6
  2. package/package.json +1 -1
package/Bot.js CHANGED
@@ -247,7 +247,7 @@ module.exports = class extends EventEmitter {
247
247
  }
248
248
  if (this.options.auditIndexation) {
249
249
  this.auditDatabase = {};
250
- for (var server of this.servers) {
250
+ for (var server of this.client.guilds.cache.values()) {
251
251
  if (!server.members.me.permissions.has(Discord.PermissionsBitField.Flags.VIEW_AUDIT_LOG)) {
252
252
  continue;
253
253
  }
@@ -262,7 +262,7 @@ module.exports = class extends EventEmitter {
262
262
  } catch {}
263
263
  }
264
264
  if (this.options.auditFile) {
265
- fs.writeFileSync(this.options.auditFile, JSON.stringify(this.auditDatabase, null, 2));
265
+ fs.writeFileSync(this.options.auditFile.replace("%", this.cluster ? this.cluster.id.toString() : "0"), JSON.stringify(this.auditDatabase, null, 2));
266
266
  }
267
267
  }
268
268
  this.emit("running", { Discord });
@@ -332,7 +332,7 @@ module.exports = class extends EventEmitter {
332
332
  }
333
333
  }
334
334
  if (this.options.auditFile) {
335
- fs.writeFileSync(this.options.auditFile, JSON.stringify(this.auditDatabase, null, 2));
335
+ fs.writeFileSync(this.options.auditFile.replace("%", this.cluster ? this.cluster.id.toString() : "0"), JSON.stringify(this.auditDatabase, null, 2));
336
336
  }
337
337
  if (!found) {
338
338
  message.deletedBy = message.author;
@@ -348,10 +348,10 @@ module.exports = class extends EventEmitter {
348
348
  });
349
349
  this.auditDatabase = {};
350
350
  if (this.options.auditFile) {
351
- if (!fs.existsSync(this.options.auditFile)) {
352
- fs.writeFileSync(this.options.auditFile, "{}");
351
+ if (!fs.existsSync(this.options.auditFile.replace("%", this.cluster ? this.cluster.id.toString() : "0"))) {
352
+ fs.writeFileSync(this.options.auditFile.replace("%", this.cluster ? this.cluster.id.toString() : "0"), "{}");
353
353
  }
354
- this.auditDatabase = JSON.parse(fs.readFileSync(this.options.auditFile).toString("utf-8"));
354
+ this.auditDatabase = JSON.parse(fs.readFileSync(this.options.auditFile.replace("%", this.cluster ? this.cluster.id.toString() : "0")).toString("utf-8"));
355
355
  }
356
356
  }
357
357
  get cluster() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catto.js",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "Universal module for everything.",
5
5
  "main": "index.js",
6
6
  "scripts": {