var webhook_array = webhook_url.split(",");
console.log(webhook_array);
function send(item) {
console.log(item)
request.open("POST", item);
request.setRequestHeader('Content-type', 'application/json');
var myEmbed = {
title: embed_title,
color: hexToDecimal(hexcolour),
description: message_content,
footer: {
text: "Powered by Yapplex Tools",
icon_url: avatarurl,
}
}
var params = {
username: webhook_username,
avatar_url: avatarurl,
embeds: [ myEmbed ]
}
request.send(JSON.stringify(params));
}
webhook_array.forEach(send);
function hexToDecimal(hex) {
return parseInt(hex.replace("#",""), 16)
}
}
This code should go through each webhook in the array and send a message using them. It prints them to console meaning that they are there and that it can detect them, but only one of the webhooks is called(when tested using two webhooks)