Class ModalBuilder

java.lang.Object
io.github.kaktushose.jdac.dispatching.reply.dynamic.ModalBuilder

public class ModalBuilder extends Object
Builder for Modals. Acts as a bridge between ModalDefinition and Modal for dynamic modifications.
  • Constructor Details

  • Method Details

    • title

      public ModalBuilder title(String title)
      See Also:
      • Modal.Builder.setTitle(String)
    • placeholder

      public ModalBuilder placeholder(Entry... placeholder)
      Parameters:
      placeholder - the placeholders to be used for localization
    • textInput

      public ModalBuilder textInput(String textInput, Function<net.dv8tion.jda.api.components.textinput.TextInput.Builder, net.dv8tion.jda.api.components.textinput.TextInput.Builder> callback)
      Allows modification of a text input with the given callback.
      Parameters:
      textInput - the name of the method parameter the text input is assigned to
      callback - the Function to modify the text input
      Returns:
      this instance for fluent interface
      See Also:
      • TextInput.Builder
    • modify

      public ModalBuilder modify(Function<net.dv8tion.jda.api.modals.Modal.Builder, net.dv8tion.jda.api.modals.Modal.Builder> callback)
      Parameters:
      callback - a Function that allows to modify the resulting jda object. The passed function will be called after all modifications except localization are made by jda-commands, shortly before the component is localized and then registered in the message
    • build

      public net.dv8tion.jda.api.modals.Modal build()
      Builds the Modal.