forked from Galactic/galactic-bot
v2 is no more
This commit is contained in:
parent
d73d1b4798
commit
63a8c79ec0
@ -5,8 +5,6 @@ const { FilterUtil, SettingsMigrator, InfractionMigrator } = require("../../../u
|
||||
const MemberWrapper = require("./MemberWrapper.js");
|
||||
const configVersion = '3.slash.2';
|
||||
|
||||
const { MONGODB_V2_HOST } = process.env;
|
||||
|
||||
class GuildWrapper {
|
||||
|
||||
constructor(client, guild) {
|
||||
@ -104,7 +102,8 @@ class GuildWrapper {
|
||||
title: this.format('GENERAL_REMINDER_TITLE'),
|
||||
description: reminder,
|
||||
color: EmbedDefaultColor
|
||||
}] });
|
||||
}]
|
||||
});
|
||||
await this.removeCallback(id);
|
||||
}
|
||||
|
||||
@ -155,16 +154,20 @@ class GuildWrapper {
|
||||
|
||||
const data = await this.fetchData();
|
||||
// eslint-disable-next-line prefer-const
|
||||
let { settings, _imported } = data;
|
||||
const {
|
||||
settings,
|
||||
// _imported
|
||||
} = data;
|
||||
const { defaultConfig } = this;
|
||||
|
||||
if (!settings && !_imported?.settings && !_imported?.modlogs && process.env.NODE_ENV === 'staging') {
|
||||
if (this._importPromise) settings = await this._importPromise;
|
||||
else {
|
||||
this._importPromise = this._attemptDataImport();
|
||||
settings = await this._importPromise;
|
||||
}
|
||||
}
|
||||
// V2 db server is no more, leaving this here if needed again
|
||||
// if (!settings && !_imported?.settings && !_imported?.modlogs && process.env.NODE_ENV === 'staging') {
|
||||
// if (this._importPromise) settings = await this._importPromise;
|
||||
// else {
|
||||
// this._importPromise = this._attemptDataImport();
|
||||
// settings = await this._importPromise;
|
||||
// }
|
||||
// }
|
||||
|
||||
if (settings) {
|
||||
// Ensure new settings properties are propagated to existing configs
|
||||
@ -221,7 +224,7 @@ class GuildWrapper {
|
||||
|
||||
async _attemptDataImport() {
|
||||
const migratorOptions = {
|
||||
host: MONGODB_V2_HOST,
|
||||
// host: MONGODB_V2_HOST,
|
||||
database: 'galacticbot',
|
||||
version: '2'
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user