Package io.manebot.command
Class CommandMessage
- java.lang.Object
-
- io.manebot.command.CommandMessage
-
- All Implemented Interfaces:
ChatMessage
public class CommandMessage extends java.lang.Object implements ChatMessage
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.manebot.chat.ChatMessage
ChatMessage.Builder
-
-
Constructor Summary
Constructors Constructor Description CommandMessage(ChatMessage chatMessage, CommandSender sender)
-
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
-
Methods inherited from interface io.manebot.chat.ChatMessage
getRawMessage
-
-
-
-
Constructor Detail
-
CommandMessage
public CommandMessage(ChatMessage chatMessage, CommandSender sender)
-
-
Method Detail
-
getSender
public CommandSender getSender()
Description copied from interface:ChatMessage
Gets the sender for this chat message.- Specified by:
getSender
in interfaceChatMessage
- Returns:
- sender.
-
delete
public void delete() throws java.lang.UnsupportedOperationException
Description copied from interface:ChatMessage
Deletes the message.- Specified by:
delete
in interfaceChatMessage
- 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 interfaceChatMessage
- 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 interfaceChatMessage
- 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 interfaceChatMessage
- 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 interfaceChatMessage
- 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 interfaceChatMessage
- 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 interfaceChatMessage
- 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 interfaceChatMessage
- 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 interfaceChatMessage
- 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 interfaceChatMessage
- Returns:
- true if the chat message mentions the bot user.
-
-