From 93f55adf7b5e53dd1882fe565dc4bb2ad2a2c553 Mon Sep 17 00:00:00 2001 From: Sean Stoves Date: Thu, 6 Aug 2020 10:51:56 -0400 Subject: [PATCH] Adding Function to permit a restriction of configurations. --- ChaosBot/Services/RestrictedConfig.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ChaosBot/Services/RestrictedConfig.cs diff --git a/ChaosBot/Services/RestrictedConfig.cs b/ChaosBot/Services/RestrictedConfig.cs new file mode 100644 index 0000000..8457b45 --- /dev/null +++ b/ChaosBot/Services/RestrictedConfig.cs @@ -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 IsAllowed(string key) + { + List restrictedCfg = new List {"Database", "Bot", "NLog", "WebServer", "Discord:Token"}; + + if (restrictedCfg.Contains(key)) + return false; + + return true; + } + } +} \ No newline at end of file