Add error handling if a channel could not be created
parent
15a1f78d47
commit
3f9a07c51e
2
index.js
2
index.js
|
@ -239,6 +239,8 @@ function getModmailChannel(user, allowCreate = true) {
|
||||||
const topic = `MODMAIL|${user.id}|${user.username}#${user.discriminator}`;
|
const topic = `MODMAIL|${user.id}|${user.username}#${user.discriminator}`;
|
||||||
setTimeout(() => resolve(channel.edit({topic: topic})), 200);
|
setTimeout(() => resolve(channel.edit({topic: topic})), 200);
|
||||||
});
|
});
|
||||||
|
}, err => {
|
||||||
|
console.error(`Error creating modmail channel for ${user.username}#${user.discriminator}!`);
|
||||||
})
|
})
|
||||||
.then(channel => {
|
.then(channel => {
|
||||||
modMailChannels[user.id] = channel.id;
|
modMailChannels[user.id] = channel.id;
|
||||||
|
|
Loading…
Reference in New Issue