From ec7d02c78ed8e354c860a2bcb68d397405a40598 Mon Sep 17 00:00:00 2001 From: Sin <50817549+8cy@users.noreply.github.com> Date: Sun, 16 Aug 2020 21:11:11 +0200 Subject: fix: only check tags if tag exists --- server/src/commands/nsfw/Danbooru.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/src') diff --git a/server/src/commands/nsfw/Danbooru.ts b/server/src/commands/nsfw/Danbooru.ts index 15e08fa..833371d 100644 --- a/server/src/commands/nsfw/Danbooru.ts +++ b/server/src/commands/nsfw/Danbooru.ts @@ -34,7 +34,7 @@ export default class DanbooruNSFW extends Command { //@ts-ignore if (!msg.channel.nsfw) return msg.reply('This is not an NSFW marked channel!'); - const tags = await tag.trim().toLowerCase(); + if (tag) const tags = await tag.trim().toLowerCase(); const denylist = ['loli', 'shota', 'cub', 'young', 'child', 'baby', 'guro', 'gore', 'vote', 'scat', 'poop', 'kid', 'kiddie', 'kiddy', 'cp', 'shit', 'turd', 'feces', 'excrement', 'excrete']; if (tags && denylist.includes(tags)) return msg.reply('A denylisted word was used! ⛔'); @@ -74,4 +74,4 @@ export default class DanbooruNSFW extends Command { .setFooter(`Score: ${response.data[randomInt].score} | Rating: ${getRating(response.data[randomInt].rating)}`, msg.author.avatarURL()); return msg.channel.send(embed); } -} \ No newline at end of file +} -- cgit v1.2.3