What did I do wrong here? Errors with “HTTP 400 (Bad Request”)
function encodeJSON(Text)
local HttpService = game:GetService("HttpService");
local messageData = {
["contents"] = Text;
};
messageData = HttpService:JSONEncode(messageData);
return messageData;
end;
function postRequest(URL, Data)
local HttpService = game:GetService("HttpService");
HttpService:PostAsync(URL, Data)
end;
function sendWebhook(Text)
local Webhook = "https://discord.com/api/webhooks/xxx/xxx"; -- Don't want to get spammed.
local Message = encodeJSON(Text);
postRequest(Webhook, Message);
end;
wait(5);
sendWebhook("testing this bro");