Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show robot.alias or robot.name as opposed to hubot in help. #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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()