Class CommandMessage

  • All Implemented Interfaces:
    ChatMessage

    public class CommandMessage
    extends java.lang.Object
    implements ChatMessage
    • Method Summary

      Modifier and Type Method Description
      void delete()
      Deletes the message.
      boolean doesMentionSelf()
      Finds if the chat message mentions the bot user.
      ChatMessage edit​(java.lang.String message)
      Edits the message to match the provided message.
      ChatMessage edit​(java.util.function.Consumer<ChatMessage.Builder> function)
      Edits the message to match the provided message.
      java.util.Date getDate()
      Gets the date this message was received, or sent by the sender.
      java.util.Date getEditedDate()
      Gets the time at which the message was edited.
      java.util.Collection<ChatEmbed> getEmbeds()
      Gets a collection of embeds associated with this chat message.
      java.util.Collection<PlatformUser> getMentions()
      Gets an immutable collections of mentions in this chat message.
      java.lang.String getMessage()
      Gets the raw chat message string for this message.
      CommandSender getSender()
      Gets the sender for this chat message.
      boolean wasEdited()
      Finds if the message was edited.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • delete

        public void delete()
                    throws java.lang.UnsupportedOperationException
        Description copied from interface: ChatMessage
        Deletes the message.
        Specified by:
        delete in interface ChatMessage
        Throws:
        java.lang.UnsupportedOperationException
      • edit

        public ChatMessage edit​(java.lang.String message)
        Description copied from interface: ChatMessage
        Edits the message to match the provided message.
        Specified by:
        edit in interface ChatMessage
        Parameters:
        message - message to edit to.
        Returns:
        edited message.
      • edit

        public ChatMessage edit​(java.util.function.Consumer<ChatMessage.Builder> function)
        Description copied from interface: ChatMessage
        Edits the message to match the provided message.
        Specified by:
        edit in interface ChatMessage
        Parameters:
        function - function to express a new message.
        Returns:
        edited message.
      • wasEdited

        public boolean wasEdited()
        Description copied from interface: ChatMessage
        Finds if the message was edited.
        Specified by:
        wasEdited in interface ChatMessage
        Returns:
        true if the message was edited, false otherwise.
      • getEditedDate

        public java.util.Date getEditedDate()
        Description copied from interface: ChatMessage
        Gets the time at which the message was edited.
        Specified by:
        getEditedDate in interface ChatMessage
        Returns:
        edited date.
      • getMessage

        public java.lang.String getMessage()
        Description copied from interface: ChatMessage
        Gets the raw chat message string for this message.
        Specified by:
        getMessage in interface ChatMessage
        Returns:
        message string.
      • getEmbeds

        public java.util.Collection<ChatEmbed> getEmbeds()
        Description copied from interface: ChatMessage
        Gets a collection of embeds associated with this chat message.
        Specified by:
        getEmbeds in interface ChatMessage
        Returns:
        embeds.
      • getDate

        public java.util.Date getDate()
        Description copied from interface: ChatMessage
        Gets the date this message was received, or sent by the sender.
        Specified by:
        getDate in interface ChatMessage
        Returns:
        message date.
      • getMentions

        public java.util.Collection<PlatformUser> getMentions()
        Description copied from interface: ChatMessage
        Gets an immutable collections of mentions in this chat message.
        Specified by:
        getMentions in interface ChatMessage
        Returns:
        collection of mentions in this message.
      • doesMentionSelf

        public boolean doesMentionSelf()
        Description copied from interface: ChatMessage
        Finds if the chat message mentions the bot user.
        Specified by:
        doesMentionSelf in interface ChatMessage
        Returns:
        true if the chat message mentions the bot user.