Update gdrivesync command to error if JSON parsing fails #143
1 changed files with 10 additions and 4 deletions
|
@ -34,12 +34,18 @@ export default class Gdrivesync extends Command {
|
||||||
await interaction.editReply(`Error while running sync command. Safe Mode has been activated. Code: ${error.code}`);
|
await interaction.editReply(`Error while running sync command. Safe Mode has been activated. Code: ${error.code}`);
|
||||||
await Config.SetValue("safemode", "true");
|
await Config.SetValue("safemode", "true");
|
||||||
} else {
|
} else {
|
||||||
await CardMetadataFunction.Execute();
|
const result = await CardMetadataFunction.Execute();
|
||||||
|
|
||||||
|
if (result) {
|
||||||
await interaction.editReply("Synced successfully.");
|
await interaction.editReply("Synced successfully.");
|
||||||
|
|
||||||
CoreClient.AllowDrops = true;
|
CoreClient.AllowDrops = true;
|
||||||
await Config.SetValue("safemode", "false");
|
await Config.SetValue("safemode", "false");
|
||||||
|
} else {
|
||||||
|
const safemode = await Config.GetValue("safemode");
|
||||||
|
|
||||||
|
await interaction.editReply(`Sync failed. ${safemode == "true" ? "(Safe Mode is on)": "(Safe Mode is off)"}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue