Webhook
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
const { Webhook } = require('discord-webhook-node');
|
||||
|
||||
|
||||
function SendMessageWebhook(title, description, webhookUrl) {
|
||||
let url = webhookUrl;
|
||||
let content = `**${title}**\n${description}`;
|
||||
|
||||
if (!url) {
|
||||
// Fallback for 2 arguments: SendMessageWebhook(content, url)
|
||||
url = description;
|
||||
content = title;
|
||||
}
|
||||
|
||||
const hook = new Webhook(url);
|
||||
hook.send(content);
|
||||
}
|
||||
|
||||
const { Webhook } = require('discord-webhook-node');
|
||||
|
||||
|
||||
function SendMessageWebhook(title, description, webhookUrl) {
|
||||
let url = webhookUrl;
|
||||
let content = `**${title}**\n${description}`;
|
||||
|
||||
if (!url) {
|
||||
// Fallback for 2 arguments: SendMessageWebhook(content, url)
|
||||
url = description;
|
||||
content = title;
|
||||
}
|
||||
|
||||
const hook = new Webhook(url);
|
||||
hook.send(content);
|
||||
}
|
||||
|
||||
module.exports = SendMessageWebhook;
|
||||
Reference in New Issue
Block a user