discord_bot/util/getOwnerOfCustomCommand.js
2021-07-02 19:29:15 +02:00

15 lines
No EOL
387 B
JavaScript

const fs = require('fs');
module.exports = function(customName){
let author = false;
const customPath = './data/customCommands.json';
let json = fs.readFileSync(customPath, 'utf8');
let customCommands = JSON.parse(json)
customCommands.forEach(function (customCommand) {
if (customCommand.customName === customName) {
author = customCommand.author;
}
});
return author;
}