From 061bfdb1fef85225297099455b523a14d2edaff2 Mon Sep 17 00:00:00 2001 From: Misha133 <61027276+Misha-133@users.noreply.github.com> Date: Fri, 9 May 2025 18:16:53 +0300 Subject: [PATCH] yep --- .../MessageComponents/ActionRowComponent.cs | 9 ++ .../Builders/ComponentBuilderExtensions.cs | 94 +------------ .../Builders/TextInputBuilder.cs | 16 +++ .../MessageComponents/ButtonComponent.cs | 10 +- .../MessageComponents/ContainerComponent.cs | 9 ++ .../MessageComponents/FileComponent.cs | 9 ++ .../MessageComponents/IMessageComponent.cs | 8 ++ .../MediaGalleryComponent.cs | 9 ++ .../MessageComponents/MediaGalleryItem.cs | 6 + .../MessageComponents/SectionComponent.cs | 9 ++ .../MessageComponents/SelectMenuComponent.cs | 131 ++++++++---------- .../MessageComponents/SeparatorComponent.cs | 9 ++ .../MessageComponents/TextDisplayComponent.cs | 9 ++ .../MessageComponents/TextInputComponent.cs | 113 ++++++++------- .../MessageComponents/ThumbnailComponent.cs | 9 ++ .../MessageComponents/UnfurledMediaItem.cs | 6 + .../API/Common/ActionRowComponent.cs | 1 + .../API/Common/ButtonComponent.cs | 2 + .../API/Common/ContainerComponent.cs | 1 + .../API/Common/FileComponent.cs | 1 + .../API/Common/MediaGalleryComponent.cs | 1 + .../API/Common/SectionComponent.cs | 1 + .../API/Common/SelectMenuComponent.cs | 1 + .../API/Common/SeparatorComponent.cs | 1 + .../API/Common/TextDisplayComponent.cs | 1 + .../API/Common/TextInputComponent.cs | 1 + .../API/Common/ThumbnailComponent.cs | 1 + 27 files changed, 248 insertions(+), 220 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ActionRowComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ActionRowComponent.cs index 855b61ee29..d04d897ea9 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ActionRowComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ActionRowComponent.cs @@ -18,10 +18,19 @@ public class ActionRowComponent : IMessageComponent /// public IReadOnlyCollection Components { get; internal set; } + /// + /// Converts a to a . + /// + public ActionRowBuilder ToBuilder() + => new(this); + internal ActionRowComponent() { } internal ActionRowComponent(IReadOnlyCollection components) { Components = components; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/Builders/ComponentBuilderExtensions.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/Builders/ComponentBuilderExtensions.cs index 4e0c6d0717..addcae8cfa 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/Builders/ComponentBuilderExtensions.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/Builders/ComponentBuilderExtensions.cs @@ -18,99 +18,7 @@ public static BuilderT WithId(this BuilderT builder, int? id) builder.Id = id; return builder; } - - /// - /// Converts a to a builder. - /// - /// Unknown component type - public static IMessageComponentBuilder ToBuilder(this IMessageComponent component) - => component switch - { - ActionRowComponent actionRow => actionRow.ToBuilder(), - ButtonComponent button => button.ToBuilder(), - SelectMenuComponent select => select.ToBuilder(), - SectionComponent section => section.ToBuilder(), - TextDisplayComponent textDisplay => textDisplay.ToBuilder(), - ThumbnailComponent thumbnail => thumbnail.ToBuilder(), - MediaGalleryComponent mediaGallery => mediaGallery.ToBuilder(), - FileComponent file => file.ToBuilder(), - SeparatorComponent separator => separator.ToBuilder(), - ContainerComponent container => container.ToBuilder(), - _ => throw new ArgumentException("Unknown component type") - }; - - /// - /// Converts a to a . - /// - public static FileComponentBuilder ToBuilder(this FileComponent file) - => new(file); - - /// - /// Converts a to a . - /// - public static SeparatorBuilder ToBuilder(this SeparatorComponent separator) - => new(separator); - - /// - /// Converts a to a . - /// - public static MediaGalleryBuilder ToBuilder(this MediaGalleryComponent mediaGallery) - => new(mediaGallery); - - /// - /// Converts a to a . - /// - public static ButtonBuilder ToBuilder(this ButtonComponent button) - => new(button); - - /// - /// Converts a to a . - /// - public static SelectMenuBuilder ToBuilder(this SelectMenuComponent select) - => new(select); - - /// - /// Converts a to a . - /// - public static ActionRowBuilder ToBuilder(this ActionRowComponent actionRow) - => new(actionRow); - - /// - /// Converts a to a . - /// - public static ContainerBuilder ToBuilder(this ContainerComponent container) - => new(container); - - /// - /// Converts a to a . - /// - public static SectionBuilder ToBuilder(this SectionComponent section) - => new(section); - - /// - /// Converts a to a . - /// - public static ThumbnailBuilder ToBuilder(this ThumbnailComponent thumbnail) - => new(thumbnail); - - /// - /// Converts a to a . - /// - public static TextDisplayBuilder ToBuilder(this TextDisplayComponent textDisplay) - => new (textDisplay); - - /// - /// Converts a to a . - /// - public static MediaGalleryItemProperties ToProperties(this MediaGalleryItem item) - => new(item.Media.ToProperties(), item.Description, item.IsSpoiler); - - /// - /// Converts a to a . - /// - public static UnfurledMediaItemProperties ToProperties(this UnfurledMediaItem item) - => new(item.Url); - + /// /// Converts a collection of to a . /// diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/Builders/TextInputBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/Builders/TextInputBuilder.cs index d3ea851cd5..abecb1f50e 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/Builders/TextInputBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/Builders/TextInputBuilder.cs @@ -169,6 +169,22 @@ public TextInputBuilder() } + /// + /// Creates a new instance of a from existing component. + /// + public TextInputBuilder(TextInputComponent textInput) + { + Label = textInput.Label; + Style = textInput.Style; + CustomId = textInput.CustomId; + Placeholder = textInput.Placeholder; + MinLength = textInput.MinLength; + MaxLength = textInput.MaxLength; + Required = textInput.Required; + Value = textInput.Value; + Id = textInput.Id; + } + /// /// Sets the label of the current builder. /// diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ButtonComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ButtonComponent.cs index 5a850e2015..e2178b1870 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ButtonComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ButtonComponent.cs @@ -51,13 +51,10 @@ public class ButtonComponent : IInteractableComponent public ulong? SkuId { get; } /// - /// Turns this button into a button builder. + /// Converts a to a . /// - /// - /// A newly created button builder with the same properties as this button. - /// public ButtonBuilder ToBuilder() - => new (Label, CustomId, Style, Url, Emote, IsDisabled); + => new(this); internal ButtonComponent(ButtonStyle style, string label, IEmote emote, string customId, string url, bool isDisabled, ulong? skuId, int? id) { @@ -70,4 +67,7 @@ internal ButtonComponent(ButtonStyle style, string label, IEmote emote, string c IsDisabled = isDisabled; SkuId = skuId; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ContainerComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ContainerComponent.cs index 20c54d6f61..9e8fe1faf8 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ContainerComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ContainerComponent.cs @@ -28,6 +28,12 @@ public class ContainerComponent : IMessageComponent /// public bool? IsSpoiler { get; } + /// + /// Converts a to a . + /// + public ContainerBuilder ToBuilder() + => new(this); + internal ContainerComponent(IReadOnlyCollection components, Color? accentColor, bool? isSpoiler, int? id = null) { Components = components; @@ -35,4 +41,7 @@ internal ContainerComponent(IReadOnlyCollection components, C IsSpoiler = isSpoiler; Id = id; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/FileComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/FileComponent.cs index 91a3c75f8c..cdb137f63c 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/FileComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/FileComponent.cs @@ -21,10 +21,19 @@ public class FileComponent : IMessageComponent /// public bool? IsSpoiler { get; } + /// + /// Converts a to a . + /// + public FileComponentBuilder ToBuilder() + => new(this); + internal FileComponent(UnfurledMediaItem file, bool? isSpoiler, int? id = null) { File = file; IsSpoiler = isSpoiler; Id = id; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/IMessageComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/IMessageComponent.cs index 6bc1c07d0d..1d043d10ad 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/IMessageComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/IMessageComponent.cs @@ -10,5 +10,13 @@ public interface IMessageComponent /// ComponentType Type { get; } + /// + /// + /// int? Id { get; } + + /// + /// Converts a to a . + /// + public IMessageComponentBuilder ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/MediaGalleryComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/MediaGalleryComponent.cs index ce3c398917..773d1b2f1c 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/MediaGalleryComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/MediaGalleryComponent.cs @@ -18,9 +18,18 @@ public class MediaGalleryComponent : IMessageComponent /// public IReadOnlyCollection Items { get; } + /// + /// Converts a to a . + /// + public MediaGalleryBuilder ToBuilder() + => new(this); + internal MediaGalleryComponent(IReadOnlyCollection items, int? id) { Items = items; Id = id; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/MediaGalleryItem.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/MediaGalleryItem.cs index da33f7c91c..6986626d30 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/MediaGalleryItem.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/MediaGalleryItem.cs @@ -20,6 +20,12 @@ public readonly struct MediaGalleryItem /// public bool IsSpoiler { get; } + /// + /// Converts a to a . + /// + public MediaGalleryItemProperties ToProperties() + => new(Media.ToProperties(), Description, IsSpoiler); + internal MediaGalleryItem(UnfurledMediaItem media, string description, bool? isSpoiler) { Media = media; diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SectionComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SectionComponent.cs index 52d71e3419..30ddcb1aed 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SectionComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SectionComponent.cs @@ -23,10 +23,19 @@ public class SectionComponent : IMessageComponent /// public IMessageComponent Accessory { get; } + /// + /// Converts a to a . + /// + public SectionBuilder ToBuilder() + => new(this); + internal SectionComponent(int? id, IReadOnlyCollection components, IMessageComponent accessory) { Id = id; Components = components; Accessory = accessory; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SelectMenuComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SelectMenuComponent.cs index 7d1a2558e3..daac300a3e 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SelectMenuComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SelectMenuComponent.cs @@ -1,87 +1,78 @@ -using System; using System.Collections.Generic; using System.Linq; -namespace Discord +namespace Discord; + +/// +/// Represents a select menu component defined at +/// +public class SelectMenuComponent : IInteractableComponent { - /// - /// Represents a select menu component defined at - /// - public class SelectMenuComponent : IInteractableComponent - { - /// - public ComponentType Type { get; } + /// + public ComponentType Type { get; } - /// - public int? Id { get; } + /// + public int? Id { get; } - /// - public string CustomId { get; } + /// + public string CustomId { get; } - /// - /// Gets the menus options to select from. - /// - public IReadOnlyCollection Options { get; } + /// + /// Gets the menus options to select from. + /// + public IReadOnlyCollection Options { get; } - /// - /// Gets the custom placeholder text if nothing is selected. - /// - public string Placeholder { get; } + /// + /// Gets the custom placeholder text if nothing is selected. + /// + public string Placeholder { get; } - /// - /// Gets the minimum number of items that must be chosen. - /// - public int MinValues { get; } + /// + /// Gets the minimum number of items that must be chosen. + /// + public int MinValues { get; } - /// - /// Gets the maximum number of items that can be chosen. - /// - public int MaxValues { get; } + /// + /// Gets the maximum number of items that can be chosen. + /// + public int MaxValues { get; } - /// - /// Gets whether this menu is disabled or not. - /// - public bool IsDisabled { get; } + /// + /// Gets whether this menu is disabled or not. + /// + public bool IsDisabled { get; } - /// - /// Gets the allowed channel types for this modal - /// - public IReadOnlyCollection ChannelTypes { get; } + /// + /// Gets the allowed channel types for this modal + /// + public IReadOnlyCollection ChannelTypes { get; } - /// - /// Gets default values for auto-populated select menu components. - /// - public IReadOnlyCollection DefaultValues { get; } + /// + /// Gets default values for auto-populated select menu components. + /// + public IReadOnlyCollection DefaultValues { get; } - /// - /// Turns this select menu into a builder. - /// - /// - /// A newly create builder with the same properties as this select menu. - /// - public SelectMenuBuilder ToBuilder() - => new SelectMenuBuilder( - CustomId, - Options.Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.IsDefault)).ToList(), - Placeholder, - MaxValues, - MinValues, - IsDisabled, Type, ChannelTypes.ToList(), - DefaultValues.ToList()); + /// + /// Converts a to a . + /// + public SelectMenuBuilder ToBuilder() + => new(this); - internal SelectMenuComponent(string customId, List options, string placeholder, int minValues, int maxValues, - bool disabled, ComponentType type, int? id, IEnumerable channelTypes = null, IEnumerable defaultValues = null) - { - CustomId = customId; - Options = options; - Placeholder = placeholder; - MinValues = minValues; - MaxValues = maxValues; - IsDisabled = disabled; - Type = type; - Id = id; - ChannelTypes = channelTypes?.ToArray() ?? []; - DefaultValues = defaultValues?.ToArray() ?? []; - } + internal SelectMenuComponent(string customId, List options, string placeholder, int minValues, int maxValues, + bool disabled, ComponentType type, int? id, IEnumerable channelTypes = null, IEnumerable defaultValues = null) + { + CustomId = customId; + Options = options; + Placeholder = placeholder; + MinValues = minValues; + MaxValues = maxValues; + IsDisabled = disabled; + Type = type; + Id = id; + ChannelTypes = channelTypes?.ToArray() ?? []; + DefaultValues = defaultValues?.ToArray() ?? []; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SeparatorComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SeparatorComponent.cs index 00c2e7cb9a..0347f53199 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SeparatorComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/SeparatorComponent.cs @@ -21,10 +21,19 @@ public class SeparatorComponent : IMessageComponent /// public SeparatorSpacingSize? Spacing { get; } + /// + /// Converts a to a . + /// + public SeparatorBuilder ToBuilder() + => new(this); + internal SeparatorComponent(bool? isDivider, SeparatorSpacingSize? spacing, int? id = null) { IsDivider = isDivider; Spacing = spacing; Id = id; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/TextDisplayComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/TextDisplayComponent.cs index e2aec7e858..206bfcf6e8 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/TextDisplayComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/TextDisplayComponent.cs @@ -16,9 +16,18 @@ public class TextDisplayComponent : IMessageComponent /// public string Content { get; } + /// + /// Converts a to a . + /// + public TextDisplayBuilder ToBuilder() + => new(this); + internal TextDisplayComponent(string content, int? id = null) { Id = id; Content = content; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/TextInputComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/TextInputComponent.cs index d76014bc07..01eae3dcc2 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/TextInputComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/TextInputComponent.cs @@ -1,66 +1,75 @@ -namespace Discord +namespace Discord; + +/// +/// Represents a text input. +/// +public class TextInputComponent : IInteractableComponent { + /// + public ComponentType Type => ComponentType.TextInput; + + /// + public string CustomId { get; } + + /// + public int? Id { get; } + /// - /// Represents a text input. + /// Gets the label of the component; this is the text shown above it. /// - public class TextInputComponent : IInteractableComponent - { - /// - public ComponentType Type => ComponentType.TextInput; - - /// - public string CustomId { get; } + public string Label { get; } - /// - public int? Id { get; } + /// + /// Gets the placeholder of the component. + /// + public string Placeholder { get; } - /// - /// Gets the label of the component; this is the text shown above it. - /// - public string Label { get; } + /// + /// Gets the minimum length of the inputted text. + /// + public int? MinLength { get; } - /// - /// Gets the placeholder of the component. - /// - public string Placeholder { get; } + /// + /// Gets the maximum length of the inputted text. + /// + public int? MaxLength { get; } - /// - /// Gets the minimum length of the inputted text. - /// - public int? MinLength { get; } + /// + /// Gets the style of the component. + /// + public TextInputStyle Style { get; } - /// - /// Gets the maximum length of the inputted text. - /// - public int? MaxLength { get; } + /// + /// Gets whether users are required to input text. + /// + public bool? Required { get; } - /// - /// Gets the style of the component. - /// - public TextInputStyle Style { get; } + /// + /// Gets the default value of the component. + /// + public string Value { get; } - /// - /// Gets whether users are required to input text. - /// - public bool? Required { get; } - /// - /// Gets the default value of the component. - /// - public string Value { get; } + /// + /// Converts a to a . + /// + public TextInputBuilder ToBuilder() + => new TextInputBuilder(this); - internal TextInputComponent(string customId, string label, string placeholder, int? minLength, int? maxLength, - TextInputStyle style, bool? required, string value, int? id) - { - CustomId = customId; - Label = label; - Placeholder = placeholder; - MinLength = minLength; - MaxLength = maxLength; - Style = style; - Required = required; - Value = value; - Id = id; - } + internal TextInputComponent(string customId, string label, string placeholder, int? minLength, int? maxLength, + TextInputStyle style, bool? required, string value, int? id) + { + CustomId = customId; + Label = label; + Placeholder = placeholder; + MinLength = minLength; + MaxLength = maxLength; + Style = style; + Required = required; + Value = value; + Id = id; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ThumbnailComponent.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ThumbnailComponent.cs index b42233923b..44a541b148 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ThumbnailComponent.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ThumbnailComponent.cs @@ -26,6 +26,12 @@ public class ThumbnailComponent : IMessageComponent /// public bool IsSpoiler { get; } + /// + /// Converts a to a . + /// + public ThumbnailBuilder ToBuilder() + => new(this); + internal ThumbnailComponent(int? id, UnfurledMediaItem media, string description, bool? isSpoiler) { Id = id; @@ -33,4 +39,7 @@ internal ThumbnailComponent(int? id, UnfurledMediaItem media, string description Description = description; IsSpoiler = isSpoiler ?? false; } + + /// + IMessageComponentBuilder IMessageComponent.ToBuilder() => ToBuilder(); } diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/UnfurledMediaItem.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/UnfurledMediaItem.cs index 52177794ed..f7d0455357 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/UnfurledMediaItem.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/UnfurledMediaItem.cs @@ -10,6 +10,12 @@ public class UnfurledMediaItem /// public string Url { get; } + /// + /// Converts a to a . + /// + public UnfurledMediaItemProperties ToProperties() + => new(Url); + internal UnfurledMediaItem(string url) { Url = url; diff --git a/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs b/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs index 4ee6311ee3..4d6476b22a 100644 --- a/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs +++ b/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs @@ -37,5 +37,6 @@ internal ActionRowComponent(Discord.ActionRowComponent c) [JsonIgnore] int? IMessageComponent.Id => Id.ToNullable(); + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; } } diff --git a/src/Discord.Net.Rest/API/Common/ButtonComponent.cs b/src/Discord.Net.Rest/API/Common/ButtonComponent.cs index 84f6e0c825..bab9d3ee96 100644 --- a/src/Discord.Net.Rest/API/Common/ButtonComponent.cs +++ b/src/Discord.Net.Rest/API/Common/ButtonComponent.cs @@ -70,5 +70,7 @@ public ButtonComponent(Discord.ButtonComponent c) [JsonIgnore] int? IMessageComponent.Id => Id.ToNullable(); + + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; } } diff --git a/src/Discord.Net.Rest/API/Common/ContainerComponent.cs b/src/Discord.Net.Rest/API/Common/ContainerComponent.cs index 311eb312c5..6c65beca35 100644 --- a/src/Discord.Net.Rest/API/Common/ContainerComponent.cs +++ b/src/Discord.Net.Rest/API/Common/ContainerComponent.cs @@ -33,4 +33,5 @@ public ContainerComponent(Discord.ContainerComponent component) } int? IMessageComponent.Id => Id.ToNullable(); + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; } diff --git a/src/Discord.Net.Rest/API/Common/FileComponent.cs b/src/Discord.Net.Rest/API/Common/FileComponent.cs index 81f189ae6b..eded3c9b36 100644 --- a/src/Discord.Net.Rest/API/Common/FileComponent.cs +++ b/src/Discord.Net.Rest/API/Common/FileComponent.cs @@ -27,4 +27,5 @@ public FileComponent(Discord.FileComponent component) } int? IMessageComponent.Id => Id.ToNullable(); + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; } diff --git a/src/Discord.Net.Rest/API/Common/MediaGalleryComponent.cs b/src/Discord.Net.Rest/API/Common/MediaGalleryComponent.cs index cc26cbd155..9e098dc128 100644 --- a/src/Discord.Net.Rest/API/Common/MediaGalleryComponent.cs +++ b/src/Discord.Net.Rest/API/Common/MediaGalleryComponent.cs @@ -30,4 +30,5 @@ public MediaGalleryComponent(Discord.MediaGalleryComponent component) } int? IMessageComponent.Id => Id.ToNullable(); + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; } diff --git a/src/Discord.Net.Rest/API/Common/SectionComponent.cs b/src/Discord.Net.Rest/API/Common/SectionComponent.cs index 76ea893d8c..dbeed42b9a 100644 --- a/src/Discord.Net.Rest/API/Common/SectionComponent.cs +++ b/src/Discord.Net.Rest/API/Common/SectionComponent.cs @@ -29,4 +29,5 @@ public SectionComponent(Discord.SectionComponent component) } int? IMessageComponent.Id => Id.ToNullable(); + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; } diff --git a/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs b/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs index f605d75b84..65ae4b3331 100644 --- a/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs +++ b/src/Discord.Net.Rest/API/Common/SelectMenuComponent.cs @@ -58,5 +58,6 @@ public SelectMenuComponent(Discord.SelectMenuComponent component) [JsonIgnore] int? IMessageComponent.Id => Id.ToNullable(); + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; } } diff --git a/src/Discord.Net.Rest/API/Common/SeparatorComponent.cs b/src/Discord.Net.Rest/API/Common/SeparatorComponent.cs index f01affac2f..8c2f1ad64d 100644 --- a/src/Discord.Net.Rest/API/Common/SeparatorComponent.cs +++ b/src/Discord.Net.Rest/API/Common/SeparatorComponent.cs @@ -27,4 +27,5 @@ public SeparatorComponent(Discord.SeparatorComponent component) } int? IMessageComponent.Id => Id.ToNullable(); + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; } diff --git a/src/Discord.Net.Rest/API/Common/TextDisplayComponent.cs b/src/Discord.Net.Rest/API/Common/TextDisplayComponent.cs index 04d66e06c9..95dd0c44b3 100644 --- a/src/Discord.Net.Rest/API/Common/TextDisplayComponent.cs +++ b/src/Discord.Net.Rest/API/Common/TextDisplayComponent.cs @@ -23,4 +23,5 @@ public TextDisplayComponent(Discord.TextDisplayComponent component) } int? IMessageComponent.Id => Id.ToNullable(); + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; } diff --git a/src/Discord.Net.Rest/API/Common/TextInputComponent.cs b/src/Discord.Net.Rest/API/Common/TextInputComponent.cs index 458cdaca56..d76dcd50f6 100644 --- a/src/Discord.Net.Rest/API/Common/TextInputComponent.cs +++ b/src/Discord.Net.Rest/API/Common/TextInputComponent.cs @@ -52,5 +52,6 @@ public TextInputComponent(Discord.TextInputComponent component) [JsonIgnore] int? IMessageComponent.Id => Id.ToNullable(); + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; } } diff --git a/src/Discord.Net.Rest/API/Common/ThumbnailComponent.cs b/src/Discord.Net.Rest/API/Common/ThumbnailComponent.cs index bc8b40dc38..609bc85514 100644 --- a/src/Discord.Net.Rest/API/Common/ThumbnailComponent.cs +++ b/src/Discord.Net.Rest/API/Common/ThumbnailComponent.cs @@ -32,4 +32,5 @@ public ThumbnailComponent(Discord.ThumbnailComponent component) } int? IMessageComponent.Id => Id.ToNullable(); + IMessageComponentBuilder IMessageComponent.ToBuilder() => null; }