HTTP 400 (Bad Request) Roblox Discord Webhook error

here
image

I use discord webhooks in a game to log admin commands here is what i use

local url = "" -- paste your webhook here
				local http = game:GetService("HttpService")
					local data = {
						['username'] = User,
						['content'] = Message
					}
					local newdata = http:JSONEncode(data)
					http:PostAsync(url, newdata)

here is also the params for discord JSON data

1 Like

Yes, I used this to create the image for the player. I think there is something with the data table though in the author section because before I added that it worked fine.

Is there a replacement for this or another way to create the same effect?

you are trying to make an embed like this correct (not saying i know how i am using a embed generator which just makes a link that i know about)
image

also what are you trying to have it look like some sort of image representation or description would be helpful :sweat_smile:

So like what I want it to look like? Something like this from another devforum post:
image

As you can see, it displays the avatar thumbnail as well as it’s name at the side, this is what I have now:
image

I know how to do something like this i will quickly write a script and test it give me about 10 minutes :sweat_smile:

Ok, thank you for responding so quickly

i replicated this without the use of an embed dont know if you specifically want the use of an embed but its simpler this way

Firstly, I use embed because it looks better and there are more options. Second of all the main problem is I want it too contain the image of the users avatar, so like a thumbnail. I’ve seen it done before on other Discord Servers so it must be possible.

discord auto embed images if you make it include a ..URL it will auto embed the image to discord i will quickly include this for demonstration

you can include this feature to get their profile or profile image url

Can I look at the code for the image?

My code to make the image? or the entire script making the message

The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). Are you sending the data to the correct endpoint? Are data encoded correctly into the json form?

made it so it autoloads the player’s avatar

image

I think I’ve traced the issue down. You are practically nesting another HTTP request inside another HTTP request and encoding the HTTP request into JSON data. If you would like to obtain the player thumbnail, I suggest checking out the API, and create a Discord JavaScript bot using discord.js and noblox.js.

After, you should make a request to the endpoint of the Roblox API thumbnails, similarly to what Roblox currently does.

In my opinion. that’s too much resouceful, I would just suggest removing the thumbnail.

Edit: Here is the Roblox API documentation https://api.roblox.com/docs?useConsolidatedPage=true

1 Like

Thank you for the knowledge, I will have a look and remote the thumbnail entirely