Http problem i have. Please help

I am trying to make a application center. I’ve made a table of answers that given
by player and i’ve sent them to server with remote events! And i’ve write them into a content for discord.

And don’t worked. No errors, no warns and no message in discord! Is that a blackhole that i made? Help me please. And HttpEnabled is true.

local httpService = game:GetService("HttpService")
local webhookUrl = "u are not my type"

game.ReplicatedStorage.FormToServer.OnServerEvent:Connect(function(player, answer1, answer2, answer3, answer4, answer5)
	local contentData = {
		['content'] = "Application sent by ".. player.Name,
		['embeds'] = {
			['title'] = "Application",
			['description'] = "Q1: ".. tostring(answer1).. "\nQ2: ".. tostring(answer2).. "\nQ3: ".. tostring(answer3).. "\nQ4: ".. tostring(answer4).. "\nQ5: ".. tostring(answer5),
			['color'] = 16614400,
			['footer'] = {
				['text'] = "Application sent by ".. player.Name, }
		} 
	}

	local sentData = httpService:JSONEncode(contentData)
	httpService:PostAsync(webhookUrl, sentData)
end)

If I recall correctly, the embeds key should be an array, which yours is not. You’re setting the embeds key to be the embed information, which doesn’t work.

To fix that, you just make the embed information it’s own table, and then put it in the embeds array, something like this:

['embeds'] = {
	{
		['title'] = "Application",
		['description'] = "Q1: ".. tostring(answer1).. "\nQ2: ".. tostring(answer2).. "\nQ3: ".. tostring(answer3).. "\nQ4: ".. tostring(answer4).. "\nQ5: ".. tostring(answer5),
		['color'] = 16614400,
		['footer'] = {
			['text'] = "Application sent by ".. player.Name, 
		}
	}
} 
1 Like