using System; namespace Discord.Interactions.Builders { /// /// Represents a builder for creating a . /// public class ModalCommandBuilder : CommandBuilder { protected override ModalCommandBuilder Instance => this; /// /// Initializes a new . /// /// Parent module of this modal. public ModalCommandBuilder(ModuleBuilder module) : base(module) { } /// /// Initializes a new . /// /// Parent module of this modal. /// Name of this modal. /// Execution callback of this modal. public ModalCommandBuilder(ModuleBuilder module, string name, ExecuteCallback callback) : base(module, name, callback) { } /// /// Adds a modal parameter to the parameters collection. /// /// factory. /// /// The builder instance. /// public override ModalCommandBuilder AddParameter(Action configure) { var parameter = new ModalCommandParameterBuilder(this); configure(parameter); AddParameters(parameter); return this; } internal override ModalCommandInfo Build(ModuleInfo module, InteractionService commandService) => new(this, module, commandService); } }