From 4bfd3be573bbc1daf74dd79fc3c7e72c73777eb8 Mon Sep 17 00:00:00 2001 From: Christopher F Date: Sat, 15 Jul 2017 22:35:31 -0400 Subject: [PATCH] Disabled ratelimits on reactions by scrambling the bucket ID --- src/Discord.Net.Rest/DiscordRestApiClient.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs index 1fac66ec5..179f88b76 100644 --- a/src/Discord.Net.Rest/DiscordRestApiClient.cs +++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs @@ -577,7 +577,8 @@ namespace Discord.API options = RequestOptions.CreateOrClone(options); - var ids = new BucketIds(channelId: channelId); + var id = new Random().Next(0, int.MaxValue); + var ids = new BucketIds(channelId: (ulong)id); await SendAsync("PUT", () => $"channels/{channelId}/messages/{messageId}/reactions/{emoji}/@me", ids, options: options).ConfigureAwait(false); } @@ -589,7 +590,8 @@ namespace Discord.API options = RequestOptions.CreateOrClone(options); - var ids = new BucketIds(channelId: channelId); + var id = new Random().Next(0, int.MaxValue); + var ids = new BucketIds(channelId: (ulong)id); await SendAsync("DELETE", () => $"channels/{channelId}/messages/{messageId}/reactions/{emoji}/{userId}", ids, options: options).ConfigureAwait(false); }