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 voiddelete()Deletes the message.booleandoesMentionSelf()Finds if the chat message mentions the bot user.ChatMessageedit(java.lang.String message)Edits the message to match the provided message.ChatMessageedit(java.util.function.Consumer<ChatMessage.Builder> function)Edits the message to match the provided message.java.util.DategetDate()Gets the date this message was received, or sent by the sender.java.util.DategetEditedDate()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.StringgetMessage()Gets the raw chat message string for this message.CommandSendergetSender()Gets the sender for this chat message.booleanwasEdited()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:ChatMessageGets the sender for this chat message.- Specified by:
getSenderin interfaceChatMessage- Returns:
- sender.
-
delete
public void delete() throws java.lang.UnsupportedOperationExceptionDescription copied from interface:ChatMessageDeletes the message.- Specified by:
deletein interfaceChatMessage- Throws:
java.lang.UnsupportedOperationException
-
edit
public ChatMessage edit(java.lang.String message)
Description copied from interface:ChatMessageEdits the message to match the provided message.- Specified by:
editin 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:ChatMessageEdits the message to match the provided message.- Specified by:
editin interfaceChatMessage- Parameters:
function- function to express a new message.- Returns:
- edited message.
-
wasEdited
public boolean wasEdited()
Description copied from interface:ChatMessageFinds if the message was edited.- Specified by:
wasEditedin interfaceChatMessage- Returns:
- true if the message was edited, false otherwise.
-
getEditedDate
public java.util.Date getEditedDate()
Description copied from interface:ChatMessageGets the time at which the message was edited.- Specified by:
getEditedDatein interfaceChatMessage- Returns:
- edited date.
-
getMessage
public java.lang.String getMessage()
Description copied from interface:ChatMessageGets the raw chat message string for this message.- Specified by:
getMessagein interfaceChatMessage- Returns:
- message string.
-
getEmbeds
public java.util.Collection<ChatEmbed> getEmbeds()
Description copied from interface:ChatMessageGets a collection of embeds associated with this chat message.- Specified by:
getEmbedsin interfaceChatMessage- Returns:
- embeds.
-
getDate
public java.util.Date getDate()
Description copied from interface:ChatMessageGets the date this message was received, or sent by the sender.- Specified by:
getDatein interfaceChatMessage- Returns:
- message date.
-
getMentions
public java.util.Collection<PlatformUser> getMentions()
Description copied from interface:ChatMessageGets an immutable collections of mentions in this chat message.- Specified by:
getMentionsin interfaceChatMessage- Returns:
- collection of mentions in this message.
-
doesMentionSelf
public boolean doesMentionSelf()
Description copied from interface:ChatMessageFinds if the chat message mentions the bot user.- Specified by:
doesMentionSelfin interfaceChatMessage- Returns:
- true if the chat message mentions the bot user.
-
-