Fix synchronous async warning RestrictedConfig

This commit is contained in:
Daniel_I_Am 2020-08-24 22:23:00 +02:00
parent 95388d65e5
commit 18c7b2c961
No known key found for this signature in database
GPG Key ID: 80C428FCC9743E84
2 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ namespace ChaosBot.Discord.Modules.Admin
{ {
if ((key != null) && (value != null) ) if ((key != null) && (value != null) )
{ {
if(await RestrictedConfig.IsAllowed(key)) if(RestrictedConfig.IsAllowed(key))
{ {
using (ChaosbotContext dbContext = new ChaosbotContext()) using (ChaosbotContext dbContext = new ChaosbotContext())
{ {
@ -120,7 +120,7 @@ namespace ChaosBot.Discord.Modules.Admin
{ {
try try
{ {
if ((key != null) && (await RestrictedConfig.IsAllowed(key))) if ((key != null) && (RestrictedConfig.IsAllowed(key)))
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
EmbedBuilder embed = new EmbedBuilder(); EmbedBuilder embed = new EmbedBuilder();
@ -161,7 +161,7 @@ namespace ChaosBot.Discord.Modules.Admin
{ {
try try
{ {
if ((key != null) && (await RestrictedConfig.IsAllowed(key))) if ((key != null) && (RestrictedConfig.IsAllowed(key)))
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
EmbedBuilder embed = new EmbedBuilder(); EmbedBuilder embed = new EmbedBuilder();

View File

@ -14,7 +14,7 @@ namespace ChaosBot.Services
{ {
private static ILogger _logger = Program.Logger; private static ILogger _logger = Program.Logger;
public static async Task<Boolean> IsAllowed(string key) public static Boolean IsAllowed(string key)
{ {
// TODO: List populated from DB // TODO: List populated from DB
List<string> restrictedCfg = new List<string> {"Database:Host", "Database:Port", "Database:Name", "Database:User", "Database:Pass", "Bot:Version", "NLog", "WebServer", "Discord:Token"}; List<string> restrictedCfg = new List<string> {"Database:Host", "Database:Port", "Database:Name", "Database:User", "Database:Pass", "Bot:Version", "NLog", "WebServer", "Discord:Token"};