       msg.send reply
   # }}}
 
-#    userName = msg.match[1].toLowerCase()
-#    user = whoIsThis robot, userName
-#
-#    redmine.Users name:user, (err, data) ->
-#      # console.log 'count:' + userName + ' ' + data.total_count
-#      unless data.total_count > 0
-#        msg.reply "\"#{userName}\" が redmine で見つけられない"
-#        return false
-#
-#      user = resolveUsers(user, data.users)[0]
-#      console.log user
-
+  robot.respond /redmine[\s]+(\d{2,4}(?:-|\/)\d{1,2}(?:-|\/)\d{1,2}[\s]+)?#(\d+)[\s]+(\d{1,2}(\.00?|\.25|\.50?|.75)?)[\s]*(?:h|時間)[\s]+([\S]+)(?:[\s]+"?([^"]+)"?)?/i, (msg) -> # {{{
+    userName = msg.message.user.name
+    user = whoIsThis robot, userName
+    return msg.send "誰？" unless user
+
+    [date, id, hours, hoursshosu, activity, userComments] = msg.match[1..6]
+    if date
+      date = new Date date
+      return msg.send "#{date} は日付じゃない" unless Date.validateDay(date.getDate(), date.getFullYear(), date.getMonth())
+    else
+      date = getPrevKadobi robot, Date.yesterday()
+    dateYMD = date.toYMD()
+    console.log dateYMD
+
+    if userComments?
+      comments = "#{msg.message.user.name}: #{userComments}"
+    else
+      comments = "Time logged by: #{msg.message.user.name}"
+    activityId = getActivityId activity
+    unless activityId
+      msg.reply "こんな\"活動\"はない > #{activity}\n"
+      msg.send " Usage: #{robot.name} redmine ##{id} #{hours}h 製造 #{activity}"
+      return
+
+    redmine.Users name:user, (err, data) =>
+      # console.log 'count:' + userName + ' ' + data.total_count
+      unless data.total_count > 0
+        msg.send "\"#{user}\" が redmine で見つけられない"
+        return false
+      redmineUser = resolveUsers(user, data.users)[0]
+
+      attributes =
+        issue_id: id
+        spent_on: dateYMD
+        hours: hours
+        comments: comments
+        user_id: redmineUser.id
+        activity_id: activityId
+
+      redmine.TimeEntry().create attributes, (error, data, response) ->
+        if response?.statusCode == 201
+          msg.reply "よく頑張りました！(#{dateYMD} で登録)"
+        else
+          msg.reply "なんか失敗"
+# }}}
+

    if method in ["POST", "PUT"]
      if typeof(body) isnt "string"
        body = JSON.stringify body

      options.headers["Content-Length"] = body.length

    # console.log options.url
    request options, (err, response, data) ->
      if !err and response?.statusCode is 200
        try
          if opt.type is 'json'
            callback null, JSON.parse(data), response
          else if opt.type is 'atom'
            rssparser.parseString data, {}, (error, feed) ->
              # console.log feed
              callback error, feed, response
        catch err2
          callback null, (data or { }), response
      else
        console.log 'error: ' + response?.statusCode + ', url =>' + options.url
        console.log err ||= response?.statusCode
        #@send "Redmine がなんかエラーやわ"
        callback err, null, response
  # /private request }}}
# /Redmine }}}


        return callback err, null if err or data is null
        timeEntries = data.time_entries
        callback null, timeEntries

    create: (attributes, callback, opt) =>
      @post "/time_entries.json", {time_entry: attributes}, opt, callback
# }}}

  getActivity: () -> # {{{
