Browse Source

Rename Default, Required, and Autocomplete to IsDefault, IsRequired, and IsAutocomplete in ApplicationCommandOptionProperties

pull/1923/head
quin lynch 3 years ago
parent
commit
ebc367446c
3 changed files with 11 additions and 11 deletions
  1. +3
    -3
      src/Discord.Net.Core/Entities/Interactions/ApplicationCommandOption.cs
  2. +3
    -3
      src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs
  3. +5
    -5
      src/Discord.Net.Rest/API/Common/ApplicationCommandOption.cs

+ 3
- 3
src/Discord.Net.Core/Entities/Interactions/ApplicationCommandOption.cs View File

@@ -60,17 +60,17 @@ namespace Discord
/// <summary>
/// Gets or sets whether or not this options is the first required option for the user to complete. only one option can be default.
/// </summary>
public bool? Default { get; set; }
public bool? IsDefault { get; set; }

/// <summary>
/// Gets or sets if the option is required.
/// </summary>
public bool? Required { get; set; }
public bool? IsRequired { get; set; }

/// <summary>
/// Gets or sets whether or not this option supports autocomplete.
/// </summary>
public bool Autocomplete { get; set; }
public bool IsAutocomplete { get; set; }
/// <summary>
/// Gets or sets the choices for string and int types for the user to pick from.
/// </summary>


+ 3
- 3
src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs View File

@@ -377,12 +377,12 @@ namespace Discord
{
Name = Name,
Description = Description,
Default = Default,
Required = Required,
IsDefault = Default,
IsRequired = Required,
Type = Type,
Options = Options?.Count > 0 ? new List<ApplicationCommandOptionProperties>(Options.Select(x => x.Build())) : null,
Choices = Choices,
Autocomplete = Autocomplete
IsAutocomplete = Autocomplete
};
}



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

@@ -70,18 +70,18 @@ namespace Discord.API
? option.Options.Select(x => new ApplicationCommandOption(x)).ToArray()
: Optional<ApplicationCommandOption[]>.Unspecified;

Required = option.Required.HasValue
? option.Required.Value
Required = option.IsRequired.HasValue
? option.IsRequired.Value
: Optional<bool>.Unspecified;

Default = option.Default.HasValue
? option.Default.Value
Default = option.IsDefault.HasValue
? option.IsDefault.Value
: Optional<bool>.Unspecified;

Name = option.Name;
Type = option.Type;
Description = option.Description;
Autocomplete = option.Autocomplete;
Autocomplete = option.IsAutocomplete;
}
}
}

Loading…
Cancel
Save