From 18c7b2c96191ff70dbc1803169311150b3baea82 Mon Sep 17 00:00:00 2001 From: Daniel-I-Am Date: Mon, 24 Aug 2020 22:23:00 +0200 Subject: [PATCH] Fix synchronous async warning RestrictedConfig --- ChaosBot/Discord/Modules/Admin/Config.cs | 6 +++--- ChaosBot/Services/RestrictedConfig.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ChaosBot/Discord/Modules/Admin/Config.cs b/ChaosBot/Discord/Modules/Admin/Config.cs index bdd4dc6..2a12cc9 100644 --- a/ChaosBot/Discord/Modules/Admin/Config.cs +++ b/ChaosBot/Discord/Modules/Admin/Config.cs @@ -86,7 +86,7 @@ namespace ChaosBot.Discord.Modules.Admin { if ((key != null) && (value != null) ) { - if(await RestrictedConfig.IsAllowed(key)) + if(RestrictedConfig.IsAllowed(key)) { using (ChaosbotContext dbContext = new ChaosbotContext()) { @@ -120,7 +120,7 @@ namespace ChaosBot.Discord.Modules.Admin { try { - if ((key != null) && (await RestrictedConfig.IsAllowed(key))) + if ((key != null) && (RestrictedConfig.IsAllowed(key))) { StringBuilder sb = new StringBuilder(); EmbedBuilder embed = new EmbedBuilder(); @@ -161,7 +161,7 @@ namespace ChaosBot.Discord.Modules.Admin { try { - if ((key != null) && (await RestrictedConfig.IsAllowed(key))) + if ((key != null) && (RestrictedConfig.IsAllowed(key))) { StringBuilder sb = new StringBuilder(); EmbedBuilder embed = new EmbedBuilder(); diff --git a/ChaosBot/Services/RestrictedConfig.cs b/ChaosBot/Services/RestrictedConfig.cs index d3a2c91..90d5d5f 100644 --- a/ChaosBot/Services/RestrictedConfig.cs +++ b/ChaosBot/Services/RestrictedConfig.cs @@ -14,7 +14,7 @@ namespace ChaosBot.Services { private static ILogger _logger = Program.Logger; - public static async Task IsAllowed(string key) + public static Boolean IsAllowed(string key) { // TODO: List populated from DB List restrictedCfg = new List {"Database:Host", "Database:Port", "Database:Name", "Database:User", "Database:Pass", "Bot:Version", "NLog", "WebServer", "Discord:Token"};