forked from Supositware/Haha-Yes
This commit is contained in:
parent
e871aafef9
commit
88e82d101c
9 changed files with 24 additions and 24 deletions
|
@ -38,7 +38,7 @@ class autoresponseCommand extends Command {
|
|||
|
||||
fs.readFile('./json/autoresponse.json', 'utf8', function readFileCallback(err, data) {
|
||||
if (err) {
|
||||
fs.close(2);
|
||||
|
||||
console.log(err);
|
||||
} else {
|
||||
|
||||
|
@ -48,14 +48,14 @@ class autoresponseCommand extends Command {
|
|||
json = json.replace(/[<#>]/g, '');
|
||||
fs.writeFile('./json/autoresponse.json', json, 'utf8', function (err) {
|
||||
if (err) {
|
||||
fs.close(2);
|
||||
|
||||
return console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
fs.close(2);
|
||||
|
||||
return message.channel.send('Auto response have been disable/enable on every channel');
|
||||
|
||||
} else if (text == 'disable' || 'enable') {
|
||||
|
@ -68,7 +68,7 @@ class autoresponseCommand extends Command {
|
|||
json = JSON.stringify(autoresponse); //convert it back to json
|
||||
fs.writeFile('./json/autoresponse.json', json, 'utf8', function (err) {
|
||||
if (err) {
|
||||
fs.close(2);
|
||||
|
||||
return console.log(err);
|
||||
}
|
||||
});
|
||||
|
@ -76,7 +76,7 @@ class autoresponseCommand extends Command {
|
|||
});
|
||||
}
|
||||
|
||||
fs.close(2);
|
||||
|
||||
return message.channel.send(`Autoresponse have been ${text}d`);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class shameboardCommand extends Command {
|
|||
if (err) {
|
||||
console.log(err);
|
||||
}
|
||||
fs.close(2);
|
||||
|
||||
return message.channel.send('This channel have been set as the shameboard');
|
||||
});
|
||||
} else {
|
||||
|
@ -34,13 +34,13 @@ class shameboardCommand extends Command {
|
|||
var json = JSON.stringify(shameboard); //convert it back to json
|
||||
fs.writeFile(`./starboard/${message.guild.id}.json`, json, 'utf8', function (err) {
|
||||
if (err) {
|
||||
fs.close(2);
|
||||
|
||||
return console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
fs.close(2);
|
||||
|
||||
return message.channel.send('This channel have been set as the shameboard');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class StarBoardCommand extends Command {
|
|||
if (err) {
|
||||
console.log(err);
|
||||
}
|
||||
fs.close(2);
|
||||
|
||||
return message.channel.send('This channel have been set as the starboard');
|
||||
});
|
||||
} else {
|
||||
|
@ -34,13 +34,13 @@ class StarBoardCommand extends Command {
|
|||
var json = JSON.stringify(starboard); //convert it back to json
|
||||
fs.writeFile(`./starboard/${message.guild.id}.json`, json, 'utf8', function (err) {
|
||||
if (err) {
|
||||
fs.close(2);
|
||||
|
||||
return console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
fs.close(2);
|
||||
|
||||
return message.channel.send('This channel have been set as the starboard');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class TagCommand extends Command {
|
|||
if (err) {
|
||||
fs.writeFile(`./tag/${message.guild.id}.json`, `{'${trigger}':'${response}'}`, function (err) {
|
||||
if (err) {
|
||||
fs.close(2);
|
||||
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
|
@ -49,14 +49,14 @@ class TagCommand extends Command {
|
|||
json = JSON.stringify(customresponse); //convert it back to json
|
||||
fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function (err) {
|
||||
if (err) {
|
||||
fs.close(2);
|
||||
|
||||
return console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
fs.close(2);
|
||||
|
||||
return message.channel.send(`autoresponse have been set to ${trigger} : ${response}`);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,14 +40,14 @@ class UnTagCommand extends Command {
|
|||
json = JSON.stringify(customresponse); //convert it back to json
|
||||
fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function (err) {
|
||||
if (err) {
|
||||
fs.close(2);
|
||||
|
||||
return console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
fs.close(2);
|
||||
|
||||
return message.channel.send(`The following autoresponse have been deleted: ${trigger}`);
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ class TtsCommand extends Command {
|
|||
// Performs the Text-to-Speech request
|
||||
gclient.synthesizeSpeech(request, (err, response) => {
|
||||
if (err) {
|
||||
fs.close(2);
|
||||
|
||||
console.error('ERROR:', err);
|
||||
return;
|
||||
}
|
||||
|
@ -48,13 +48,13 @@ class TtsCommand extends Command {
|
|||
if (err) {
|
||||
console.error('ERROR:', err);
|
||||
message.channel.send('An error has occured, the message is probably too long');
|
||||
fs.close(2);
|
||||
|
||||
return;
|
||||
}
|
||||
console.log('Audio content written to file: tts.mp3');
|
||||
message.channel.send({ files: ['./tts.mp3'] });
|
||||
});
|
||||
fs.close(2);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ class TtsvcCommand extends Command {
|
|||
if (err) {
|
||||
console.error('ERROR:', err);
|
||||
message.channel.send('An error has occured, the message is probably too long');
|
||||
fs.close(2);
|
||||
|
||||
return;
|
||||
}
|
||||
console.log('Audio content written to file: ttsvc.mp3');
|
||||
|
|
|
@ -43,10 +43,10 @@ class DownloadCommand extends Command {
|
|||
message.delete();
|
||||
message.channel.send(`Downloaded by ${message.author.username}`, { files: ['./video.mp4'] })
|
||||
.catch(() => message.channel.send('File too big'));
|
||||
fs.close(2);
|
||||
|
||||
});
|
||||
} else {
|
||||
fs.close(2);
|
||||
|
||||
message.channel.send('You need to input a valid link');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class taglistCommand extends Command {
|
|||
await fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
fs.close(2);
|
||||
|
||||
return;
|
||||
}
|
||||
let json = JSON.stringify(data);
|
||||
|
@ -39,7 +39,7 @@ class taglistCommand extends Command {
|
|||
|
||||
message.channel.send(tagEmbed);
|
||||
});
|
||||
fs.close(2);
|
||||
|
||||
message.channel.send('An error has occured, do you have any tags on the server?');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue