In part of a UI I am making for my own fun, I added when pressing the ban command it fires and event to send a webhook, but it now errors when I added the reason part and claims it is HTTP 400 (Bad Request)`
local chat = game:GetService("Chat")
local HTTPService = game:GetService("HttpService")
local storage = game:GetService("ReplicatedStorage")
local sendLog = storage.:WaitForChild("Ban")
local GameName = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Name
local webhooktosend = ""
sendLog.OnServerEvent:Connect(function(person, accused, text) --member
local data =
{
["content"] = "",
["embeds"] = {{
["title"] = "__**Hybrid Karting Admin GUI**__",
["description"] = ""..person.Name.." has banned a player inside of "..GameName,
["type"] = "rich",
["color"] = tonumber(0xffffff),
["fields"] = {
{
["name"] = "Reason",
["value"] = text,
["inline"] = true,
},
{
["name"] = "Details",
["value"] = "Player Effected: "..accused,
["inline"] = true,
},
{
["name"] = "Game ran in:",
["value"] = GameName,
["inline"] = true,
},
{
["name"] = "Moderator:",
["value"] = person.Name,
["inline"] = true,
},
}
}}
}
local JSON = HTTPService:JSONEncode(data)
HTTPService:PostAsync(webhooktosend, JSON)
end)```
And this is to Fire the server in the Ban Button
local Frame = script.Parent.Parent.Parent.AdminFrame
local BanReason = Frame.Message
local PlayerBan = Frame.PlrNameLabel
Frame.Ban.MouseButton1Click:Connect(function()
if BanReason.Text ~= "" then
game:GetService("ReplicatedStorage"):WaitForChild("Ban"):FireServer(PlayerBan.Text)
end
end)
Frame.Ban.MouseButton1Click:Connect(function()
if PlayerBan.Text ~= "" then
game:GetService("ReplicatedStorage"):WaitForChild("Ban"):FireServer(BanReason.Text)
end
end)
Thank you!