diff --git a/Xiao.js b/Xiao.js index fa031692..56e16994 100644 --- a/Xiao.js +++ b/Xiao.js @@ -163,11 +163,11 @@ client.on('message', async msg => { if (!call.adminCall && (msg.guild && (!msg.channel.topic || !msg.channel.topic.includes('')))) return; if (!call.active) return; if (call.adminCall && msg.guild.id === call.origin.guild.id && !client.isOwner(msg.author)) return; - // try { + try { await call.send(origin ? call.recipient : call.origin, msg, hasText, hasImage, hasEmbed); - //} catch { - // return; // eslint-disable-line no-useless-return - //} + } catch { + return; // eslint-disable-line no-useless-return + } }); client.on('guildCreate', async guild => { diff --git a/util/Util.js b/util/Util.js index 7d3ede40..8f32e347 100644 --- a/util/Util.js +++ b/util/Util.js @@ -207,6 +207,7 @@ module.exports = class Util { static stripNSFWURLs(str, siteList, text = '[redacted nsfw url]') { const uris = str.match(/(https?:\/\/\S+)/g); + if (!uris) return str; for (const uri of uris) { const parsed = url.parse(uri); if (!siteList.some(pornURL => parsed.host === pornURL)) continue;