UNPKG

hubot-command-mapper

Version:
13 lines (12 loc) 466 B
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); } }; }