welcome-message.ts 819 B

123456789101112131415161718192021
  1. import { ChatPostMessageResponse, WebClient } from '@slack/web-api';
  2. export const postWelcomeMessage = (client: WebClient, userId: string): Promise<ChatPostMessageResponse> => {
  3. return client.chat.postMessage({
  4. channel: userId,
  5. user: userId,
  6. blocks: [
  7. {
  8. type: 'section',
  9. text: {
  10. type: 'mrkdwn',
  11. text: ':tada: You have successfully installed GROWI Official bot on this Slack workspace.\n'
  12. + 'At first you do `/growi register` in the channel that you want to use.\n'
  13. + 'Looking for additional help?'
  14. // eslint-disable-next-line max-len
  15. + 'See <https://docs.growi.org/en/admin-guide/management-cookbook/slack-integration/official-bot-settings.html#official-bot-settings | Docs>.',
  16. },
  17. },
  18. ],
  19. });
  20. };