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.

4 comments

0

I thought while putting links of discord servers and such on the web isn't permissible, sending HTTP requests to it is fine....?

0

Nvm, understood what the problem was.

0

Discord has blocked all webhook requests coming from Roblox servers You need to use a proxy to get around this.