Dbot.Processor.Commander.Song C# (CSharp) Method

Song() private method

private Song ( ) : string
return string
        private string Song()
        {
            var json = Tools.DownloadData(
            $"http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=stevenbonnellii&api_key={PrivateConstants.LastFmApiKey}&format=json");
              var dyn = (JObject) JsonConvert.DeserializeObject(json.Result);
              var artist = dyn.SelectToken("recenttracks.track[0].artist.#text");
              var name = dyn.SelectToken("recenttracks.track[0].name");
              if (dyn.SelectToken("recenttracks.track[0][email protected]") != null) {
            return $"{name} - {artist} last.fm/user/stevenbonnellii";
              }
              var epochStringTime = dyn.SelectToken("recenttracks.track[0].date.uts").Value<string>();
              var epochTime = Convert.ToInt32(epochStringTime);
              var delta = Tools.Epoch(DateTime.UtcNow) - TimeSpan.FromSeconds(epochTime);
              var prettyDelta = Tools.PrettyDeltaTime(delta);
              return $"No song played/scrobbled. Played {prettyDelta} ago: {name} - {artist}";
        }