Fixing regular command handling
This commit is contained in:
parent
52327a897d
commit
a11666bc4d
@ -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!');
|
||||
}
|
||||
}
|
@ -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;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user