From 376f2d75ac5098e5c68f42b1ae4de538f1c31fe1 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 25 Apr 2022 15:44:35 +0300 Subject: [PATCH] import command --- src/localization/en_gb/commands/en_gb_administration.lang | 5 ++++- src/structure/components/commands/administration/Import.js | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/localization/en_gb/commands/en_gb_administration.lang b/src/localization/en_gb/commands/en_gb_administration.lang index 3cb0860..27e5801 100644 --- a/src/localization/en_gb/commands/en_gb_administration.lang +++ b/src/localization/en_gb/commands/en_gb_administration.lang @@ -89,4 +89,7 @@ Import configuration and data from old versions of the bot. [COMMAND_IMPORT_ERROR] Error during import, contact a developer about this issue: -{message} \ No newline at end of file +{message} + +[COMMAND_IMPORT_SUCCESS] +Successfully imported settings! \ No newline at end of file diff --git a/src/structure/components/commands/administration/Import.js b/src/structure/components/commands/administration/Import.js index 4858e89..fb258f3 100644 --- a/src/structure/components/commands/administration/Import.js +++ b/src/structure/components/commands/administration/Import.js @@ -49,6 +49,7 @@ class ImportCommand extends SlashCommand { database: dbs[version], // Default to v3 version }); + await migrator.connect(); let imported = null; try { @@ -56,8 +57,9 @@ class ImportCommand extends SlashCommand { } catch (err) { return { index: 'COMMAND_IMPORT_ERROR', params: { message: err.message }, emoji: 'failure' }; } - console.log(imported); - console.log(settings); + + await guild.updateSettings(imported); + return { index: 'COMMAND_IMPORT_SUCCESS', emoji: 'success' }; } }