;fwmsgs should ocne again dm the first bot owner, not a random one

This commit is contained in:
Kwoth 2017-04-10 03:14:52 +02:00
parent 4a3bb0f57e
commit a3bd89460b
3 changed files with 5 additions and 4 deletions

View File

@ -75,12 +75,13 @@ namespace NadekoBot.Services
}
})))
.Where(ch => ch != null)
.OrderBy(x => NadekoBot.Credentials.OwnerIds.IndexOf(x.Id))
.ToList();
if (!ownerChannels.Any())
_log.Warn("No owner channels created! Make sure you've specified correct OwnerId in the credentials.json file.");
else
_log.Info($"Created {ownerChannels.Count} out of {NadekoBot.Credentials.OwnerIds.Count} owner message channels.");
_log.Info($"Created {ownerChannels.Count} out of {NadekoBot.Credentials.OwnerIds.Length} owner message channels.");
});
_client.MessageReceived += MessageReceivedHandler;

View File

@ -10,7 +10,7 @@ namespace NadekoBot.Services
string Token { get; }
string GoogleApiKey { get; }
ImmutableHashSet<ulong> OwnerIds { get; }
ImmutableArray<ulong> OwnerIds { get; }
string MashapeKey { get; }
string LoLApiKey { get; }
string PatreonAccessToken { get; }

View File

@ -21,7 +21,7 @@ namespace NadekoBot.Services.Impl
public string Token { get; }
public ImmutableHashSet<ulong> OwnerIds { get; }
public ImmutableArray<ulong> OwnerIds { get; }
public string LoLApiKey { get; }
public string OsuApiKey { get; }
@ -62,7 +62,7 @@ namespace NadekoBot.Services.Impl
Token = data[nameof(Token)];
if (string.IsNullOrWhiteSpace(Token))
throw new ArgumentNullException(nameof(Token), "Token is missing from credentials.json or Environment varibles.");
OwnerIds = data.GetSection("OwnerIds").GetChildren().Select(c => ulong.Parse(c.Value)).ToImmutableHashSet();
OwnerIds = data.GetSection("OwnerIds").GetChildren().Select(c => ulong.Parse(c.Value)).ToImmutableArray();
LoLApiKey = data[nameof(LoLApiKey)];
GoogleApiKey = data[nameof(GoogleApiKey)];
MashapeKey = data[nameof(MashapeKey)];