
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
discord-webhook-ts
Advanced tools
Predefined TypeScript types and documentation for Discord webhook requests.
This package contains type definitions for all properties you can pass to a Discord webhook execution request, along with descriptions for each property.
Pull in the package from npm:
npm install discord-webhook-ts
Pull in the webhook client and enjoy auto-completion from your IDE.
import DiscordWebhook from 'discord-webhook-ts';
// Pass in your Discord webhook URL.
const discordClient = new DiscordWebhook('https://discordapp.com/api/webhooks/4752...');
discordClient.execute({
embeds: [
{
title: 'Some title',
description: 'Some description',
},
{
fields: [
{
name: 'Some field',
value: 'Some field value',
}
]
}
]
}).then((response) => {
console.log('Successfully sent webhook.')
})
discordClient.get().then((response) => console.log(response.data))
discordClient.modify({
name: 'new name',
avatar: 'https://via.placeholder.com/150',
}).then((response) => {
console.log('Successfully updated webhook!');
})
Pull in and attach the Discord Webhook.input.POST
interface to your request object.
import DiscordWebhook, { Webhook } from 'discord-webhook-ts';
// Pass in your Discord webhook URL.
const discordClient = new DiscordWebhook('https://discordapp.com/api/webhooks/4752...');
const requestBody: Webhook.input.POST = {
embeds: [
{
title: 'Some title',
description: 'Some description',
},
{
fields: [
{
name: 'Some field',
value: 'Some field value',
}
]
}
]
};
discordClient.execute(requestBody) // -> Promise<AxiosResponse>
Contributions are more than welcome! If you spot a missing or incorrectly formatted or documented property, just submit a pull request.
This repository is licensed under the ISC license.
Copyright (c) 2019, Jørgen Vatle.
FAQs
Client & Type definitions for the Discord Webhooks API. 📘
The npm package discord-webhook-ts receives a total of 516 weekly downloads. As such, discord-webhook-ts popularity was classified as not popular.
We found that discord-webhook-ts 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.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.