public static CompletableFuture < MessageSet > getMessagesBetween ( TextChannel channel , long from , long to ) { CompletableFuture < MessageSet > future = new CompletableFuture <> ( ) ; channel . getApi ( ) . getThreadPool ( ) . getExecutorService ( ) . submit ( ( ) -> { try { future . complete ( new MessageSetImpl ( getMessagesBetweenAsStream ( channel , from , to ) . collect ( Collectors . toList ( ) ) ) ) ; } catch ( Throwable t ) { future . completeExceptionally ( t ) ; } } ) ; return future ; }
Gets all messages in the given channel between the first given message in any channel and the second given message in any channel excluding the boundaries . Gets up to a given amount of messages in the given channel before a given message in any channel .