error check, if yes remove hello and goodbye

main
kry008 2024-06-16 11:16:56 +02:00
parent ecaf3810d6
commit d7ef54efee
2 changed files with 12 additions and 2 deletions

View File

@ -49,7 +49,13 @@ module.exports = {
console.error("Welcome channel not found."); console.error("Welcome channel not found.");
} }
}) })
.catch(console.error); .catch(
//if the channel is not found, set the welcome channel to null and hello to false
data.helloChannel = null,
data.hello = false,
fs.writeFileSync(filePath, JSON.stringify(data))
);
} else { } else {
return; return;
} }

View File

@ -32,7 +32,11 @@ module.exports = {
console.error("Goodbye channel not found."); console.error("Goodbye channel not found.");
} }
}) })
.catch(console.error); .catch(
data.goodbyeChannel = null,
data.goodbye = false,
fs.writeFileSync(filePath, JSON.stringify(data))
);
} }
else else
{ {