RegisterService.ts 874 B

123456789101112131415161718192021222324252627
  1. import { SlashCommand } from '@slack/bolt';
  2. import { WebClient, LogLevel } from '@slack/web-api';
  3. import { generateInputSectionBlock, generateMarkdownSectionBlock } from '../../../slack/src/utils/block-creater';
  4. export const openRegisterModal = async(body:SlashCommand) : Promise<void> => {
  5. const client = new WebClient('xoxb-1399660543842-1848670292404-TYsbWjgHPtNcTvqupgwb3h75', { logLevel: LogLevel.DEBUG });
  6. await client.views.open({
  7. trigger_id: body.trigger_id,
  8. view: {
  9. type: 'modal',
  10. title: {
  11. type: 'plain_text',
  12. text: 'Register Credential',
  13. },
  14. close: {
  15. type: 'plain_text',
  16. text: 'Close',
  17. },
  18. blocks: [
  19. generateMarkdownSectionBlock('hoge'),
  20. // generateInputSectionBlock('contents', 'Contents', 'contents_input', true, 'Input with Markdown...'),
  21. ],
  22. },
  23. });
  24. };