{"id":17492929,"url":"https://github.com/bamada/nest-slack-bolt","last_synced_at":"2025-12-29T02:29:58.336Z","repository":{"id":65564904,"uuid":"550295440","full_name":"bamada/nest-slack-bolt","owner":"bamada","description":"A NestJS module for seamless integration with Slack using the Bolt SDK. Simplify Slack bot development with decorators for message, event, action, and command handling.","archived":false,"fork":false,"pushed_at":"2025-03-27T17:34:46.000Z","size":4446,"stargazers_count":34,"open_issues_count":4,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T10:06:36.861Z","etag":null,"topics":["bolt-js","nestjs","slack","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nestjs-slack-bolt","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bamada.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-12T14:16:48.000Z","updated_at":"2025-03-27T08:58:55.000Z","dependencies_parsed_at":"2024-01-14T06:21:35.582Z","dependency_job_id":"688ae6fd-1331-4b3c-9dc5-d89937d764f3","html_url":"https://github.com/bamada/nest-slack-bolt","commit_stats":{"total_commits":481,"total_committers":7,"mean_commits":68.71428571428571,"dds":0.1787941787941788,"last_synced_commit":"6032618e1611497f23979e4727b8a4408f7341ef"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamada%2Fnest-slack-bolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamada%2Fnest-slack-bolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamada%2Fnest-slack-bolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamada%2Fnest-slack-bolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bamada","download_url":"https://codeload.github.com/bamada/nest-slack-bolt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247471517,"owners_count":20944158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bolt-js","nestjs","slack","typescript"],"created_at":"2024-10-19T11:07:59.038Z","updated_at":"2025-12-29T02:29:58.330Z","avatar_url":"https://github.com/bamada.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/bamada/nest-slack-bolt\" target=\"blank\"\u003e\u003cimg src=\"logo.svg\" width=\"100\" alt=\"Nestjs Slack Bolt\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eA \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003eNestjs\u003c/a\u003e module to interact seamlessly with \u003ca href=\"https://api.slack.com/\" target=\"_blank\"\u003eSlack\u003c/a\u003e API using the \u003ca href=\"https://api.slack.com/bolt\"\u003eBolt\u003c/a\u003e SDK.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nestjs-slack-bolt\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/nestjs-slack-bolt.svg\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nestjs-slack-bolt\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/nestjs-slack-bolt.svg\" alt=\"Package License\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nestjs-slack-bolt\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/nestjs-slack-bolt.svg\" alt=\"NPM Downloads\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/bamada/nest-slack-bolt/actions\"\u003e\u003cimg src=\"https://github.com/bamada/nest-slack-bolt/workflows/CI/badge.svg\" alt=\"CI Status\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/bamada/nest-slack-bolt#contributors-\"\u003e\u003cimg src=\"https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square\" alt=\"All Contributors\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/prettier/prettier\"\u003e\u003cimg src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\" alt=\"code style: prettier\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Table of Contents\n\n- [Description](#description)\n- [Features](#features)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Configuration](#configuration)\n- [Usage](#usage)\n  - [Using annotations](#using-annotations)\n    - [Handling a message event](#handling-a-message-event)\n    - [Handling an action](#handling-an-action)\n    - [Handling a command](#handling-a-command)\n    - [Handling an event](#handling-an-event)\n    - [Handling a shortcut event](#handling-a-shortcut-event)\n  - [Using the SlackService](#using-the-slackservice)\n- [Troubleshooting](#troubleshooting)\n- [Changelog](#changelog)\n- [Contributing](#contributing)\n- [Support](#support)\n- [License](#license)\n- [Contributors](#contributors-)\n\n## Description\n\nThis module provides a convenient way to develop Slack applications using the Nestjs framework. It seamlessly integrates the Slack Bolt SDK with NestJS, allowing you to leverage the power of both platforms.\n\n## Features\n\n- **Message Handling**: Easily respond to and process incoming Slack messages.\n- **Command Handling**: Implement custom Slack commands for your application.\n- **Action Handling**: React to user interactions with buttons, select menus, and other Slack UI elements.\n- **Event Handling**: Listen and respond to various Slack events in real-time.\n- **Shortcut Handling**: Create and manage global and message shortcuts.\n- **View Submissions**: Process and respond to modal view submissions.\n- **Seamless NestJS Integration**: Utilize NestJS dependency injection and module system with Slack Bolt.\n- **Decorators for Easy Setup**: Use custom decorators to quickly set up event listeners.\n\n## Installation\n\n```bash\n$ npm install nestjs-slack-bolt\n# or\n$ yarn add nestjs-slack-bolt\n```\n\n## Quick Start\n\n1. Install the package\n2. Set up environment variables (see Configuration)\n3. Import SlackModule in your app.module.ts:\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { SlackModule } from 'nestjs-slack-bolt';\n\n@Module({\n  imports: [SlackModule.forRoot()],\n})\nexport class AppModule {}\n```\n\n4. Use decorators in your controllers to handle Slack events\n\n## Configuration\n\nAdd these variables to your `.env` file:\n\n```bash\n# Required for all modes\nSLACK_BOT_TOKEN=\"xoxb-your-bot-token\"\n\n# Required for socket mode\nSLACK_APP_TOKEN=\"xapp-your-app-token\"\nSLACK_SOCKET_MODE=true\n\n# Required for HTTP mode\nSLACK_SIGNING_SECRET=\"your-signing-secret\"\n```\n\nYou can also pass options to `SlackModule.forRoot()`:\n\n```typescript\nSlackModule.forRoot({\n  logLevel: LogLevel.DEBUG,\n  // other Bolt app options\n});\n```\n\n## Usage\n\n### Using annotations\n\n#### Handling a message event\n\n```typescript\nimport { Controller } from '@nestjs/common';\nimport { Message } from 'nestjs-slack-bolt';\nimport { SlackEventMiddlewareArgs } from '@slack/bolt';\n\n@Controller()\nexport class AppController {\n  @Message('hi')\n  message({ say }: SlackEventMiddlewareArgs\u003c'message'\u003e) {\n    say('Hello, I received your message!');\n  }\n  // Other handlers...\n}\n```\n\n#### Handling an action\n\n```typescript\nimport { Controller } from '@nestjs/common';\nimport { Action } from 'nestjs-slack-bolt';\nimport { SlackActionMiddlewareArgs } from '@slack/bolt';\n\n@Controller()\nexport class AppController {\n  @Action('click')\n  action({ say }: SlackActionMiddlewareArgs) {\n    say('Click event received, nice job!');\n  }\n  // Other handlers...\n}\n```\n\n#### Handling a command\n\n```typescript\nimport { Controller } from '@nestjs/common';\nimport { Command } from 'nestjs-slack-bolt';\nimport { SlackCommandMiddlewareArgs } from '@slack/bolt';\n\n@Controller()\nexport class AppController {\n  @Command('/list')\n  command({ say }: SlackCommandMiddlewareArgs) {\n    say('The /list command has been received. Processing...');\n  }\n  // Other handlers...\n}\n```\n\n#### Handling an event\n\n```typescript\nimport { Controller } from '@nestjs/common';\nimport { Event } from 'nestjs-slack-bolt';\nimport { SlackEventMiddlewareArgs } from '@slack/bolt';\n\n@Controller()\nexport class AppController {\n  @Event('app_home_opened')\n  event({ say }: SlackEventMiddlewareArgs\u003c'app_home_opened'\u003e) {\n    say('The app was just opened!');\n  }\n  // Other handlers...\n}\n```\n\n#### Handling a shortcut event\n\n```typescript\nimport { Controller } from '@nestjs/common';\nimport { Shortcut } from 'nestjs-slack-bolt';\n\n@Controller()\nexport class AppController {\n  @Shortcut('test_shortcut')\n  async shortcut({ shortcut, ack, client, logger }) {\n    try {\n      await ack(); //Acknowledge shortcut request\n\n      const result = await client.views.open({\n        trigger_id: shortcut.trigger_id,\n        view: {\n          /* Your view parameters */\n        },\n      });\n\n      logger.info(result); // Log the result\n    } catch (error) {\n      logger.error(error); // Log any error\n    }\n  }\n  // Other handlers...\n}\n```\n\n### Using the SlackService\n\n```typescript\nimport { Controller } from '@nestjs/common';\nimport { ConfigService } from '@nestjs/config';\nimport { SlackService } from 'nestjs-slack-bolt/services/slack.service';\nimport { Cron, CronExpression } from '@nestjs/schedule';\nimport { from } from 'rxjs';\n\n@Controller()\nexport class AppController {\n  constructor(\n    private readonly slackService: SlackService,\n    private readonly configService: ConfigService,\n  ) {}\n\n  @Cron(CronExpression.EVERY_10_SECONDS)\n  cronJob() {\n    this.searchUsers()\n      .pipe()\n      .subscribe((users) =\u003e {\n        console.log(JSON.stringify(users));\n      });\n  }\n\n  searchUsers(cursor?: string) {\n    return from(\n      this.slackService.client.users.list({\n        token: this.configService.get('SLACK_BOT_TOKEN'),\n        limit: 1,\n        ...(cursor \u0026\u0026 { cursor }),\n      }),\n    );\n  }\n}\n```\n\n## Troubleshooting\n\nHere are some common issues and their solutions:\n\n1. \"**Cannot find module 'nestjs-slack-bolt'**\": Ensure you've installed the package correctly.\n2. \"**Invalid token**\": Double-check your SLACK_BOT_TOKEN in the .env file.\n3. **Socket mode not working**: Verify that SLACK_APP_TOKEN is set and SLACK_SOCKET_MODE is true.\n\nFor more issues, please check our GitHub issues or open a new one.\n\n## Changelog\n\nSee CHANGELOG.md for details on recent changes.\n\n## Contributing\n\nWe welcome contributions! Please see our CONTRIBUTING.md for details on how to contribute.\n\n## Support\n\nFor support, please open an issue on our GitHub repository.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/bamada\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7466570?v=4?s=100\" width=\"100px;\" alt=\"madcam\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003emadcam\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bamada/nest-slack-bolt/commits?author=bamada\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/bamada/nest-slack-bolt/commits?author=bamada\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/bamada/nest-slack-bolt/commits?author=bamada\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/bamada/nest-slack-bolt/issues?q=author%3Abamada\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/nadirabbas\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/38838675?v=4?s=100\" width=\"100px;\" alt=\"Nadir Abbas\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNadir Abbas\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bamada/nest-slack-bolt/commits?author=nadirabbas\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/bamada/nest-slack-bolt/commits?author=nadirabbas\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/bamada/nest-slack-bolt/issues?q=author%3Anadirabbas\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/bamada/nest-slack-bolt/commits?author=nadirabbas\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/ognjenco\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/8527400?v=4?s=100\" width=\"100px;\" alt=\"ognjenco\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eognjenco\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bamada/nest-slack-bolt/issues?q=author%3Aognjenco\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/bamada/nest-slack-bolt/commits?author=ognjenco\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/bamada/nest-slack-bolt/commits?author=ognjenco\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/bamada/nest-slack-bolt/commits?author=ognjenco\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbamada%2Fnest-slack-bolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbamada%2Fnest-slack-bolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbamada%2Fnest-slack-bolt/lists"}