private async Task <Station> PlayNowPlaying(ITurnContext turnContext, string token, CancellationToken cancellationToken) { // no query so start / resume station // Play whatever the user is currently playing on Spotify var info = RingoBotHelper.NormalizedConversationInfo(turnContext); var channelUserId = RingoBotHelper.ChannelUserId(turnContext); SpotifyApi.NetCore.CurrentPlaybackContext nowPlaying = await _spotifyService.GetUserNowPlaying(token); if (nowPlaying == null || !nowPlaying.IsPlaying || nowPlaying.Context == null) { if (nowPlaying.IsPlaying && nowPlaying.Context == null) { await turnContext.SendActivityAsync(RingoBotMessages.NowPlayingNoContext(info), cancellationToken); } else if (nowPlaying.IsPlaying && !new[] { "playlist", "album" }.Contains(nowPlaying.Context.Type)) { await turnContext.SendActivityAsync( RingoBotMessages.NowPlayingNotSupported(info, nowPlaying.Context.Type), cancellationToken); } else { await turnContext.SendActivityAsync(RingoBotMessages.NotPlayingAnything(info), cancellationToken); } return(null); } await _spotifyService.TurnOffShuffleRepeat(token, nowPlaying); Station station = null; switch (nowPlaying.Context.Type) { case "playlist": var playlist = await _spotifyService.GetPlaylist(token, nowPlaying.Context.Uri); station = info.IsGroup ? await _ringoService.CreateConversationStation(info, playlist : playlist) : await _ringoService.CreateUserStation(info, playlist : playlist); break; case "album": var album = await _spotifyService.GetAlbum(token, nowPlaying.Context.Uri); station = info.IsGroup ? await _ringoService.CreateConversationStation(info, album : album) : await _ringoService.CreateUserStation(info, album : album); break; default: await turnContext.SendActivityAsync( RingoBotMessages.NowPlayingNotSupported(info, nowPlaying.Context.Type), cancellationToken); break; } return(station); }