help.js 996 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * !!help command and its message text must exist only in growi app package!!
  3. * the help message should vary depending on the growi version
  4. */
  5. const { markdownSectionBlock } = require('@growi/slack');
  6. module.exports = () => {
  7. const BaseSlackCommandHandler = require('./slack-command-handler');
  8. const handler = new BaseSlackCommandHandler();
  9. handler.handleCommand = async(growiCommand, client, body, respondUtil) => {
  10. // adjust spacing
  11. let message = '*Help*\n\n';
  12. message += 'Usage: `/growi [command] [args]`\n\n';
  13. message += 'Commands:\n\n';
  14. message += '`/growi note` Take a note on GROWI\n\n';
  15. message += '`/growi search [keyword]` Search pages\n\n';
  16. message += '`/growi keep` Create new page with existing slack conversations (Alpha)\n\n';
  17. await respondUtil.respond({
  18. text: 'Help',
  19. blocks: [
  20. markdownSectionBlock(message),
  21. ],
  22. });
  23. };
  24. return handler;
  25. };