From 4f8e78cec22e3cc6792388df0d4dc39c0f1b4c52 Mon Sep 17 00:00:00 2001 From: Gideon Tong Date: Tue, 7 May 2019 17:23:04 -0700 Subject: [PATCH] Updated easter egg efficiency --- bot.js | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/bot.js b/bot.js index e0c83c0..d8e4b1e 100644 --- a/bot.js +++ b/bot.js @@ -13,28 +13,25 @@ bot.on("ready", function () { }) }); -/*bot.on('message', msg => { - if (msg.content.toLowerCase().includes('i love you')) { - msg.reply('i love paul too'); - } -}); - bot.on('message', msg => { - if (msg.content.toLowerCase().includes('paul is')) { + content = ""; + var attach; + if (msg.content.toLowerCase().includes('i love you')) { + if(msg.author.username == "pyu"){ + content += "LOVE YOU TOO :heart: :heart_eyes: :heartpulse:"; + } else { + content += "I love Paul, did you know that!?"; + } + } else if (msg.content.toLowerCase().includes('paul is')) { msg.reply('I don\'t have any time for any gossip now'); } -}); - -bot.on('message', msg => { if (msg.content.toLowerCase().includes('dress')) { attach = new Discord.Attachment("generates/dress.png") - msg.channel.send(attach) } -}); - -bot.on('message', msg => { - if (msg.content.toLowerCase().includes('nissan')) { + else if (msg.content.toLowerCase().includes('nissan')) { attach = new Discord.Attachment("generates/nissan.png") - msg.channel.send(attach) } -});*/ \ No newline at end of file + if(content.length > 0 || attach != null) { + msg.reply(content, file = attach); + } +}); \ No newline at end of file