Example #1
0
 internal ModalInfo(Builders.ModalBuilder builder)
 {
     Title      = builder.Title;
     Type       = builder.Type;
     Components = builder.Components.Select(x => x switch
     {
         Builders.TextInputComponentBuilder textComponent => textComponent.Build(this),
         _ => throw new InvalidOperationException($"{x.GetType().FullName} isn't a supported modal input component builder type.")
     }).ToImmutableArray();
Example #2
0
 /// <summary>
 ///     Creates an instance of <see cref="InputComponentBuilder{TInfo, TBuilder}"/>
 /// </summary>
 /// <param name="modal">Parent modal of this input component.</param>
 public InputComponentBuilder(ModalBuilder modal)
 {
     Modal       = modal;
     _attributes = new();
 }