How to send a Discord webhook through Roblox

Thank you very much, I appreciate it!

2 Likes

Please leave a like on the post if you found it helpful :happy1:

2 Likes

API is up 24/7 so you shouldn’t encounter any issues and no rate limit is set in place. Highly recommend using this for your game/project.

2 Likes

Developers are really obsessed with abusing Discord webhooks, huh? :tired_face:

I understand there are some good intentioned uses of them but I know for a fact that a lot of developers are just going to use them for logging that they should otherwise be doing through DataStores or proper services/software rather than a chat room.

I hope you have rate limiting there. It’s the very least you could do if you’re going to make a proxy assuming Discord doesn’t ban your proxy server when developers start abusing them again as usual. Gets old after a while to tell people they shouldn’t misuse features.

7 Likes

I beg to differ, in fact logging through discord offers a lot of advantages, such as staff being able to see them through channels. Yes, it can be abused in big games, but the servers are proxied through cloudflare. I appreciated your concern and I will take your feedback to heart and add a partial rate limit of 100 per second. Before a 5 minute timeout.

Thank you for your concern though, it’s very much appreciated.

2 Likes

I’ll leave these two here (out of many other similar posts I’ve made, they’re just the most recent ones) and won’t comment further. It gets tiring after a while to keep telling people that perceived advantages of misusing webhooks to log are not real advantages and are just signs of complacency and laziness. This is why Roblox’s UserAgent got banned again to begin with.

5 Likes

UPDATE: Status codes now return for requests. On a successful request, a status code of 200 will return, etc.

1 Like

Does anyone have any suggestions on things I could make better? I am currently adding an API where you can add multiple embeds to the webhook.

1 Like

Hmm… This link doesn’t work.

1 Like

Overall, seems really good! Thank you!

Thank you! If it helped please leave a like. Also in your previous post, thank you for alerting me that the link didn’t work.

RobloxStudioBeta_skABpqjPbo
It shows red syntax on content_type
That’s obviously because it’s written in Lua format, but it’s supposed to be in JSON format
Can anyone help me please?
(Im new to this)

1 Like

Content Type isn’t relevant just remove that argument

1 Like

You should of removed that in your code.

My bad, I do apologise for any inconvenience caused.

A RATE LIMIT OF 10 REQUESTS A SECOND HAD BEEN ADDED

Exceeding this ratelimit will result in a 1 hour timeout from the API

Due to a high amount of requests, the ratelimit has been increased to 60 a minute, I recommend adding a debounce to any of your scripts that utilise this function and to secure remote events to prevent exploiters hijacking this vulnerability.

Good job! It worked out fine for me after some small corrections.

Thank you! If you enjoyed it please make sure to leave a like.

HOW TO ADD DEBOUNCE TO WEBHOOK CHATLOGS EXAMPLE

local debounce = 0 
game.Players.PlayerAdded:Connect(function(Player)
    Player.Chatted:Connect(function(Message)
        local data = {
            ['WebhookURL'] = 'https://discord.com/webhook/blahblahblah'
            ['WebhookData'] = {['username']='xG_andalf', ['content']=Message}
        }
        if debounce > 59 then repeat wait(1) until debounce == 0 end end
        local https = game:GetService('HttpService')
        local data = https:JSONEncode(data)
        local success,errorm = pcall(function()
            https:PostAsync('https://bloxrank.com/api/webhook/', data)
        end)
    end)
end)

local RuntimeService = game:GetService('RuntimeService')

function resetcalldowns() 
    while true do 
        wait(60)
        debounce = 0
    end
end

local coro = coroutine.create(resetcalldowns())
coroutine.resume(coro)

If you require anymore help, feel free to send me a message or reply to this post

2 Likes