From d6f08654c7c5c3c8e0141549b2f9fdd4742ab42d Mon Sep 17 00:00:00 2001 From: Nic Ashton Date: Fri, 12 Feb 2016 20:48:10 +0000 Subject: [PATCH 1/2] Split the acknowledgment by a pipe to allow for random response. --- scripts/stackstorm.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/stackstorm.js b/scripts/stackstorm.js index ff49a15..78b7ec4 100644 --- a/scripts/stackstorm.js +++ b/scripts/stackstorm.js @@ -243,6 +243,11 @@ module.exports = function(robot) { } if (res.message) { + var msgs = (res.message + history).split('|'); + if (msgs.length > 1) { + return msg.send(msg.random(msgs)); + } + return msg.send(res.message + history); } From eb97ed7e5902977800986552e1e69e4abb47ffe2 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 15 Apr 2016 10:35:55 +0100 Subject: [PATCH 2/2] Catch all message created for unknown commands --- scripts/stackstorm.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/stackstorm.js b/scripts/stackstorm.js index 78b7ec4..5213967 100644 --- a/scripts/stackstorm.js +++ b/scripts/stackstorm.js @@ -284,7 +284,9 @@ module.exports = function(robot) { result = command_factory.getMatchingCommand(command.toLowerCase()); if (!result) { - // No command found + //add a default response if the command is not found + msg.send("I'm sorry but I didn't recognise that command. Please try !help for available commands."); + // No command found, notifiy slack user return; }