From 3966da0303ac986b28f61406451e722015b4ebaa Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 25 Apr 2022 15:16:13 +0300 Subject: [PATCH] error messages --- .../en_gb/commands/en_gb_administration.lang | 9 ++++++++- .../components/commands/administration/Import.js | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/localization/en_gb/commands/en_gb_administration.lang b/src/localization/en_gb/commands/en_gb_administration.lang index 4d52daf..3cb0860 100644 --- a/src/localization/en_gb/commands/en_gb_administration.lang +++ b/src/localization/en_gb/commands/en_gb_administration.lang @@ -82,4 +82,11 @@ The commands `{alreadyDisabled}` were already disabled. // Settings [COMMAND_MODERATION_HELP] -Configure moderation related settings. \ No newline at end of file +Configure moderation related settings. + +[COMMAND_IMPORT_HELP] +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 diff --git a/src/structure/components/commands/administration/Import.js b/src/structure/components/commands/administration/Import.js index 6ac9b46..4858e89 100644 --- a/src/structure/components/commands/administration/Import.js +++ b/src/structure/components/commands/administration/Import.js @@ -50,7 +50,12 @@ class ImportCommand extends SlashCommand { version }); await migrator.connect(); - const imported = await migrator.migrate(); + let imported = null; + try { + imported = await migrator.migrate(); + } catch (err) { + return { index: 'COMMAND_IMPORT_ERROR', params: { message: err.message }, emoji: 'failure' }; + } console.log(imported); console.log(settings); }