Browse Source

Add custom id to IMessageComponent

pull/1923/head
quin lynch 3 years ago
parent
commit
2339501572
3 changed files with 14 additions and 4 deletions
  1. +4
    -0
      src/Discord.Net.Core/Entities/Interactions/Message Components/ActionRowComponent.cs
  2. +0
    -2
      src/Discord.Net.Core/Entities/Interactions/Message Components/ButtonComponent.cs
  3. +10
    -2
      src/Discord.Net.Core/Entities/Interactions/Message Components/IMessageComponent.cs

+ 4
- 0
src/Discord.Net.Core/Entities/Interactions/Message Components/ActionRowComponent.cs View File

@@ -20,10 +20,14 @@ namespace Discord
/// </summary> /// </summary>
public IReadOnlyCollection<IMessageComponent> Components { get; internal set; } public IReadOnlyCollection<IMessageComponent> Components { get; internal set; }



internal ActionRowComponent() { } internal ActionRowComponent() { }
internal ActionRowComponent(List<IMessageComponent> components) internal ActionRowComponent(List<IMessageComponent> components)
{ {
this.Components = components; this.Components = components;
} }

string IMessageComponent.CustomId => null;
} }
} }

+ 0
- 2
src/Discord.Net.Core/Entities/Interactions/Message Components/ButtonComponent.cs View File

@@ -57,7 +57,5 @@ namespace Discord
this.Url = url; this.Url = url;
this.Disabled = disabled; this.Disabled = disabled;
} }


} }
} }

+ 10
- 2
src/Discord.Net.Core/Entities/Interactions/Message Components/IMessageComponent.cs View File

@@ -6,11 +6,19 @@ using System.Threading.Tasks;


namespace Discord namespace Discord
{ {
/// <summary>
/// Represents a message component on a message.
/// </summary>
public interface IMessageComponent public interface IMessageComponent
{ {
/// <summary> /// <summary>
/// The <see cref="ComponentType"/> of this Message Component.
/// Gets the <see cref="ComponentType"/> of this Message Component.
/// </summary> /// </summary>
public ComponentType Type { get; }
ComponentType Type { get; }

/// <summary>
/// Gets the custom id of the component if possible; otherwise <see langword="null"/>.
/// </summary>
string CustomId { get; }
} }
} }

Loading…
Cancel
Save