From 6da9264171a1ba67927cbf1c3606d066e9e1e94c Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Mon, 13 Feb 2023 20:06:16 +0100 Subject: [PATCH] Add ModalBuilder.AddModalCommand with option to specify callback Fixes: #2597 --- .../Builders/ModuleBuilder.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Discord.Net.Interactions/Builders/ModuleBuilder.cs b/src/Discord.Net.Interactions/Builders/ModuleBuilder.cs index e3ac0140a..26402762e 100644 --- a/src/Discord.Net.Interactions/Builders/ModuleBuilder.cs +++ b/src/Discord.Net.Interactions/Builders/ModuleBuilder.cs @@ -390,6 +390,23 @@ namespace Discord.Interactions.Builders _modalCommands.Add(command); return this; } + + /// + /// Adds a modal command builder to . + /// + /// Name of the command. + /// Command callback to be executed. + /// factory. + /// + /// The builder instance. + /// + public ModuleBuilder AddModalCommand(string name, ExecuteCallback callback, Action configure) + { + var command = new ModalCommandBuilder(this, name, callback); + configure(command); + _modalCommands.Add(command); + return this; + } /// /// Adds sub-module builder to .