Adding Function to permit a restriction of configurations.
This commit is contained in:
parent
7a18e4a14b
commit
93f55adf7b
27
ChaosBot/Services/RestrictedConfig.cs
Normal file
27
ChaosBot/Services/RestrictedConfig.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using ChaosBot.Models;
|
||||
using ChaosBot.Repositories;
|
||||
using Discord.Commands;
|
||||
using Discord.WebSocket;
|
||||
using NLog;
|
||||
|
||||
namespace ChaosBot.Services
|
||||
{
|
||||
public class RestrictedConfig
|
||||
{
|
||||
private static ILogger _logger = Program.Logger;
|
||||
|
||||
public static async Task<Boolean> IsAllowed(string key)
|
||||
{
|
||||
List<string> restrictedCfg = new List<string> {"Database", "Bot", "NLog", "WebServer", "Discord:Token"};
|
||||
|
||||
if (restrictedCfg.Contains(key))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user