Yes, I tested on everything and it’s still saying that error.
Sometimes you get lucky, because there are 3 different server headers that can be used for an HttpRequest. You could get lucky with one that isn’t blocked, or you could get one that’s blocked. It’s kinda roulette sometimes.
1 Like
Okay, thanks for helping!
1 Like
I’ve just tested in studio and in game and the webhook works fine. I believe improper formatting is causing your problem.
I’ve ran this code and it works fine.
local HttpServ = game:GetService('HttpService')
local url = "https://discord.com/api/webhooks/123" -- change this
function TestWebhook()
local data =
{
["avatar_url"] = "",
["content"] = "",
["embeds"] = {{
["title"] = "TEST BOT",
["description"] = "TEST",
["type"] = "rich",
["color"] = tonumber(16711680),
["fields"] = {
{
["name"] = "Username",
["value"] = "Player1",
["inline"] = true
},
{
["name"] = "TEST FIELD 1",
["value"] = 0,
["inline"] = true
},
{
["name"] = "TEST FIELD 2",
["value"] = "test",
["inline"] = false
},
{
["name"] = "TEST FIELD 3",
["value"] = "test",
["inline"] = false
}
}
}}
}
local newdata = HttpServ:JSONEncode(data)
HttpServ:PostAsync(url, newdata)
end
TestWebhook()
The problem was that you forgot the name key.
The code you used
['fields'] = {
{
['value']="Report: "..V,
['inline']=true
}
}
Should have been
['fields'] = {
{
["name"] = "Report:",
['value']= V,
['inline']= true
}
}
Worked, thank you so much!
OP most likely deleted it and made a new one for security reasons.
Okay, I get it why he deleted it, someone might have runned a code that will spam his disco.