I like my Steam account

This commit is contained in:
JustArchi
2016-12-23 03:37:29 +01:00
parent e3f87e4a19
commit 6038faaa5f
2 changed files with 22 additions and 2 deletions

View File

@@ -118,8 +118,8 @@ namespace ArchiSteamFarm {
Bot.ArchiLogger.LogGenericDebug("Getting SteamAwards page...");
HtmlDocument htmlDocument = await Bot.ArchiWebHandler.GetSteamAwardsPage().ConfigureAwait(false);
HtmlNode voteNode = htmlDocument?.DocumentNode.SelectSingleNode("//div[@class='vote_nomination ']");
if (voteNode == null) {
HtmlNodeCollection voteNodes = htmlDocument?.DocumentNode.SelectNodes("//div[@class='vote_nomination ']");
if (voteNodes == null) {
// Event ended, error or likewise
Bot.ArchiLogger.LogGenericDebug("Could not get SteamAwards page, returning");
return;
@@ -150,6 +150,9 @@ namespace ArchiSteamFarm {
return;
}
// Random a game we'll actually vote for, we don't want to make GabeN angry by rigging votes...
HtmlNode voteNode = voteNodes[Utilities.RandomNext(voteNodes.Count)];
string appIDText = voteNode.GetAttributeValue("data-vote-appid", null);
if (string.IsNullOrEmpty(appIDText)) {
Bot.ArchiLogger.LogNullError(nameof(appIDText));