Add error handling for getDMChannel
parent
c306479d8a
commit
26c468d5fb
|
@ -183,10 +183,15 @@ if(config.typingProxy || config.typingProxyReverse) {
|
|||
else if(config.typingProxyReverse && (channel instanceof Eris.GuildChannel) && ! user.bot) {
|
||||
thread = await threads.getByChannelId(channel.id);
|
||||
if (! thread) return;
|
||||
try {
|
||||
let dm;
|
||||
dm = await bot.getDMChannel(thread.userId);
|
||||
bot.sendChannelTyping(dm.id);
|
||||
}
|
||||
catch(error) {
|
||||
console.log("An error occured when trying to type in DM.");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue