Socket
Book a DemoInstallSign in
Socket

gleamingexaltedactivemovie

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

gleamingexaltedactivemovie

![pic](https://cdn.discordapp.com/attachments/874714297324957747/877000930590064680/final.png) Join the Official [Discord support server](https://discord.gg/QWS3zcAPXb)

unpublished
latest
npmnpm
Version
1.0.0-dev
Version published
Maintainers
1
Created
Source

discord-webhook.js ⚡

a simple package to interact with discord webhooks

pic Join the Official Discord support server

content

How to install ?

npm i discord-webhook.js

Presets

send info message:

const { Webhook } = require("discord-webhook.js")
const hook = new Webhook("WEBHOOK URL")
hook.sendInfo("WEBHOOK NAME", "this is info") // you can put avatar by adding hook.setAvatar("AVATAR URL")

Output:
example
send Warn message:

const { Webhook } = require("discord-webhook.js")
const hook = new Webhook("WEBHOOK URL")
hook.sendWarn("WEBHOOK NAME", "this is Warn")

Output:
example
send Error message:

const { Webhook } = require("discord-webhook.js")
const hook = new Webhook("WEBHOOK URL")
hook.sendErr("WEBHOOK NAME", "this is Error")

Output:
example
send Success message:

const { Webhook } = require("discord-webhook.js")
const hook = new Webhook("WEBHOOK URL")
hook.sendSuccess("WEBHOOK NAME", "this is Success")

Output:
example

Usage

How to send message?

const { Webhook } = require("discord-webhook.js")
const hook = new Webhook("YOUR WEBHOOK URL")
hook.setUsername("discord-webhooks.js")
hook.setAvatar("AVATAR URL")

hook.send("hi there!!")

Output:
OUTPUT
how to send embed ?

const { Webhook, MessageBuilder } = require("discord-webhook.js")
const hook = new Webhook("YOUR WEBHOOK URL")
const embed = new MessageBuilder()
.setTitle('My title here')
.setAuthor('author', 'https://cdn.discordapp.com/embed/avatars/0.png', 'https://www.google.com')
.setURL('https://www.google.com')
.addField('field', 'this is inline', true)
.addField('field', 'this is not inline') // deafult is false
.setColor('#00b0f4')
.setThumbnail('https://cdn.discordapp.com/embed/avatars/0.png')
.setDescription('description')
.setImage('https://cdn.discordapp.com/embed/avatars/0.png')
.setFooter('Footer', 'https://cdn.discordapp.com/embed/avatars/0.png')
.setTimestamp();
hook.setUsername("Discord")
hook.send(embed)

Output:
OUTPUT
you can send text + embed by using .setText() Example:

const { Webhook, MessageBuilder } = require("discord-webhook.js")
const hook = new Webhook("YOUR WEBHOOK URL")
const embed = new MessageBuilder()
.setText("this is a message")
.setTitle('My title here')
.setAuthor('author', 'https://cdn.discordapp.com/embed/avatars/0.png', 'https://www.google.com')
.setURL('https://www.google.com')
.addField('field', 'this is inline', true)
.addField('field', 'this is not inline') // deafult is false
.setColor('#00b0f4')
.setThumbnail('https://cdn.discordapp.com/embed/avatars/0.png')
.setDescription('description')
.setImage('https://cdn.discordapp.com/embed/avatars/0.png')
.setFooter('Footer', 'https://cdn.discordapp.com/embed/avatars/0.png')
.setTimestamp();
hook.setUsername("Discord")
hook.send(embed)

Output:
OUTPUT

FAQs

Package last updated on 17 Aug 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