Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

discord-hooks

mertssmnoglu28ISC1.0.3

Basic Discord WebHooks

discord, discord-hook, discord-hooks, discord-webhooks, webhook, webhooks

readme

Discord Hooks

Basic Discord Hooks

npm version npm downloads

About

Basic discord webhook library. Allows you to send messages, embeds to discord with webhooks.

Installation

npm install discord-hooks

Import

Import the discord-hooks module to your project.

import Webhook from "discord-hooks";

Commands

  • send(username, avatarUrl, content, embed)

const webhook = new Webhook("YOUR WEBHOOK URL")
webhook.send(
'USERNAME',
'AVATAR_URL',
'This is a test message!',
[
    {
        title: "Discord Hooks",
        url: "https://npmjs.com/package/discord-hooks",
        color: "#5865F2",
        description: "Basic discord webhook library. Allows you to send messages, embeds to discord with webhooks.",
        timestamp: new Date(),
        footer: {
            text: "This message sent with discord-hooks.",
            icon_url: "ICON_URL"
        }
    }
]
)
  • destory()

const webhook = new Webhook("YOUR WEBHOOK URL")
webhook.destroy().then(console.log("Webhook Destroyed!"));