can use the random thingy on tag

This commit is contained in:
Supositware 2019-02-08 19:06:29 +01:00
parent d66fef2b55
commit 8f95a637f5

View file

@ -2,6 +2,7 @@ const { Listener } = require('discord-akairo');
const responseObject = require('../../json/reply.json'); const responseObject = require('../../json/reply.json');
const reactObject = require('../../json/react.json'); const reactObject = require('../../json/react.json');
const imgResponseObject = require('../../json/imgreply.json'); const imgResponseObject = require('../../json/imgreply.json');
const rand = require('../../rand.js');
const reload = require('auto-reload'); const reload = require('auto-reload');
class messageListener extends Listener { class messageListener extends Listener {
@ -42,7 +43,9 @@ class messageListener extends Listener {
// User autoresponse // User autoresponse
let customresponse = reload(`../../tag/${message.guild.id}.json`); let customresponse = reload(`../../tag/${message.guild.id}.json`);
if(customresponse[message_content]) { if(customresponse[message_content]) {
message.channel.send(customresponse[message_content]); let text = customresponse[message_content];
text = rand.random(text, message);
message.channel.send(text);
} }
} }
} }