Created
May 19, 2015 17:16
-
-
Save aaronstaves/a814836c469e65560cab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Description: | |
| # Utility commands surrounding Hubot uptime. | |
| # | |
| # Commands: | |
| # hubot ping - Reply with pong | |
| # hubot echo <text> - Reply back with <text> | |
| # hubot time - Reply with current time | |
| # hubot die - End hubot process | |
| module.exports = (robot) -> | |
| robot.respond /PING$/i, (msg) -> | |
| msg.send "PONG" | |
| robot.respond /ADAPTER$/i, (msg) -> | |
| msg.send robot.adapterName | |
| robot.respond /ECHO (.*)$/i, (msg) -> | |
| msg.send msg.match[1] | |
| robot.respond /TIME$/i, (msg) -> | |
| msg.send "Server time is: #{new Date()}" | |
| robot.respond /DIE$/i, (msg) -> | |
| if robot.auth.hasRole(msg.envelope.user, "killer") | |
| msg.send "Goodbye, cruel world." | |
| process.exit 0 | |
| else | |
| msg.send "Nope" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment