Interface ChatSender

    • Method Detail

      • getPlatformUser

        PlatformUser getPlatformUser()
        Gets the platform user that is associated with this chat sender.
        Returns:
        PlatformUser instance.
      • getUsername

        default java.lang.String getUsername()
        Gets the username of the command sender.
      • getDisplayName

        default java.lang.String getDisplayName()
        Gets the display name of the command sender.
      • getChat

        Chat getChat()
        Gets the chat the message was sent in.
        Returns:
        Chat instance.
      • begin

        boolean begin()
        Opens the command buffer.
        Returns:
        true if the buffer was opened, false if no changes were made.
      • end

        java.util.Collection<ChatMessage> end()
        Ends the command buffer.
        Returns:
        ChatMessage generated.
      • flush

        java.util.Collection<ChatMessage> flush()
        Flushes the buffer.
        Returns:
        ChatMessage generated.
      • sendList

        <T> java.util.Collection<ChatMessage> sendList​(java.lang.Class<T> type,
                                                       java.util.function.Consumer<CommandListResponse.Builder<T>> function)
                                                throws CommandExecutionException
        Creates a list response to get to the command sender, opportunistically formatting as rich content.
        Type Parameters:
        T - List item type.
        Parameters:
        function - Function providing a command response object from a builder.
        Returns:
        CommandResponse object corresponding to the desired message; contains get() method to dispatch.
        Throws:
        CommandExecutionException
      • sendList

        default <T> java.util.Collection<ChatMessage> sendList​(java.lang.Class<T> type,
                                                               SearchResult<T> result,
                                                               CommandListResponse.ListElementFormatter<T> formatter)
                                                        throws CommandExecutionException
        Constructs a list response on the given search object and associated chat sender. Has a default implementation for ease-of-use, via the virtual list accessor system, used for paged results where more results exist virtually outside the application (such as, in the case of a search). This is used to improve performance and lower overhead when searching over millions of rows, for example.
        Type Parameters:
        T - List item type.
        Parameters:
        type - List item type.
        result - Search result object, obtained from a SearchHandler class.
        Returns:
        CommandResponse object corresponding to the desired message; contains get() method to dispatch.
        Throws:
        CommandExecutionException
      • sendDetails

        java.util.Collection<ChatMessage> sendDetails​(java.util.function.Consumer<CommandDetailsResponse.Builder> function)
                                               throws CommandExecutionException
        Creates a details response to get to the command sender, opportunistically formatting as rich content. Details are formatted as such: ObjectName "ObjectKey" details: Key: value Key: [value1,value2,value3]
        Parameters:
        function - Function providing a command response object from a builder.
        Returns:
        CommandResponse object corresponding to the desired message; contains get() method to dispatch.
        Throws:
        CommandExecutionException