diff --git a/scripts/stackstorm.js b/scripts/stackstorm.js index ff49a15..5213967 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); } @@ -279,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; }