|
|
@ -24,16 +24,16 @@ module.exports = class sayCommand extends Command {
|
|
|
|
if(blacklist[message.author.id])
|
|
|
|
if(blacklist[message.author.id])
|
|
|
|
return message.channel.send("You are blacklisted")
|
|
|
|
return message.channel.send("You are blacklisted")
|
|
|
|
|
|
|
|
|
|
|
|
let test = {}
|
|
|
|
let autoresponse = {}
|
|
|
|
let json = JSON.stringify(test)
|
|
|
|
let json = JSON.stringify(autoresponse)
|
|
|
|
|
|
|
|
|
|
|
|
fs.readFile('json/autoresponse.json', 'utf8', function readFileCallback(err, data){
|
|
|
|
fs.readFile('json/autoresponse.json', 'utf8', function readFileCallback(err, data){
|
|
|
|
if (err){
|
|
|
|
if (err){
|
|
|
|
console.log(err);
|
|
|
|
console.log(err);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
test = JSON.parse(data); //now it an object
|
|
|
|
autoresponse = JSON.parse(data); //now it an object
|
|
|
|
test [message.channel.id] = text
|
|
|
|
autoresponse [message.channel.id] = text
|
|
|
|
json = JSON.stringify(test); //convert it back to json
|
|
|
|
json = JSON.stringify(autoresponse); //convert it back to json
|
|
|
|
fs.writeFile('json/autoresponse.json', json, 'utf8', function(err) {
|
|
|
|
fs.writeFile('json/autoresponse.json', json, 'utf8', function(err) {
|
|
|
|
if(err) {
|
|
|
|
if(err) {
|
|
|
|
return console.log(err);
|
|
|
|
return console.log(err);
|
|
|
|