import command

This commit is contained in:
Erik 2022-04-25 15:44:35 +03:00
parent bd8d5f1ca2
commit 376f2d75ac
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 8 additions and 3 deletions

View File

@ -89,4 +89,7 @@ Import configuration and data from old versions of the bot.
[COMMAND_IMPORT_ERROR] [COMMAND_IMPORT_ERROR]
Error during import, contact a developer about this issue: Error during import, contact a developer about this issue:
{message} {message}
[COMMAND_IMPORT_SUCCESS]
Successfully imported settings!

View File

@ -49,6 +49,7 @@ class ImportCommand extends SlashCommand {
database: dbs[version], // Default to v3 database: dbs[version], // Default to v3
version version
}); });
await migrator.connect(); await migrator.connect();
let imported = null; let imported = null;
try { try {
@ -56,8 +57,9 @@ class ImportCommand extends SlashCommand {
} catch (err) { } catch (err) {
return { index: 'COMMAND_IMPORT_ERROR', params: { message: err.message }, emoji: 'failure' }; 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' };
} }
} }