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
|
@ -61,7 +61,7 @@ module.exports = {
|
|||
}
|
||||
case "list": {
|
||||
const embed = new EmbedBuilder();
|
||||
sendText = getAllCustomCommands();
|
||||
sendText = getAllCustomCommands(client);
|
||||
if(sendText !== ""){
|
||||
embed.setColor(15780145)
|
||||
embed.addFields(
|
||||
|
|
|
@ -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
Reference in a new issue