[Feature] Voice channel status support (#2777)
* initial commit * MOCKED CHANNELS AGRHHHHHHHH * fix for sharded * yup
This commit is contained in:
@@ -38,6 +38,11 @@ namespace Discord.WebSocket
|
||||
/// <inheritdoc/>
|
||||
public VideoQualityMode VideoQualityMode { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the voice channel status set in this channel. <see langword="null" /> if it is not set.
|
||||
/// </summary>
|
||||
public virtual string Status { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a collection of users that are currently connected to this voice channel.
|
||||
/// </summary>
|
||||
@@ -51,12 +56,19 @@ namespace Discord.WebSocket
|
||||
: base(discord, id, guild)
|
||||
{
|
||||
}
|
||||
|
||||
internal new static SocketVoiceChannel Create(SocketGuild guild, ClientState state, Model model)
|
||||
{
|
||||
var entity = new SocketVoiceChannel(guild?.Discord, model.Id, guild);
|
||||
entity.Update(state, model);
|
||||
return entity;
|
||||
}
|
||||
|
||||
internal void UpdateVoiceStatus(string status)
|
||||
{
|
||||
Status = status;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
internal override void Update(ClientState state, Model model)
|
||||
{
|
||||
@@ -65,8 +77,13 @@ namespace Discord.WebSocket
|
||||
UserLimit = model.UserLimit.GetValueOrDefault() != 0 ? model.UserLimit.Value : (int?)null;
|
||||
VideoQualityMode = model.VideoQualityMode.GetValueOrDefault(VideoQualityMode.Auto);
|
||||
RTCRegion = model.RTCRegion.GetValueOrDefault(null);
|
||||
Status = model.Status.GetValueOrDefault(null);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual Task SetStatusAsync(string status, RequestOptions options = null)
|
||||
=> ChannelHelper.ModifyVoiceChannelStatusAsync(this, status, Discord, options);
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task ModifyAsync(Action<VoiceChannelProperties> func, RequestOptions options = null)
|
||||
=> ChannelHelper.ModifyAsync(this, Discord, func, options);
|
||||
|
||||
Reference in New Issue
Block a user