Fixed patreon error

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

View File

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

View File

@ -21,7 +21,7 @@ namespace NadekoBot.Core.Services.Impl
private readonly IBotCredentials _creds; private readonly IBotCredentials _creds;
private readonly DateTime _started; private readonly DateTime _started;
public const string BotVersion = "2.2.2"; public const string BotVersion = "2.2.3";
public string Author => "Kwoth#2560"; public string Author => "Kwoth#2560";
public string Library => "Discord.Net"; public string Library => "Discord.Net";