From 3f9a07c51e0fd6d55f98bc00479507aaae43ef0e Mon Sep 17 00:00:00 2001 From: Miikka Virtanen Date: Fri, 30 Dec 2016 17:10:20 +0200 Subject: [PATCH] Add error handling if a channel could not be created --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 3727d4c..cea48c0 100644 --- a/index.js +++ b/index.js @@ -239,6 +239,8 @@ function getModmailChannel(user, allowCreate = true) { const topic = `MODMAIL|${user.id}|${user.username}#${user.discriminator}`; setTimeout(() => resolve(channel.edit({topic: topic})), 200); }); + }, err => { + console.error(`Error creating modmail channel for ${user.username}#${user.discriminator}!`); }) .then(channel => { modMailChannels[user.id] = channel.id;