Interface Message.Builder

Enclosing interface:
Message

public static interface Message.Builder
Builder for a message object.
Since:
5.2.240708
  • Method Details

    • addContent

      @Contract("_ -> this") @NotNull @NotNull Message.Builder addContent(@NotNull @NotNull MessagePart part)
      Adds a new message content part to this message.
      Parameters:
      part - The message content part to be added.
      Returns:
      This builder instance.
      Since:
      5.2.240708
    • addText

      @Contract("_ -> this") @NotNull default @NotNull Message.Builder addText(@NotNull @NotNull String text)
      Adds textual content to this message.
      Parameters:
      text - The text to be added.
      Returns:
      This builder instance.
      Since:
      5.2.240708
    • addImageUrl

      @Contract("_ -> this") @NotNull default @NotNull Message.Builder addImageUrl(@NotNull @NotNull String url)
      Adds an image URL to this message.
      Parameters:
      url - The image URL to be added.
      Returns:
      This builder instance.
      Since:
      5.2.240708
    • role

      @Contract("_ -> this") @NotNull @NotNull Message.Builder role(@NotNull @NotNull String role)
      Configures the role of the message author, Message.USER by default.
      Parameters:
      role - The message author role.
      Returns:
      This builder instance.
      Since:
      5.2.240708
    • create

      @NotNull @NotNull Message create()
      Creates a new message object.
      Returns:
      The new message instance.
      Since:
      5.2.240708