Possibly fix mute & deaf state for guild users (#3070)

This commit is contained in:
Mihail Gribkov
2025-02-27 21:36:59 +03:00
committed by GitHub
parent 6e7b3c2577
commit 5f6c26bf9c

View File

@@ -24,6 +24,9 @@ namespace Discord.WebSocket
private long? _joinedAtTicks;
private ImmutableArray<ulong> _roleIds;
private bool? _isDeafened;
private bool? _isMuted;
internal override SocketGlobalUser GlobalUser { get; set; }
/// <summary>
/// Gets the guild the user is in.
@@ -66,9 +69,9 @@ namespace Discord.WebSocket
/// <inheritdoc />
public bool IsSuppressed => VoiceState?.IsSuppressed ?? false;
/// <inheritdoc />
public bool IsDeafened => VoiceState?.IsDeafened ?? false;
public bool IsDeafened => VoiceState?.IsDeafened ?? _isDeafened ?? false;
/// <inheritdoc />
public bool IsMuted => VoiceState?.IsMuted ?? false;
public bool IsMuted => VoiceState?.IsMuted ?? _isMuted ?? false;
/// <inheritdoc />
public bool IsStreaming => VoiceState?.IsStreaming ?? false;
/// <inheritdoc />
@@ -191,6 +194,11 @@ namespace Discord.WebSocket
if (model.Banner.IsSpecified)
GuildBannerHash = model.Banner.Value;
if (model.Mute.IsSpecified)
_isMuted = model.Mute.Value;
if (model.Deaf.IsSpecified)
_isDeafened = model.Deaf.Value;
Flags = model.Flags;
}
internal void Update(ClientState state, PresenceModel model, bool updatePresence)