Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does PostAsync to discord bot returns error 403?

Asked by
Z_DC 104
6 years ago

I have the following script in serverscriptservice:

local url = "a correct url"
local data = {
    ["username"] = "Bot",
    ["content"] = "Test"
}

workspace.Baseplate.Touched:Connect(function(part)
    game:GetService("HttpService"):PostAsync("https://discordapp.com/api/webhooks/" .. url, game:GetService("HttpService"):JSONEncode(data))
end)

I have enabled HTTP service.

This works completely fine on studio mode, both Server and Play modes, but it does not work online.

I receive this error when activating this online:

HTTP 403 (HTTP/1.1 403 Forbidden) Stack Begin Script 'Workspace.Script', Line 8 Stack End

What is the problem with my script and why does it not work? I am fairly new to the HTTP service regarding Discord, and therefore I probably made a newbie mistake.

0
I thought while putting links of discord servers and such on the web isn't permissible, sending HTTP requests to it is fine....? Z_DC 104 — 6y
0
Nvm, understood what the problem was. Z_DC 104 — 6y
0
Discord has blocked all webhook requests coming from Roblox servers You need to use a proxy to get around this. Timmerman73 85 — 6y

Answer this question