From 2e43e5fa059e4360bd4538376f600544190d5e21 Mon Sep 17 00:00:00 2001 From: Alee Date: Sat, 24 Feb 2018 13:13:04 -0500 Subject: You can now interact to this bot! --- bot.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bot.js') diff --git a/bot.js b/bot.js index e73ff6d..65357f5 100644 --- a/bot.js +++ b/bot.js @@ -101,6 +101,18 @@ bot.on('messageDeleteBulk', (msgs) => { bot.on('message', (msg) => { parseCommand(msg); + + if (msg.mentions != null && msg.mentions.users != null) { + if (msg.mentions.users.has("416637860146446346")){ + if (msg.content.toLowerCase().includes("hello") || (msg.content.toLowerCase().includes("hi"))) { + msg.reply("Hi there."); + } else { + if (msg.content.toLowerCase().includes("shut") && msg.content.toLowerCase().includes("up")) { + msg.reply("Excuse me?") + } + } + } +} }); bot.on('messageUpdate', (oldMsg, newMsg) => { -- cgit v1.2.3 From f0eceb99aea5595c338fc130f14d0eff67c7c9f2 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 24 Feb 2018 13:17:30 -0500 Subject: eslint fix --- bot.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'bot.js') diff --git a/bot.js b/bot.js index 65357f5..ab11781 100644 --- a/bot.js +++ b/bot.js @@ -103,16 +103,14 @@ bot.on('message', (msg) => { parseCommand(msg); if (msg.mentions != null && msg.mentions.users != null) { - if (msg.mentions.users.has("416637860146446346")){ - if (msg.content.toLowerCase().includes("hello") || (msg.content.toLowerCase().includes("hi"))) { - msg.reply("Hi there."); - } else { - if (msg.content.toLowerCase().includes("shut") && msg.content.toLowerCase().includes("up")) { - msg.reply("Excuse me?") - } + if (msg.mentions.users.has('416637860146446346')) { + if (msg.content.toLowerCase().includes('hello') || (msg.content.toLowerCase().includes('hi'))) { + msg.reply('Hi there.'); + } else if (msg.content.toLowerCase().includes('shut') && msg.content.toLowerCase().includes('up')) { + msg.reply('Excuse me?'); } } -} + } }); bot.on('messageUpdate', (oldMsg, newMsg) => { -- cgit v1.2.3