mirror of
https://github.com/Nezumi-2711/cloudflare-gateway-pihole-scripts.git
synced 2026-09-22 13:38:37 +00:00
Improve compatibility with non-Discord webhooks
This commit is contained in:
+2
-1
@@ -27,7 +27,8 @@ if (!globalThis.fetch) {
|
|||||||
*/
|
*/
|
||||||
async function sendMessageToWebhook(url, message) {
|
async function sendMessageToWebhook(url, message) {
|
||||||
// Create the payload object with the message
|
// Create the payload object with the message
|
||||||
const payload = { content: message };
|
// The message is provided as 2 different properties to improve compatibility with webhook servers outside Discord
|
||||||
|
const payload = { content: message, body: message };
|
||||||
|
|
||||||
// Send a POST request to the webhook url with the payload as JSON
|
// Send a POST request to the webhook url with the payload as JSON
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user