commands/help.js
/**
     * @brief This function handles the /ttt 'help' command. It creates a Slack
     *        JSON message explaining the command's usage.
     *
     * @param req express http request object
     * @param res express http response object
     *
     * @return none
     */
@brief This function handles the /ttt 'help' command. It creates a Slack
JSON message explaining the command's usage.

@param req express http request object
@param res express http response object

@return none
@brief This function handles the / ttt ' help ' command . It creates a Slack JSON message explaining the command ' s usage . @param req express http request object @param res express http response object @return none
function handle(req, res) {
        let text = labels.CMD_TEXT;
        let attachment = constants.help.helpUsageSlackAttachment;
        if (req.body.errorMessage !== undefined) {
            text = req.body.errorMessage;
            attachment = constants.help.commandUsageSlackAttachment;
        }
        res.json(
            slackUtil.createResponse({
                text,
                response_type: "ephemeral",
                attachments: [attachment]
            })
        );
    }
function handle ( req , res ) { let text = labels . CMD_TEXT ; let attachment = constants . help . helpUsageSlackAttachment ; if ( req . body . errorMessage !== undefined ) { text = req . body . errorMessage ; attachment = constants . help . commandUsageSlackAttachment ; } res . json ( slackUtil . createResponse ( { text , response_type : "ephemeral" , attachments : [ attachment ] } ) ) ; }
@brief This function handles the /ttt 'help' command.
@brief This function handles the / ttt ' help ' command .
// Get help text and attachments. // If an error message is present in req use the appropriate attachment. // Send Slack JSON message as the response.