Fixed patreon error

This commit is contained in:
Master Kwoth committed 2017-10-29 09:25:50 +01:00
1 parent 83194fca6e
commit a17de3dc58
2 files changed
+7 -4

No files matched your search

@@ -93,9 +93,12 @@ namespace NadekoBot.Modules.Utility.Services
var pledgers = data.Data.Where(x => x["type"].ToString() == "pledge");
rewards.AddRange(pledgers.Select(x => JsonConvert.DeserializeObject<PatreonPledge>(x.ToString()))
.Where(x => x.attributes.declined_since == null));
users.AddRange(data.Included
.Where(x => x["type"].ToString() == "user")
.Select(x => JsonConvert.DeserializeObject<PatreonUser>(x.ToString())));
if (data.Included != null)
{
users.AddRange(data.Included
.Where(x => x["type"].ToString() == "user")
.Select(x => JsonConvert.DeserializeObject<PatreonUser>(x.ToString())));
}
} while (!string.IsNullOrWhiteSpace(data.Links.next));
}
var db = _cache.Redis.GetDatabase();