bugfix
This commit is contained in:
parent
ea082e5f51
commit
d589deac76
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user