{"id":25984586,"url":"https://github.com/tejastn10/nest-pingbot","last_synced_at":"2026-04-11T15:39:37.022Z","repository":{"id":280789016,"uuid":"941076778","full_name":"tejastn10/nest-pingbot","owner":"tejastn10","description":"A NestJS messaging module for Slack and Discord notifications, built with a focus on simplicity and ease of use.","archived":false,"fork":false,"pushed_at":"2026-03-09T09:20:11.000Z","size":744,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-09T14:00:08.407Z","etag":null,"topics":["bot","discord","nestjs","slack","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nest-pingbot","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/tejastn10.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-01T12:35:02.000Z","updated_at":"2026-03-09T09:20:15.000Z","dependencies_parsed_at":"2025-03-05T10:32:18.092Z","dependency_job_id":"7ee80c75-a367-4c86-924b-936d64935af0","html_url":"https://github.com/tejastn10/nest-pingbot","commit_stats":null,"previous_names":["tejastn10/nest-pingbot"],"tags_count":9,"template":false,"template_full_name":"tejastn10/hearth","purl":"pkg:github/tejastn10/nest-pingbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejastn10%2Fnest-pingbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejastn10%2Fnest-pingbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejastn10%2Fnest-pingbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejastn10%2Fnest-pingbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tejastn10","download_url":"https://codeload.github.com/tejastn10/nest-pingbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejastn10%2Fnest-pingbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31686141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bot","discord","nestjs","slack","typescript"],"created_at":"2025-03-05T11:25:47.623Z","updated_at":"2026-04-11T15:39:36.986Z","avatar_url":"https://github.com/tejastn10.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.svg\" alt=\"Logo\"\u003e\n\u003c/p\u003e\n\n# Nest Pingbot 🔔\n\n![Node.js Version](https://img.shields.io/badge/Node.js-20%2B-339933?logo=nodedotjs\u0026logoColor=white)\n![TypeScript](https://img.shields.io/badge/TypeScript-5%2B-007ACC?logo=typescript\u0026logoColor=white)\n![NestJS](https://img.shields.io/badge/NestJS-10%2B-E0234E?logo=nestjs\u0026logoColor=white)\n![License](https://img.shields.io/badge/License-MIT-yellow?logo=open-source-initiative\u0026logoColor=white)\n[![NPM Version](https://img.shields.io/npm/v/nest-pingbot?logo=npm\u0026logoColor=white\u0026color=CB3837)](https://www.npmjs.com/package/nest-pingbot)\n[![Unit Tests](https://github.com/tejastn10/nest-pingbot/actions/workflows/unit-test.yml/badge.svg)](https://github.com/tejastn10/nest-pingbot/actions/workflows/unit-test.yml)\n\n**Nest Pingbot** is a flexible NestJS module for integrating Slack and Discord messaging capabilities into your applications. Send notifications, alerts, and messages to your team's communication channels directly from your NestJS application.\n\n---\n\n## Features ⚡\n\n- **Multi-Platform Support**: Send messages to both Slack and Discord from a single interface\n- **Platform-Specific Features**:\n  - **Slack**: Support for Block Kit UI elements, thread replies, and rich formatting\n  - **Discord**: Support for embeds and advanced message formatting\n- **Flexible Configuration**:\n  - Use only Slack, only Discord, or both simultaneously\n  - Clear error handling when platforms aren't configured\n- **Type Safety**:\n  - Full TypeScript support with proper interfaces for all message components\n  - Dedicated types for Slack Block Kit components\n- **Developer Experience**:\n  - Simple integration with any NestJS application\n  - Comprehensive test coverage\n  - Well-documented API\n\n---\n\n## Installation ⚙️\n\n```bash\nnpm install nest-pingbot\n```\n\n## Usage 🚀\n\n### Module Registration\n\nYou can register the module in multiple ways:\n\n#### Basic Registration\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { MessagingModule, MessagePlatform } from 'nest-pingbot';\n\n@Module({\n  imports: [\n    MessagingModule.register({\n      platforms: {\n        slack: {\n          token: 'your-slack-token',\n          // or\n          webhookUrl: 'your-slack-webhook-url',\n        },\n        discord: {\n          token: 'your-discord-token',\n        },\n      },\n      defaultPlatform: MessagePlatform.SLACK,\n      debug: true, // Optional debugging\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n#### Global Registration\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { MessagingModule } from 'nest-pingbot';\n\n@Module({\n  imports: [\n    MessagingModule.forRoot({\n      platforms: {\n        slack: {\n          token: process.env.SLACK_TOKEN,\n        },\n      },\n      debug: true,\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n#### Async Registration\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { MessagingModule } from 'nest-pingbot';\nimport { ConfigModule, ConfigService } from '@nestjs/config';\n\n@Module({\n  imports: [\n    ConfigModule.forRoot(),\n    MessagingModule.registerAsync({\n      imports: [ConfigModule],\n      inject: [ConfigService],\n      useFactory: (configService: ConfigService) =\u003e ({\n        platforms: {\n          slack: {\n            token: configService.get('SLACK_TOKEN'),\n          },\n          discord: {\n            token: configService.get('DISCORD_TOKEN'),\n          },\n        },\n        debug: configService.get('NODE_ENV') !== 'production',\n      }),\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### Sending Messages\n\nInject the MessagingService into your controllers or services:\n\n```typescript\nimport { Injectable } from '@nestjs/common';\nimport { MessagingService } from 'nest-pingbot';\n\n@Injectable()\nexport class NotificationService {\n  constructor(private readonly messagingService: MessagingService) {}\n\n  async sendAlert(message: string) {\n    return this.messagingService.sendMessage({\n      slack: {\n        channel: 'alerts',\n        text: message,\n        blocks: [\n          {\n            type: 'header',\n            text: {\n              type: 'plain_text',\n              text: 'New Alert',\n            },\n          },\n          {\n            type: 'section',\n            text: {\n              type: 'mrkdwn',\n              text: message,\n            },\n          },\n        ],\n      },\n      discord: {\n        channelId: '1234567890123456789',\n        content: 'New Alert',\n        embeds: [\n          {\n            title: 'Alert',\n            description: message,\n            color: 0xff0000,\n            timestamp: new Date(),\n          },\n        ],\n      },\n    });\n  }\n\n  async scheduleReminder(message: string, scheduledTime: Date) {\n    return this.messagingService.sendMessage({\n      slack: {\n        channel: 'reminders',\n        text: `Reminder: ${message}`,\n      },\n      schedule: {\n        time: scheduledTime,\n      },\n    });\n  }\n}\n```\n\n### Working with Threads\n\n#### Slack Threads\n\n```typescript\nasync continueSlackThread(threadTs: string, message: string) {\n  return this.messagingService.sendMessage({\n    slack: {\n      channel: 'general',\n      text: message,\n      threadTs: threadTs,\n    },\n  });\n}\n```\n\n#### Discord Threads\n\n```typescript\nasync continueDiscordThread(channelId: string, threadId: string, message: string) {\n  return this.messagingService.sendMessage({\n    discord: {\n      channelId: channelId,\n      threadId: threadId,\n      content: message,\n    },\n  });\n}\n```\n\n## API Reference 📒\n\n### MessagingService\n\nThe main service for sending messages:\n\n- `sendMessage(options: MessageOptions): Promise\u003cany\u003e` - Send messages to one or both platforms\n\n### MessageOptions\n\n```typescript\ninterface MessageOptions {\n  slack?: SlackMessageOptions;\n  discord?: DiscordMessageOptions;\n  schedule?: ScheduleOptions;\n}\n```\n\n### SlackMessageOptions\n\n```typescript\ninterface SlackMessageOptions {\n  channel: string;\n  text?: string;\n  blocks?: SlackBlock[];\n  threadTs?: string;\n  unfurlLinks?: boolean;\n  unfurlMedia?: boolean;\n  mrkdwn?: boolean;\n}\n```\n\n### DiscordMessageOptions\n\n```typescript\ninterface DiscordMessageOptions {\n  channelId: string;\n  content?: string;\n  embeds?: DiscordEmbed[];\n  threadId?: string;\n  components?: any[];\n}\n```\n\n### ScheduleOptions\n\n```typescript\ninterface ScheduleOptions {\n  time: Date;\n  timezone?: string;\n}\n```\n\n## Testing 🧪\n\nThe module includes comprehensive tests:\n\n```bash\n# Run unit tests\nnpm test\n```\n\n## Contributing 🤝\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License 📜\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.\n\n---\n\n## Acknowledgments 🙌\n\n- Built with **NestJS** for a structured and scalable messaging solution.\n- Inspired by the need for simple, unified messaging across different platforms.\n- Made with ❤️ for developers who need reliable communication integrations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftejastn10%2Fnest-pingbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftejastn10%2Fnest-pingbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftejastn10%2Fnest-pingbot/lists"}