Last active
August 29, 2015 14:23
-
-
Save hotakasaito/a3cac9f57c211573136f to your computer and use it in GitHub Desktop.
hubotでsleep ref: http://qiita.com/hotakasaito/items/d68a81d816c04f95bb50
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) -> | |
sleep = (ms) -> | |
start = new Date().getTime() | |
continue while new Date().getTime() - start < ms | |
robot.on 'my:sleep', (ms) -> | |
sleep ms |
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
robot.emit 'my:sleep', 1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment