public Task <TwitchAccessToken> StoreTokenAsync(TwitchAccessToken token) { if (Acquired) { throw new Exception("Already acquired token, should re-use"); } Acquired = true; CurrentToken = token; return(Task.FromResult(token)); }
private async Task <TwitchAccessToken> GetAccessToken(string channelName) { string path; path = "http://api.twitch.tv/api/channels/" + channelName.ToLower() + "/access_token.json?oauth_token=qflco99t368mdeu5o04vx1eaw4tz52"; string response; try { response = await httpClient.GetStringAsync(path); } catch { Console.WriteLine("error"); return(null); } TwitchAccessToken accessToken = Utility.Deserialize <TwitchAccessToken>(response); return(accessToken); }
public Task <TwitchAccessToken> StoreTokenAsync(TwitchAccessToken token) { CurrentToken = token; return(Task.FromResult(token)); }