diff --git a/src/structure/components/commands/administration/Import.js b/src/structure/components/commands/administration/Import.js index 88876f7..c4fce86 100644 --- a/src/structure/components/commands/administration/Import.js +++ b/src/structure/components/commands/administration/Import.js @@ -56,7 +56,7 @@ class ImportCommand extends SlashCommand { version = version?.value || '3'; await invoker.reply({ index: 'COMMAND_IMPORT_WORKING', emoji: 'loading' }); - const result = await this[subcommand.name](guild, version, overwrite.value); + const result = await this[subcommand.name](guild, version, overwrite?.value); // This looks ridiculous but it's to keep track of what's been imported settings = guild._settings; @@ -72,7 +72,7 @@ class ImportCommand extends SlashCommand { const migrator = new InfractionMigrator(this.client, guild, { host: version === '2' ? MONGODB_V2_HOST : MONGODB_HOST, - username: MONGODB_USERNAME, + username: version === '2' ? null : MONGODB_USERNAME, password: MONGODB_PASSWORD, database: dbs[version], // Default to v3 version @@ -113,7 +113,7 @@ class ImportCommand extends SlashCommand { // const { MONGODB_HOST, MONGODB_USERNAME, MONGODB_PASSWORD } = process.env; const migrator = new SettingsMigrator(this.client, guild, { host: version === '2' ? MONGODB_V2_HOST : MONGODB_HOST, - username: MONGODB_USERNAME, + username: version === '2' ? null : MONGODB_USERNAME, password: MONGODB_PASSWORD, database: dbs[version], // Default to v3 version