From 3f62f89e1840183d19f60d3254f72a445f89c5d4 Mon Sep 17 00:00:00 2001 From: spiral Date: Mon, 28 Nov 2022 18:59:02 -0500 Subject: [PATCH] feat(bot): print any rate limit headers received on interactions routes --- Myriad/Rest/Ratelimit/Ratelimiter.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Myriad/Rest/Ratelimit/Ratelimiter.cs b/Myriad/Rest/Ratelimit/Ratelimiter.cs index b06e5bcf..f90ee11f 100644 --- a/Myriad/Rest/Ratelimit/Ratelimiter.cs +++ b/Myriad/Rest/Ratelimit/Ratelimiter.cs @@ -60,6 +60,9 @@ public class Ratelimiter: IDisposable if (!headers.HasRatelimitInfo) return; + if (endpoint.Contains("interactions")) + _logger.Information($"Discord debug: got rate limit headers for interaction endpoint: global? {headers.Global}, limit: {headers.Limit}, remaining: {headers.Remaining}, reset: {headers.Reset?.ToUnixTimeSeconds()}, reset_after: {headers.ResetAfter?.TotalSeconds}, bucket: {headers.Bucket}"); + // TODO: properly calculate server time? if (headers.Global) {