diff --git a/commands/save-pasta.js b/commands/save-pasta.js index 31aa252..1dfdaf8 100644 --- a/commands/save-pasta.js +++ b/commands/save-pasta.js @@ -5,13 +5,13 @@ module.exports = { const fs = require('fs'); const filename = args.shift(); 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; console.log('Saved file!'); - const pasta = require(`../pasta/${filename}.js`); + const pasta = require(`../pastas/${filename}.js`); message.client.pastas.set(pasta.name, pasta); }); - message.reply('GIF saved as: ' + args[0] + '.gif!'); + message.reply('GIF saved as: ' + filename + '.pasta!'); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/functions.js b/functions.js index 987997f..f85eb75 100644 --- a/functions.js +++ b/functions.js @@ -31,7 +31,7 @@ module.exports = { if (debug) console.log(client.pastas); }, getExtension(args) { - const finalWord = args.pop(); + const finalWord = args[args.length - 1]; const file = finalWord.split('.'); return file; },