Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/scripts/pagerduty.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ module.exports = (robot) ->
else
msg.send "I couldn't find your user :( #{emailNote}"

cmds = robot.helpCommands()
cmds = (cmd for cmd in cmds when cmd.match(/hubot (pager |who's on call)/))
cmds = renamedHelpCommands(robot)
msg.send cmds.join("\n")

robot.respond /pager(?: me)? as (.*)$/i, (msg) ->
Expand Down Expand Up @@ -876,3 +875,11 @@ module.exports = (robot) ->
incidents.filter (incident) ->
incident.assigned_to.some (assignment) ->
assignment.object.email is userEmail

renamedHelpCommands = (robot) ->
robot_name = robot.alias or robot.name
cmds = robot.helpCommands()
cmds = (cmd for cmd in cmds when cmd.match(/hubot (pager |who's on call)/))
help_commands = cmds.map (command) ->
command.replace /^hubot/i, robot_name
help_commands.sort()