stage for merge

This commit is contained in:
appelemac 2016-08-22 12:01:08 +02:00
parent 1b7927e8da
commit bdd9aef7ac

View File

@ -24,10 +24,11 @@ namespace NadekoBot.Services.Impl
public ulong[] OwnerIds { get; } public ulong[] OwnerIds { get; }
public string LoLApiKey { get; } public string LoLApiKey { get; }
public string OsuApiKey { get; }
public string SoundCloudClientId { get; }
public BotCredentials() public BotCredentials()
{ {
File.WriteAllText("./credentials_example.json", JsonConvert.SerializeObject(new CredentialsModel(), Formatting.Indented));
_log = LogManager.GetCurrentClassLogger(); _log = LogManager.GetCurrentClassLogger();
if (File.Exists("./credentials.json")) if (File.Exists("./credentials.json"))
{ {
@ -37,17 +38,22 @@ namespace NadekoBot.Services.Impl
LoLApiKey = cm.LoLApiKey; LoLApiKey = cm.LoLApiKey;
GoogleApiKey = cm.GoogleApiKey; GoogleApiKey = cm.GoogleApiKey;
MashapeKey = cm.MashapeKey; MashapeKey = cm.MashapeKey;
OsuApiKey = cm.OsuApiKey;
SoundCloudClientId = cm.SoundCloudClientId;
} }
else else
_log.Fatal("credentials.json is missing. Failed to start."); _log.Fatal("credentials.json is missing. Failed to start.");
} }
private class CredentialsModel { private class CredentialsModel
{
public string Token { get; set; } public string Token { get; set; }
public ulong[] OwnerIds { get; set; } public ulong[] OwnerIds { get; set; }
public string LoLApiKey { get; set; } public string LoLApiKey { get; set; }
public string GoogleApiKey { get; set; } public string GoogleApiKey { get; set; }
public string MashapeKey { get; set; } public string MashapeKey { get; set; }
public string OsuApiKey { get; set; }
public string SoundCloudClientId { get; set; }
} }
public bool IsOwner(IUser u) => OwnerIds.Contains(u.Id); public bool IsOwner(IUser u) => OwnerIds.Contains(u.Id);