From 8af943f503046e0108f7a19d7d2145115f46af9c Mon Sep 17 00:00:00 2001 From: Misha133 Date: Thu, 3 Nov 2022 22:50:48 +0300 Subject: [PATCH] fix `ActionRowBuilder` --- .../Interactions/MessageComponents/ComponentBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs index c266da7b2..29ff80cf2 100644 --- a/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs +++ b/src/Discord.Net.Core/Entities/Interactions/MessageComponents/ComponentBuilder.cs @@ -362,7 +362,7 @@ namespace Discord /// The type of the select menu. /// Menus valid channel types (only for ) /// The current builder. - public ActionRowBuilder WithSelectMenu(string customId, List options, + public ActionRowBuilder WithSelectMenu(string customId, List options = null, string placeholder = null, int minValues = 1, int maxValues = 1, bool disabled = false, ComponentType type = ComponentType.SelectMenu, ChannelType[] channelTypes = null) { @@ -385,7 +385,7 @@ namespace Discord /// The current builder. public ActionRowBuilder WithSelectMenu(SelectMenuBuilder menu) { - if (menu.Options.Distinct().Count() != menu.Options.Count) + if (menu.Options is not null && menu.Options.Distinct().Count() != menu.Options.Count) throw new InvalidOperationException("Please make sure that there is no duplicates values."); var builtMenu = menu.Build();