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) {
|
else if(config.typingProxyReverse && (channel instanceof Eris.GuildChannel) && ! user.bot) {
|
||||||
thread = await threads.getByChannelId(channel.id);
|
thread = await threads.getByChannelId(channel.id);
|
||||||
if (! thread) return;
|
if (! thread) return;
|
||||||
|
try {
|
||||||
let dm;
|
let dm;
|
||||||
dm = await bot.getDMChannel(thread.userId);
|
dm = await bot.getDMChannel(thread.userId);
|
||||||
bot.sendChannelTyping(dm.id);
|
bot.sendChannelTyping(dm.id);
|
||||||
}
|
}
|
||||||
|
catch(error) {
|
||||||
|
console.log("An error occured when trying to type in DM.");
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue