Interface MessageBuilderDelegate

    • Method Detail

      • addComponents

        void addComponents​(HighLevelComponent... highLevelComponents)
        Add high-level components to the message.
        Parameters:
        highLevelComponents - The high-level components.
      • addActionRow

        void addActionRow​(LowLevelComponent... lowLevelComponents)
        Add low-level components to the message, wrapped in an ActionRow.
        Parameters:
        lowLevelComponents - The low level components.
      • 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.
      • copy

        void copy​(Message message)
        Fill the builder's values with a given message.
        Parameters:
        message - The message to copy from.
      • 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.
      • addEmbed

        void addEmbed​(EmbedBuilder embed)
        Adds the embed to the message.
        Parameters:
        embed - The embed to add.
      • removeAllEmbeds

        void removeAllEmbeds​()
        Removes all embeds from the message.
      • addEmbeds

        void addEmbeds​(EmbedBuilder... embeds)
        Adds the embeds to the message.
        Parameters:
        embeds - The embeds to add.
      • removeEmbed

        void removeEmbed​(EmbedBuilder embed)
        Removes the embed from the message.
        Parameters:
        embed - The embed to remove.
      • removeEmbeds

        void removeEmbeds​(EmbedBuilder... embeds)
        Removes the embeds from the message.
        Parameters:
        embeds - The embeds to remove.
      • removeComponent

        void removeComponent​(int index)
        Remove a high-level component from the message.
        Parameters:
        index - The index placement.
      • removeComponent

        void removeComponent​(HighLevelComponent component)
        Remove a high-level component from the message.
        Parameters:
        component - The high-level component being removed.
      • removeAllComponents

        void removeAllComponents​()
        Remove all high-level components from the message.
      • 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.
      • setAllowedMentions

        void setAllowedMentions​(AllowedMentions allowedMentions)
        Controls the mention behavior.
        Parameters:
        allowedMentions - The mention object to specify which mention should ping.
      • replyTo

        void replyTo​(long messageId)
        Sets the message to reply to.
        Parameters:
        messageId - The id of the message to reply to.
      • 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.
      • sendWithWebhook

        CompletableFuture<Message> sendWithWebhook​(DiscordApi api,
                                                   String webhookId,
                                                   String webhookToken)
        Sends the message.
        Parameters:
        api - The api instance needed to send and return the message.
        webhookId - The id of the webhook from which the message should be sent.
        webhookToken - The token of the webhook from which the message should be sent.
        Returns:
        The sent message.