Package io.manebot.chat
Interface ChatMessage
-
- All Known Implementing Classes:
AbstractChatMessage
,AbstractTextChatMessage
,BasicTextChatMessage
,CommandMessage
public interface ChatMessage
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ChatMessage.Builder
-
Method Summary
Modifier and Type Method Description void
delete()
Deletes the message.default boolean
doesMentionSelf()
Finds if the chat message mentions the bot user.default 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.default 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.default java.lang.String
getRawMessage()
Gets the user-friendly chat message string for this message.ChatSender
getSender()
Gets the sender for this chat message.boolean
wasEdited()
Finds if the message was edited.
-
-
-
Method Detail
-
getMessage
java.lang.String getMessage()
Gets the raw chat message string for this message.- Returns:
- message string.
-
getRawMessage
default java.lang.String getRawMessage()
Gets the user-friendly chat message string for this message.- Returns:
- message string.
-
getEmbeds
java.util.Collection<ChatEmbed> getEmbeds()
Gets a collection of embeds associated with this chat message.- Returns:
- embeds.
-
getSender
ChatSender getSender()
Gets the sender for this chat message.- Returns:
- sender.
-
delete
void delete() throws java.lang.UnsupportedOperationException
Deletes the message.- Throws:
java.lang.UnsupportedOperationException
-
edit
default ChatMessage edit(java.lang.String message)
Edits the message to match the provided message.- Parameters:
message
- message to edit to.- Returns:
- edited message.
-
edit
ChatMessage edit(java.util.function.Consumer<ChatMessage.Builder> function)
Edits the message to match the provided message.- Parameters:
function
- function to express a new message.- Returns:
- edited message.
-
wasEdited
boolean wasEdited()
Finds if the message was edited.- Returns:
- true if the message was edited, false otherwise.
-
getEditedDate
java.util.Date getEditedDate()
Gets the time at which the message was edited.- Returns:
- edited date.
-
getDate
java.util.Date getDate()
Gets the date this message was received, or sent by the sender.- Returns:
- message date.
-
getMentions
default java.util.Collection<PlatformUser> getMentions()
Gets an immutable collections of mentions in this chat message.- Returns:
- collection of mentions in this message.
-
doesMentionSelf
default boolean doesMentionSelf()
Finds if the chat message mentions the bot user.- Returns:
- true if the chat message mentions the bot user.
-
-