i accidently uploaded WIP tag system
This commit is contained in:
parent
b45201af39
commit
8cc712fd90
1 changed files with 3 additions and 3 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue