WebhookProxy | Discord webhooks go brrrrrrr

Makes sense, thanks for reporting the outage, I thought there was something in my code that was breaking it.

Is that a Transformer character?
Man I’m acting like a child

sorry for bumping i hate myself

1 Like

It doesn’t return anything. It just slows down your request when you hit the limit until you stop being ratelimited. This is one of the advantages of it as you can keep hitting it without implementing ratelimiting code and there won’t be any issue besides longer yield times from HTTPService. However, if you badly need this as a feature, I can implement the standard X-Ratelimit style headers that Discord usually uses.

It won’t! Also another advantage of the queue system. You cannot get banned through this unless you flood it with bad requests. Messages are sent at the regular ratelimit.

1 Like

So, can I just check if the data that postasync returns is nil, then make it wait until the limit is reset?

What I meant is that it stalled your request when you hit the ratelimit, then processes it later. Again, if you’d like ratelimiting information, I can provide it, but for this endpoint you don’t really need it.

So I don’t have to respect ratelimits in my code?

For queues, correct. You’re fine.

1 Like

Hey all, I might be about to completely and utterly break everything whilst I perform an update to how the anti-abuse works. This is mainly to permit scalability and to make the proxy stateless (wow, cool buzz words!). I’m trying to avoid storing state in the app and moving to Redis for caching.

If everything goes wrong, I’ll revert it as soon as possible. Don’t worry if your webhooks break for a short amount of time.

This should now be complete. Nothing went absolutely horribly wrong, and the proxy is now running two processes instead of one.

However, please message me immediately if you see any quirks or falsebans.

1 Like

Hi everyone,

I found a fatal bug in the anti-abuse measures I put in place relating to ratelimits. I have fixed the bug in the latest commit, and as an apology I have unbanned all webhooks affected by the anti-abuse for ratelimit violations.

To keep it short, I was accidentally using the same Redis key for two operations: ratelimit violation tracking and ratelimit reset time. This would mean the proxy thought your webhooks were millions of requests over the threshold for bans.

On self hosted instances with autoBlock turned off (or prior to the Redis migration), this will not affect you and is an optional update, however I recommend updating anyway just in case that you start to use auto blocking.

I’m sorry if this affected your webhooks.

2 Likes

It does not seem to be working for me.

Edit: I inputted “webhook.lewistehminerz.de” instead of “webhook.lewistehminerz.dev” lol. Works fine now.

1 Like

Let me answer that for you, most people use discord literally guided is not really that used. To be honest it was a big swing and miss.

1 Like

In my eyes, that’s better, Less latency and traffic for our http requests to get messed about on.
I use guilded for developing, not for communication or chat. It creates two separate channels and can help organization of the game development.

  • Guilded has a ton more useful channels.
1 Like

Any plans on making this into a Docker?
I use Docker a lot :slight_smile:

1 Like

Docker containers aren’t my forte and I never planned to make this into a containerised app but I can give it a shot. Can you live with docker-compose?

E: Looks like I’d have to rewrite parts of the codebase to support this. I’ll put it on the backburner for now.

2 Likes

This is how i normally set up my dockers.
Not sure if docker-compose is the same.

PS: Sometimes it’s also best to include port 80 = choose.
That way we can use what port we need :slight_smile:

Can you pls tell me how to use this proxy in my code ?
Do I need to add this or what I need to do ?

And how do I get the webhook id ?
Just by copying the url of the webhook and paste it up in the chrome ?

There’s a guide on the site but I’ll put it here too.

If you have a piece of code that looks like this:

local httpService = game:GetService("HttpService")

httpService:PostAsync("https://discord.com/api/webhooks/{WEBHOOK_ID}/{WEBHOOK_TOKEN}",
	httpService:JSONEncode({
		content = "Hello, world!"
	})
)

You need to change discord.com to webhook.lewistehminerz.dev. After that it will work as normal.

You can optionally use the module I wrote which hides away the interaction with the proxy and gives a niceish API. The id and token are in the URL already; the ID is the numbers after /api/webhooks and the token is after the ID.

1 Like

Thankyou for the explanation @lewisakura