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": {
|
case "list": {
|
||||||
const embed = new EmbedBuilder();
|
const embed = new EmbedBuilder();
|
||||||
sendText = getAllCustomCommands();
|
sendText = getAllCustomCommands(client);
|
||||||
if(sendText !== ""){
|
if(sendText !== ""){
|
||||||
embed.setColor(15780145)
|
embed.setColor(15780145)
|
||||||
embed.addFields(
|
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 list = "";
|
||||||
|
client.customCommands.keys().forEach(commandName => list += `${commandName}\n`)
|
||||||
let json = fs.readFileSync(customPath, 'utf8');
|
|
||||||
let customCommands = JSON.parse(json)
|
|
||||||
customCommands.forEach(function (customCommand) {
|
|
||||||
list = list + customCommand.customName+"\n";
|
|
||||||
});
|
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue