added enum to help messages and checks whether command is in list for member helper

This commit is contained in:
Aster Fialla
2026-02-13 21:45:01 -05:00
parent 65c0664972
commit 1d1f62af31
2 changed files with 7 additions and 1 deletions

View File

@@ -8,7 +8,8 @@ helperEnums.err = {
MEMBER_EXISTS: "A member with that name already exists. Please pick a unique name.",
USER_NO_MEMBERS: "You have no members created.",
DISPLAY_NAME_TOO_LONG: "The display name is too long. Please limit it to 32 characters or less.",
PROXY_EXISTS: "A duplicate proxy already exists for one of your members. Please pick a new one, or change the old one first."
PROXY_EXISTS: "A duplicate proxy already exists for one of your members. Please pick a new one, or change the old one first.",
NO_SUCH_COMMAND: "No such command exists."
}
helperEnums.help = {

View File

@@ -3,6 +3,8 @@ import {enums} from "../enums.js";
const mh = {};
const commandList = ['--help', 'add', 'remove', 'displayName', 'proxy'];
/**
* Parses through the subcommands that come after "pf;member" and calls functions accordingly.
*
@@ -12,6 +14,9 @@ const mh = {};
*/
mh.parseMemberCommand = async function(authorId, args){
console.log(authorId, args);
if(!commandList.includes(args[0])) {
return enums.err.NO_SUCH_COMMAND;
}
switch(args[0]) {
case '--help':
return enums.help.MEMBER;