Browse Source

Added autocomplete in SlashCommandOptionBuilder. (#206)

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
pull/1923/head
Eugene Garbuzov GitHub 3 years ago
parent
commit
e7cec9588a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs

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

@@ -12,15 +12,15 @@ namespace Discord
/// </summary> /// </summary>
public class SlashCommandBuilder public class SlashCommandBuilder
{ {
/// <summary>
/// <summary>
/// Returns the maximun length a commands name allowed by Discord /// Returns the maximun length a commands name allowed by Discord
/// </summary> /// </summary>
public const int MaxNameLength = 32; public const int MaxNameLength = 32;
/// <summary>
/// Returns the maximum length of a commands description allowed by Discord.
/// <summary>
/// Returns the maximum length of a commands description allowed by Discord.
/// </summary> /// </summary>
public const int MaxDescriptionLength = 100; public const int MaxDescriptionLength = 100;
/// <summary>
/// <summary>
/// Returns the maximum count of command options allowed by Discord /// Returns the maximum count of command options allowed by Discord
/// </summary> /// </summary>
public const int MaxOptionsCount = 25; public const int MaxOptionsCount = 25;
@@ -382,6 +382,7 @@ namespace Discord
/// <param name="description">The description of this option.</param> /// <param name="description">The description of this option.</param>
/// <param name="required">If this option is required for this command.</param> /// <param name="required">If this option is required for this command.</param>
/// <param name="isDefault">If this option is the default option.</param> /// <param name="isDefault">If this option is the default option.</param>
/// <param name="isAutocomplete">If this option supports autocomplete.</param>
/// <param name="options">The options of the option to add.</param> /// <param name="options">The options of the option to add.</param>
/// <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>
@@ -417,6 +418,7 @@ namespace Discord
Description = description, Description = description,
Required = required, Required = required,
Default = isDefault, Default = isDefault,
Autocomplete = isAutocomplete,
Options = options, Options = options,
Type = type, Type = type,
Choices = choices != null ? new List<ApplicationCommandOptionChoiceProperties>(choices) : null, Choices = choices != null ? new List<ApplicationCommandOptionChoiceProperties>(choices) : null,


Loading…
Cancel
Save