From 67f508f5e6970f998d01221ee8f0e15d511aef8c Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sat, 11 Jun 2022 10:55:13 -0400 Subject: [PATCH] Add ability to have aliases for dotCommands --- functions.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/functions.js b/functions.js index afdb15b..c65239f 100644 --- a/functions.js +++ b/functions.js @@ -54,8 +54,12 @@ const functions = { if (isDev) console.log('Slash Commands Collection Built'); }, setvalidCommands(client) { - for (const entry of client.dotCommands.map(command => command.name)) { - config.validCommands.push(entry); + for (const entry of client.dotCommands.map(command => command)) { + config.validCommands.push(entry.name); + if (entry.alias != undefined) { + config.validCommands.push(entry.alias); + } + } if (isDev) console.log('Valid Commands Added to Config'); }, @@ -65,6 +69,9 @@ const functions = { for (const file of dotCommandFiles) { const dotCommand = require(`./dot-commands/${file}`); client.dotCommands.set(dotCommand.name, dotCommand); + if (dotCommand.alias != undefined) { + client.dotCommands.set(dotCommand.alias, dotCommand); + } } if (isDev) console.log('Dot Commands Collection Built'); },