
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
discord-webhook.js
Advanced tools
npm i discord-webhook.js
send info message:
const { Webhook } = require("discord-webhook.js")
const hook = new Webhook("WEBHOOK URL")
hook.info("WEBHOOK NAME", "this is info") // you can put avatar by adding hook.setAvatar("AVATAR URL")
Output:
send warn message:
const { Webhook } = require("discord-webhook.js")
const hook = new Webhook("WEBHOOK URL")
hook.warn("WEBHOOK NAME", "this is Warn")
Output:
send error message:
const { Webhook } = require("discord-webhook.js")
const hook = new Webhook("WEBHOOK URL")
hook.error("WEBHOOK NAME", "this is Error")
Output:
send success message:
const { Webhook } = require("discord-webhook.js")
const hook = new Webhook("WEBHOOK URL")
hook.success("WEBHOOK NAME", "this is Success")
Output:
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:
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("", {embeds:[embed]})
Output:
you can send text + embed
Example:
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("this is a message", {embed})
Output:
Example:
const { Webhook } = require("discord-webhook.js")
const hook = new Webhook("YOUR WEBHOOK URL")
hook.setUsername("Spidey Bot")
hook.setAvatar("AVATAR URL")
hook.sendFile("./filename.js") // you can send any file type not just js
Output:
FAQs
Always easy to send webhooks
The npm package discord-webhook.js receives a total of 0 weekly downloads. As such, discord-webhook.js popularity was classified as not popular.
We found that discord-webhook.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.