Namespace: CoreFunctions

MIGChat.CoreFunctions

Core application functionality including command processing and validation

Source:

Methods

(static) executeCommand(cmd, processedArgs)

Execute validated command with processed arguments

.

Execute validated command with processed arguments

Parameters:
Name Type Description
cmd object

Command configuration object

processedArgs string | Array.<string>

Validated arguments

Source:

(static) getCommand(command) → {object|null}

Unified command accessor

.

Unified command accessor

Parameters:
Name Type Description
command string

Command name or alias

Source:
Returns:

Command configuration object or null if not found

Type
object | null

(static) initSidebar() → {void}

Initialize sidebar UI elements and behaviors

.

Initialize sidebar UI elements and behaviors

Source:
Returns:
Type
void

(static) preprocessCommandArgs(command, args) → {string|array|null}

Pre-process command arguments based on command type

.

Pre-process command arguments based on command type

Parameters:
Name Type Description
command string

Command name being processed

args Array.<string>

Raw arguments array

Source:
Returns:

Processed arguments or null if validation failed

Type
string | array | null

(static) processCommand(command, args)

Process chat command and validate arguments

.

Process chat command and validate arguments

Parameters:
Name Type Description
command string

Command name (e.g. "join", "send")

args Array.<string>

Array of command arguments

Source:
Throws:

When command processing fails

Type
Error

(static) processMessageArgs(args) → {string|null}

Process message arguments into single line string

.

Process message arguments into single line string

Parameters:
Name Type Description
args Array.<string>

Message parts array

Source:
Returns:

Combined message string or null if empty

Type
string | null

(static) validateArgCount(cmd, args) → {boolean}

Check argument count matches command requirements

.

Check argument count matches command requirements

Parameters:
Name Type Description
cmd object

Command configuration object

args Array.<string>

Provided arguments array

Source:
Returns:

True if argument count is valid

Type
boolean

(static) validateRoomArgs(roomName) → {boolean}

Validate room name format

.

Validate room name format

Parameters:
Name Type Description
roomName string

Room name to validate (with # prefix)

Source:
Returns:

True if room name is valid

Type
boolean