Class MessageUtils
-
- All Implemented Interfaces:
public final class MessageUtils
-
-
Method Summary
Modifier and Type Method Description final static MessagelatestOrNull(List<Message> $self)Peeks the latest message from the sorted List of messages. final static BooleancreatedAfter(Message $self, Message that)Tests if this message was created after that message. final static BooleanisFailed(Message $self)final static BooleanisErrorOrFailed(Message $self)final static BooleanisDeleted(Message $self)final static BooleanisPinnedAndNotDeleted(Message $self)final static BooleanisPinned(Message $self, Function0<Long> now)final static BooleanisPinExpired(Message $self, Function0<Long> now)final static BooleanisRegular(Message $self)final static BooleanisEphemeral(Message $self)final static BooleanisSystem(Message $self)final static BooleanisError(Message $self)final static BooleanisGiphy(Message $self)final static BooleanhasAudioRecording(Message $self)final static BooleanisPoll(Message $self)final static BooleanisPollClosed(Message $self)final static BooleanisGiphyEphemeral(Message $self)final static BooleanisThreadStart(Message $self)final static BooleanisThreadReply(Message $self)final static BooleanbelongsToThread(Message $self)final static BooleanisReply(Message $self)final static BooleanhasSharedLocation(Message $self)final static BooleanisMine(Message $self, String currentUserId)final static BooleanisModerationBounce(Message $self)final static BooleanisModerationBlock(Message $self)final static BooleanisModerationFlag(Message $self)final static BooleanisModerationError(Message $self, String currentUserId)-
-
Method Detail
-
latestOrNull
final static Message latestOrNull(List<Message> $self)
Peeks the latest message from the sorted List of messages.
-
createdAfter
final static Boolean createdAfter(Message $self, Message that)
Tests if this message was created after that message.
-
isFailed
final static Boolean isFailed(Message $self)
- Returns:
If the current message failed to send.
-
isErrorOrFailed
final static Boolean isErrorOrFailed(Message $self)
- Returns:
If the message type is error or failed to send.
-
isPinnedAndNotDeleted
final static Boolean isPinnedAndNotDeleted(Message $self)
- Returns:
If the message is pinned and not deleted.
-
isPinned
final static Boolean isPinned(Message $self, Function0<Long> now)
- Parameters:
now- A function that provides the current time in milliseconds.- Returns:
If the message is a valid pinned message.
-
isPinExpired
final static Boolean isPinExpired(Message $self, Function0<Long> now)
- Returns:
If the message is a valid pinned message.
-
isEphemeral
final static Boolean isEphemeral(Message $self)
- Returns:
If the message type is ephemeral.
-
isGiphy
final static Boolean isGiphy(Message $self)
- Returns:
If the message is related to a Giphy slash command.
-
hasAudioRecording
final static Boolean hasAudioRecording(Message $self)
- Returns:
If the message has an audio recording attachment.
-
isPollClosed
final static Boolean isPollClosed(Message $self)
- Returns:
If the message is related to the poll.
-
isGiphyEphemeral
final static Boolean isGiphyEphemeral(Message $self)
- Returns:
If the message is a temporary message to select a gif.
-
isThreadStart
final static Boolean isThreadStart(Message $self)
- Returns:
If the message is a start of a thread.
-
isThreadReply
final static Boolean isThreadReply(Message $self)
- Returns:
If the message is a thread reply.
-
belongsToThread
final static Boolean belongsToThread(Message $self)
- Returns:
If the message belongs to a thread.
-
isReply
final static Boolean isReply(Message $self)
- Returns:
If the message contains quoted message.
-
hasSharedLocation
final static Boolean hasSharedLocation(Message $self)
- Returns:
If the message has a shared location.
-
isMine
final static Boolean isMine(Message $self, String currentUserId)
- Returns:
If the message belongs to the current user.
-
isModerationBounce
final static Boolean isModerationBounce(Message $self)
- Returns:
If the message has moderation bounce action.
-
isModerationBlock
final static Boolean isModerationBlock(Message $self)
- Returns:
If the message has moderation block action.
-
isModerationFlag
final static Boolean isModerationFlag(Message $self)
- Returns:
If the message has moderation flag action.
-
isModerationError
final static Boolean isModerationError(Message $self, String currentUserId)
- Returns:
if the message failed at moderation or not.
-
-
-
-