diff --git a/events/newMember.js b/events/newMember.js index 384b18c..5b2236d 100644 --- a/events/newMember.js +++ b/events/newMember.js @@ -49,7 +49,13 @@ module.exports = { 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 { return; } diff --git a/events/removeMember.js b/events/removeMember.js index 5cc9056..27dc88b 100644 --- a/events/removeMember.js +++ b/events/removeMember.js @@ -32,7 +32,11 @@ module.exports = { console.error("Goodbye channel not found."); } }) - .catch(console.error); + .catch( + data.goodbyeChannel = null, + data.goodbye = false, + fs.writeFileSync(filePath, JSON.stringify(data)) + ); } else {