Skip to content

Commit

Permalink
Use different bucket if it is a PATCH request
Browse files Browse the repository at this point in the history
I'm still not 100% sure if this is how Discord's rate limits for this patch really works because rate limits are very confusing to me, but I'm like, 99% sure
  • Loading branch information
MrPowerGamerBR committed Oct 1, 2024
1 parent 23fc2e7 commit b0d1268
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bucketpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func GetOptimisticBucketPath(url string, method string) string {
// ! stands for any replaceable id
switch parts[0] {
case MajorChannels:
if numParts == 2 {
if numParts == 2 && method != "PATCH" {
// Return the same bucket for all reqs to /channels/id
// In this case, the discord bucket is the same regardless of the id
bucket.WriteString(MajorChannels)
Expand Down Expand Up @@ -196,4 +196,4 @@ func GetOptimisticBucketPath(url string, method string) string {
}

return bucket.String()
}
}

0 comments on commit b0d1268

Please sign in to comment.