nestjs-discord-webhook
TypeScript icon, indicating that this package has built-in type declarations

1.11.9 • Public • Published

nestjs-discord-webhook

Actions Status npm version

Nest.js + Discord Webhook Client

Description

A simple nestjs package to connect to Discord webhook using discord.js library.

Requirements

Discord.js Library version 14.7.1 or higher

Install

npm install nestjs-discord-webhook

Usage

@Module({
  imports: [
    DiscordModule.forRoot({
      url: "DISCORD_WEBHOOK_URL", // ref: 
    }),
  ],
})
export class AppModule {}

or using webhook token and id:

@Module({
  imports: [
    DiscordModule.forRoot({
      id: "DISCORD_WEBHOOK_ID", // ref: 
token: "DISCORD_WEBHOOK_TOKEN", // ref: }), ], }) export class AppModule {}

Inject IncomingWebhook instance

import { WebhookClient } from "discord.js" 

@Injectable() export class AppService { constructor( @InjectDiscord() private readonly discord: WebhookClient, ) {} }

Contributing

PRs accepted.

License

MIT © Andromeda7177

Changes needing to happen

  • remove redundant code from slant transfer to discord platform
  • Fix bug to allow nestjs configModule service paramaters to discordModule.forAsync useFactory

Supporting

This software is based on G59 nestjs-slack-webhook package

Extra Support

Buy Me A Coffee

Readme

Keywords

Package Sidebar

Install

npm i nestjs-discord-webhook

Weekly Downloads

8

Version

1.11.9

License

MIT

Unpacked Size

36.3 kB

Total Files

36

Last publish

Collaborators

  • raykia