Improve compatibility with non-Discord webhooks

This commit is contained in:
mrrfv
2023-11-09 17:04:28 +01:00
committed by GitHub
parent 111b029776
commit cf941737d5
+2 -1
View File
@@ -27,7 +27,8 @@ if (!globalThis.fetch) {
*/
async function sendMessageToWebhook(url, 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
try {