public async Task <IReadOnlyCollection <string> > GetAppNameListAsync() { var response = await _steamApps.GetAppListAsync(); var data = response.Data; var names = data.Select(x => x.Name).ToArray(); return(names); }
public async Task GetAppListAsync_Should_Succeed() { var response = await steamInterface.GetAppListAsync(); Assert.NotNull(response); Assert.NotNull(response.Data); }
private static Task UpdateSteamAsync() { Console.WriteLine("Updating Steam App List..."); var service = new BotServices(); var token = service.GetAPIToken("steam"); var apps = new SteamApps(token); var games = apps.GetAppListAsync().Result.Data; GlobalVariables.SteamAppList.Clear(); foreach (var game in games) { if (!string.IsNullOrWhiteSpace(game.Name)) { GlobalVariables.SteamAppList.Add(Convert.ToUInt32(game.AppId), game.Name); } } Console.WriteLine("Updating TF2 Item Schema..."); var schema = new EconItems(token, EconItemsAppId.TeamFortress2); var items = schema.GetSchemaForTF2Async(); GlobalVariables.TFItemSchema.Clear(); foreach (var item in items.Result.Data.Items) { if (!string.IsNullOrWhiteSpace(item.ItemName)) { GlobalVariables.TFItemSchema.Add(Convert.ToUInt32(item.DefIndex), item.ItemName); } } return(Task.CompletedTask); }