diff --git a/index.js b/index.js index 06134c8e6c8c894183c44474f5ac40a4db3966ab..d73db6037f72a410b58534f617530eebd5b1c782 100644 --- a/index.js +++ b/index.js @@ -28,7 +28,12 @@ app.get( '/', function( req, res ) { app.post( '/log', function( req, res ) { // Don't bother if there's nothing to record if ( 'undefined' === typeof req.body || 'undefined' === typeof req.body.text || ! req.body.text.length ) { - return res.sendStatus( 400 ); + var response = { + "response_type": "ephemeral", + "text": "Please provide something to record." + }; + + return res.status( 400 ).send( response ); } // Limit who can trigger the command @@ -38,7 +43,7 @@ app.post( '/log', function( req, res ) { "text": "Sorry, you can't record completed tasks." }; - return res.send( response ); + return res.status( 403 ).send( response ); } // Massage the title