Browse Source

Update SelectMenuOption summaries, Rename Default to IsDefault in SelectMenuOption

pull/1923/head
quin lynch 3 years ago
parent
commit
6cd4730147
4 changed files with 12 additions and 12 deletions
  1. +3
    -3
      src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs
  2. +1
    -1
      src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs
  3. +7
    -7
      src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuOption.cs
  4. +1
    -1
      src/Discord.Net.Rest/API/Common/SelectMenuOption.cs

+ 3
- 3
src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs View File

@@ -76,7 +76,7 @@ namespace Discord
AddComponent(cmp, row);
break;
case SelectMenuComponent menu:
WithSelectMenu(menu.Placeholder, menu.CustomId, menu.Options.Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.Default)).ToList(), menu.Placeholder, menu.MinValues, menu.MaxValues, menu.Disabled, row);
WithSelectMenu(menu.Placeholder, menu.CustomId, menu.Options.Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.IsDefault)).ToList(), menu.Placeholder, menu.MinValues, menu.MaxValues, menu.Disabled, row);
break;
}
}
@@ -742,7 +742,7 @@ namespace Discord
MinValues = selectMenu.MinValues;
Disabled = selectMenu.Disabled;
Options = selectMenu.Options?
.Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.Default))
.Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.IsDefault))
.ToList();
}

@@ -1028,7 +1028,7 @@ namespace Discord
Value = option.Value;
Description = option.Description;
Emote = option.Emote;
Default = option.Default;
Default = option.IsDefault;
}

/// <summary>


+ 1
- 1
src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs View File

@@ -53,7 +53,7 @@ namespace Discord
public SelectMenuBuilder ToBuilder()
=> new SelectMenuBuilder(
CustomId,
Options.Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.Default)).ToList(),
Options.Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.IsDefault)).ToList(),
Placeholder,
MaxValues,
MinValues,


+ 7
- 7
src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuOption.cs View File

@@ -12,29 +12,29 @@ namespace Discord
public class SelectMenuOption
{
/// <summary>
/// The user-facing name of the option, max 25 characters.
/// Gets the user-facing name of the option.
/// </summary>
public string Label { get; }

/// <summary>
/// The dev-define value of the option, max 100 characters.
/// Gets the dev-define value of the option.
/// </summary>
public string Value { get; }

/// <summary>
/// An additional description of the option, max 50 characters.
/// Gets a description of the option.
/// </summary>
public string Description { get; }

/// <summary>
/// A <see cref="IEmote"/> that will be displayed with this menu option.
/// Gets the <see cref="IEmote"/> displayed with this menu option.
/// </summary>
public IEmote Emote { get; }

/// <summary>
/// Will render this option as selected by default.
/// Gets whether or not this option will render as selected by default.
/// </summary>
public bool? Default { get; }
public bool? IsDefault { get; }

internal SelectMenuOption(string label, string value, string description, IEmote emote, bool? defaultValue)
{
@@ -42,7 +42,7 @@ namespace Discord
Value = value;
Description = description;
Emote = emote;
Default = defaultValue;
IsDefault = defaultValue;
}
}
}

+ 1
- 1
src/Discord.Net.Rest/API/Common/SelectMenuOption.cs View File

@@ -52,7 +52,7 @@ namespace Discord.API
}
}

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

Loading…
Cancel
Save