@@ -6011,7 +6011,7 @@ | |||||
<param name="value">The default permission value to set.</param> | <param name="value">The default permission value to set.</param> | ||||
<returns>The current builder.</returns> | <returns>The current builder.</returns> | ||||
</member> | </member> | ||||
<member name="M:Discord.SlashCommandBuilder.AddOption(System.String,Discord.ApplicationCommandOptionType,System.String,System.Boolean,System.Boolean,System.Boolean,System.Collections.Generic.List{Discord.SlashCommandOptionBuilder},Discord.ApplicationCommandOptionChoiceProperties[])"> | |||||
<member name="M:Discord.SlashCommandBuilder.AddOption(System.String,Discord.ApplicationCommandOptionType,System.String,System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Boolean,System.Collections.Generic.List{Discord.SlashCommandOptionBuilder},Discord.ApplicationCommandOptionChoiceProperties[])"> | |||||
<summary> | <summary> | ||||
Adds an option to the current slash command. | Adds an option to the current slash command. | ||||
</summary> | </summary> | ||||
@@ -6108,7 +6108,7 @@ | |||||
</summary> | </summary> | ||||
<returns>The built version of this option.</returns> | <returns>The built version of this option.</returns> | ||||
</member> | </member> | ||||
<member name="M:Discord.SlashCommandOptionBuilder.AddOption(System.String,Discord.ApplicationCommandOptionType,System.String,System.Boolean,System.Boolean,System.Collections.Generic.List{Discord.SlashCommandOptionBuilder},Discord.ApplicationCommandOptionChoiceProperties[])"> | |||||
<member name="M:Discord.SlashCommandOptionBuilder.AddOption(System.String,Discord.ApplicationCommandOptionType,System.String,System.Nullable{System.Boolean},System.Boolean,System.Collections.Generic.List{Discord.SlashCommandOptionBuilder},Discord.ApplicationCommandOptionChoiceProperties[])"> | |||||
<summary> | <summary> | ||||
Adds an option to the current slash command. | Adds an option to the current slash command. | ||||
</summary> | </summary> | ||||
@@ -6,7 +6,7 @@ namespace Discord | |||||
/// <summary> | /// <summary> | ||||
/// Represents a generic voice channel in a guild. | /// Represents a generic voice channel in a guild. | ||||
/// </summary> | /// </summary> | ||||
public interface IVoiceChannel : INestedChannel, IAudioChannel | |||||
public interface IVoiceChannel : INestedChannel, IAudioChannel, IMentionable | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Gets the bit-rate that the clients in this voice channel are requested to use. | /// Gets the bit-rate that the clients in this voice channel are requested to use. | ||||
@@ -165,7 +165,7 @@ namespace Discord | |||||
/// <param name="choices">The choices of this option.</param> | /// <param name="choices">The choices of this option.</param> | ||||
/// <returns>The current builder.</returns> | /// <returns>The current builder.</returns> | ||||
public SlashCommandBuilder AddOption(string name, ApplicationCommandOptionType type, | public SlashCommandBuilder AddOption(string name, ApplicationCommandOptionType type, | ||||
string description, bool required = true, bool isDefault = false, bool isAutocomplete = false, List<SlashCommandOptionBuilder> options = null, params ApplicationCommandOptionChoiceProperties[] choices) | |||||
string description, bool? required = null, bool? isDefault = null, bool isAutocomplete = false, List<SlashCommandOptionBuilder> options = null, params ApplicationCommandOptionChoiceProperties[] choices) | |||||
{ | { | ||||
// Make sure the name matches the requirements from discord | // Make sure the name matches the requirements from discord | ||||
Preconditions.NotNullOrEmpty(name, nameof(name)); | Preconditions.NotNullOrEmpty(name, nameof(name)); | ||||
@@ -183,7 +183,7 @@ namespace Discord | |||||
Preconditions.AtMost(description.Length, MaxDescriptionLength, nameof(description)); | Preconditions.AtMost(description.Length, MaxDescriptionLength, nameof(description)); | ||||
// make sure theres only one option with default set to true | // make sure theres only one option with default set to true | ||||
if (isDefault) | |||||
if (isDefault.HasValue && isDefault.Value) | |||||
{ | { | ||||
if (this.Options != null) | if (this.Options != null) | ||||
if (this.Options.Any(x => x.Default.HasValue && x.Default.Value)) | if (this.Options.Any(x => x.Default.HasValue && x.Default.Value)) | ||||
@@ -339,7 +339,7 @@ namespace Discord | |||||
/// <summary> | /// <summary> | ||||
/// Gets or sets if the option is required. | /// Gets or sets if the option is required. | ||||
/// </summary> | /// </summary> | ||||
public bool Required { get; set; } | |||||
public bool? Required { get; set; } = null; | |||||
/// <summary> | /// <summary> | ||||
/// Gets or sets whether or not this option supports autocomplete. | /// Gets or sets whether or not this option supports autocomplete. | ||||
@@ -395,7 +395,7 @@ namespace Discord | |||||
/// <param name="choices">The choices of this option.</param> | /// <param name="choices">The choices of this option.</param> | ||||
/// <returns>The current builder.</returns> | /// <returns>The current builder.</returns> | ||||
public SlashCommandOptionBuilder AddOption(string name, ApplicationCommandOptionType type, | public SlashCommandOptionBuilder AddOption(string name, ApplicationCommandOptionType type, | ||||
string description, bool required = true, bool isDefault = false, List<SlashCommandOptionBuilder> options = null, params ApplicationCommandOptionChoiceProperties[] choices) | |||||
string description, bool? required = null, bool isDefault = false, List<SlashCommandOptionBuilder> options = null, params ApplicationCommandOptionChoiceProperties[] choices) | |||||
{ | { | ||||
// Make sure the name matches the requirements from discord | // Make sure the name matches the requirements from discord | ||||
Preconditions.NotNullOrEmpty(name, nameof(name)); | Preconditions.NotNullOrEmpty(name, nameof(name)); | ||||
@@ -2803,6 +2803,9 @@ | |||||
<member name="P:Discord.Rest.RestVoiceChannel.CategoryId"> | <member name="P:Discord.Rest.RestVoiceChannel.CategoryId"> | ||||
<inheritdoc /> | <inheritdoc /> | ||||
</member> | </member> | ||||
<member name="P:Discord.Rest.RestVoiceChannel.Mention"> | |||||
<inheritdoc /> | |||||
</member> | |||||
<member name="M:Discord.Rest.RestVoiceChannel.Update(Discord.API.Channel)"> | <member name="M:Discord.Rest.RestVoiceChannel.Update(Discord.API.Channel)"> | ||||
<inheritdoc /> | <inheritdoc /> | ||||
</member> | </member> | ||||
@@ -21,7 +21,8 @@ namespace Discord.Rest | |||||
public int? UserLimit { get; private set; } | public int? UserLimit { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public ulong? CategoryId { get; private set; } | public ulong? CategoryId { get; private set; } | ||||
/// <inheritdoc /> | |||||
public string Mention => MentionUtils.MentionChannel(Id); | |||||
internal RestVoiceChannel(BaseDiscordClient discord, IGuild guild, ulong id) | internal RestVoiceChannel(BaseDiscordClient discord, IGuild guild, ulong id) | ||||
: base(discord, guild, id) | : base(discord, guild, id) | ||||
{ | { | ||||
@@ -2802,6 +2802,9 @@ | |||||
A category channel representing the parent of this channel; <c>null</c> if none is set. | A category channel representing the parent of this channel; <c>null</c> if none is set. | ||||
</returns> | </returns> | ||||
</member> | </member> | ||||
<member name="P:Discord.WebSocket.SocketVoiceChannel.Mention"> | |||||
<inheritdoc /> | |||||
</member> | |||||
<member name="M:Discord.WebSocket.SocketVoiceChannel.SyncPermissionsAsync(Discord.RequestOptions)"> | <member name="M:Discord.WebSocket.SocketVoiceChannel.SyncPermissionsAsync(Discord.RequestOptions)"> | ||||
<inheritdoc /> | <inheritdoc /> | ||||
</member> | </member> | ||||
@@ -32,6 +32,8 @@ namespace Discord.WebSocket | |||||
public ICategoryChannel Category | public ICategoryChannel Category | ||||
=> CategoryId.HasValue ? Guild.GetChannel(CategoryId.Value) as ICategoryChannel : null; | => CategoryId.HasValue ? Guild.GetChannel(CategoryId.Value) as ICategoryChannel : null; | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public string Mention => MentionUtils.MentionChannel(Id); | |||||
/// <inheritdoc /> | |||||
public Task SyncPermissionsAsync(RequestOptions options = null) | public Task SyncPermissionsAsync(RequestOptions options = null) | ||||
=> ChannelHelper.SyncPermissionsAsync(this, Discord, options); | => ChannelHelper.SyncPermissionsAsync(this, Discord, options); | ||||
@@ -25,7 +25,7 @@ namespace Discord | |||||
public string Name => throw new NotImplementedException(); | public string Name => throw new NotImplementedException(); | ||||
public DateTimeOffset CreatedAt => throw new NotImplementedException(); | public DateTimeOffset CreatedAt => throw new NotImplementedException(); | ||||
public string Mention => throw new NotImplementedException(); | |||||
public ulong Id => throw new NotImplementedException(); | public ulong Id => throw new NotImplementedException(); | ||||
public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) | public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) | ||||