Browse Source

Merge 4bfd3be573 into c4dcb9dc17

pull/757/merge
Christopher F GitHub 8 years ago
parent
commit
eab8516d26
2 changed files with 7 additions and 3 deletions
  1. +4
    -2
      src/Discord.Net.Rest/DiscordRestApiClient.cs
  2. +3
    -1
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 4
- 2
src/Discord.Net.Rest/DiscordRestApiClient.cs View File

@@ -577,7 +577,8 @@ namespace Discord.API


options = RequestOptions.CreateOrClone(options); 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); 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); 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); await SendAsync("DELETE", () => $"channels/{channelId}/messages/{messageId}/reactions/{emoji}/{userId}", ids, options: options).ConfigureAwait(false);
} }


+ 3
- 1
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -1631,7 +1631,9 @@ namespace Discord.WebSocket


internal ISocketPrivateChannel AddPrivateChannel(API.Channel model, ClientState state) internal ISocketPrivateChannel AddPrivateChannel(API.Channel model, ClientState state)
{ {
var channel = SocketChannel.CreatePrivate(this, state, model);
if (state.GetChannel(model.Id) is ISocketPrivateChannel channel)
return channel;
channel = SocketChannel.CreatePrivate(this, state, model);
state.AddChannel(channel as SocketChannel); state.AddChannel(channel as SocketChannel);
if (channel is SocketDMChannel dm) if (channel is SocketDMChannel dm)
dm.Recipient.GlobalUser.DMChannel = dm; dm.Recipient.GlobalUser.DMChannel = dm;


Loading…
Cancel
Save