From 1fc32f71d0813a3f94d994d718eac48691e843dd Mon Sep 17 00:00:00 2001 From: Dragory Date: Sat, 21 Apr 2018 14:31:58 +0300 Subject: [PATCH] Fix #67: errors from privacy settings are now ignored with greetings --- src/modules/greeting.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/greeting.js b/src/modules/greeting.js index 879310e..4f1f822 100644 --- a/src/modules/greeting.js +++ b/src/modules/greeting.js @@ -13,7 +13,12 @@ module.exports = bot => { function sendGreeting(file) { bot.getDMChannel(member.id).then(channel => { if (! channel) return; - channel.createMessage(config.greetingMessage || '', file); + + channel.createMessage(config.greetingMessage || '', file) + .catch(e => { + if (e.code === 50007) return; + throw e; + }); }); }