discordgo icon indicating copy to clipboard operation
discordgo copied to clipboard

No `/api/gateway` ratelimits?

Open Cynosphere opened this issue 4 years ago • 1 comments

I'm indirectly using this library through matterbridge and durring the connection issues on Dec 15, 2019, I had matterbridge and my bot running in a different language entirely attempting to reconnect to the gateway during this incident. This ended up getting me ratelimited on a Cloudflare level, even with my bot turned off (and I couldn't shut down matterbridge as its on another user I don't have access to).

Is there no ratelimit for grabbing the gateway URL? I doubt I can blame Eris as it has a 30 second wait period between reconnections plus it only grabs the gateway URL once a session.

Extra: "error code: 1015" when trying to curl gateway "1015 is Cloudflare's version of a 429"

Cynosphere avatar Dec 15 '19 20:12 Cynosphere

DiscordGo will self ratelimit re-connect attempts, it increments the reconnect delay each time it fails until it reaches a max value of 10 minutes per attempt.

See https://github.com/bwmarrin/discordgo/blob/master/wsapi.go#L827

bwmarrin avatar Jan 19 '20 21:01 bwmarrin