Webhook not working. (Bad Request, likely Data formatting.)

Making a user report system with embeds. I already have a feedback system that works perfectly fine, so I just copy and pasted and added more tables, but this time, it’s not working.

Here’s my code:

local function ReportPlayer(plr, UserReport, Reason)
	if not table.find(BlacklistedUsers, plr.UserId) then
		local Data = {
			["content"] = "",
			["embeds"] = {{
				["title"] = "Feedback Form",
				["description"] = "",
				["type"] = "rich",
				["color"] = tonumber(0xed0404),
				["footer"] = {
					["text"] = "Sent by ACC Training Center at: " .. os.date("%x")
				},
				["fields"] = {
					{
						["name"]= "Username",
						["value"]= plr.Name,
						["inline"] = true
					},
					{
						["name"]= "UserId",
						["value"] = plr.UserId,
						["inline"]= true
					},
					{
						["name"] = "Time Sent",
						["value"] = os.date("%c"),
						["inline"] = true
					},
					{
						["name"]= "User Reported",
						["value"] = UserReport,
						["inline"] = false
					},
					{
						["name"]= "Reason",
						["value"] = Reason,
						["inline"] = true
					}
				}},
			}}

		HS:PostAsync(Webhook,Data)
		return "Sent"
	elseif table.find(BlacklistedUsers, plr.UserId) then
		return "Blacklisted"
	else
		return "Error"
	end
	
end

You probably don’t need this, but this is the LocalScript:

local Success = ReportEvent:InvokeServer(Parent.Username.Text, Parent.Reason.Text)
  1. The webhook link is perfectly correct, I just didn’t give you it. (I tested it out with the feedback system. It’s the same script.
  2. It’s the regular HTTP 400 (Bad Request) error.

Honestly don’t know what else to say,

Also, due to the fact of the HTTP 400 error, I know the if statement works perfectly fine.

Help is greatly appreciated.

1 Like

I forgot to JSON Encode it, smh, that’s why.

Discord can’t return empty strings, like this one:

[“description”] = “”,

1 Like

Well um, I just did. So uhhh… Idk what to say.
image

I assume it was that since I had an issue in one of my fields being left empty, but I guess it only counts for fields then.