Give private users a proper ID.
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Discord
|
|||||||
public Members(DiscordClient client, object writerLock)
|
public Members(DiscordClient client, object writerLock)
|
||||||
: base(client, writerLock, x => x.OnCached(), x => x.OnUncached()) { }
|
: base(client, writerLock, x => x.OnCached(), x => x.OnUncached()) { }
|
||||||
private string GetKey(string userId, string serverId)
|
private string GetKey(string userId, string serverId)
|
||||||
=> serverId + '_' + userId;
|
=> (serverId ?? "Private") + '_' + userId;
|
||||||
|
|
||||||
public User this[string userId, string serverId]
|
public User this[string userId, string serverId]
|
||||||
=> this[GetKey(userId, serverId)];
|
=> this[GetKey(userId, serverId)];
|
||||||
|
|||||||
@@ -549,7 +549,7 @@ namespace Discord
|
|||||||
var channel = _channels[data.ChannelId];
|
var channel = _channels[data.ChannelId];
|
||||||
if (channel != null)
|
if (channel != null)
|
||||||
{
|
{
|
||||||
var user = _members[data.UserId, channel.Server.Id];
|
var user = _members[data.UserId, channel.Server?.Id];
|
||||||
|
|
||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user