Interface MessageBuilderDelegate



  • public interface MessageBuilderDelegate
    This class is internally used by the MessageBuilder to create messages. You usually don't want to interact with this object.
    • Method Detail

      • appendCode

        void appendCode​(String language,
                        String code)
        Appends code to the message.
        Parameters:
        language - The language, e.g. "java".
        code - The code.
      • append

        void append​(String message,
                    MessageDecoration... decorations)
        Appends a sting with or without decoration to the message.
        Parameters:
        message - The string to append.
        decorations - The decorations of the string.
      • append

        void append​(Mentionable entity)
        Appends a mentionable entity (usually a user or channel) to the message.
        Parameters:
        entity - The entity to mention.
      • appendNewLine

        void appendNewLine​()
        Appends a new line to the message.
      • setContent

        void setContent​(String content)
        Sets the content of the message. This method overwrites all previous content changes (using append(String, MessageDecoration...) for example).
        Parameters:
        content - The new content of the message.
      • setEmbed

        void setEmbed​(EmbedBuilder embed)
        Sets the embed of the message.
        Parameters:
        embed - The embed to set.
      • setTts

        void setTts​(boolean tts)
        Sets if the message should be text to speech.
        Parameters:
        tts - Whether the message should be text to speech or not.
      • addFile

        void addFile​(File file)
        Adds a file to the message.
        Parameters:
        file - The file to add as an attachment.
        See Also:
        addAttachment(File)
      • addFile

        void addFile​(Icon icon)
        Adds a file to the message.
        Parameters:
        icon - The icon to add as an attachment.
        See Also:
        addAttachment(Icon)
      • addFile

        void addFile​(URL url)
        Adds a file to the message.
        Parameters:
        url - The url of the attachment.
        See Also:
        addAttachment(URL)
      • addFile

        void addFile​(byte[] bytes,
                     String fileName)
        Adds a file to the message.
        Parameters:
        bytes - The bytes of the file.
        fileName - The name of the file.
        See Also:
        addAttachment(byte[], String)
      • addFileAsSpoiler

        void addFileAsSpoiler​(File file)
        Adds a spoiler attachment to the message.
        Parameters:
        file - The file to add as an attachment.
      • addFileAsSpoiler

        void addFileAsSpoiler​(Icon icon)
        Adds a spoiler attachment to the message.
        Parameters:
        icon - The icon to add as an attachment.
      • addFileAsSpoiler

        void addFileAsSpoiler​(URL url)
        Adds a spoiler attachment to the message.
        Parameters:
        url - The url of the attachment.
      • addAttachment

        void addAttachment​(BufferedImage image,
                           String fileName)
        Adds an attachment to the message.
        Parameters:
        image - The image to add as an attachment.
        fileName - The file name of the image.
      • addAttachment

        void addAttachment​(File file)
        Adds an attachment to the message.
        Parameters:
        file - The file to add as an attachment.
      • addAttachment

        void addAttachment​(Icon icon)
        Adds an attachment to the message.
        Parameters:
        icon - The icon to add as an attachment.
      • addAttachment

        void addAttachment​(URL url)
        Adds an attachment to the message.
        Parameters:
        url - The url of the attachment.
      • addAttachment

        void addAttachment​(byte[] bytes,
                           String fileName)
        Adds an attachment to the message.
        Parameters:
        bytes - The bytes of the file.
        fileName - The name of the file.
      • addAttachment

        void addAttachment​(InputStream stream,
                           String fileName)
        Adds an attachment to the message.
        Parameters:
        stream - The stream of the file.
        fileName - The name of the file.
      • addAttachmentAsSpoiler

        void addAttachmentAsSpoiler​(File file)
        Adds a spoiler attachment to the message.
        Parameters:
        file - The file to add as an attachment.
      • addAttachmentAsSpoiler

        void addAttachmentAsSpoiler​(Icon icon)
        Adds a spoiler attachment to the message.
        Parameters:
        icon - The icon to add as an attachment.
      • addAttachmentAsSpoiler

        void addAttachmentAsSpoiler​(URL url)
        Adds a spoiler attachment to the message.
        Parameters:
        url - The url of the attachment.
      • setNonce

        void setNonce​(String nonce)
        Sets the nonce of the message.
        Parameters:
        nonce - The nonce to set.
      • getStringBuilder

        StringBuilder getStringBuilder​()
        Gets the StringBuilder which is used to build the message.
        Returns:
        The StringBuilder which is used to build the message.
      • send

        CompletableFuture<Message> send​(User user)
        Sends the message.
        Parameters:
        user - The user to which the message should be sent.
        Returns:
        The sent message.
      • send

        CompletableFuture<Message> send​(TextChannel channel)
        Sends the message.
        Parameters:
        channel - The channel in which the message should be sent.
        Returns:
        The sent message.