This commit is contained in:
Loïc Bersier 2018-09-07 01:13:02 +02:00
parent 8bbd22088f
commit f4737f39a1
3 changed files with 10 additions and 7 deletions

View file

@ -1,7 +0,0 @@
module.exports = {
name: 'haha yes',
description: 'haha yes',
execute(message) {
message.channel.send('haha yes');
},
};

View file

@ -1,6 +1,7 @@
const fs = require('fs'); const fs = require('fs');
const Discord = require('discord.js'); const Discord = require('discord.js');
const { prefix, token } = require('./config.json'); const { prefix, token } = require('./config.json');
const responseObject = require("./reply.json");
const client = new Discord.Client(); const client = new Discord.Client();
client.commands = new Discord.Collection(); client.commands = new Discord.Collection();
@ -20,6 +21,11 @@ client.on('ready', () => {
}); });
client.on('message', message => { 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; if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/); const args = message.content.slice(prefix.length).split(/ +/);

4
reply.json Normal file
View file

@ -0,0 +1,4 @@
{
"haha yes": "haha yes",
"lol": "veri funi"
}