publish-initial-home-view.ts 890 B

12345678910111213141516171819202122232425262728293031
  1. // Now Home tab is disabled
  2. // TODO Imple Home tab
  3. import type { ViewsPublishResponse, WebClient } from '@slack/web-api';
  4. export const publishInitialHomeView = (client: WebClient, userId: string): Promise<ViewsPublishResponse> => {
  5. return client.views.publish({
  6. user_id: userId,
  7. view: {
  8. type: 'home',
  9. blocks: [
  10. {
  11. type: 'section',
  12. text: {
  13. type: 'mrkdwn',
  14. text: 'Welcome GROWI Official Bot Home',
  15. },
  16. },
  17. {
  18. type: 'section',
  19. text: {
  20. type: 'mrkdwn',
  21. text: 'Learn how to use GROWI Official bot.'
  22. // eslint-disable-next-line max-len
  23. + 'See <https://docs.growi.org/en/admin-guide/management-cookbook/slack-integration/official-bot-settings.html#official-bot-settings | Docs>.',
  24. },
  25. },
  26. ],
  27. },
  28. });
  29. };