diff --git a/src/modules/close.js b/src/modules/close.js index 58f5378..0ba7263 100644 --- a/src/modules/close.js +++ b/src/modules/close.js @@ -14,7 +14,7 @@ module.exports = bot => { async function applyScheduledCloses() { const threadsToBeClosed = await threads.getThreadsThatShouldBeClosed(); for (const thread of threadsToBeClosed) { - if(config.closeMessage) await thread.postToUser(config.closeMessage); + if(config.closeMessage) await thread.postToUser(config.closeMessage).catch(() => {}); await thread.close(); const logUrl = await thread.getLogUrl(); @@ -68,7 +68,7 @@ module.exports = bot => { } // Regular close - if(config.closeMessage) await thread.postToUser(config.closeMessage); + if(config.closeMessage) await thread.postToUser(config.closeMessage).catch(() => {}); await thread.close(); const logUrl = await thread.getLogUrl(); @@ -86,7 +86,7 @@ module.exports = bot => { if (! thread) return; console.log(`[INFO] Auto-closing thread with ${thread.user_name} because the channel was deleted`); - if(config.closeMessage) await thread.postToUser(config.closeMessage); + if(config.closeMessage) await thread.postToUser(config.closeMessage).catch(() => {}); await thread.close(true); const logUrl = await thread.getLogUrl();