Add error handling if a channel could not be created

master
Miikka Virtanen 2016-12-30 17:10:20 +02:00
parent 15a1f78d47
commit 3f9a07c51e
1 changed files with 2 additions and 0 deletions

View File

@ -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;