From 511976a239394c76fe6db1f8d0c3612707aa8ff4 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Sat, 13 Jul 2024 14:59:12 +0500 Subject: [PATCH] fix config not saving --- commands/Administration/config.js | 4 ++++ commands/Administration/goodbye.js | 4 ++-- commands/Administration/welcome.js | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/commands/Administration/config.js b/commands/Administration/config.js index bb760b66..96b3c9d6 100644 --- a/commands/Administration/config.js +++ b/commands/Administration/config.js @@ -194,6 +194,7 @@ async function changeSetting(interaction, setting, state, channel) { if (!state) { data.plugins[settingSplitted[0]][settingSplitted[1]] = null; + data.markModified(setting); await data.save(); return interaction.reply({ @@ -206,6 +207,7 @@ async function changeSetting(interaction, setting, state, channel) { if (channel) { data.plugins[settingSplitted[0]][settingSplitted[1]] = channel.id; + data.markModified(setting); await data.save(); return interaction.reply({ @@ -224,6 +226,7 @@ async function changeSetting(interaction, setting, state, channel) { if (!state) { data.plugins[setting] = null; + data.markModified(setting); await data.save(); return interaction.reply({ @@ -234,6 +237,7 @@ async function changeSetting(interaction, setting, state, channel) { if (channel) { data.plugins[setting] = channel.id; + data.markModified(setting); await data.save(); return interaction.reply({ diff --git a/commands/Administration/goodbye.js b/commands/Administration/goodbye.js index cfc37923..ad8c8e64 100644 --- a/commands/Administration/goodbye.js +++ b/commands/Administration/goodbye.js @@ -103,7 +103,7 @@ class Goodbye extends BaseCommand { withImage: null, }; - await guildData.markModified("plugins.goodbye"); + guildData.markModified("plugins.goodbye"); await guildData.save(); interaction.success("administration/goodbye:DISABLED", null, { edit: true }); @@ -119,7 +119,7 @@ class Goodbye extends BaseCommand { withImage: image, }; - await guildData.markModified("plugins.goodbye"); + guildData.markModified("plugins.goodbye"); await guildData.save(); interaction.success("administration/goodbye:ENABLED", { diff --git a/commands/Administration/welcome.js b/commands/Administration/welcome.js index 56af2554..5ff4afe8 100644 --- a/commands/Administration/welcome.js +++ b/commands/Administration/welcome.js @@ -103,7 +103,7 @@ class Welcome extends BaseCommand { withImage: null, }; - await guildData.markModified("plugins.welcome"); + guildData.markModified("plugins.welcome"); await guildData.save(); interaction.success("administration/welcome:DISABLED", null); @@ -119,7 +119,7 @@ class Welcome extends BaseCommand { withImage: image, }; - await guildData.markModified("plugins.welcome"); + guildData.markModified("plugins.welcome"); await guildData.save(); interaction.success("administration/welcome:ENABLED", {