From 20055e7cc1d631ce7fad10e21ed0feda49f1a58a Mon Sep 17 00:00:00 2001 From: dolfies Date: Wed, 25 Jun 2025 21:05:13 -0400 Subject: [PATCH] Fix calculation of hashed rate limit keys --- discord/http.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/discord/http.py b/discord/http.py index 7d59c8bfb..f1f4ec58b 100644 --- a/discord/http.py +++ b/discord/http.py @@ -673,14 +673,13 @@ class HTTPClient: _log.debug(fmt, route_key, bucket_hash, discord_hash) self._bucket_hashes[route_key] = discord_hash - recalculated_key = discord_hash + route.major_parameters - self._buckets[recalculated_key] = ratelimit + self._buckets[f'{discord_hash}:{route.major_parameters}'] = ratelimit self._buckets.pop(key, None) elif route_key not in self._bucket_hashes: fmt = '%s has found its initial rate limit bucket hash (%s).' _log.debug(fmt, route_key, discord_hash) self._bucket_hashes[route_key] = discord_hash - self._buckets[discord_hash + route.major_parameters] = ratelimit + self._buckets[f'{discord_hash}:{route.major_parameters}'] = ratelimit if has_ratelimit_headers: if response.status != 429: