i accidently uploaded WIP tag system

This commit is contained in:
Loic Bersier 2018-12-18 23:33:42 +01:00
parent b45201af39
commit 8cc712fd90

View file

@ -6,7 +6,7 @@ module.exports = class CustomResponseCommand extends Command {
super(client, { super(client, {
name: 'tag', name: 'tag',
aliases: ['customresponse'], aliases: ['customresponse'],
group: 'utility', group: 'admin',
memberName: 'tag', memberName: 'tag',
description: `Custom auto response`, description: `Custom auto response`,
userPermissions: ['MANAGE_MESSAGES'], userPermissions: ['MANAGE_MESSAGES'],
@ -42,14 +42,14 @@ module.exports = class CustomResponseCommand extends Command {
fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data){ fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data){
if (err){ if (err){
fs.writeFile(`./tag/${message.guild.id}.json`, `{"${trigger}": {"response":"${response}","owner":"${message.author.id}"}}`, function (err) { fs.writeFile(`./tag/${message.guild.id}.json`, `{"${trigger}":"${response}"}`, function (err) {
if (err){ if (err){
console.log(err); console.log(err);
} }
}) })
} else { } else {
customresponse = JSON.parse(data); //now it an object customresponse = JSON.parse(data); //now it an object
customresponse.trigger = `response":${response},"owner":"${message.author.id}` customresponse [trigger] = response
json = JSON.stringify(customresponse); //convert it back to json json = JSON.stringify(customresponse); //convert it back to json
fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function(err) { fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function(err) {
if(err) { if(err) {