whatever I do, it doesn’t work anyway, I checked everything about 30 times and it still shows me an HTML 400 error.
Code:
local HttpData = {
embeds = {
{
title = "A Secret weapon was earned!",
color = 16720621,
fields = {
{
name = "Player",
value = "1",
inline = true
},
{
name = "Weapon",
value = "2",
inline = true
},
{
name = "Rarity",
value = "3",
inline = true
}
},
thumbnail = {
url = "https://media.discordapp.net/attachments/--" -- hidden
}
}
}
}
local Success, Failure = pcall(function()
game.ReplicatedStorage:WaitForChild("PostDiscordMessageAsync"):InvokeServer(game:GetService("HttpService"):JSONEncode(HttpData))
end)
if not Success then
warn(Failure)
end
game.ReplicatedStorage:WaitForChild("PostDiscordMessageAsync"):InvokeServer(game:GetService("HttpService"):JSONEncode(HttpData))
What server-side code is this invoking?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local HttpService = game:GetService("HttpService")
local Url = "https://discord.com/api/webhooks/" -- hidden
local RemoteFunction = Instance.new("RemoteFunction")
RemoteFunction.Name = "PostDiscordMessageAsync"
RemoteFunction.Parent = ReplicatedStorage
function RemoteFunction.OnServerInvoke(Player, Data)
HttpService:PostAsync(Url, HttpService:JSONEncode(Data))
end