For some reason, my webhook is not posting no matter what I set the content to. Everything I tried has failed, and I’m getting no errors in output. This is located inside the Basic Admin Module pretty far down inside of one of the functions.
local Data = {
["content"] = "hi"
}
local HTTP = game:GetService("HttpService")
local webhook = "https://discordapp.com/api/webhooks/private"
HTTP:PostAsync(webhook, HTTP:JSONEncode(Data))
Maybe try to put it in a function like this? I apologize, I have been reading off my Webhook script and we used a function.
local HTTP = game:GetService("HttpService")
local webhook = "https://discordapp.com/api/webhooks/private"
local Players = game:FindService("Players")
function fireWebhook()
local Data = {
content = "hi";
username = "Name";
}
HTTP:PostAsync(webhook, HTTP:JSONEncode(Data))
end
Players.PlayerAdded:Connect(fireWebhook)
Hello, are you sure the script is being called by your Basic Admin module? Can you print data successfully in this module? Is this located within some function? Is that function being fired?
Interesting, so I don’t think it’s Discord that is the issue. Put a print right before postBan(), and in the other if-statement to start debugging and see where the script is going in runtime.