public function nowListening(string $username)
    {
        $this->query = array_merge($this->query, [
            'method' => 'user.getRecentTracks',
            'user' => $username,
        ]);

        $this->pluck = 'recenttracks.track.0';

        $most_recent_track = $this->limit(1)->get();

        if (!isset($most_recent_track['@attr']['nowplaying'])) {
            return false;
        }

        return $most_recent_track;
    }
public function nowListening(string $username)
    {
        $this->query = array_merge($this->query, [
            'method' => 'user.getRecentTracks',
            'user' => $username,
        ]);

        $this->pluck = 'recenttracks.track.0';

        $most_recent_track = $this->limit(1)->get();

        if (!isset($most_recent_track['@attr']['nowplaying'])) {
            return false;
        }

        return $most_recent_track;
    }
public function nowListening ( string $ username ) { $ this -> query = array_merge ( $ this -> query , [ 'method' => 'user.getRecentTracks' , 'user' => $ username , ] ) ; $ this -> pluck = 'recenttracks.track.0' ; $ most_recent_track = $ this -> limit ( 1 ) -> get ( ) ; if ( ! isset ( $ most_recent_track [ '@attr' ] [ 'nowplaying' ] ) ) { return false ; } return $ most_recent_track ; }
Retrieve the track that is currently playing or "false" if not
currently playing any track.

@param string $username

@return array|bool
Retrieve the track that is currently playing or false if not currently playing any track .