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

Why isn't this http request to a discord webhook not working?

Asked by 5 years ago

I know its part of the ['username'] because it works, but it stops working when I have the string and the plr.UserId together

local url = "https://discord.osyr.is/api/webhooks/my-webhook"
local http = game:GetService('HttpService')
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr, msg)


        local data = {
            ['username'] = plr.Name.." User Id: "..plr.UserId,
            ['content'] = msg
        }
        local newdata = http:JSONEncode(data)
        http:PostAsync(url,newdata)
        print('sent')

    end)
0
P.S It DOES print "sent" knightking_laval -4 — 5y
1
I believe discord blocks roblox requests, but i'm not to sure. Reach out to them on twitter green271 635 — 5y
0
he's using osyr.is thingy so discord doesn't block it Sonostor 17 — 5y
0
Is FE enabled? c5or 8 — 5y
0
Filtering Enabled is on, yes knightking_laval -4 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Discord started blocking webhook requests from Roblox servers because they were being abused for things like game error logging and storing arbitrary data outside of Roblox.

To get around this, you can use try to use a proxy server as detailed in this devforum post.

However, it's only a matter of time until Discord finds each proxy and blocks them too, so I wouldn't rely too heavily on connecting to Discord in this way for your game.

Edit: After re-reading your code, it seems that you're already using the proxy, so it could be that Discord has already found it and blocked requests from that IP address.

0
No, its not. Because it works, but it stops working when the string and the `plr.UserId` are together in ['username'] knightking_laval -4 — 5y
Ad

Answer this question