commands/start.js
/**
     * @brief This function checks the request body to see if all the valid
     *        parameters are present. The 'start' command needs a username to be
     *        able to execute.
     *
     * @return boolean indicating the request validity
     */
@brief This function checks the request body to see if all the valid
parameters are present. The 'start' command needs a username to be
able to execute.

@return boolean indicating the request validity
@brief This function checks the request body to see if all the valid parameters are present . The ' start ' command needs a username to be able to execute . @return boolean indicating the request validity
function parseArgs(req) {
        let text = req.body.text;
        let args = text.trim().split(" ");
        if (args.length < 2 || args[1].startsWith("@") === false) {
            return false;
        }
        req.body.tttUserName = args[1].substr(1);
        if (req.body.user_name === req.body.tttUserName) {
            req.body.errorMessage = labels.SAME_USER_ERROR;
            return false;
        }
        return true;
    }
function parseArgs ( req ) { let text = req . body . text ; let args = text . trim ( ) . split ( " " ) ; if ( args . length < 2 || args [ 1 ] . startsWith ( "@" ) === false ) { return false ; } req . body . tttUserName = args [ 1 ] . substr ( 1 ) ; if ( req . body . user_name === req . body . tttUserName ) { req . body . errorMessage = labels . SAME_USER_ERROR ; return false ; } return true ; }
@brief This function checks the request body to see if all the valid
        parameters are present.
@brief This function checks the request body to see if all the valid parameters are present .
// Parse the 'text' field to get the /ttt arguments. // Username should be the 2nd argument.