module.exports = { name: 'save-pasta', description: 'Adds a given copypasta to the hardcoded list.', execute(message, args) { 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) { if (err) throw err; console.log('Saved file!'); const pasta = require(`../pasta/${filename}.js`); message.client.pastas.set(pasta.name, pasta); }); message.reply('GIF saved as: ' + args[0] + '.gif!'); } }