Interface Message
-
- All Superinterfaces:
Comparable<Message>,DiscordEntity,MessageAttachableListenerManager,Updatable<Message>,UpdatableFromCache<Message>
public interface Message extends DiscordEntity, Comparable<Message>, UpdatableFromCache<Message>, MessageAttachableListenerManager
This class represents a Discord message.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default CompletableFuture<Void>addReaction(String unicodeEmoji)Adds a unicode reaction to the message.static CompletableFuture<Void>addReaction(DiscordApi api, long channelId, long messageId, String unicodeEmoji)Adds a unicode reaction to the message.static CompletableFuture<Void>addReaction(DiscordApi api, long channelId, long messageId, Emoji emoji)Adds a reaction to the message.static CompletableFuture<Void>addReaction(DiscordApi api, String channelId, String messageId, String unicodeEmoji)Adds a unicode reaction to the message.static CompletableFuture<Void>addReaction(DiscordApi api, String channelId, String messageId, Emoji emoji)Adds a reaction to the message.default CompletableFuture<Void>addReaction(Emoji emoji)Adds a reaction to the message.CompletableFuture<Void>addReactions(String... unicodeEmojis)Adds unicode reactions to the message.default CompletableFuture<Void>addReactions(Emoji... emojis)Adds reactions to the message.default booleancanAddNewReactions(User user)Checks if the given user is allowed to add new reactions to the message.default booleancanDelete(User user)Checks if the given user can delete this message.default booleancanYouAddNewReactions()Checks if the user of the connected account is allowed to add new reactions to the message.default booleancanYouDelete()Checks if the user of the connected account can delete this message.default CompletableFuture<Message>crossPost()Cross posts the message if it is in a announcement channel.static CompletableFuture<Message>crossPost(DiscordApi api, long channelId, long messageId)Cross posts the message if it is in a announcement channel.default CompletableFuture<Void>delete()Deletes the message.default CompletableFuture<Void>delete(String reason)Deletes the message.static CompletableFuture<Void>delete(DiscordApi api, long channelId, long messageId)Deletes the message.static CompletableFuture<Void>delete(DiscordApi api, long channelId, long... messageIds)Deletes multiple messages at once.static CompletableFuture<Void>delete(DiscordApi api, long channelId, long messageId, String reason)Deletes the message.static CompletableFuture<Void>delete(DiscordApi api, Iterable<Message> messages)Deletes multiple messages at once.static CompletableFuture<Void>delete(DiscordApi api, String channelId, String messageId)Deletes the message.static CompletableFuture<Void>delete(DiscordApi api, String channelId, String... messageIds)Deletes multiple messages at once.static CompletableFuture<Void>delete(DiscordApi api, String channelId, String messageId, String reason)Deletes the message.static CompletableFuture<Void>delete(DiscordApi api, Message... messages)Deletes multiple messages at once.default CompletableFuture<Message>edit(String content)Updates the content of the message.default CompletableFuture<Message>edit(String content, EmbedBuilder embed)Updates the content and the embed of the message.static CompletableFuture<Message>edit(DiscordApi api, long channelId, long messageId, String content)Updates the content of the message.static CompletableFuture<Message>edit(DiscordApi api, long channelId, long messageId, String content, boolean updateContent, EmbedBuilder embed, boolean updateEmbed)Updates the content and the embed of the message.static CompletableFuture<Message>edit(DiscordApi api, long channelId, long messageId, String content, EmbedBuilder embed)Updates the content and the embed of the message.static CompletableFuture<Message>edit(DiscordApi api, long channelId, long messageId, EmbedBuilder embed)Updates the embed of the message.static CompletableFuture<Message>edit(DiscordApi api, String channelId, String messageId, String content)Updates the content of the message.static CompletableFuture<Message>edit(DiscordApi api, String channelId, String messageId, String content, boolean updateContent, EmbedBuilder embed, boolean updateEmbed)Updates the content and the embed of the message.static CompletableFuture<Message>edit(DiscordApi api, String channelId, String messageId, String content, EmbedBuilder embed)Updates the content and the embed of the message.static CompletableFuture<Message>edit(DiscordApi api, String channelId, String messageId, EmbedBuilder embed)Updates the embed of the message.default CompletableFuture<Message>edit(EmbedBuilder embed)Updates the embed of the message.Optional<MessageActivity>getActivity()Gets the activity of the message.List<MessageAttachment>getAttachments()Gets the attachments of the message.MessageAuthorgetAuthor()Gets the author of the message.TextChannelgetChannel()Gets the text channel of the message.StringgetContent()Gets the content of the message.default Optional<Message>getCurrentCachedInstance()Gets an updated instance of this entity from the cache.List<CustomEmoji>getCustomEmojis()Gets a list of all custom emojis in the message.List<Embed>getEmbeds()Gets a list with all embeds of the message.default Optional<GroupChannel>getGroupChannel()Gets the group channel of the message.Optional<Instant>getLastEditTimestamp()Gets the last time the message was edited.default CompletableFuture<Message>getLatestInstance()Gets an updated instance of this entity from the cache or from Discord directly.default URLgetLink()Gets the link leading to this message.default List<ServerTextChannel>getMentionedChannels()Gets a list with all channels mentioned in this message.List<Role>getMentionedRoles()Gets a list with all roles mentioned in this message.List<User>getMentionedUsers()Gets a list with all users mentioned in this message.default CompletableFuture<MessageSet>getMessagesAfter(int limit)Gets up to a given amount of messages after this message.default Stream<Message>getMessagesAfterAsStream()Gets a stream of messages after this message sorted from oldest to newest.default CompletableFuture<MessageSet>getMessagesAfterUntil(Predicate<Message> condition)Gets messages after this message until one that meets the given condition is found.default CompletableFuture<MessageSet>getMessagesAfterWhile(Predicate<Message> condition)Gets messages after this message while they meet the given condition.default CompletableFuture<MessageSet>getMessagesAround(int limit)Gets up to a given amount of messages around this message.default Stream<Message>getMessagesAroundAsStream()Gets a stream of messages around this message.default CompletableFuture<MessageSet>getMessagesAroundUntil(Predicate<Message> condition)Gets messages around this message until one that meets the given condition is found.default CompletableFuture<MessageSet>getMessagesAroundWhile(Predicate<Message> condition)Gets messages around this message while they meet the given condition.default CompletableFuture<MessageSet>getMessagesBefore(int limit)Gets up to a given amount of messages before this message.default Stream<Message>getMessagesBeforeAsStream()Gets a stream of messages before this message sorted from newest to oldest.default CompletableFuture<MessageSet>getMessagesBeforeUntil(Predicate<Message> condition)Gets messages before this message until one that meets the given condition is found.default CompletableFuture<MessageSet>getMessagesBeforeWhile(Predicate<Message> condition)Gets messages before this message while they meet the given condition.default CompletableFuture<MessageSet>getMessagesBetween(long other)Gets all messages between this messages and the given message, excluding the boundaries.default CompletableFuture<MessageSet>getMessagesBetween(Message other)Gets all messages between this messages and the given message, excluding the boundaries.default Stream<Message>getMessagesBetweenAsStream(long other)Gets a stream of all messages between this message and the given message, excluding the boundaries, sorted from this message to the given message.default Stream<Message>getMessagesBetweenAsStream(Message other)Gets a stream of all messages between this message and the given message, excluding the boundaries, sorted from this message to the given message.default CompletableFuture<MessageSet>getMessagesBetweenUntil(long other, Predicate<Message> condition)Gets all messages between this message and the given message, excluding the boundaries, until one that meets the given condition is found.default CompletableFuture<MessageSet>getMessagesBetweenUntil(Message other, Predicate<Message> condition)Gets all messages between this message and the given message, excluding the boundaries, until one that meets the given condition is found.default CompletableFuture<MessageSet>getMessagesBetweenWhile(long other, Predicate<Message> condition)Gets all messages between this message and the given message, excluding the boundaries, while they meet the given condition.default CompletableFuture<MessageSet>getMessagesBetweenWhile(Message other, Predicate<Message> condition)Gets all messages between this message and the given message, excluding the boundaries, while they meet the given condition.Optional<String>getNonce()Gets the nonce of the message.default Optional<PrivateChannel>getPrivateChannel()Gets the private channel of the message.default Optional<Reaction>getReactionByEmoji(String unicodeEmoji)Gets a reaction by its unicode emoji.default Optional<Reaction>getReactionByEmoji(Emoji emoji)Gets a reaction by its emoji.List<Reaction>getReactions()Gets a list with all reactions of the message.default StringgetReadableContent()Gets the readable content of the message, which replaces all mentions etc.Optional<Message>getReferencedMessage()Gets the message referenced with a reply.Optional<Long>getReferencedMessageId()Gets the id of the message referenced with a reply.default Optional<Server>getServer()Gets the server of the message.default Optional<ServerTextChannel>getServerTextChannel()Gets the server text channel of the message.MessageTypegetType()Gets the type of the message.Optional<User>getUserAuthor()Gets the user author of the message.booleanisCachedForever()Checks if the message is kept in cache forever.default booleanisGroupMessage()Checks if the message was sent in agroup channel.booleanisPinned()Checks if the message is pinned.default booleanisPrivate()Deprecated.UseisPrivateMessage()instead.default booleanisPrivateMessage()Checks if the message was sent in aprivate channel.default booleanisServerMessage()Checks if the message was sent in aserver channel.booleanisTts()Checks if this message is text-to-speech.booleanmentionsEveryone()Checks if the message mentions everyone.default CompletableFuture<Void>pin()Pins this message.static CompletableFuture<Void>pin(DiscordApi api, long channelId, long messageId)Pins this message.static CompletableFuture<Void>pin(DiscordApi api, String channelId, String messageId)Pins this message.default CompletableFuture<Void>removeAllReactions()Deletes all reactions on this message.static CompletableFuture<Void>removeAllReactions(DiscordApi api, long channelId, long messageId)Deletes all reactions on this message.static CompletableFuture<Void>removeAllReactions(DiscordApi api, String channelId, String messageId)Deletes all reactions on this message.default CompletableFuture<Message>removeContent()Removes the content of the message.static CompletableFuture<Message>removeContent(DiscordApi api, long channelId, long messageId)Removes the content of the message.static CompletableFuture<Message>removeContent(DiscordApi api, String channelId, String messageId)Removes the content of the message.default CompletableFuture<Message>removeContentAndEmbed()Removes the content and embed of the message.static CompletableFuture<Message>removeContentAndEmbed(DiscordApi api, long channelId, long messageId)Removes the content and embed of the message.static CompletableFuture<Message>removeContentAndEmbed(DiscordApi api, String channelId, String messageId)Removes the content and embed of the message.default CompletableFuture<Message>removeEmbed()Removes the embed of the message.static CompletableFuture<Message>removeEmbed(DiscordApi api, long channelId, long messageId)Removes the embed of the message.static CompletableFuture<Message>removeEmbed(DiscordApi api, String channelId, String messageId)Removes the embed of the message.CompletableFuture<Void>removeOwnReactionByEmoji(String unicodeEmoji)Removes you from the list of reactors of a given unicode emoji reaction.default CompletableFuture<Void>removeOwnReactionByEmoji(Emoji emoji)Removes you from the list of reactors of a given emoji reaction.CompletableFuture<Void>removeOwnReactionsByEmoji(String... unicodeEmojis)Removes you from the list of reactors of the given unicode emoji reactions.default CompletableFuture<Void>removeOwnReactionsByEmoji(Emoji... emojis)Removes you from the list of reactors of the given emoji reactions.CompletableFuture<Void>removeReactionByEmoji(String unicodeEmoji)Removes all reactors of a given unicode emoji reaction.default CompletableFuture<Void>removeReactionByEmoji(Emoji emoji)Removes all reactors of a given emoji reaction.CompletableFuture<Void>removeReactionByEmoji(User user, String unicodeEmoji)Removes a user from the list of reactors of a given unicode emoji reaction.default CompletableFuture<Void>removeReactionByEmoji(User user, Emoji emoji)Removes a user from the list of reactors of a given emoji reaction.CompletableFuture<Void>removeReactionsByEmoji(String... unicodeEmojis)Removes all reactors of the given unicode emoji reactions.default CompletableFuture<Void>removeReactionsByEmoji(Emoji... emojis)Removes all reactors of the given emoji reactions.CompletableFuture<Void>removeReactionsByEmoji(User user, String... unicodeEmojis)Removes a user from the list of reactors of the given unicode emoji reactions.default CompletableFuture<Void>removeReactionsByEmoji(User user, Emoji... emojis)Removes a user from the list of reactors of the given emoji reactions.default CompletableFuture<Message>reply(String messageContent)Replies to this message with the given text.default CompletableFuture<Message>reply(EmbedBuilder embed)Replies to this message with the given embed.default Optional<CompletableFuture<Message>>requestReferencedMessage()Requests the message referenced with a reply.voidsetCachedForever(boolean cachedForever)Sets if the the message is kept in cache forever.default MessageBuildertoMessageBuilder()Returns aMessageBuilderaccording to thisMessage.default WebhookMessageBuildertoWebhookMessageBuilder()Returns aWebhookMessageBuilderaccording to thisMessage.default CompletableFuture<Void>unpin()Unpins this message.static CompletableFuture<Void>unpin(DiscordApi api, long channelId, long messageId)Unpins this message.static CompletableFuture<Void>unpin(DiscordApi api, String channelId, String messageId)Unpins this message.-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getApi, getCreationTimestamp, getCreationTimestamp, getId, getIdAsString
-
Methods inherited from interface org.javacord.api.listener.message.MessageAttachableListenerManager
addCachedMessagePinListener, addCachedMessageUnpinListener, addMessageAttachableListener, addMessageAttachableListener, addMessageAttachableListener, addMessageDeleteListener, addMessageDeleteListener, addMessageEditListener, addMessageEditListener, addReactionAddListener, addReactionAddListener, addReactionRemoveAllListener, addReactionRemoveAllListener, addReactionRemoveListener, addReactionRemoveListener, getCachedMessagePinListeners, getCachedMessageUnpinListeners, getMessageAttachableListeners, getMessageAttachableListeners, getMessageAttachableListeners, getMessageDeleteListeners, getMessageDeleteListeners, getMessageDeleteListeners, getMessageEditListeners, getMessageEditListeners, getMessageEditListeners, getReactionAddListeners, getReactionAddListeners, getReactionAddListeners, getReactionRemoveAllListeners, getReactionRemoveAllListeners, getReactionRemoveAllListeners, getReactionRemoveListeners, getReactionRemoveListeners, getReactionRemoveListeners, removeListener, removeListener, removeListener, removeMessageAttachableListener, removeMessageAttachableListener, removeMessageAttachableListener
-
-
-
-
Method Detail
-
toMessageBuilder
default MessageBuilder toMessageBuilder()
Returns aMessageBuilderaccording to thisMessage.- Returns:
- The
MessageBuilder. - See Also:
MessageBuilder.fromMessage(Message)
-
toWebhookMessageBuilder
default WebhookMessageBuilder toWebhookMessageBuilder()
Returns aWebhookMessageBuilderaccording to thisMessage.- Returns:
- The
WebhookMessageBuilder. - See Also:
WebhookMessageBuilder.fromMessage(Message)
-
crossPost
static CompletableFuture<Message> crossPost(DiscordApi api, long channelId, long messageId)
Cross posts the message if it is in a announcement channel.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- The new message object.
-
crossPost
default CompletableFuture<Message> crossPost()
Cross posts the message if it is in a announcement channel.- Returns:
- The new message object.
-
delete
static CompletableFuture<Void> delete(DiscordApi api, long channelId, long messageId)
Deletes the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the deletion was successful.
-
delete
static CompletableFuture<Void> delete(DiscordApi api, String channelId, String messageId)
Deletes the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the deletion was successful.
-
delete
static CompletableFuture<Void> delete(DiscordApi api, long channelId, long messageId, String reason)
Deletes the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.reason- The audit log reason for the deletion.- Returns:
- A future to tell us if the deletion was successful.
-
delete
static CompletableFuture<Void> delete(DiscordApi api, String channelId, String messageId, String reason)
Deletes the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.reason- The audit log reason for the deletion.- Returns:
- A future to tell us if the deletion was successful.
-
delete
default CompletableFuture<Void> delete()
Deletes the message.- Returns:
- A future to tell us if the deletion was successful.
-
delete
default CompletableFuture<Void> delete(String reason)
Deletes the message.- Parameters:
reason- The audit log reason for the deletion.- Returns:
- A future to tell us if the deletion was successful.
-
delete
static CompletableFuture<Void> delete(DiscordApi api, long channelId, long... messageIds)
Deletes multiple messages at once. This method does not have a size or age restriction. Messages younger than two weeks are sent in batches of 100 messages to the bulk delete API, older messages are deleted with individual delete requests.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageIds- The ids of the messages to delete.- Returns:
- A future to tell us if the deletion was successful.
-
delete
static CompletableFuture<Void> delete(DiscordApi api, String channelId, String... messageIds)
Deletes multiple messages at once. This method does not have a size or age restriction. Messages younger than two weeks are sent in batches of 100 messages to the bulk delete API, older messages are deleted with individual delete requests.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageIds- The ids of the messages to delete.- Returns:
- A future to tell us if the deletion was successful.
-
delete
static CompletableFuture<Void> delete(DiscordApi api, Message... messages)
Deletes multiple messages at once. This method does not have a size or age restriction. Messages younger than two weeks are sent in batches of 100 messages to the bulk delete API, older messages are deleted with individual delete requests.- Parameters:
api- The discord api instance.messages- The messages to delete.- Returns:
- A future to tell us if the deletion was successful.
-
delete
static CompletableFuture<Void> delete(DiscordApi api, Iterable<Message> messages)
Deletes multiple messages at once. This method does not have a size or age restriction. Messages younger than two weeks are sent in batches of 100 messages to the bulk delete API, older messages are deleted with individual delete requests.- Parameters:
api- The discord api instance.messages- The messages to delete.- Returns:
- A future to tell us if the deletion was successful.
-
edit
static CompletableFuture<Message> edit(DiscordApi api, long channelId, long messageId, String content)
Updates the content of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.- Returns:
- A future to check if the update was successful.
-
edit
static CompletableFuture<Message> edit(DiscordApi api, String channelId, String messageId, String content)
Updates the content of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.- Returns:
- A future to check if the update was successful.
-
edit
static CompletableFuture<Message> edit(DiscordApi api, long channelId, long messageId, EmbedBuilder embed)
Updates the embed of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.embed- The new embed of the message.- Returns:
- A future to check if the update was successful.
-
edit
static CompletableFuture<Message> edit(DiscordApi api, String channelId, String messageId, EmbedBuilder embed)
Updates the embed of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.embed- The new embed of the message.- Returns:
- A future to check if the update was successful.
-
edit
static CompletableFuture<Message> edit(DiscordApi api, long channelId, long messageId, String content, EmbedBuilder embed)
Updates the content and the embed of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.embed- The new embed of the message.- Returns:
- A future to check if the update was successful.
-
edit
static CompletableFuture<Message> edit(DiscordApi api, String channelId, String messageId, String content, EmbedBuilder embed)
Updates the content and the embed of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.embed- The new embed of the message.- Returns:
- A future to check if the update was successful.
-
edit
static CompletableFuture<Message> edit(DiscordApi api, long channelId, long messageId, String content, boolean updateContent, EmbedBuilder embed, boolean updateEmbed)
Updates the content and the embed of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.updateContent- Whether to update or remove the content.embed- The new embed of the message.updateEmbed- Whether to update or remove the embed.- Returns:
- A future to check if the update was successful.
-
edit
static CompletableFuture<Message> edit(DiscordApi api, String channelId, String messageId, String content, boolean updateContent, EmbedBuilder embed, boolean updateEmbed)
Updates the content and the embed of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.updateContent- Whether to update or remove the content.embed- The new embed of the message.updateEmbed- Whether to update or remove the embed.- Returns:
- A future to check if the update was successful.
-
edit
default CompletableFuture<Message> edit(String content)
Updates the content of the message.- Parameters:
content- The new content of the message.- Returns:
- A future to check if the update was successful.
-
edit
default CompletableFuture<Message> edit(EmbedBuilder embed)
Updates the embed of the message.- Parameters:
embed- The new embed of the message.- Returns:
- A future to check if the update was successful.
-
edit
default CompletableFuture<Message> edit(String content, EmbedBuilder embed)
Updates the content and the embed of the message.- Parameters:
content- The new content of the message.embed- The new embed of the message.- Returns:
- A future to check if the update was successful.
-
removeContent
static CompletableFuture<Message> removeContent(DiscordApi api, long channelId, long messageId)
Removes the content of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeContent
static CompletableFuture<Message> removeContent(DiscordApi api, String channelId, String messageId)
Removes the content of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeContent
default CompletableFuture<Message> removeContent()
Removes the content of the message.- Returns:
- A future to check if the removal was successful.
-
removeEmbed
static CompletableFuture<Message> removeEmbed(DiscordApi api, long channelId, long messageId)
Removes the embed of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeEmbed
static CompletableFuture<Message> removeEmbed(DiscordApi api, String channelId, String messageId)
Removes the embed of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeEmbed
default CompletableFuture<Message> removeEmbed()
Removes the embed of the message.- Returns:
- A future to check if the removal was successful.
-
removeContentAndEmbed
static CompletableFuture<Message> removeContentAndEmbed(DiscordApi api, long channelId, long messageId)
Removes the content and embed of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeContentAndEmbed
static CompletableFuture<Message> removeContentAndEmbed(DiscordApi api, String channelId, String messageId)
Removes the content and embed of the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeContentAndEmbed
default CompletableFuture<Message> removeContentAndEmbed()
Removes the content and embed of the message.- Returns:
- A future to check if the removal was successful.
-
addReaction
static CompletableFuture<Void> addReaction(DiscordApi api, long channelId, long messageId, String unicodeEmoji)
Adds a unicode reaction to the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.unicodeEmoji- The unicode emoji string.- Returns:
- A future to tell us if the action was successful.
-
addReaction
static CompletableFuture<Void> addReaction(DiscordApi api, String channelId, String messageId, String unicodeEmoji)
Adds a unicode reaction to the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.unicodeEmoji- The unicode emoji string.- Returns:
- A future to tell us if the action was successful.
-
addReaction
default CompletableFuture<Void> addReaction(Emoji emoji)
Adds a reaction to the message.- Parameters:
emoji- The emoji.- Returns:
- A future to tell us if the action was successful.
-
addReaction
static CompletableFuture<Void> addReaction(DiscordApi api, long channelId, long messageId, Emoji emoji)
Adds a reaction to the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji.- Returns:
- A future to tell us if the action was successful.
-
addReaction
default CompletableFuture<Void> addReaction(String unicodeEmoji)
Adds a unicode reaction to the message.- Parameters:
unicodeEmoji- The unicode emoji string.- Returns:
- A future to tell us if the action was successful.
-
addReaction
static CompletableFuture<Void> addReaction(DiscordApi api, String channelId, String messageId, Emoji emoji)
Adds a reaction to the message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji.- Returns:
- A future to tell us if the action was successful.
-
removeAllReactions
static CompletableFuture<Void> removeAllReactions(DiscordApi api, long channelId, long messageId)
Deletes all reactions on this message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the deletion was successful.
-
removeAllReactions
static CompletableFuture<Void> removeAllReactions(DiscordApi api, String channelId, String messageId)
Deletes all reactions on this message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the deletion was successful.
-
removeAllReactions
default CompletableFuture<Void> removeAllReactions()
Deletes all reactions on this message.- Returns:
- A future to tell us if the deletion was successful.
-
pin
static CompletableFuture<Void> pin(DiscordApi api, long channelId, long messageId)
Pins this message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the pin was successful.
-
pin
static CompletableFuture<Void> pin(DiscordApi api, String channelId, String messageId)
Pins this message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the pin was successful.
-
pin
default CompletableFuture<Void> pin()
Pins this message.- Returns:
- A future to tell us if the pin was successful.
-
unpin
static CompletableFuture<Void> unpin(DiscordApi api, long channelId, long messageId)
Unpins this message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the action was successful.
-
unpin
static CompletableFuture<Void> unpin(DiscordApi api, String channelId, String messageId)
Unpins this message.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the action was successful.
-
unpin
default CompletableFuture<Void> unpin()
Unpins this message.- Returns:
- A future to tell us if the action was successful.
-
getContent
String getContent()
Gets the content of the message.- Returns:
- The content of the message.
-
getLastEditTimestamp
Optional<Instant> getLastEditTimestamp()
Gets the last time the message was edited.- Returns:
- The last time the message was edited.
-
getAttachments
List<MessageAttachment> getAttachments()
Gets the attachments of the message.- Returns:
- The attachments of the message.
-
getReadableContent
default String getReadableContent()
Gets the readable content of the message, which replaces all mentions etc. with the actual name. The replacement happens as following:- User mentions:
@nicknameif the user has a nickname,@nameif the user has no nickname, unchanged if the user is not in the cache. - Role mentions:
@nameif the role exists in the server, otherwise#deleted-role - Channel mentions:
#nameif the text channel exists in the server, otherwise#deleted-channel - Custom emoji:
:name:. If the emoji is known, the real name is used, otherwise the name from the mention tag.
- Returns:
- The readable content of the message.
- User mentions:
-
getLink
default URL getLink() throws AssertionError
Gets the link leading to this message.- Returns:
- The message link.
- Throws:
AssertionError- If the link is malformed.
-
getCustomEmojis
List<CustomEmoji> getCustomEmojis()
Gets a list of all custom emojis in the message.- Returns:
- The list of custom emojis in the message.
-
getType
MessageType getType()
Gets the type of the message.- Returns:
- The type of the message.
-
getChannel
TextChannel getChannel()
Gets the text channel of the message.- Returns:
- The text channel of the message.
-
getActivity
Optional<MessageActivity> getActivity()
Gets the activity of the message.- Returns:
- The activity of the message.
-
isPinned
boolean isPinned()
Checks if the message is pinned.- Returns:
- Whether the message is pinned or not.
-
isTts
boolean isTts()
Checks if this message is text-to-speech.- Returns:
- Whether this message is text-to-speech or not.
-
mentionsEveryone
boolean mentionsEveryone()
Checks if the message mentions everyone.- Returns:
- Whether the message mentions everyone or not.
-
getEmbeds
List<Embed> getEmbeds()
Gets a list with all embeds of the message.- Returns:
- A list with all embeds of the message.
-
getUserAuthor
Optional<User> getUserAuthor()
Gets the user author of the message. The author is not present, if it's a webhook.- Returns:
- The user author of the message.
-
getAuthor
MessageAuthor getAuthor()
Gets the author of the message. Might be a user or a webhook.- Returns:
- The author of the message.
-
getReferencedMessageId
Optional<Long> getReferencedMessageId()
Gets the id of the message referenced with a reply. Only present if this message is typeMessageType.REPLY.- Returns:
- The id of the referenced message.
-
getReferencedMessage
Optional<Message> getReferencedMessage()
Gets the message referenced with a reply. Only present if this message is typeMessageType.REPLY, discord decided to send it and the message hasn't been deleted.- Returns:
- The referenced message.
-
requestReferencedMessage
default Optional<CompletableFuture<Message>> requestReferencedMessage()
Requests the message referenced with a reply.If the message is in the cache, the message is served from the cache.
- Returns:
- The referenced message.
-
isCachedForever
boolean isCachedForever()
Checks if the message is kept in cache forever.- Returns:
- Whether the message is kept in cache forever or not.
-
setCachedForever
void setCachedForever(boolean cachedForever)
Sets if the the message is kept in cache forever.- Parameters:
cachedForever- Whether the message should be kept in cache forever or not.
-
getReactions
List<Reaction> getReactions()
Gets a list with all reactions of the message.- Returns:
- A list which contains all reactions of the message.
-
getMentionedUsers
List<User> getMentionedUsers()
Gets a list with all users mentioned in this message.- Returns:
- A list with all users mentioned in this message.
-
getMentionedRoles
List<Role> getMentionedRoles()
Gets a list with all roles mentioned in this message.- Returns:
- A list with all roles mentioned in this message.
-
getNonce
Optional<String> getNonce()
Gets the nonce of the message.- Returns:
- The nonce of the message.
-
getMentionedChannels
default List<ServerTextChannel> getMentionedChannels()
Gets a list with all channels mentioned in this message.- Returns:
- A list with all channels mentioned in this message.
-
isPrivate
@Deprecated default boolean isPrivate()
Deprecated. UseisPrivateMessage()instead.Checks if the message was sent in aprivate channel.- Returns:
- Whether or not the message was sent in a private channel.
-
isPrivateMessage
default boolean isPrivateMessage()
Checks if the message was sent in aprivate channel.- Returns:
- Whether or not the message was sent in a private channel.
-
isServerMessage
default boolean isServerMessage()
Checks if the message was sent in aserver channel.- Returns:
- Whether or not the message was sent in a server channel.
-
isGroupMessage
default boolean isGroupMessage()
Checks if the message was sent in agroup channel.- Returns:
- Whether or not the message was sent in a group channel.
-
getReactionByEmoji
default Optional<Reaction> getReactionByEmoji(Emoji emoji)
Gets a reaction by its emoji.- Parameters:
emoji- The emoji of the reaction.- Returns:
- The reaction for the given emoji.
-
getReactionByEmoji
default Optional<Reaction> getReactionByEmoji(String unicodeEmoji)
Gets a reaction by its unicode emoji.- Parameters:
unicodeEmoji- The unicode emoji of the reaction.- Returns:
- The reaction for the given emoji.
-
addReactions
default CompletableFuture<Void> addReactions(Emoji... emojis)
Adds reactions to the message.- Parameters:
emojis- The emojis.- Returns:
- A future to tell us if the action was successful.
-
addReactions
CompletableFuture<Void> addReactions(String... unicodeEmojis)
Adds unicode reactions to the message.- Parameters:
unicodeEmojis- The unicode emoji strings.- Returns:
- A future to tell us if the action was successful.
-
removeReactionByEmoji
default CompletableFuture<Void> removeReactionByEmoji(User user, Emoji emoji)
Removes a user from the list of reactors of a given emoji reaction.- Parameters:
user- The user to remove.emoji- The emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionByEmoji
CompletableFuture<Void> removeReactionByEmoji(User user, String unicodeEmoji)
Removes a user from the list of reactors of a given unicode emoji reaction.- Parameters:
user- The user to remove.unicodeEmoji- The unicode emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionByEmoji
default CompletableFuture<Void> removeReactionByEmoji(Emoji emoji)
Removes all reactors of a given emoji reaction.- Parameters:
emoji- The emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionByEmoji
CompletableFuture<Void> removeReactionByEmoji(String unicodeEmoji)
Removes all reactors of a given unicode emoji reaction.- Parameters:
unicodeEmoji- The unicode emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionsByEmoji
default CompletableFuture<Void> removeReactionsByEmoji(User user, Emoji... emojis)
Removes a user from the list of reactors of the given emoji reactions.- Parameters:
user- The user to remove.emojis- The emojis of the reactions.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionsByEmoji
CompletableFuture<Void> removeReactionsByEmoji(User user, String... unicodeEmojis)
Removes a user from the list of reactors of the given unicode emoji reactions.- Parameters:
unicodeEmojis- The unicode emojis of the reactions.user- The user to remove.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionsByEmoji
default CompletableFuture<Void> removeReactionsByEmoji(Emoji... emojis)
Removes all reactors of the given emoji reactions.- Parameters:
emojis- The emojis of the reactions.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionsByEmoji
CompletableFuture<Void> removeReactionsByEmoji(String... unicodeEmojis)
Removes all reactors of the given unicode emoji reactions.- Parameters:
unicodeEmojis- The unicode emojis of the reactions.- Returns:
- A future to tell us if the deletion was successful.
-
removeOwnReactionByEmoji
default CompletableFuture<Void> removeOwnReactionByEmoji(Emoji emoji)
Removes you from the list of reactors of a given emoji reaction.- Parameters:
emoji- The emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeOwnReactionByEmoji
CompletableFuture<Void> removeOwnReactionByEmoji(String unicodeEmoji)
Removes you from the list of reactors of a given unicode emoji reaction.- Parameters:
unicodeEmoji- The unicode emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeOwnReactionsByEmoji
default CompletableFuture<Void> removeOwnReactionsByEmoji(Emoji... emojis)
Removes you from the list of reactors of the given emoji reactions.- Parameters:
emojis- The emojis of the reactions.- Returns:
- A future to tell us if the deletion was successful.
-
removeOwnReactionsByEmoji
CompletableFuture<Void> removeOwnReactionsByEmoji(String... unicodeEmojis)
Removes you from the list of reactors of the given unicode emoji reactions.- Parameters:
unicodeEmojis- The unicode emojis of the reactions.- Returns:
- A future to tell us if the deletion was successful.
-
getServerTextChannel
default Optional<ServerTextChannel> getServerTextChannel()
Gets the server text channel of the message. Only present if the message was sent in a server.- Returns:
- The server text channel.
-
getPrivateChannel
default Optional<PrivateChannel> getPrivateChannel()
Gets the private channel of the message. Only present if the message was sent in a private conversation.- Returns:
- The private channel.
-
getGroupChannel
default Optional<GroupChannel> getGroupChannel()
Gets the group channel of the message. Only present if the message was sent in a group channel.- Returns:
- The group channel.
-
getServer
default Optional<Server> getServer()
Gets the server of the message.- Returns:
- The server of the message.
-
getMessagesBefore
default CompletableFuture<MessageSet> getMessagesBefore(int limit)
Gets up to a given amount of messages before this message.- Parameters:
limit- The limit of messages to get.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesBefore(int, long),getMessagesBeforeAsStream()
-
getMessagesBeforeUntil
default CompletableFuture<MessageSet> getMessagesBeforeUntil(Predicate<Message> condition)
Gets messages before this message until one that meets the given condition is found. If no message matches the condition, an empty set is returned.- Parameters:
condition- The abort condition for when to stop retrieving messages.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesBefore(int, long),getMessagesBeforeAsStream()
-
getMessagesBeforeWhile
default CompletableFuture<MessageSet> getMessagesBeforeWhile(Predicate<Message> condition)
Gets messages before this message while they meet the given condition. If the first message does not match the condition, an empty set is returned.- Parameters:
condition- The condition that has to be met.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesBeforeWhile(Predicate, long),getMessagesBeforeAsStream()
-
getMessagesBeforeAsStream
default Stream<Message> getMessagesBeforeAsStream()
Gets a stream of messages before this message sorted from newest to oldest.The messages are retrieved in batches synchronously from Discord, so consider not using this method from a listener directly.
- Returns:
- The stream.
- See Also:
TextChannel.getMessagesBeforeAsStream(long),getMessagesBefore(int)
-
getMessagesAfter
default CompletableFuture<MessageSet> getMessagesAfter(int limit)
Gets up to a given amount of messages after this message.- Parameters:
limit- The limit of messages to get.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesAfter(int, long),getMessagesAfterAsStream()
-
getMessagesAfterUntil
default CompletableFuture<MessageSet> getMessagesAfterUntil(Predicate<Message> condition)
Gets messages after this message until one that meets the given condition is found. If no message matches the condition, an empty set is returned.- Parameters:
condition- The abort condition for when to stop retrieving messages.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesAfter(int, long),getMessagesAfterAsStream()
-
getMessagesAfterWhile
default CompletableFuture<MessageSet> getMessagesAfterWhile(Predicate<Message> condition)
Gets messages after this message while they meet the given condition. If the first message does not match the condition, an empty set is returned.- Parameters:
condition- The condition that has to be met.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesAfterWhile(Predicate, long),getMessagesAfterAsStream()
-
getMessagesAfterAsStream
default Stream<Message> getMessagesAfterAsStream()
Gets a stream of messages after this message sorted from oldest to newest.The messages are retrieved in batches synchronously from Discord, so consider not using this method from a listener directly.
- Returns:
- The stream.
- See Also:
TextChannel.getMessagesAfterAsStream(long),getMessagesAfter(int)
-
getMessagesAround
default CompletableFuture<MessageSet> getMessagesAround(int limit)
Gets up to a given amount of messages around this message. This message will be part of the result in addition to the messages around and does not count towards the limit. Half of the messages will be older than this message and half of the message will be newer. If there aren't enough older or newer messages, the actual amount of messages will be less than the given limit. It's also not guaranteed to be perfectly balanced.- Parameters:
limit- The limit of messages to get.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesAround(int, long),getMessagesAroundAsStream()
-
getMessagesAroundUntil
default CompletableFuture<MessageSet> getMessagesAroundUntil(Predicate<Message> condition)
Gets messages around this message until one that meets the given condition is found. If no message matches the condition, an empty set is returned. This message will be part of the result in addition to the messages around and is matched against the condition and will abort retrieval. Half of the messages will be older than this message and half of the message will be newer. If there aren't enough older or newer messages, the actual amount of messages will be less than the given limit. It's also not guaranteed to be perfectly balanced.- Parameters:
condition- The abort condition for when to stop retrieving messages.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesAround(int, long),getMessagesAroundAsStream()
-
getMessagesAroundWhile
default CompletableFuture<MessageSet> getMessagesAroundWhile(Predicate<Message> condition)
Gets messages around this message while they meet the given condition. If this message does not match the condition, an empty set is returned. This message will be part of the result in addition to the messages around and is matched against the condition and will abort retrieval. Half of the messages will be older than this message and half of the message will be newer. If there aren't enough older or newer messages, the actual amount of messages will be less than the given limit. It's also not guaranteed to be perfectly balanced.- Parameters:
condition- The condition that has to be met.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesAroundWhile(Predicate, long),getMessagesAroundAsStream()
-
getMessagesAroundAsStream
default Stream<Message> getMessagesAroundAsStream()
Gets a stream of messages around this message. The first message in the stream will be this message. After that you will always get an older message and a newer message alternating as long as on both sides messages are available. If only on one side further messages are available, only those are delivered further on. It's not guaranteed to be perfectly balanced.The messages are retrieved in batches synchronously from Discord, so consider not using this method from a listener directly.
- Returns:
- The stream.
- See Also:
TextChannel.getMessagesAroundAsStream(long),getMessagesAround(int)
-
getMessagesBetween
default CompletableFuture<MessageSet> getMessagesBetween(long other)
Gets all messages between this messages and the given message, excluding the boundaries.- Parameters:
other- The id of the other boundary messages.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesBetween(long, long),getMessagesBetweenAsStream(long)
-
getMessagesBetween
default CompletableFuture<MessageSet> getMessagesBetween(Message other)
Gets all messages between this messages and the given message, excluding the boundaries.- Parameters:
other- The other boundary messages.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesBetween(long, long),getMessagesBetweenAsStream(long)
-
getMessagesBetweenUntil
default CompletableFuture<MessageSet> getMessagesBetweenUntil(long other, Predicate<Message> condition)
Gets all messages between this message and the given message, excluding the boundaries, until one that meets the given condition is found. If no message matches the condition, an empty set is returned.- Parameters:
other- The id of the other boundary messages.condition- The abort condition for when to stop retrieving messages.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesBetweenUntil(Predicate, long, long),getMessagesBetweenAsStream(long)
-
getMessagesBetweenUntil
default CompletableFuture<MessageSet> getMessagesBetweenUntil(Message other, Predicate<Message> condition)
Gets all messages between this message and the given message, excluding the boundaries, until one that meets the given condition is found. If no message matches the condition, an empty set is returned.- Parameters:
other- The other boundary messages.condition- The abort condition for when to stop retrieving messages.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesBetweenUntil(Predicate, long, long),getMessagesBetweenAsStream(long)
-
getMessagesBetweenWhile
default CompletableFuture<MessageSet> getMessagesBetweenWhile(long other, Predicate<Message> condition)
Gets all messages between this message and the given message, excluding the boundaries, while they meet the given condition. If the first message does not match the condition, an empty set is returned.- Parameters:
other- The id of the other boundary messages.condition- The condition that has to be met.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesBetweenWhile(Predicate, long, long),getMessagesBetweenAsStream(long)
-
getMessagesBetweenWhile
default CompletableFuture<MessageSet> getMessagesBetweenWhile(Message other, Predicate<Message> condition)
Gets all messages between this message and the given message, excluding the boundaries, while they meet the given condition. If the first message does not match the condition, an empty set is returned.- Parameters:
other- The other boundary messages.condition- The condition that has to be met.- Returns:
- The messages.
- See Also:
TextChannel.getMessagesBetweenWhile(Predicate, long, long),getMessagesBetweenAsStream(long)
-
getMessagesBetweenAsStream
default Stream<Message> getMessagesBetweenAsStream(long other)
Gets a stream of all messages between this message and the given message, excluding the boundaries, sorted from this message to the given message.The messages are retrieved in batches synchronously from Discord, so consider not using this method from a listener directly.
- Parameters:
other- The id of the other boundary messages.- Returns:
- The stream.
- See Also:
TextChannel.getMessagesBetweenAsStream(long, long),getMessagesBetween(long)
-
getMessagesBetweenAsStream
default Stream<Message> getMessagesBetweenAsStream(Message other)
Gets a stream of all messages between this message and the given message, excluding the boundaries, sorted from this message to the given message.The messages are retrieved in batches synchronously from Discord, so consider not using this method from a listener directly.
- Parameters:
other- The other boundary messages.- Returns:
- The stream.
- See Also:
TextChannel.getMessagesBetweenAsStream(long, long),getMessagesBetween(long)
-
canAddNewReactions
default boolean canAddNewReactions(User user)
Checks if the given user is allowed to add new reactions to the message.- Parameters:
user- The user to check.- Returns:
- Whether the given user is allowed to add new reactions to the message or not.
-
canYouAddNewReactions
default boolean canYouAddNewReactions()
Checks if the user of the connected account is allowed to add new reactions to the message.- Returns:
- Whether the user of the connected account is allowed to add new reactions to the message or not.
-
canDelete
default boolean canDelete(User user)
Checks if the given user can delete this message.- Parameters:
user- The user to check.- Returns:
- Whether the given user can delete the message or not.
-
reply
default CompletableFuture<Message> reply(String messageContent)
Replies to this message with the given text.- Parameters:
messageContent- The text to reply with.- Returns:
- The sent message.
-
reply
default CompletableFuture<Message> reply(EmbedBuilder embed)
Replies to this message with the given embed.- Parameters:
embed- The EmbedBuilder to reply with.- Returns:
- The sent message.
-
canYouDelete
default boolean canYouDelete()
Checks if the user of the connected account can delete this message.- Returns:
- Whether the user of the connected account can delete the message or not.
-
getCurrentCachedInstance
default Optional<Message> getCurrentCachedInstance()
Description copied from interface:UpdatableFromCacheGets an updated instance of this entity from the cache. This is for example necessary if an instance got invalid by a reconnect to Discord which invalidates all existing instances which means they do not get any further updates from Discord applied. Due to that, references to instances should usually not be held for an extended period of time. If they are, this method can be used to retrieve the current instance from the cache, that gets updates from Discord, in case this one was invalidated.This method returns the currently cached entity, or an empty
Optionalif the entity is not cached any longer, for example because it was deleted or the message was thrown out of the cache.- Specified by:
getCurrentCachedInstancein interfaceUpdatableFromCache<Message>- Returns:
- The current cached instance.
-
getLatestInstance
default CompletableFuture<Message> getLatestInstance()
Description copied from interface:UpdatableGets an updated instance of this entity from the cache or from Discord directly. This is for example necessary if an instance got invalid by a reconnect to Discord which invalidates all existing instances which means they do not get any further updates from Discord applied. Due to that, references to instances should usually not be held for an extended period of time. If they are, this method can be used to retrieve the current instance from the cache if present or from Discord directly.This method returns the currently cached entity if present, or request the entity from Discord if it is not cached or not permanently cached. If the entity is a fully cached entity and is not in the cache any longer, for example because it was deleted or the message was thrown out of the cache, the
CompletableFuturecompletes exceptionally with aNoSuchElementException. If a request to Discord is made, the according remote call exception will be used to complete theCompletableFutureexceptionally.- Specified by:
getLatestInstancein interfaceUpdatable<Message>- Specified by:
getLatestInstancein interfaceUpdatableFromCache<Message>- Returns:
- The current cached instance.
-
-