From 7f040d5b1230778a660ab4b45d9ea0436fe8a72c Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 28 Aug 2018 17:03:11 +0000 Subject: [PATCH] Set NSFW to false in DM --- commands/search/google.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/search/google.js b/commands/search/google.js index 4a6d5ac2..4bbd6a7f 100644 --- a/commands/search/google.js +++ b/commands/search/google.js @@ -28,11 +28,12 @@ module.exports = class GoogleCommand extends Command { async run(msg, { query }) { let href; + const nsfw = msg.channel.nsfw || false; try { - href = await this.searchGoogle(query, msg.channel.nsfw); + href = await this.searchGoogle(query, nsfw); } catch (err) { try { - href = await this.customSearch(query, msg.channel.nsfw); + href = await this.customSearch(query, nsfw); } catch (err) { href = `http://lmgtfy.com/?iie=1&q=${encodeURIComponent(query)}`; }