From d589deac76ecfd5d9d417e83e1fac023dbc319cc Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Thu, 7 Jul 2022 21:15:00 +0300 Subject: [PATCH] bugfix --- src/utilities/SettingsMigrator.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utilities/SettingsMigrator.js b/src/utilities/SettingsMigrator.js index 8a400d5..fd60f55 100644 --- a/src/utilities/SettingsMigrator.js +++ b/src/utilities/SettingsMigrator.js @@ -62,13 +62,13 @@ class SettingsMigrator { } const filter = { [idIdentifier]: this.guild }; - const settings = await this.mongo.findOne(collection, filter); - if (!settings) return Promise.reject(new Error('No old settings found')); + const data = await this.mongo.findOne(collection, filter); + if (!data) return Promise.reject(new Error('No old settings found')); // const { _version } = settings; // if (!_version) return Promise.reject(new Error('Unable to determine configuration version')); - const translated = this[version](settings.settings || settings); + const translated = this[version](data.settings || data); let webhook = null, permissions = null; @@ -78,8 +78,8 @@ class SettingsMigrator { if(webhook) delete webhook._id; if(permissions) delete permissions._id; } else if (version === '2') { - ({ webhook = null } = settings.chatlogs || {}); - const resolved = this.permissions(settings.roles); + ({ webhook = null } = data.settings.chatlogs || {}); + const resolved = this.permissions(data.settings.roles); ({ permissions } = resolved); const { overrideRoles } = resolved;