Use set for listing all custom commands
This commit is contained in:
parent
eae1e9130e
commit
7702f10587
2 changed files with 5 additions and 11 deletions
|
@ -1,13 +1,7 @@
|
|||
const fs = require('fs');
|
||||
module.exports = function(){
|
||||
const customPath = './data/customCommands.json';
|
||||
|
||||
|
||||
module.exports = function(client){
|
||||
let list = "";
|
||||
|
||||
let json = fs.readFileSync(customPath, 'utf8');
|
||||
let customCommands = JSON.parse(json)
|
||||
customCommands.forEach(function (customCommand) {
|
||||
list = list + customCommand.customName+"\n";
|
||||
});
|
||||
|
||||
client.customCommands.keys().forEach(commandName => list += `${commandName}\n`)
|
||||
return list;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue