Created
March 27, 2018 14:08
-
-
Save lukaszlenart/3da9891861600f9eb0f962be52b4cbd8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (robot) -> | |
robot.hear /^(halina)? (.+)/i, (msg) -> | |
msg.finish() | |
robot.logger.info "Catching: #{msg.match[2]}" | |
message = msg.message | |
message.done = false | |
message.text = message.text.replace(msg.match[1], robot.name) | |
robot.logger.info "Reroute message back to robot" | |
robot.receive message | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment