aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-09-27 12:04:36 +0200
committerNoah Loomans <noahloomans@gmail.com>2017-09-27 12:04:36 +0200
commitdfe3d68edaddd71b020f39ae676ac7e1ec3d7c04 (patch)
tree94cbda3ab9e25f48441181c09ff53d7aa54f60ae /src
parenta03f63c9a7474af07e91e9770397e08e8964e6ad (diff)
Add slack error message
Diffstat (limited to 'src')
-rw-r--r--src/server/routes/slack.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/routes/slack.js b/src/server/routes/slack.js
index ac38c9a..5dc7047 100644
--- a/src/server/routes/slack.js
+++ b/src/server/routes/slack.js
@@ -2,9 +2,16 @@ const express = require('express')
const router = express.Router()
router.all('/', function (req, res, next) {
+ if (!/^[0-9]+$/.test(req.body.text)) {
+ res.json({
+ "response_type": "ephemeral",
+ "text": "Only student id's are currently supported, more comming soon!"
+ })
+ return
+ }
res.json({
"response_type": "in_channel",
- "text": "Here is the schedule of _18561_",
+ "text": `Here is the schedule of _${req.body.text}_`,
"mrkdwn": true,
"attachments": [
{