Class MessageUtils

  • All Implemented Interfaces:

    
    public final class MessageUtils
    
                        
    • Constructor Detail

    • 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.

      • isDeleted

         final static Boolean isDeleted(Message $self)
        Returns:

        If the message is 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.

      • isRegular

         final static Boolean isRegular(Message $self)
        Returns:

        If the message type is regular.

      • isEphemeral

         final static Boolean isEphemeral(Message $self)
        Returns:

        If the message type is ephemeral.

      • isSystem

         final static Boolean isSystem(Message $self)
        Returns:

        If the message type is system.

      • isError

         final static Boolean isError(Message $self)
        Returns:

        If the message type is error.

      • 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.

      • isPoll

         final static Boolean isPoll(Message $self)
        Returns:

        If the message is related to the poll.

      • 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.