Browse Source

Try to pull DM channels from cache on CHANNEL_CREATE

tags/2.0.0-beta
RogueException 7 years ago
parent
commit
f997089174
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 5
- 0
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -699,7 +699,12 @@ namespace Discord.WebSocket
}
}
else
{
channel = State.GetChannel(data.Id);
if (channel != null)
return; //Discord may send duplicate CHANNEL_CREATEs for DMs
channel = AddPrivateChannel(data, State) as SocketChannel;
}

if (channel != null)
await TimedInvokeAsync(_channelCreatedEvent, nameof(ChannelCreated), channel).ConfigureAwait(false);


Loading…
Cancel
Save