Hey everyone, so I’m trying to make an application center, which will send an embed to a Discord webhook, but when sending it, it throws 400 HTTP Error
.
Script:
local Event = game.ReplicatedStorage.RemoteEvent
local wh = "https://ptb.discord.com/api/webhooks/****/**********"
Event.OnServerEvent:Connect(function(player, q1, q2, q3, q4, q5, q6, q7, q8, q9)
local HttpService = game:GetService("HttpService")
local data =
{
["content"] = "New Application Pushed",
["embeds"] = {{
["title"] = "__**New Application**__",
["description"] = player.Name .. " has submitted an application.",
["type"] = "rich",
["color"] = tonumber(0xffffff),
["fields"] = {
{
["name"] = "__Question 1__",
["value"] = q1,
},
{
["name"] = "__Question 2__",
["value"] = q2,
},
{
["name"] = "__Question 3__",
["value"] = q3,
},
{
["name"] = "__Question 4__",
["value"] = q4,
},
{
["name"] = "__Question 5__",
["value"] = q5,
},
{
["name"] = "__Question 6__",
["value"] = q6,
},
{
["name"] = "__Question 7__",
["value"] = q7,
},
{
["name"] = "__Question 8__",
["value"] = q8,
},
{
["name"] = "__Question 9__",
["value"] = q9,
}
}
}}
}
local finalizedData = HttpService:JSONEncode(data)
HttpService:PostAsync(wh, finalizedData)
end)