From f61df82de7cef70ceded23ebe37eab071bd90477 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 28 Feb 2021 15:02:01 -0500 Subject: [PATCH] Fix --- Xiao.js | 8 ++++---- util/Util.js | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) 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;