From 555dc536ce74a4e699d32d02895bf22154ca3300 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sat, 18 Jun 2022 14:23:32 +0300 Subject: [PATCH] bugfix --- .../components/commands/administration/Import.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/structure/components/commands/administration/Import.js b/src/structure/components/commands/administration/Import.js index 2b50c1e..eb8918f 100644 --- a/src/structure/components/commands/administration/Import.js +++ b/src/structure/components/commands/administration/Import.js @@ -51,18 +51,18 @@ class ImportCommand extends SlashCommand { async execute(invoker, { version, overwrite }) { const { subcommand, guild } = invoker; - let settings = await guild.settings(); - if (!settings._imported) settings._imported = {}; - if (settings._imported[subcommand.name]) return { emoji: 'failure', index: 'COMMAND_IMPORT_IMPORTED', params: { thing: Util.capitalise(subcommand.name) } }; + const data = await guild.fetchData(); + if (!data._imported) data._imported = {}; + if (data._imported[subcommand.name]) return { emoji: 'failure', index: 'COMMAND_IMPORT_IMPORTED', params: { thing: Util.capitalise(subcommand.name) } }; version = version?.value || '3'; await invoker.reply({ index: 'COMMAND_IMPORT_WORKING', emoji: 'loading' }); 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; - if (!settings.imported) settings.imported = {}; - settings.imported[subcommand.name] = true; + // if (!settings.imported) settings.imported = {}; + data._imported[subcommand.name] = true; + await guild.updateData({ _imported: data._imported }); result._edit = true; return result;