Browse Source

Merge pull request #228 from Nitix/fix-174

Fix Voice Channel being null #174
tags/1.0-rc
RogueException GitHub 9 years ago
parent
commit
5519cfa9fd
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      src/Discord.Net/WebSocket/Entities/Users/SocketGuildUser.cs

+ 6
- 2
src/Discord.Net/WebSocket/Entities/Users/SocketGuildUser.cs View File

@@ -4,7 +4,7 @@ using PresenceModel = Discord.API.Presence;


namespace Discord.WebSocket namespace Discord.WebSocket
{ {
internal class SocketGuildUser : GuildUser, ISocketUser
internal class SocketGuildUser : GuildUser, ISocketUser, IVoiceState
{ {
internal override bool IsAttached => true; internal override bool IsAttached => true;


@@ -20,7 +20,11 @@ namespace Discord.WebSocket
public bool IsSelfDeafened => VoiceState?.IsSelfDeafened ?? false; public bool IsSelfDeafened => VoiceState?.IsSelfDeafened ?? false;
public bool IsSelfMuted => VoiceState?.IsSelfMuted ?? false; public bool IsSelfMuted => VoiceState?.IsSelfMuted ?? false;
public bool IsSuppressed => VoiceState?.IsSuppressed ?? false; public bool IsSuppressed => VoiceState?.IsSuppressed ?? false;
public SocketVoiceChannel VoiceChannel => VoiceState?.VoiceChannel;
public VoiceChannel VoiceChannel => VoiceState?.VoiceChannel;
public bool IsDeafened => VoiceState?.IsDeafened ?? false;
public bool IsMuted => VoiceState?.IsMuted ?? false;
public string VoiceSessionId => VoiceState?.VoiceSessionId ?? "";
IVoiceChannel IVoiceState.VoiceChannel => VoiceState?.VoiceChannel;


public SocketGuildUser(SocketGuild guild, SocketGlobalUser user, Model model) public SocketGuildUser(SocketGuild guild, SocketGlobalUser user, Model model)
: base(guild, user, model) : base(guild, user, model)


Loading…
Cancel
Save