lib/commands.js
function checkAvailable(map, command, logType, logMsg) {
        if (map[command]) {
            const prefix = logType === 'error' ? 'ERROR' : 'WARNING';
            forum.emit(logType, `${prefix}, ${command} is already registered: ${logMsg}`);
            return false;
        }
        return true;
    }
function checkAvailable(map, command, logType, logMsg) {
        if (map[command]) {
            const prefix = logType === 'error' ? 'ERROR' : 'WARNING';
            forum.emit(logType, `${prefix}, ${command} is already registered: ${logMsg}`);
            return false;
        }
        return true;
    }
function checkAvailable ( map , command , logType , logMsg ) { if ( map [ command ] ) { const prefix = logType === 'error' ? 'ERROR' : 'WARNING' ; forum . emit ( logType , ` ${ prefix } ${ command } ${ logMsg } ` ) ; return false ; } return true ; }
Check the availability of a command

@param {object} map A map of commands to check availability against
@param {string} command Name of command to check
@param {string} logType Type of log to log if command isn't available
@param {string} logMsg Message to log if command is not available
@returns {boolean} True if available, false otherwise
Check the availability of a command