Class MessageChain

    • Method Detail

      • iterator

        @NotNull
        public @NotNull Iterator<Message> iterator()
        Get the iterator of this message chain
        Specified by:
        iterator in interface Iterable<Message>
        Returns:
        the iterator of this message chain
      • stream

        public java.util.stream.Stream<Message> stream()
        Get the stream of this message chain
        Returns:
        the stream of this message chain
      • toMiraiCode

        public String toMiraiCode()
        Get the message as MiraiCode
        Returns:
        the message as MiraiCode
      • get

        public Message get​(int index)
        Get the message at the specified index
        Parameters:
        index - the specified index
        Returns:
        the message at the specified index
      • size

        public int size()
        Get the size of this message chain
        Returns:
        the size of this message chain
      • of

        @NotNull
        @Contract("_ -> new")
        public static @NotNull MessageChain of​(net.mamoe.mirai.message.data.MessageChain message)
        Wrap a message chain
        Parameters:
        message - the native message chain
        Returns:
        the wrapped message chain