HTTP 400: Bad Request when adding a webhook?
Asked by
4 years ago Edited 4 years ago
Hi Everyone!
I wanted to make a webhook in my discord server that will take certain text posted by the server in the roblox chat onto a channel in my discord server. Since the text can only be sent through a local script, i use a remote event to tell another script to send the text to the discord server. Here is some of the local script:
2 | [ "Data" ] = player.Name .. " Has Beaten " .. message .. " in " .. timebeaten .. "!" .. extra |
4 | local encodedText = http:JSONEncode(text) |
5 | game.ReplicatedStorage.Completion:FireServer(encodedText) |
Here is how the script takes the event and attempts to post the message in the discord server
1 | http = game:GetService( "HttpService" ) |
3 | game.ReplicatedStorage.Completion.OnServerEvent:Connect( function (encodedText) |
4 | http:PostAsync( "[the webhook lol]" , encodedText) |
For some reason, the output is returning "HTTP 400: Bad Request", and it takes me to the PostAsync line. The URL of the webhook is accurate as well, its just not fully seen in the code block. Can someone tell me whats wrong?
Any help is appreciated :)