Socket
Socket
Sign inDemoInstall

webhooks.js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webhooks.js

A fast & lightweight Node.js wrapper for the Discord Webhook API.


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Discord npm NPM downloads

npm installnfo

Table of Contents

About

Webhooks.js is a new, lightweight, and fast Node.js wrapper for the Discord Webhooks API.

  • Object Oriented
  • Up-to-Date

Installation

Node.js 12 or newer is required.

npm install webhooks.js --save

Examples

You can send a raw Webhook params object Read More

const hooks = require('webhooks.js')
const hook = new hooks.Webhook({ id: "your-webhook-id", token: "your-webhook-token" })

hook.send({
    username: "Webhook",
    content: "Hello!",
    embeds: [{
        title: "hello!"
    }]
})
.then(json => {
    console.log(json)
})
.catch(err => {
    console.error(err)
})

or you can send a string

const hooks = require('webhooks.js')
const hook = new hooks.Webhook({ id: "your-webhook-id", token: "your-webhook-token" })

hook.send("hello world!")
.then(json => {
    console.log(json)
})
.catch(err => {
    console.error(err)
})

or you can send a RichEmbed (different from Discord.js MessageEmbeds)


const hooks = require('webhooks.js')
const hook = new hooks.Webhook({ id: "your-webhook-id", token: "your-webhook-token" })

const embed = new hooks.RichEmbed()
.setTitle(`Embed test`)
.setTimestamp()
.setDescription("Test..?")

hook.send(embed)
.then(json => {
    console.log(json)
})
.catch(err => {
    console.error(err)
})

Help

You can get help in the Webhooks.js Discord Server in the #support channel.

Updates

v0.0.1

  • Published initial working code without README

v0.0.2

  • Published updated code with README

v0.0.3

  • Added typings and cleaned up some code.

Keywords

FAQs

Package last updated on 12 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc