lib/commands.js
function parseLine(line) {
        let args, mention, commandText;
        if (new RegExp(`^@${forum.username}\\s\\S{3,}(\\s|$)`, 'i').test(line)) {
            args = line.split(/\s+/);
            args.shift();
            commandText = args.shift();
            mention = true;
        } else if (/^!\w\S{2,}(\s|$)/.test(line)) {
            args = line.split(/\s+/);
            commandText = args.shift().substring(1);
            mention = false;
        }
        if (commandText) {
            return {
                commandText: commandText,
                command: commandText.toLowerCase(),
                args: args,
                line: line,
                mention: mention
            };
        }
        return null;
    }
function parseLine(line) {
        let args, mention, commandText;
        if (new RegExp(`^@${forum.username}\\s\\S{3,}(\\s|$)`, 'i').test(line)) {
            args = line.split(/\s+/);
            args.shift();
            commandText = args.shift();
            mention = true;
        } else if (/^!\w\S{2,}(\s|$)/.test(line)) {
            args = line.split(/\s+/);
            commandText = args.shift().substring(1);
            mention = false;
        }
        if (commandText) {
            return {
                commandText: commandText,
                command: commandText.toLowerCase(),
                args: args,
                line: line,
                mention: mention
            };
        }
        return null;
    }
function parseLine ( line ) { let args , mention , commandText ; if ( new RegExp ( ` ${ forum . username } \\ \\ \\ ` , 'i' ) . test ( line ) ) { args = line . split ( / \s+ / ) ; args . shift ( ) ; commandText = args . shift ( ) ; mention = true ; } else if ( / ^!\w\S{2,}(\s|$) / . test ( line ) ) { args = line . split ( / \s+ / ) ; commandText = args . shift ( ) . substring ( 1 ) ; mention = false ; } if ( commandText ) { return { commandText : commandText , command : commandText . toLowerCase ( ) , args : args , line : line , mention : mention } ; } return null ; }
Parse command definitions from a line of text

@private

@param {string} line Text to parse
@returns {object} Parsed command definition
Parse command definitions from a line of text