Skip to content

Instantly share code, notes, and snippets.

@lukaszlenart
Created March 27, 2018 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaszlenart/3da9891861600f9eb0f962be52b4cbd8 to your computer and use it in GitHub Desktop.
Save lukaszlenart/3da9891861600f9eb0f962be52b4cbd8 to your computer and use it in GitHub Desktop.
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