Hi,
I've been learning scripting recently and I'm struggling right now when trying to send a Discord message using a fetchRemote() function. I think I did nothing wrong when initializing the webhook, but still it doesn't send anything. Is there anyone, who might know the cause of this problem?
function testWebhook()
local url = "https://discordapp.com/api/webhooks/..."
if url then
sendOptions = {
queueName = "default",
connectionAttempts = 3,
connectTimeout = 5000,
formFields = {
content = "test"
},
}
fetchRemote (url, sendOptions, function()end)
else
outputDebugString("Webhook not provided.");
end
end
addEventHandler("onResourceStart", getResourceRootElement(), testWebhook)
Thanks.