Interface MessageChannel

  • All Superinterfaces:
    AbstractChannel, java.util.Formattable, ISnowflake
    All Known Subinterfaces:
    PrivateChannel, TextChannel

    public interface MessageChannel
    extends AbstractChannel, java.util.Formattable
    Represents a Discord channel that can have Messages and files sent to it.

    Formattable

    This interface extends Formattable and can be used with a Formatter such as used by String.format(String, Object...) or PrintStream.printf(String, Object...).

    This will use AbstractChannel.getName() rather than Object.toString()!
    Supported Features:

    • Alternative
      - Prepends the name with # (Example: %#s - results in #AbstractChannel.getName())
    • Width/Left-Justification
      - Ensures the size of a format (Example: %20s - uses at minimum 20 chars; %-10s - uses left-justified padding)
    • Precision
      - Cuts the content to the specified size (Example: %.20s)

    More information on formatting syntax can be found in the format syntax documentation!
    TextChannel is a special case which uses IMentionable.getAsMention() by default and uses the #AbstractChannel.getName() format as alternative

    See Also:
    TextChannel, PrivateChannel
    • Method Detail

      • getLatestMessageId

        @Nonnull
        default java.lang.String getLatestMessageId()
        The id for the most recent message sent in this current MessageChannel.
        This should only be used if hasLatestMessage() returns true!

        This value is updated on each MessageReceivedEvent and will be reset to null if the message associated with this ID gets deleted

        Returns:
        The most recent message's id
        Throws:
        java.lang.IllegalStateException - If no message id is available
      • purgeMessagesById

        @Nonnull
        default java.util.List<java.util.concurrent.CompletableFuture<java.lang.Void>> purgeMessagesById​(@Nonnull
                                                                                                         java.util.List<java.lang.String> messageIds)
        Convenience method to delete messages in the most efficient way available.
        This combines both TextChannel.deleteMessagesByIds(Collection) as well as deleteMessageById(long) to delete all messages provided. No checks will be done to prevent failures, use CompletionStage.exceptionally(Function) to handle failures.

        For possible ErrorResponses see purgeMessagesById(long...).

        Parameters:
        messageIds - The message ids to delete
        Returns:
        List of futures representing all deletion tasks
        See Also:
        CompletableFuture.allOf(java.util.concurrent.CompletableFuture[])
      • purgeMessagesById

        @Nonnull
        default java.util.List<java.util.concurrent.CompletableFuture<java.lang.Void>> purgeMessagesById​(@Nonnull
                                                                                                         java.lang.String... messageIds)
        Convenience method to delete messages in the most efficient way available.
        This combines both TextChannel.deleteMessagesByIds(Collection) as well as deleteMessageById(long) to delete all messages provided. No checks will be done to prevent failures, use CompletionStage.exceptionally(Function) to handle failures.

        For possible ErrorResponses see purgeMessagesById(long...).

        Parameters:
        messageIds - The message ids to delete
        Returns:
        List of futures representing all deletion tasks
        See Also:
        CompletableFuture.allOf(java.util.concurrent.CompletableFuture[])
      • purgeMessages

        @Nonnull
        default java.util.List<java.util.concurrent.CompletableFuture<java.lang.Void>> purgeMessages​(@Nonnull
                                                                                                     Message... messages)
        Convenience method to delete messages in the most efficient way available.
        This combines both TextChannel.deleteMessagesByIds(Collection) as well as Message.delete() to delete all messages provided. No checks will be done to prevent failures, use CompletionStage.exceptionally(Function) to handle failures.

        For possible ErrorResponses see purgeMessagesById(long...).

        Parameters:
        messages - The messages to delete
        Returns:
        List of futures representing all deletion tasks
        Throws:
        InsufficientPermissionException - If one of the provided messages is from another user and cannot be deleted due to permissions
        java.lang.IllegalArgumentException - If one of the provided messages is from another user and cannot be deleted because this is not in a guild
        See Also:
        CompletableFuture.allOf(java.util.concurrent.CompletableFuture[])
      • purgeMessages

        @Nonnull
        default java.util.List<java.util.concurrent.CompletableFuture<java.lang.Void>> purgeMessages​(@Nonnull
                                                                                                     java.util.List<? extends Message> messages)
        Convenience method to delete messages in the most efficient way available.
        This combines both TextChannel.deleteMessagesByIds(Collection) as well as Message.delete() to delete all messages provided. No checks will be done to prevent failures, use CompletionStage.exceptionally(Function) to handle failures.

        For possible ErrorResponses see purgeMessagesById(long...).

        Parameters:
        messages - The messages to delete
        Returns:
        List of futures representing all deletion tasks
        Throws:
        InsufficientPermissionException - If one of the provided messages is from another user and cannot be deleted due to permissions
        java.lang.IllegalArgumentException - If one of the provided messages is from another user and cannot be deleted because this is not in a guild
        See Also:
        CompletableFuture.allOf(java.util.concurrent.CompletableFuture[])
      • purgeMessagesById

        @Nonnull
        default java.util.List<java.util.concurrent.CompletableFuture<java.lang.Void>> purgeMessagesById​(@Nonnull
                                                                                                         long... messageIds)
        Convenience method to delete messages in the most efficient way available.
        This combines both TextChannel.deleteMessagesByIds(Collection) as well as deleteMessageById(long) to delete all messages provided. No checks will be done to prevent failures, use CompletionStage.exceptionally(Function) to handle failures.

        Possible ErrorResponses include:

        Parameters:
        messageIds - The message ids to delete
        Returns:
        List of futures representing all deletion tasks
        See Also:
        CompletableFuture.allOf(java.util.concurrent.CompletableFuture[])
      • getLatestMessageIdLong

        long getLatestMessageIdLong()
        The id for the most recent message sent in this current MessageChannel.
        This should only be used if hasLatestMessage() returns true!

        This value is updated on each MessageReceivedEvent and will be reset to null if the message associated with this ID gets deleted

        Returns:
        The most recent message's id
        Throws:
        java.lang.IllegalStateException - If no message id is available
      • hasLatestMessage

        boolean hasLatestMessage()
        Whether this MessageChannel contains a tracked most recent message or not.

        This does not directly mean that getHistory() will be unable to retrieve past messages, it merely means that the latest message is untracked by our internal cache meaning that if this returns false the getLatestMessageId() method will throw an NoSuchElementException

        Returns:
        True, if a latest message id is available for retrieval by getLatestMessageId()
        See Also:
        getLatestMessageId()
      • sendMessageFormat

        @Nonnull
        @CheckReturnValue
        default MessageAction sendMessageFormat​(@Nonnull
                                                java.lang.String format,
                                                @Nonnull
                                                java.lang.Object... args)
        Sends a formatted text message to this channel.
        This will fail if this channel is an instance of TextChannel and the currently logged in account does not have permissions to send a message to this channel.
        To determine if you are able to send a message in a TextChannel use guild.getSelfMember().hasPermission(channel, Permission.MESSAGE_WRITE).

        For ErrorResponse information, refer to sendMessage(Message).

        Parameters:
        format - The string that should be formatted, if this is null or empty the content of the Message would be empty and cause a builder exception.
        args - The arguments for your format
        Returns:
        MessageAction
        The newly created Message after it has been sent to Discord.
        Throws:
        InsufficientPermissionException - If this is a TextChannel and the logged in account does not have
        java.lang.IllegalArgumentException - If the provided format text is null, empty or longer than 2000 characters
        java.lang.UnsupportedOperationException - If this is a PrivateChannel and both the currently logged in account and the target user are bots.
        java.util.IllegalFormatException - If a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the Details section of the formatter class specification.
      • sendFile

        @Nonnull
        @CheckReturnValue
        default MessageAction sendFile​(@Nonnull
                                       java.io.File file,
                                       @Nonnull
                                       java.lang.String fileName,
                                       @Nonnull
                                       AttachmentOption... options)
        Uploads a file to the Discord servers and sends it to this MessageChannel. Sends the provided Message with the uploaded file.
        If you want to send a Message with the uploaded file, you can add the file to the MessageAction returned by sendMessage(Message).

        The fileName parameter is used to inform Discord about what the file should be called. This is 2 fold:

        1. The file name provided is the name that is found in Message.Attachment.getFileName() after upload and it is the name that will show up in the client when the upload is displayed.
          Note: The fileName does not show up on the Desktop client for images. It does on mobile however.
        2. The extension of the provided fileName also determines how Discord will treat the file. Discord currently only has special handling for image file types, but the fileName's extension must indicate that it is an image file. This means it has to end in something like .png, .jpg, .jpeg, .gif, etc. As a note, you can also not provide a full name for the file and instead ONLY provide the extension like "png" or "gif" and Discord will generate a name for the upload and append the fileName as the extension.

        Uploading images with Embeds
        When uploading an image you can reference said image using the specified filename as URI attachment://filename.ext.

        Example

        
         MessageChannel channel; // = reference of a MessageChannel
         EmbedBuilder embed = new EmbedBuilder();
         File file = new File("cat_01.gif");
         embed.setImage("attachment://cat.gif") // we specify this in sendFile as "cat.gif"
              .setDescription("This is a cute cat :3");
         channel.sendFile(file, "cat.gif").setEmbeds(embed.build()).queue();
         

        The following ErrorResponses are possible:

        Parameters:
        file - The file to upload to the MessageChannel.
        fileName - The name that should be sent to discord
        options - Possible options to apply to this attachment, such as marking it as spoiler image
        Returns:
        MessageAction
        Providing the Message created from this upload.
        Throws:
        java.lang.IllegalArgumentException -
        • Provided file is null.
        • Provided file does not exist.
        • Provided file is unreadable.
        • Provided file is greater than 8 MiB on a normal or 50 MiB on a nitro account.
        InsufficientPermissionException - If this is a TextChannel and the logged in account does not have
        java.lang.UnsupportedOperationException - If this is a PrivateChannel and both the currently logged in account and the target user are bots.
      • sendFile

        @Nonnull
        @CheckReturnValue
        default MessageAction sendFile​(@Nonnull
                                       java.io.InputStream data,
                                       @Nonnull
                                       java.lang.String fileName,
                                       @Nonnull
                                       AttachmentOption... options)
        Uploads a file to the Discord servers and sends it to this MessageChannel. Sends the provided Message with the uploaded file.
        If you want to send a Message with the uploaded file, you can add the file to the MessageAction returned by sendMessage(Message).
        This allows you to send an InputStream as substitute to a file.

        For information about the fileName parameter, Refer to the documentation for sendFile(java.io.File, String, AttachmentOption...).
        For ErrorResponse information, refer to the documentation for sendFile(java.io.File, String, AttachmentOption...).

        Uploading images with Embeds
        When uploading an image you can reference said image using the specified filename as URI attachment://filename.ext.

        Example

        
         MessageChannel channel; // = reference of a MessageChannel
         EmbedBuilder embed = new EmbedBuilder();
         InputStream file = new URL("https://http.cat/500").openStream();
         embed.setImage("attachment://cat.png") // we specify this in sendFile as "cat.png"
              .setDescription("This is a cute cat :3");
         channel.sendFile(file, "cat.png").setEmbeds(embed.build()).queue();
         
        Parameters:
        data - The InputStream data to upload to the MessageChannel.
        fileName - The name that should be sent to discord
        Refer to the documentation for sendFile(java.io.File, String, AttachmentOption...) for information about this parameter.
        options - Possible options to apply to this attachment, such as marking it as spoiler image
        Returns:
        MessageAction
        Provides the Message created from this upload.
        Throws:
        java.lang.IllegalArgumentException - If the provided file or filename is null or empty.
        InsufficientPermissionException - If this is a TextChannel and the logged in account does not have
        java.lang.UnsupportedOperationException - If this is a PrivateChannel and both the currently logged in account and the target user are bots.
      • sendFile

        @Nonnull
        @CheckReturnValue
        default MessageAction sendFile​(@Nonnull
                                       byte[] data,
                                       @Nonnull
                                       java.lang.String fileName,
                                       @Nonnull
                                       AttachmentOption... options)
        Uploads a file to the Discord servers and sends it to this MessageChannel. Sends the provided Message with the uploaded file.
        If you want to send a Message with the uploaded file, you can add the file to the MessageAction returned by sendMessage(Message).
        This allows you to send an byte[] as substitute to a file.

        For information about the fileName parameter, Refer to the documentation for sendFile(java.io.File, String, AttachmentOption...).
        For ErrorResponse information, refer to the documentation for sendFile(java.io.File, String, AttachmentOption...).

        Uploading images with Embeds
        When uploading an image you can reference said image using the specified filename as URI attachment://filename.ext.

        Example

        
         MessageChannel channel; // = reference of a MessageChannel
         EmbedBuilder embed = new EmbedBuilder();
         byte[] file = IOUtil.readFully(new URL("https://http.cat/500").openStream());
         embed.setImage("attachment://cat.png") // we specify this in sendFile as "cat.png"
              .setDescription("This is a cute cat :3");
         channel.sendFile(file, "cat.png").setEmbeds(embed.build()).queue();
         
        Parameters:
        data - The byte[] data to upload to the MessageChannel.
        fileName - The name that should be sent to discord.
        Refer to the documentation for sendFile(java.io.File, String, AttachmentOption...) for information about this parameter.
        options - Possible options to apply to this attachment, such as marking it as spoiler image
        Returns:
        MessageAction
        Provides the Message created from this upload.
        Throws:
        java.lang.IllegalArgumentException -
        • If the provided filename is null or empty
        • If the provided data is larger than 8 MiB on a normal or 50 MiB on a nitro account
        InsufficientPermissionException - If this is a TextChannel and the logged in account does not have
        java.lang.UnsupportedOperationException - If this is a PrivateChannel and both the currently logged in account and the target user are bots.
      • getIterableHistory

        @Nonnull
        @CheckReturnValue
        default MessagePaginationAction getIterableHistory()
        A PaginationAction implementation that allows to iterate over recent Messages of this MessageChannel.
        This is not a cache for received messages and it can only view messages that were sent before. This iterates chronologically backwards (from present to past).

        It is recommended not to use this in an enhanced for-loop without end conditions as it might cause memory overflows in channels with a long message history.

        Examples

        
         public CompletableFuture<List<Message>> getMessagesByUser(MessageChannel channel, User user) {
             return channel.getIterableHistory()
                 .takeAsync(1000) // Collect 1000 messages
                 .thenApply(list ->
                     list.stream()
                         .filter(m -> m.getAuthor().equals(user)) // Filter messages by author
                         .collect(Collectors.toList())
                 );
         }
         
        Returns:
        MessagePaginationAction
        Throws:
        InsufficientPermissionException - If this is a TextChannel and the currently logged in account does not have the permission MESSAGE_HISTORY
      • getHistoryAround

        @Nonnull
        @CheckReturnValue
        default MessageHistory.MessageRetrieveAction getHistoryAround​(@Nonnull
                                                                      java.lang.String messageId,
                                                                      int limit)
        Uses the provided id of a message as a marker and retrieves messages sent around the marker. The limit determines the amount of messages retrieved near the marker. Discord will attempt to evenly split the limit between before and after the marker, however in the case that the marker is set near the beginning or near the end of the channel's history the amount of messages on each side of the marker may be different, and their total count may not equal the provided limit.

        Examples:
        Retrieve 100 messages from the middle of history. >100 message exist in history and the marker is >50 messages from the edge of history.
        getHistoryAround(messageId, 100) - This will retrieve 100 messages from history, 50 before the marker and 50 after the marker.

        Retrieve 10 messages near the end of history. Provided id is for a message that is the 3rd most recent message.
        getHistoryAround(messageId, 10) - This will retrieve 10 messages from history, 8 before the marker and 2 after the marker.

        The following ErrorResponses are possible:

        Parameters:
        messageId - The id of the message that will act as a marker.
        limit - The amount of messages to be retrieved around the marker. Minimum: 1, Max: 100.
        Returns:
        MessageHistory.MessageRetrieveAction
        Provides a MessageHistory object with messages around the provided message loaded into it.
        Throws:
        java.lang.IllegalArgumentException -
        • Provided messageId is null or empty.
        • Provided limit is less than 1 or greater than 100.
        InsufficientPermissionException - If this is a TextChannel and the logged in account does not have
        See Also:
        MessageHistory.getHistoryAround(MessageChannel, String)
      • getHistoryAround

        @Nonnull
        @CheckReturnValue
        default MessageHistory.MessageRetrieveAction getHistoryAround​(long messageId,
                                                                      int limit)
        Uses the provided id of a message as a marker and retrieves messages around the marker. The limit determines the amount of messages retrieved near the marker. Discord will attempt to evenly split the limit between before and after the marker, however in the case that the marker is set near the beginning or near the end of the channel's history the amount of messages on each side of the marker may be different, and their total count may not equal the provided limit.

        Examples:
        Retrieve 100 messages from the middle of history. >100 message exist in history and the marker is >50 messages from the edge of history.
        getHistoryAround(messageId, 100) - This will retrieve 100 messages from history, 50 before the marker and 50 after the marker.

        Retrieve 10 messages near the end of history. Provided id is for a message that is the 3rd most recent message.
        getHistoryAround(messageId, 10) - This will retrieve 10 messages from history, 8 before the marker and 2 after the marker.

        The following ErrorResponses are possible:

        Parameters:
        messageId - The id of the message that will act as a marker. The id must refer to a message from this MessageChannel.
        limit - The amount of messages to be retrieved around the marker. Minimum: 1, Max: 100.
        Returns:
        MessageHistory.MessageRetrieveAction
        Provides a MessageHistory object with messages around the provided message loaded into it.
        Throws:
        java.lang.IllegalArgumentException -
        • Provided messageId is not positive.
        • Provided limit is less than 1 or greater than 100.
        InsufficientPermissionException - If this is a TextChannel and the logged in account does not have
        See Also:
        MessageHistory.getHistoryAround(MessageChannel, String)
      • getHistoryAround

        @Nonnull
        @CheckReturnValue
        default MessageHistory.MessageRetrieveAction getHistoryAround​(@Nonnull
                                                                      Message message,
                                                                      int limit)
        Uses the provided Message as a marker and retrieves messages around the marker. The limit determines the amount of messages retrieved near the marker. Discord will attempt to evenly split the limit between before and after the marker, however in the case that the marker is set near the beginning or near the end of the channel's history the amount of messages on each side of the marker may be different, and their total count may not equal the provided limit.

        Examples:
        Retrieve 100 messages from the middle of history. >100 message exist in history and the marker is >50 messages from the edge of history.
        getHistoryAround(message, 100) - This will retrieve 100 messages from history, 50 before the marker and 50 after the marker.

        Retrieve 10 messages near the end of history. Provided message is the 3rd most recent message.
        getHistoryAround(message, 10) - This will retrieve 10 messages from history, 8 before the marker and 2 after the marker.

        The following ErrorResponses are possible:

        Parameters:
        message - The Message that will act as a marker. The provided Message must be from this MessageChannel.
        limit - The amount of messages to be retrieved around the marker. Minimum: 1, Max: 100.
        Returns:
        MessageHistory.MessageRetrieveAction
        Provides a MessageHistory object with messages around the provided message loaded into it.
        Throws:
        java.lang.IllegalArgumentException -
        • Provided message is null.
        • Provided limit is less than 1 or greater than 100.
        InsufficientPermissionException - If this is a TextChannel and the logged in account does not have
        See Also:
        MessageHistory.getHistoryAround(MessageChannel, String)
      • addReactionById

        @Nonnull
        @CheckReturnValue
        default RestAction<java.lang.Void> addReactionById​(@Nonnull
                                                           java.lang.String messageId,
                                                           @Nonnull
                                                           java.lang.String unicode)
        Attempts to react to a message represented by the specified messageId in this MessageChannel.

        The unicode provided has to be a unicode representation of the emoji that is supposed to be used for the Reaction.
        To retrieve the characters needed you can use an api or the official discord client by escaping the emoji (\:emoji-name:) and copying the resulting emoji from the sent message.

        This method encodes the provided unicode for you. Do not encode the emoji before providing the unicode.

        Examples

        // custom
        channel.addReactionById(messageId, "minn:245267426227388416").queue();
        // unicode escape
        channel.addReactionById(messageId, "\uD83D\uDE02").queue();
        // codepoint notation
        channel.addReactionById(messageId, "U+1F602").queue();

        The following ErrorResponses are possible:

        Parameters:
        messageId - The messageId to attach the reaction to
        unicode - The unicode characters to react with
        Returns:
        RestAction
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is null or not a valid snowflake.
        • If provided unicode is null or empty.
        InsufficientPermissionException - If the MessageChannel this message was sent in was a TextChannel and the logged in account does not have:
      • addReactionById

        @Nonnull
        @CheckReturnValue
        default RestAction<java.lang.Void> addReactionById​(long messageId,
                                                           @Nonnull
                                                           java.lang.String unicode)
        Attempts to react to a message represented by the specified messageId in this MessageChannel.

        The unicode provided has to be a unicode representation of the emoji that is supposed to be used for the Reaction.
        To retrieve the characters needed you can use an api or the official discord client by escaping the emoji (\:emoji-name:) and copying the resulting emoji from the sent message.

        This method encodes the provided unicode for you. Do not encode the emoji before providing the unicode.

        Examples

        // custom
        channel.addReactionById(messageId, "minn:245267426227388416").queue();
        // unicode escape
        channel.addReactionById(messageId, "\uD83D\uDE02").queue();
        // codepoint notation
        channel.addReactionById(messageId, "U+1F602").queue();

        The following ErrorResponses are possible:

        Parameters:
        messageId - The messageId to attach the reaction to
        unicode - The unicode characters to react with
        Returns:
        RestAction
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is not a valid snowflake.
        • If provided unicode is null or empty.
        InsufficientPermissionException - If the MessageChannel this message was sent in was a TextChannel and the logged in account does not have:
      • removeReactionById

        @Nonnull
        @CheckReturnValue
        default RestAction<java.lang.Void> removeReactionById​(@Nonnull
                                                              java.lang.String messageId,
                                                              @Nonnull
                                                              java.lang.String unicode)
        Attempts to remove the reaction from a message represented by the specified messageId in this MessageChannel.

        The unicode provided has to be a unicode representation of the emoji that is supposed to be represented by the Reaction.
        To retrieve the characters needed you can use an api or the official discord client by escaping the emoji (\:emoji-name:) and copying the resulting emoji from the sent message.

        This method encodes the provided unicode for you. Do not encode the emoji before providing the unicode.

        The following ErrorResponses are possible:

        Parameters:
        messageId - The messageId to remove the reaction from
        unicode - The unicode characters of the emoji
        Returns:
        RestAction
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is null or not a valid snowflake.
        • If provided unicode is null or empty.
      • removeReactionById

        @Nonnull
        @CheckReturnValue
        default RestAction<java.lang.Void> removeReactionById​(long messageId,
                                                              @Nonnull
                                                              java.lang.String unicode)
        Attempts to remove the reaction from a message represented by the specified messageId in this MessageChannel.

        The unicode provided has to be a unicode representation of the emoji that is supposed to be represented by the Reaction.
        To retrieve the characters needed you can use an api or the official discord client by escaping the emoji (\:emoji-name:) and copying the resulting emoji from the sent message.

        This method encodes the provided unicode for you. Do not encode the emoji before providing the unicode.

        The following ErrorResponses are possible:

        Parameters:
        messageId - The messageId to remove the reaction from
        unicode - The unicode characters of the emoji
        Returns:
        RestAction
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is not a valid snowflake.
        • If provided unicode is null or empty.
      • removeReactionById

        @Nonnull
        @CheckReturnValue
        default RestAction<java.lang.Void> removeReactionById​(@Nonnull
                                                              java.lang.String messageId,
                                                              @Nonnull
                                                              Emote emote)
        Attempts to remove the reaction from a message represented by the specified messageId in this MessageChannel.

        An Emote is not the same as an emoji!
        Emotes are custom guild-specific images unlike global unicode emojis!

        The following ErrorResponses are possible:

        Parameters:
        messageId - The messageId to remove the reaction from
        emote - The emote to remove
        Returns:
        RestAction
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is null or not a valid snowflake.
        • If provided emote is null.
      • removeReactionById

        @Nonnull
        @CheckReturnValue
        default RestAction<java.lang.Void> removeReactionById​(long messageId,
                                                              @Nonnull
                                                              Emote emote)
        Attempts to remove the reaction from a message represented by the specified messageId in this MessageChannel.

        An Emote is not the same as an emoji!
        Emotes are custom guild-specific images unlike global unicode emojis!

        The following ErrorResponses are possible:

        Parameters:
        messageId - The messageId to remove the reaction from
        emote - The emote to remove
        Returns:
        RestAction
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is not a valid snowflake.
        • If provided emote is null.
      • retrieveReactionUsersById

        @Nonnull
        @CheckReturnValue
        default ReactionPaginationAction retrieveReactionUsersById​(@Nonnull
                                                                   java.lang.String messageId,
                                                                   @Nonnull
                                                                   java.lang.String unicode)
        This obtains the users who reacted to a message using the given unicode emoji.

        Messages maintain a list of reactions, alongside a list of users who added them.

        Using this data, we can obtain a ReactionPaginationAction of the users who've reacted to this message.

        The following ErrorResponses are possible:

        Parameters:
        messageId - The messageId to retrieve the users from.
        unicode - The unicode emote to retrieve users for.
        Returns:
        The ReactionPaginationAction of the emoji's users.
        Throws:
        InsufficientPermissionException - If this is a TextChannel and the logged in account does not have Permission.MESSAGE_HISTORY.
        java.lang.IllegalArgumentException -
        • If provided messageId is null or not a valid snowflake.
        • If the provided unicode emoji is null or empty.
        Since:
        4.2.0
      • retrieveReactionUsersById

        @Nonnull
        @CheckReturnValue
        default ReactionPaginationAction retrieveReactionUsersById​(long messageId,
                                                                   @Nonnull
                                                                   java.lang.String unicode)
        This obtains the users who reacted to a message using the given unicode emoji.

        Messages maintain a list of reactions, alongside a list of users who added them.

        Using this data, we can obtain a ReactionPaginationAction of the users who've reacted to this message.

        The following ErrorResponses are possible:

        Parameters:
        messageId - The messageId to retrieve the users from.
        unicode - The unicode emote to retrieve users for.
        Returns:
        The ReactionPaginationAction of the emoji's users.
        Throws:
        InsufficientPermissionException - If this is a TextChannel and the logged in account does not have Permission.MESSAGE_HISTORY.
        java.lang.IllegalArgumentException -
        • If provided messageId is not a valid snowflake.
        • If provided unicode emoji is null or empty.
        Since:
        4.2.0
      • retrieveReactionUsersById

        @Nonnull
        @CheckReturnValue
        default ReactionPaginationAction retrieveReactionUsersById​(@Nonnull
                                                                   java.lang.String messageId,
                                                                   @Nonnull
                                                                   Emote emote)
        This obtains the users who reacted to a message using the given emote.

        Messages maintain a list of reactions, alongside a list of users who added them.

        Using this data, we can obtain a ReactionPaginationAction of the users who've reacted to the given message.

        The following ErrorResponses are possible:

        • MISSING_ACCESS
          The retrieve request was attempted after the account lost access to the TextChannel due to Permission.MESSAGE_READ being revoked
          Also can happen if the account lost the Permission.MESSAGE_HISTORY
        • UNKNOWN_EMOJI
          The provided emote was deleted, doesn't exist, or is not available to the currently logged-in account in this channel.
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        Parameters:
        messageId - The messageId to retrieve the users from.
        emote - The emote to retrieve users for.
        Returns:
        The ReactionPaginationAction of the emote's users.
        Throws:
        InsufficientPermissionException - If this is a TextChannel and the logged in account does not have Permission.MESSAGE_HISTORY.
        java.lang.IllegalArgumentException -
        • If provided messageId is null or not a valid snowflake.
        • If provided Emote is null.
        Since:
        4.2.0
      • editMessageById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageById​(@Nonnull
                                              java.lang.String messageId,
                                              @Nonnull
                                              java.lang.CharSequence newContent)
        Attempts to edit a message by its id in this MessageChannel. The string provided as newContent must have a length that is greater than 0 and less-than or equal to 2000. This is a Discord message length limitation.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.
        Parameters:
        messageId - The id referencing the Message that should be edited
        newContent - The new content for the edited message
        Returns:
        MessageAction
        The modified Message after it has been sent to Discord.
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is null or empty.
        • If provided newContent is null or empty.
        • If provided newContent length is greater than 2000 characters.
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ
      • editMessageById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageById​(long messageId,
                                              @Nonnull
                                              java.lang.CharSequence newContent)
        Attempts to edit a message by its id in this MessageChannel. The string provided as newContent must have a length that is greater than 0 and less-than or equal to 2000. This is a Discord message length limitation.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.
        Parameters:
        messageId - The id referencing the Message that should be edited
        newContent - The new content for the edited message
        Returns:
        MessageAction
        The modified Message after it has been sent to Discord.
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is null or empty.
        • If provided newContent is null or empty.
        • If provided newContent length is greater than 2000 characters.
        PermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ
      • editMessageById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageById​(@Nonnull
                                              java.lang.String messageId,
                                              @Nonnull
                                              Message newContent)
        Attempts to edit a message by its id in this MessageChannel.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.
        Parameters:
        messageId - The id referencing the Message that should be edited
        newContent - The new content for the edited message
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is null or empty.
        • If provided newContent is null.
        • If provided Message contains a MessageEmbed which is not sendable
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ
      • editMessageById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageById​(long messageId,
                                              @Nonnull
                                              Message newContent)
        Attempts to edit a message by its id in this MessageChannel.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.
        Parameters:
        messageId - The id referencing the Message that should be edited
        newContent - The new content for the edited message
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is not positive.
        • If provided newContent is null.
        • If provided Message contains a MessageEmbed which is not sendable
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ
      • editMessageFormatById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageFormatById​(@Nonnull
                                                    java.lang.String messageId,
                                                    @Nonnull
                                                    java.lang.String format,
                                                    @Nonnull
                                                    java.lang.Object... args)
        Attempts to edit a message by its id in this MessageChannel.
        Shortcut for MessageBuilder.appendFormat(String, Object...).

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.
        Parameters:
        messageId - The id referencing the Message that should be edited
        format - Format String used to generate new Content
        args - The arguments which should be used to format the given format String
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is null or empty.
        • If provided format is null or blank.
        java.lang.IllegalStateException - If the resulting message is either empty or too long to be sent
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ
        java.util.IllegalFormatException - If a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the Details section of the formatter class specification.
      • editMessageFormatById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageFormatById​(long messageId,
                                                    @Nonnull
                                                    java.lang.String format,
                                                    @Nonnull
                                                    java.lang.Object... args)
        Attempts to edit a message by its id in this MessageChannel.
        Shortcut for MessageBuilder.appendFormat(String, Object...).

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.
        Parameters:
        messageId - The id referencing the Message that should be edited
        format - Format String used to generate new Content
        args - The arguments which should be used to format the given format String
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is not positive.
        • If provided format is null or blank.
        java.lang.IllegalStateException - If the resulting message is either empty or too long to be sent
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ
        java.util.IllegalFormatException - If a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the Details section of the formatter class specification.
      • editMessageEmbedsById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageEmbedsById​(@Nonnull
                                                    java.lang.String messageId,
                                                    @Nonnull
                                                    MessageEmbed... newEmbeds)
        Attempts to edit a message by its id in this MessageChannel.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.
        Parameters:
        messageId - The id referencing the Message that should be edited
        newEmbeds - Up to 10 new MessageEmbeds for the edited message
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.IllegalArgumentException -
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ or Permission.MESSAGE_WRITE
      • editMessageEmbedsById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageEmbedsById​(long messageId,
                                                    @Nonnull
                                                    MessageEmbed... newEmbeds)
        Attempts to edit a message by its id in this MessageChannel.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.
        Parameters:
        messageId - The id referencing the Message that should be edited
        newEmbeds - Up to 10 new MessageEmbeds for the edited message
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.IllegalArgumentException -
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ or Permission.MESSAGE_WRITE
      • editMessageEmbedsById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageEmbedsById​(@Nonnull
                                                    java.lang.String messageId,
                                                    @Nonnull
                                                    java.util.Collection<? extends MessageEmbed> newEmbeds)
        Attempts to edit a message by its id in this MessageChannel.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.
        Parameters:
        messageId - The id referencing the Message that should be edited
        newEmbeds - Up to 10 new MessageEmbeds for the edited message
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.IllegalArgumentException -
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ or Permission.MESSAGE_WRITE
      • editMessageEmbedsById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageEmbedsById​(long messageId,
                                                    @Nonnull
                                                    java.util.Collection<? extends MessageEmbed> newEmbeds)
        Attempts to edit a message by its id in this MessageChannel.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.
        Parameters:
        messageId - The id referencing the Message that should be edited
        newEmbeds - Up to 10 new MessageEmbeds for the edited message
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.IllegalArgumentException -
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ or Permission.MESSAGE_WRITE
      • editMessageComponentsById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageComponentsById​(@Nonnull
                                                        java.lang.String messageId,
                                                        @Nonnull
                                                        java.util.Collection<? extends ComponentLayout> components)
        Attempts to edit a message by its id in this MessageChannel.
        This will replace all the current Components, such as Buttons or SelectionMenus on this message. The provided parameters are ComponentLayout such as ActionRow which contain a list of components to arrange in the respective layout.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted. This might also be triggered for ephemeral messages.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.

        Example

        
         List<ActionRow> rows = Arrays.asList(
           ActionRow.of(Button.success("prompt:accept", "Accept"), Button.danger("prompt:reject", "Reject")), // 1st row below message
           ActionRow.of(Button.link(url, "Help")) // 2nd row below message
         );
         channel.editMessageComponentsById(messageId, rows).queue();
         
        Parameters:
        messageId - The id referencing the Message that should be edited
        components - Up to 5 new ComponentLayouts for the edited message, such as ActionRow
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.UnsupportedOperationException - If the component layout is a custom implementation that is not supported by this interface
        java.lang.IllegalArgumentException -
        • If provided messageId is null or empty.
        • If any of the provided ComponentLayouts is null
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ or Permission.MESSAGE_WRITE
      • editMessageComponentsById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageComponentsById​(long messageId,
                                                        @Nonnull
                                                        java.util.Collection<? extends ComponentLayout> components)
        Attempts to edit a message by its id in this MessageChannel.
        This will replace all the current Components, such as Buttons or SelectionMenus on this message. The provided parameters are ComponentLayout such as ActionRow which contain a list of components to arrange in the respective layout.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted. This might also be triggered for ephemeral messages.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.

        Example

        
         List<ActionRow> rows = Arrays.asList(
           ActionRow.of(Button.success("prompt:accept", "Accept"), Button.danger("prompt:reject", "Reject")), // 1st row below message
           ActionRow.of(Button.link(url, "Help")) // 2nd row below message
         );
         channel.editMessageComponentsById(messageId, rows).queue();
         
        Parameters:
        messageId - The id referencing the Message that should be edited
        components - Up to 5 new ComponentLayouts for the edited message, such as ActionRow
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.UnsupportedOperationException - If the component layout is a custom implementation that is not supported by this interface
        java.lang.IllegalArgumentException - If any of the provided ComponentLayouts is null
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ or Permission.MESSAGE_WRITE
      • editMessageComponentsById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageComponentsById​(@Nonnull
                                                        java.lang.String messageId,
                                                        @Nonnull
                                                        ComponentLayout... components)
        Attempts to edit a message by its id in this MessageChannel.
        This will replace all the current Components, such as Buttons or SelectionMenus on this message. The provided parameters are ComponentLayout such as ActionRow which contain a list of components to arrange in the respective layout.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted. This might also be triggered for ephemeral messages.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.

        Example

        
         channel.editMessageComponentsById(messageId,
           ActionRow.of(Button.success("prompt:accept", "Accept"), Button.danger("prompt:reject", "Reject")), // 1st row below message
           ActionRow.of(Button.link(url, "Help")) // 2nd row below message
         ).queue();
         
        Parameters:
        messageId - The id referencing the Message that should be edited
        components - Up to 5 new ComponentLayouts for the edited message, such as ActionRow
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.UnsupportedOperationException - If the component layout is a custom implementation that is not supported by this interface
        java.lang.IllegalArgumentException -
        • If provided messageId is null or empty.
        • If any of the provided ComponentLayouts is null
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ or Permission.MESSAGE_WRITE
      • editMessageComponentsById

        @Nonnull
        @CheckReturnValue
        default MessageAction editMessageComponentsById​(long messageId,
                                                        @Nonnull
                                                        ComponentLayout... components)
        Attempts to edit a message by its id in this MessageChannel.
        This will replace all the current Components, such as Buttons or SelectionMenus on this message. The provided parameters are ComponentLayout such as ActionRow which contain a list of components to arrange in the respective layout.

        The following ErrorResponses are possible:

        • INVALID_AUTHOR_EDIT
          Attempted to edit a message that was not sent by the currently logged in account. Discord does not allow editing of other users' Messages!
        • MISSING_ACCESS
          The request was attempted after the account lost access to the Guild typically due to being kicked or removed, or after Permission.MESSAGE_READ was revoked in the TextChannel
        • UNKNOWN_MESSAGE
          The provided messageId is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted. This might also be triggered for ephemeral messages.
        • UNKNOWN_CHANNEL
          The request was attempted after the channel was deleted.

        Example

        
         channel.editMessageComponentsById(messageId,
           ActionRow.of(Button.success("prompt:accept", "Accept"), Button.danger("prompt:reject", "Reject")), // 1st row below message
           ActionRow.of(Button.link(url, "Help")) // 2nd row below message
         ).queue();
         
        Parameters:
        messageId - The id referencing the Message that should be edited
        components - Up to 5 new ComponentLayouts for the edited message, such as ActionRow
        Returns:
        MessageAction
        The modified Message after it has been sent to discord
        Throws:
        java.lang.UnsupportedOperationException - If the component layout is a custom implementation that is not supported by this interface
        java.lang.IllegalArgumentException - If any of the provided ComponentLayouts is null
        InsufficientPermissionException - If this is a TextChannel and this account does not have Permission.MESSAGE_READ or Permission.MESSAGE_WRITE
      • formatTo

        default void formatTo​(java.util.Formatter formatter,
                              int flags,
                              int width,
                              int precision)
        Specified by:
        formatTo in interface java.util.Formattable