Skip to content

Commit

Permalink
fix: help message around qrafty points (#203)
Browse files Browse the repository at this point in the history
* fix: help message around qrafty points

* fix: use bot name to craft regexp
  • Loading branch information
pmalouin committed Feb 27, 2024
1 parent 0525cb7 commit 12fc869
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/messageHandlers/helpMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ const { RegExpPlusPlus } = require('../lib/regExpPlusPlus');
const HelpService = require('../lib/services/help');

module.exports = function help(robot) {
const bn = robot.name || 'hubot';

robot.respond(RegExpPlusPlus.getHelp(), HelpService.respondWithHelpGuidance);
robot.respond(
/(plusplus version|-v|--version)/i,
HelpService.respondWithVersion,
);

robot.respond(/how much .*point.*/i, HelpService.tellHowMuchPointsAreWorth);
const howMuchRegexp = new RegExp(
`how much .*${bn} point.*`,
'i',
);
robot.respond(howMuchRegexp, HelpService.tellHowMuchPointsAreWorth);
};

0 comments on commit 12fc869

Please sign in to comment.