Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

5 comments

0

P.S It DOES print "sent"

1

I believe discord blocks roblox requests, but i'm not to sure. Reach out to them on twitter

0

he's using osyr.is thingy so discord doesn't block it

0

Is FE enabled?

0

Filtering Enabled is on, yes

1 answer

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.

1 comment

0

No, its not. Because it works, but it stops working when the string and the plr.UserId are together in ['username']

This discussion is preserved as it was. New answers, comments, and votes are closed.