Discord Embed Help

I’m currently trying to log some information sent from the game to Discord. I am getting the same error, HTTP 400 (Bad Request)

Things I have checked for:
If HTTP Requests were on in studio
Discord webhook correct
No errors in the embed or code

Code:

local EmbedData = {
						["embeds"] = {
							["description"] = "Staff\n"..Staff.Name.."\n\nPatient\n"..FinaleReceiver.."\n\nDepartment\n"..Bindable.."\n\nServer Id\n"..game.JobId,
							["color"] = tonumber(0x90ecff)
						}
					}
					game["HttpService"]:PostAsync(CheckInWebhook, game["HttpService"]:JSONEncode(EmbedData))

If anyone can help me, that would be great. I’ve been stuck on this issue for a while now.

Embeds is an array, not an object:

{
    "embeds":[{"description":"string"}]
}
3 Likes

That doesn’t work either. I get Expected '=' when parsing table field, go ':'

Because I sent json

{
    embeds={{description="string"}}
}
3 Likes

I’ve had this error before.

It has something to do with your code - there are many YouTube tutorials out there that can help you find the error.

It is mainly you formatting the code incorrectly, which happened to me too.

local HttpService = game:GetService("HttpService")

local webhook = "insert-webhook-here"

      local data = {
    				["content"] = "",
    				["embeds"] = {{
    					["title"] = "Bob Chatter",
    					["description"] = ("Bob said something!"),
    					["type"] = "rich",
    					["color"] = tonumber(0x5BC2C2),
    					["fields"] = {
    						{
    							["name"] = "Bob says:",
    							["value"] = "Hello!",
    							["inline"] = true
    					    },
    					}
    				}}
      }
  HttpService:PostAsync(webhook, HttpService:JSONEncode(data))
1 Like