Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Discord embed not sending (error 400)?

Hey there! My Discord embed hasn't been sending, and I don't know why.

It gave me the error "HTTP 400 (Bad Request)", and I don't know what's wrong with my code! I've made sure HTTP services are on, and I've double checked my code, but I can't find what's wrong!

My code:

function sendWebhook(user, rank)
	local data = http:JSONEncode({
		{
			["content"] = "",
			["embeds"] = {{
					["title"] = "USER PROMOTED",
					["type"] = "rich",
					["color"] = tonumber(0xFFA500),
					["description"] = user..' has been promoted to '..rank..'!',
					["footer"] = 'AutoRank created by ParticularlyPenguin',
					
				}},
		},
	})
	http:PostAsync(webhook, data)
end

All help will be appreciated.

1 answer

✓ Accepted answer

Did A Bit Of Messing Around And Came Up With This:

function sendWebhook(user, rank)
local data ={
["embeds"] = {{
["color"] = 5368,
["title"] = "USER PROMOTED",
["description"] = user.." has been promoted to "..rank.."!",
["fields"] = {
}
}}
}
local newdata = http:JSONEncode(data)
http:PostAsync(webhook,newdata)
end

3 comments

0

The Color Codes May Be Found Here: https://www.colorschemer.com/roblox-color-codes/

0

I'll test this right now.

0

Worked well! Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.