local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
local Webhook = "link"
local Timeout = 5
local CanUse = true
local Remote = script.Parent.Text
Remote.OnServerEvent:Connect(function(Player,Text)
if not CanUse then return end
if Text == "" then return end
CanUse = false
local PlayerImage = Players:GetUserThumbnailAsync(Player.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size420x420)
print(PlayerImage)
local Date = string.format("%s:%s, %s, %s",os.date("%H"),os.date("%M"),os.date("%d"),os.date("%B"))
print(Date)
local Data = {
["content"] = string.format('Reported "%s", at %s.',Text,Date),
["username"] = Player.Name,
["avatar_url"] = PlayerImage,
}
Data = HttpService:JSONEncode(Data)
HttpService:PostAsync(Webhook,Data) -- line 24
task.wait(Timeout)
CanUse = true
end)
…I manage to send some reports to a chat I have on my Discord server. However, I get the HTTP 400 (Bad Request) error at line 24. What am I doing wrong?
Of course. With the deprecated version. And even if it was the blocked URL, Studio should still work. Plus, the error for this is “Forbidden”. My problem is “Bad Request”.