Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
webcord
Advanced tools
Readme
Webcord is an easy to use, Discord compliant webhook module for Node.js, featuring a simplistic design inspired by Discord.js message embeds.
It ships with Typescript support by default (no need to create those pesky typings), and requires zero dependencies!
Using npm:
npm install webcord
The code below features every method built into Webcord. Think of it as the documentation. Highlighting over the code in Visual Studio Code also shows what the methods do.
const webcord = require("webcord")
new webcord({
url: "https://discordapp.com/api/webhooks/712433174063349761/-YgMVHCyQlfxval8rwJYO79CuJjrIj1jwAqePLluBgfQseU0FFH1GhEeiJf8bxnmfWOQ", // Discord webhook url
name: "Webcord v2.0.0", // Webhook display name
avatar: "https://cdn.clipart.email/401241ecd4daff63d501b958f75a734b_discord-logo-icon-293532-free-icons-library_250-250.png" // Webhook display avatar
}) // Configures the webhook
.setTitle("Add titles like this") // Sets an embed title
.setDescription("Set some descriptions") // Sets an embed description
.addField('Add single fields:', "like me!", false) // Adds an embed field (max 25 fields)
.addFields({
name: "Hate repeating yourself?",
value: "set mutliple fields with the `.addFields()`!",
inline: false
},
{
name: "I'm another field",
value: "Set with the `addFields()` method!",
inline: false
}) // Adds multiple fields at once (max 25 fields)
.setAuthor({
name: "Easily set an author field",
icon: "https://discord.com/assets/2c21aeda16de354ba5334551a883b481.png",
url: "https://www.npmjs.com/package/webcord"
}) // Sets an embed author
.setFooter({
text: "I'm a footer",
icon: "https://discord.com/assets/e05ead6e6ebc08df9291738d0aa6986d.png"
}) // Sets an embed footer
.setURL("https://www.npmjs.com/package/webcord") // Adds a URL to the embeds title
.setImage("https://discord.com/assets/fc0b01fe10a0b8c602fb0106d8189d9b.png") // Sets the image of the embed
.setTimestamp() // Sets the timestamp of the embed
.setThumbnail("https://discord.com/assets/f72fbed55baa5642d5a0348bab7d7226.png")
.setColor("#7289DA") // Sets an embed color
.inc() // Creates another embed
.setTitle("This title is a part of the new embed!") // Creates a title on the new embed
.send("This is an optional plain text message").then((res) => {
console.log(res) //Logs all request information to the console
})
/*
Every webcord message must use the .send() method at the end to fire the POST request.
It also supports a promise which returns request information after the POST request is sent out.
*/
The above code outputs this:
Webcord Contributors can be found here! Want to contribute? Follow the Contributing Guide!
FAQs
A lightweight library for interacting with Discord webhooks.
The npm package webcord receives a total of 1 weekly downloads. As such, webcord popularity was classified as not popular.
We found that webcord demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.