Browse Source

Renamed SelectMenu to SelectMenuComponent

pull/1923/head
quin lynch 3 years ago
parent
commit
97d3b0ee63
7 changed files with 18 additions and 18 deletions
  1. +11
    -11
      src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs
  2. +2
    -2
      src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs
  3. +1
    -1
      src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuOption.cs
  4. +1
    -1
      src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs
  5. +1
    -1
      src/Discord.Net.Rest/Entities/Messages/RestMessage.cs
  6. +1
    -1
      src/Discord.Net.WebSocket/Entities/Interaction/Message Components/SocketMessageComponentData.cs
  7. +1
    -1
      src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs

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

@@ -80,7 +80,7 @@ namespace Discord
foreach (var cmp in actionRow.Components)
AddComponent(cmp, row);
break;
case SelectMenu menu:
case SelectMenuComponent menu:
this.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);
break;
}
@@ -595,22 +595,22 @@ namespace Discord
}

/// <summary>
/// Represents a class used to build <see cref="SelectMenu"/>'s.
/// Represents a class used to build <see cref="SelectMenuComponent"/>'s.
/// </summary>
public class SelectMenuBuilder
{
/// <summary>
/// The max length of a <see cref="SelectMenu.Placeholder"/>.
/// The max length of a <see cref="SelectMenuComponent.Placeholder"/>.
/// </summary>
public const int MaxPlaceholderLength = 100;

/// <summary>
/// The maximum number of values for the <see cref="SelectMenu.MinValues"/> and <see cref="SelectMenu.MaxValues"/> properties.
/// The maximum number of values for the <see cref="SelectMenuComponent.MinValues"/> and <see cref="SelectMenuComponent.MaxValues"/> properties.
/// </summary>
public const int MaxValuesCount = 25;

/// <summary>
/// The maximum number of options a <see cref="SelectMenu"/> can have.
/// The maximum number of options a <see cref="SelectMenuComponent"/> can have.
/// </summary>
public const int MaxOptionCount = 25;

@@ -709,9 +709,9 @@ namespace Discord
public SelectMenuBuilder() { }

/// <summary>
/// Creates a new instance of a <see cref="SelectMenuBuilder"/> from instance of <see cref="SelectMenu"/>.
/// Creates a new instance of a <see cref="SelectMenuBuilder"/> from instance of <see cref="SelectMenuComponent"/>.
/// </summary>
public SelectMenuBuilder(SelectMenu selectMenu)
public SelectMenuBuilder(SelectMenuComponent selectMenu)
{
this.Placeholder = selectMenu.Placeholder;
this.CustomId = selectMenu.Placeholder;
@@ -861,14 +861,14 @@ namespace Discord
}

/// <summary>
/// Builds a <see cref="SelectMenu"/>
/// Builds a <see cref="SelectMenuComponent"/>
/// </summary>
/// <returns>The newly built <see cref="SelectMenu"/></returns>
public SelectMenu Build()
/// <returns>The newly built <see cref="SelectMenuComponent"/></returns>
public SelectMenuComponent Build()
{
var options = this.Options?.Select(x => x.Build()).ToList();

return new SelectMenu(this.CustomId, options, this.Placeholder, this.MinValues, this.MaxValues, this.Disabled);
return new SelectMenuComponent(this.CustomId, options, this.Placeholder, this.MinValues, this.MaxValues, this.Disabled);
}
}



src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenu.cs → src/Discord.Net.Core/Entities/Interactions/Message Components/SelectMenuComponent.cs View File

@@ -9,7 +9,7 @@ namespace Discord
/// <summary>
/// Represents a select menu component defined at <see href="https://discord.com/developers/docs/interactions/message-components#select-menu-object"/>
/// </summary>
public class SelectMenu : IMessageComponent
public class SelectMenuComponent : IMessageComponent
{
/// <inheritdoc/>
public ComponentType Type => ComponentType.SelectMenu;
@@ -59,7 +59,7 @@ namespace Discord
this.MinValues,
this.Disabled);

internal SelectMenu(string customId, List<SelectMenuOption> options, string placeholder, int minValues, int maxValues, bool disabled)
internal SelectMenuComponent(string customId, List<SelectMenuOption> options, string placeholder, int minValues, int maxValues, bool disabled)
{
this.CustomId = customId;
this.Options = options;

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

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Discord
{
/// <summary>
/// Represents a choice for a <see cref="SelectMenu"/>.
/// Represents a choice for a <see cref="SelectMenuComponent"/>.
/// </summary>
public class SelectMenuOption
{


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

@@ -32,7 +32,7 @@ namespace Discord.API

public SelectMenuComponent() { }

public SelectMenuComponent(Discord.SelectMenu component)
public SelectMenuComponent(Discord.SelectMenuComponent component)
{
this.Type = component.Type;
this.CustomId = component.CustomId;


+ 1
- 1
src/Discord.Net.Rest/Entities/Messages/RestMessage.cs View File

@@ -163,7 +163,7 @@ namespace Discord.Rest
case ComponentType.SelectMenu:
{
var parsed = (API.SelectMenuComponent)y;
return new SelectMenu(
return new SelectMenuComponent(
parsed.CustomId,
parsed.Options.Select(z => new SelectMenuOption(
z.Label,


+ 1
- 1
src/Discord.Net.WebSocket/Entities/Interaction/Message Components/SocketMessageComponentData.cs View File

@@ -23,7 +23,7 @@ namespace Discord.WebSocket
public ComponentType Type { get; }

/// <summary>
/// The value(s) of a <see cref="SelectMenu"/> interaction response.
/// The value(s) of a <see cref="SelectMenuComponent"/> interaction response.
/// </summary>
public IReadOnlyCollection<string> Values { get; }



+ 1
- 1
src/Discord.Net.WebSocket/Entities/Messages/SocketMessage.cs View File

@@ -198,7 +198,7 @@ namespace Discord.WebSocket
case ComponentType.SelectMenu:
{
var parsed = (API.SelectMenuComponent)y;
return new SelectMenu(
return new SelectMenuComponent(
parsed.CustomId,
parsed.Options.Select(z => new SelectMenuOption(
z.Label,


Loading…
Cancel
Save