Skip to content

Instantly share code, notes, and snippets.

@tknzk
Created September 12, 2014 08:26
Show Gist options
  • Save tknzk/86e8efeb1598001b4df9 to your computer and use it in GitHub Desktop.
Save tknzk/86e8efeb1598001b4df9 to your computer and use it in GitHub Desktop.
# Description:
# heisei
#
# Dependencies:
#
# Configuration:
#
# Commands:
# hubot heisei
#
# Author:
# tknzk
module.exports = (robot) ->
robot.respond /heisei/i, (msg) ->
msg.send generate()
generate = (str) ->
d = new Date();
year = d.getFullYear();
heisei = year - 2000 + 12;
'今年は平成' + heisei + '年だよ';
@tknzk
Copy link
Author

tknzk commented Sep 12, 2014

Hubot> hubot heisei
Hubot> 今年は平成26年だよ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment