From f4737f39a16bab7f57a32c8b5e79fd42a0e41837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Fri, 7 Sep 2018 01:13:02 +0200 Subject: [PATCH] haha yes --- commands/yes.js | 7 ------- hahayesv2.js | 6 ++++++ reply.json | 4 ++++ 3 files changed, 10 insertions(+), 7 deletions(-) delete mode 100644 commands/yes.js create mode 100644 reply.json diff --git a/commands/yes.js b/commands/yes.js deleted file mode 100644 index ad18304b..00000000 --- a/commands/yes.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - name: 'haha yes', - description: 'haha yes', - execute(message) { - message.channel.send('haha yes'); - }, -}; diff --git a/hahayesv2.js b/hahayesv2.js index 5dea136b..cee613df 100644 --- a/hahayesv2.js +++ b/hahayesv2.js @@ -1,6 +1,7 @@ const fs = require('fs'); const Discord = require('discord.js'); const { prefix, token } = require('./config.json'); +const responseObject = require("./reply.json"); const client = new Discord.Client(); client.commands = new Discord.Collection(); @@ -20,6 +21,11 @@ client.on('ready', () => { }); client.on('message', message => { + // haha yes + if(responseObject[message.content]) { + message.channel.send(responseObject[message.content]); + } + if (!message.content.startsWith(prefix) || message.author.bot) return; const args = message.content.slice(prefix.length).split(/ +/); diff --git a/reply.json b/reply.json new file mode 100644 index 00000000..cd9d929f --- /dev/null +++ b/reply.json @@ -0,0 +1,4 @@ +{ + "haha yes": "haha yes", + "lol": "veri funi" +} \ No newline at end of file