fix config not saving

This commit is contained in:
Jonny_Bro (Nikita) 2024-07-13 14:59:12 +05:00
parent 62e8c7a244
commit 511976a239
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8
3 changed files with 8 additions and 4 deletions

View file

@ -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({

View file

@ -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", {

View file

@ -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", {