hubot-command-mapper
Version:
Helps with mapping tools and commands to Hubot.
13 lines (12 loc) • 466 B
JavaScript
export default function createDebugCommand() {
return {
name: "debug",
execute: (context) => {
let msg = `The tool "${context.tool.name}" uses the following commands:`;
const internalTool = context.tool;
const registrations = internalTool?.__registrations || [];
registrations.forEach(r => (msg += `\n- ${r.commandName}: ${r.messageRegex}`));
context.res.reply(msg);
}
};
}