a bit faster OwnerOnly checking
This commit is contained in:
		@@ -1,4 +1,6 @@
 | 
			
		||||
using Discord;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Collections.Immutable;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Services
 | 
			
		||||
{
 | 
			
		||||
@@ -9,7 +11,7 @@ namespace NadekoBot.Services
 | 
			
		||||
 | 
			
		||||
        string Token { get; }
 | 
			
		||||
        string GoogleApiKey { get; }
 | 
			
		||||
        ulong[] OwnerIds { get; }
 | 
			
		||||
        ImmutableHashSet<ulong> OwnerIds { get; }
 | 
			
		||||
        string MashapeKey { get; }
 | 
			
		||||
        string LoLApiKey { get; }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,8 @@ using Discord;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using NLog;
 | 
			
		||||
using Microsoft.Extensions.Configuration;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Collections.Immutable;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Services.Impl
 | 
			
		||||
{
 | 
			
		||||
@@ -21,7 +23,7 @@ namespace NadekoBot.Services.Impl
 | 
			
		||||
 | 
			
		||||
        public string Token { get; }
 | 
			
		||||
 | 
			
		||||
        public ulong[] OwnerIds { get; }
 | 
			
		||||
        public ImmutableHashSet<ulong> OwnerIds { get; }
 | 
			
		||||
 | 
			
		||||
        public string LoLApiKey { get; }
 | 
			
		||||
        public string OsuApiKey { get; }
 | 
			
		||||
@@ -61,7 +63,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)).ToArray();
 | 
			
		||||
                OwnerIds = data.GetSection("OwnerIds").GetChildren().Select(c => ulong.Parse(c.Value)).ToImmutableHashSet();
 | 
			
		||||
                LoLApiKey = data[nameof(LoLApiKey)];
 | 
			
		||||
                GoogleApiKey = data[nameof(GoogleApiKey)];
 | 
			
		||||
                MashapeKey = data[nameof(MashapeKey)];
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user