def execute(self, user: User, alias: str, args: str, respond: ResponseHook) -> bool: """ Same as !request, but automatically picks from ALL possible matches. This includes matches that cannot be picked with !pick due to lower relevance. Usually best used with artists, e.g. !random acdc """ with self._queue: match = CustomDLC.random(args, *self.__exclusions()) if not match: without_exclusions = CustomDLC.random_pool(query=args).count() message = f'Everything already played or enqueued' if without_exclusions else f'No matches' return respond.to_sender(f'{message} for <{args}>') request = Match(user, args, match) return self._enqueue_request(user, request, respond)
def test_filtered_pools(es_cdlc): assert_that(list(CustomDLC.playable())).is_length( 4) # 2 mock CDLCs out of 6 are not playable assert_that(list(CustomDLC.random_pool())).is_length( 3) # 1 more CDLC is official