Browse Source

Rename Default and Required to IsDefault and IsRequired in IApplicationCommandOption. Rename DefaultPermission to IsDefaultPermission in IApplicationCommand

pull/1923/head
quin lynch 3 years ago
parent
commit
596ac746b6
10 changed files with 28 additions and 28 deletions
  1. +3
    -3
      src/Discord.Net.Core/Discord.Net.Core.xml
  2. +1
    -1
      src/Discord.Net.Core/Entities/Interactions/IApplicationCommand.cs
  3. +2
    -2
      src/Discord.Net.Core/Entities/Interactions/IApplicationCommandOption.cs
  4. +4
    -4
      src/Discord.Net.Rest/API/Common/ApplicationCommandOption.cs
  5. +3
    -3
      src/Discord.Net.Rest/Discord.Net.Rest.xml
  6. +2
    -2
      src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommand.cs
  7. +4
    -4
      src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommandOption.cs
  8. +3
    -3
      src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml
  9. +2
    -2
      src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommand.cs
  10. +4
    -4
      src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommandOption.cs

+ 3
- 3
src/Discord.Net.Core/Discord.Net.Core.xml View File

@@ -4875,7 +4875,7 @@
The description of the command.
</summary>
</member>
<member name="P:Discord.IApplicationCommand.DefaultPermission">
<member name="P:Discord.IApplicationCommand.IsDefaultPermission">
<summary>
Whether the command is enabled by default when the app is added to a guild.
</summary>
@@ -4974,12 +4974,12 @@
The description of this command option, 1-100 character description.
</summary>
</member>
<member name="P:Discord.IApplicationCommandOption.Default">
<member name="P:Discord.IApplicationCommandOption.IsDefault">
<summary>
The first required option for the user to complete--only one option can be default.
</summary>
</member>
<member name="P:Discord.IApplicationCommandOption.Required">
<member name="P:Discord.IApplicationCommandOption.IsRequired">
<summary>
If the parameter is required or optional, default is <see langword="false"/>.
</summary>


+ 1
- 1
src/Discord.Net.Core/Entities/Interactions/IApplicationCommand.cs View File

@@ -34,7 +34,7 @@ namespace Discord
/// <summary>
/// Whether the command is enabled by default when the app is added to a guild.
/// </summary>
bool DefaultPermission { get; }
bool IsDefaultPermission { get; }

/// <summary>
/// If the option is a subcommand or subcommand group type, this nested options will be the parameters.


+ 2
- 2
src/Discord.Net.Core/Entities/Interactions/IApplicationCommandOption.cs View File

@@ -29,12 +29,12 @@ namespace Discord
/// <summary>
/// The first required option for the user to complete--only one option can be default.
/// </summary>
bool? Default { get; }
bool? IsDefault { get; }

/// <summary>
/// If the parameter is required or optional, default is <see langword="false"/>.
/// </summary>
bool? Required { get; }
bool? IsRequired { get; }

/// <summary>
/// Choices for string and int types for the user to pick from.


+ 4
- 4
src/Discord.Net.Rest/API/Common/ApplicationCommandOption.cs View File

@@ -50,11 +50,11 @@ namespace Discord.API

ChannelTypes = cmd.ChannelTypes.ToArray();

Required = cmd.Required.HasValue
? cmd.Required.Value
Required = cmd.IsRequired.HasValue
? cmd.IsRequired.Value
: Optional<bool>.Unspecified;
Default = cmd.Default.HasValue
? cmd.Default.Value
Default = cmd.IsDefault.HasValue
? cmd.IsDefault.Value
: Optional<bool>.Unspecified;

Name = cmd.Name;


+ 3
- 3
src/Discord.Net.Rest/Discord.Net.Rest.xml View File

@@ -4058,7 +4058,7 @@
<member name="P:Discord.Rest.RestApplicationCommand.Description">
<inheritdoc/>
</member>
<member name="P:Discord.Rest.RestApplicationCommand.DefaultPermission">
<member name="P:Discord.Rest.RestApplicationCommand.IsDefaultPermission">
<inheritdoc/>
</member>
<member name="P:Discord.Rest.RestApplicationCommand.Options">
@@ -4103,10 +4103,10 @@
<member name="P:Discord.Rest.RestApplicationCommandOption.Description">
<inheritdoc/>
</member>
<member name="P:Discord.Rest.RestApplicationCommandOption.Default">
<member name="P:Discord.Rest.RestApplicationCommandOption.IsDefault">
<inheritdoc/>
</member>
<member name="P:Discord.Rest.RestApplicationCommandOption.Required">
<member name="P:Discord.Rest.RestApplicationCommandOption.IsRequired">
<inheritdoc/>
</member>
<member name="P:Discord.Rest.RestApplicationCommandOption.Choices">


+ 2
- 2
src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommand.cs View File

@@ -26,7 +26,7 @@ namespace Discord.Rest
public string Description { get; private set; }

/// <inheritdoc/>
public bool DefaultPermission { get; private set; }
public bool IsDefaultPermission { get; private set; }

/// <summary>
/// The options of this command.
@@ -61,7 +61,7 @@ namespace Discord.Rest
ApplicationId = model.ApplicationId;
Name = model.Name;
Description = model.Description;
DefaultPermission = model.DefaultPermissions.GetValueOrDefault(true);
IsDefaultPermission = model.DefaultPermissions.GetValueOrDefault(true);

Options = model.Options.IsSpecified
? model.Options.Value.Select(x => RestApplicationCommandOption.Create(x)).ToImmutableArray()


+ 4
- 4
src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommandOption.cs View File

@@ -24,10 +24,10 @@ namespace Discord.Rest
public string Description { get; private set; }

/// <inheritdoc/>
public bool? Default { get; private set; }
public bool? IsDefault { get; private set; }

/// <inheritdoc/>
public bool? Required { get; private set; }
public bool? IsRequired { get; private set; }

/// <summary>
/// A collection of <see cref="RestApplicationCommandChoice"/>'s for this command.
@@ -60,10 +60,10 @@ namespace Discord.Rest
Description = model.Description;

if (model.Default.IsSpecified)
Default = model.Default.Value;
IsDefault = model.Default.Value;

if (model.Required.IsSpecified)
Required = model.Required.Value;
IsRequired = model.Required.Value;

Options = model.Options.IsSpecified
? model.Options.Value.Select(x => Create(x)).ToImmutableArray()


+ 3
- 3
src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml View File

@@ -4120,7 +4120,7 @@
<member name="P:Discord.WebSocket.SocketApplicationCommand.Description">
<inheritdoc/>
</member>
<member name="P:Discord.WebSocket.SocketApplicationCommand.DefaultPermission">
<member name="P:Discord.WebSocket.SocketApplicationCommand.IsDefaultPermission">
<inheritdoc/>
</member>
<member name="P:Discord.WebSocket.SocketApplicationCommand.Options">
@@ -4173,10 +4173,10 @@
<member name="P:Discord.WebSocket.SocketApplicationCommandOption.Description">
<inheritdoc/>
</member>
<member name="P:Discord.WebSocket.SocketApplicationCommandOption.Default">
<member name="P:Discord.WebSocket.SocketApplicationCommandOption.IsDefault">
<inheritdoc/>
</member>
<member name="P:Discord.WebSocket.SocketApplicationCommandOption.Required">
<member name="P:Discord.WebSocket.SocketApplicationCommandOption.IsRequired">
<inheritdoc/>
</member>
<member name="P:Discord.WebSocket.SocketApplicationCommandOption.Choices">


+ 2
- 2
src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommand.cs View File

@@ -35,7 +35,7 @@ namespace Discord.WebSocket
public string Description { get; private set; }

/// <inheritdoc/>
public bool DefaultPermission { get; private set; }
public bool IsDefaultPermission { get; private set; }

/// <summary>
/// A collection of <see cref="SocketApplicationCommandOption"/>'s for this command.
@@ -81,7 +81,7 @@ namespace Discord.WebSocket
ApplicationId = model.ApplicationId;
Description = model.Description;
Name = model.Name;
DefaultPermission = model.DefaultPermissions.GetValueOrDefault(true);
IsDefaultPermission = model.DefaultPermissions.GetValueOrDefault(true);
Type = model.Type;

Options = model.Options.IsSpecified


+ 4
- 4
src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommandOption.cs View File

@@ -23,10 +23,10 @@ namespace Discord.WebSocket
public string Description { get; private set; }

/// <inheritdoc/>
public bool? Default { get; private set; }
public bool? IsDefault { get; private set; }

/// <inheritdoc/>
public bool? Required { get; private set; }
public bool? IsRequired { get; private set; }

/// <summary>
/// Choices for string and int types for the user to pick from.
@@ -57,11 +57,11 @@ namespace Discord.WebSocket
Type = model.Type;
Description = model.Description;

Default = model.Default.IsSpecified
IsDefault = model.Default.IsSpecified
? model.Default.Value
: null;

Required = model.Required.IsSpecified
IsRequired = model.Required.IsSpecified
? model.Required.Value
: null;



Loading…
Cancel
Save