 #   hubot who's on call - return the username of who's on call
 #   hubot pager me page <msg> - create a new incident
 #   hubot pager me 60 - take the pager for 60 minutes
+#   hubot pager me as you@yourdomain.com - remember your pager email is you@yourdomain.com
 #   hubot pager me incidents - return the current incidents
 #   hubot pager me problems - return all open inicidents
 #   hubot pager me ack 24 - ack incident #24

pagerDutySubdomain   = process.env.HUBOT_PAGERDUTY_SUBDOMAIN
pagerDutyBaseUrl     = "https://#{pagerDutySubdomain}.pagerduty.com/api/v1"
pagerDutyApiKey      = process.env.HUBOT_PAGERDUTY_APIKEY

module.exports = (robot) ->
  robot.respond /pager( me)?$/i, (msg) ->

    until: oneHour,
    overflow: 'true'
  }
  pagerDutyGet msg, "/schedules/#{pagerDutyScheduleId}/entries", query, (json) ->
    if json.entries and json.entries.length > 0
      cb(json.entries[0].user.name)

