nodbot/commands/roll.js

17 lines
494 B
JavaScript
Raw Normal View History

2021-07-20 20:23:30 +00:00
const fs = require('fs');
const strings = require('../src/strings.json');
2021-07-20 20:32:16 +00:00
const functions = require('../functions.js');
2021-07-20 20:23:30 +00:00
module.exports = {
name: 'roll',
description: 'Add a phrase to the .joint command',
2021-07-20 20:24:24 +00:00
usage: '<phrase to save>',
2021-07-20 20:23:30 +00:00
execute(message, file) {
2021-07-20 20:32:16 +00:00
strings.weed.push(functions.cleanInput(file.name));
2021-07-20 20:23:30 +00:00
fs.writeFile('./src/strings.json', JSON.stringify(strings), err => {
if (err) throw err;
2021-07-20 20:34:15 +00:00
message.channel.send('"' + file.name + '" has been added to the list');
2021-07-20 20:23:30 +00:00
})
}
}