Made IVoiceChannel.UserLimit nullable
This commit is contained in:
@@ -56,7 +56,7 @@ namespace Discord.Rest
|
||||
Bitrate = args.Bitrate,
|
||||
Name = args.Name,
|
||||
Position = args.Position,
|
||||
UserLimit = args.UserLimit
|
||||
UserLimit = args.UserLimit.IsSpecified ? (args.UserLimit.Value ?? 0) : Optional.Create<int>()
|
||||
};
|
||||
return await client.ApiClient.ModifyGuildChannelAsync(channel.Id, apiArgs, options).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Discord.API.Rest;
|
||||
using Discord.Audio;
|
||||
using Discord.Audio;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -13,7 +12,7 @@ namespace Discord.Rest
|
||||
public class RestVoiceChannel : RestGuildChannel, IVoiceChannel, IRestAudioChannel
|
||||
{
|
||||
public int Bitrate { get; private set; }
|
||||
public int UserLimit { get; private set; }
|
||||
public int? UserLimit { get; private set; }
|
||||
|
||||
internal RestVoiceChannel(BaseDiscordClient discord, IGuild guild, ulong id)
|
||||
: base(discord, guild, id)
|
||||
@@ -30,7 +29,7 @@ namespace Discord.Rest
|
||||
base.Update(model);
|
||||
|
||||
Bitrate = model.Bitrate.Value;
|
||||
UserLimit = model.UserLimit.Value;
|
||||
UserLimit = model.UserLimit.Value != 0 ? model.UserLimit.Value : (int?)null;
|
||||
}
|
||||
|
||||
public async Task ModifyAsync(Action<VoiceChannelProperties> func, RequestOptions options = null)
|
||||
|
||||
Reference in New Issue
Block a user