Move custom command files into own directory
This commit is contained in:
parent
e6bf4045ed
commit
4e41a035ed
9 changed files with 8 additions and 8 deletions
15
util/custom_commands/getOwnerOfCustomCommand.js
Normal file
15
util/custom_commands/getOwnerOfCustomCommand.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
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;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue