Files
discord.js/docs/examples/webhook.js
2020-06-19 11:46:59 +02:00

20 lines
591 B
JavaScript

'use strict';
/**
* Send a message using a webhook
*/
// Import the discord.js module
const Discord = require('discord.js');
/*
* Create a new webhook
* The Webhooks ID and token can be found in the URL, when you request that URL, or in the response body.
* https://discord.com/api/webhooks/12345678910/T0kEn0fw3Bh00K
* ^^^^^^^^^^ ^^^^^^^^^^^^
* Webhook ID Webhook Token
*/
const hook = new Discord.WebhookClient('webhook id', 'webhook token');
// Send a message using the webhook
hook.send('I am now alive!');