I need help with a embed structure, I am trying to add a footer but when it runs I get error 400. Here is my code
local HttpService = game:GetService("HttpService")
local function twoDigitsString(n)
if n == 0 then
return "00"
elseif n < 10 then
return "0" .. n
else
return tostring(n)
end
end
local EST_SECONDS = os.time() - 14400
local date = os.date("!*t", EST_SECONDS)
local textDate = date.year .. "-" .. twoDigitsString(date.month) .. "-" .. twoDigitsString(date.day)
local textTime = twoDigitsString(date.hour) .. ":" .. twoDigitsString(date.min) .. ":" .. twoDigitsString(date.sec)
game.Players.PlayerAdded:Connect(function(player)
local data = {
["content"] = "",
["embeds"] = {{
["title"] = "Join Logs",
["type"] = "rich",
["color"] = tonumber(0xffffff),
["fields"] = {
{
["title"] = "Player: ",
["value"] = player.name,
["inline"] = true,
},
{
["title"] = "User Id: ",
["value"] = player.UserId,
}
},
["footer"] = {
{
["icon_url"] = "",
["value"] = "Player joined: "..textDate.." at "..textTime,
}
}
}}
}
local newdata = HttpService:JSONEncode(data)
HttpService:PostAsync("Webhookurl", newdata)
end)