Created VotesApi project nad re-worked vote rewards handling

This commit is contained in:
Kwoth
2021-10-15 22:06:30 +00:00
parent 02de25a931
commit 1af75fd813
32 changed files with 830 additions and 82 deletions

View File

@@ -128,7 +128,10 @@ namespace NadekoBot.Services
null,
null,
oldCreds.PatreonCampaignId),
Votes = new Creds.VotesSettings(oldCreds.VotesUrl, oldCreds.VotesToken),
Votes = new(oldCreds.VotesUrl,
oldCreds.VotesToken,
string.Empty,
string.Empty),
BotListToken = oldCreds.BotListToken,
RedisOptions = oldCreds.RedisOptions,
LocationIqApiKey = oldCreds.LocationIqApiKey,
@@ -141,6 +144,17 @@ namespace NadekoBot.Services
Log.Warning("Data from credentials.json has been moved to creds.yml\nPlease inspect your creds.yml for correctness");
}
if (File.Exists(_credsFileName))
{
var creds = Yaml.Deserializer.Deserialize<Creds>(File.ReadAllText(_credsFileName));
if (creds.Version <= 1)
{
creds.Version = 2;
File.WriteAllText(_credsFileName, Yaml.Serializer.Serialize(creds));
}
}
}
public Creds GetCreds() => _creds;