From 43c9ab7c5f30aecf34cd55b339491c2790f71f91 Mon Sep 17 00:00:00 2001 From: Misha133 Date: Wed, 2 Nov 2022 11:46:19 +0300 Subject: [PATCH] some component&action row builder additions --- .../MessageComponents/ComponentBuilder.cs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs index 4721b0cbd..ee3ea8928 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs @@ -92,9 +92,11 @@ namespace Discord /// The max values of the placeholder. /// Whether or not the menu is disabled. /// The row to add the menu to. + /// The type of the select menu. + /// Menus valid channel types (only for ) /// - public ComponentBuilder WithSelectMenu(string customId, List options, - string placeholder = null, int minValues = 1, int maxValues = 1, bool disabled = false, int row = 0) + public ComponentBuilder WithSelectMenu(string customId, List options = null, + string placeholder = null, int minValues = 1, int maxValues = 1, bool disabled = false, int row = 0, ComponentType type = ComponentType.SelectMenu, ChannelType[] channelTypes = null) { return WithSelectMenu(new SelectMenuBuilder() .WithCustomId(customId) @@ -102,7 +104,9 @@ namespace Discord .WithPlaceholder(placeholder) .WithMaxValues(maxValues) .WithMinValues(minValues) - .WithDisabled(disabled), + .WithDisabled(disabled) + .WithType(type) + .WithChannelTypes(channelTypes), row); } @@ -354,10 +358,13 @@ namespace Discord /// The placeholder of the menu. /// The min values of the placeholder. /// The max values of the placeholder. - /// Whether or not the menu is disabled. + /// Whether or not the menu is disabled. + /// The type of the select menu. + /// Menus valid channel types (only for ) /// The current builder. public ActionRowBuilder WithSelectMenu(string customId, List options, - string placeholder = null, int minValues = 1, int maxValues = 1, bool disabled = false) + string placeholder = null, int minValues = 1, int maxValues = 1, bool disabled = false, + ComponentType type = ComponentType.SelectMenu, ChannelType[] channelTypes = null) { return WithSelectMenu(new SelectMenuBuilder() .WithCustomId(customId) @@ -365,7 +372,9 @@ namespace Discord .WithPlaceholder(placeholder) .WithMaxValues(maxValues) .WithMinValues(minValues) - .WithDisabled(disabled)); + .WithDisabled(disabled) + .WithType(type) + .WithChannelTypes(channelTypes)); } ///