Fixing regular command handling

This commit is contained in:
= 2021-06-28 19:58:46 -04:00
parent 52327a897d
commit a11666bc4d
2 changed files with 5 additions and 5 deletions

View File

@ -5,13 +5,13 @@ module.exports = {
const fs = require('fs'); const fs = require('fs');
const filename = args.shift(); const filename = args.shift();
const pastaText = args.join(' '); const pastaText = args.join(' ');
fs.appendFile(`./pasta/${filename}.js`, `module.exports = {\n\tname: '${filename}',\n\tcontent: '${pastaText}'\n}`, function(err) { fs.appendFile(`./pastas/${filename}.js`, `module.exports = {\n\tname: '${filename}',\n\tcontent: '${pastaText}'\n}`, function(err) {
if (err) throw err; if (err) throw err;
console.log('Saved file!'); console.log('Saved file!');
const pasta = require(`../pasta/${filename}.js`); const pasta = require(`../pastas/${filename}.js`);
message.client.pastas.set(pasta.name, pasta); message.client.pastas.set(pasta.name, pasta);
}); });
message.reply('GIF saved as: ' + args[0] + '.gif!'); message.reply('GIF saved as: ' + filename + '.pasta!');
} }
} }

View File

@ -31,7 +31,7 @@ module.exports = {
if (debug) console.log(client.pastas); if (debug) console.log(client.pastas);
}, },
getExtension(args) { getExtension(args) {
const finalWord = args.pop(); const finalWord = args[args.length - 1];
const file = finalWord.split('.'); const file = finalWord.split('.');
return file; return file;
}, },