aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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": [
{