Augmenting code to use isAllowed
This commit is contained in:
parent
93f55adf7b
commit
f1577ba5b7
@ -6,6 +6,7 @@ using System.Text;
|
||||
using ChaosBot.Discord.PreConditions;
|
||||
using ChaosBot.Models;
|
||||
using ChaosBot.Repositories;
|
||||
using ChaosBot.Services;
|
||||
using Discord;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
@ -79,6 +80,8 @@ namespace ChaosBot.Discord.Modules.Admin
|
||||
try
|
||||
{
|
||||
if ((key != null) && (value != null) )
|
||||
{
|
||||
if(await RestrictedConfig.IsAllowed(key))
|
||||
{
|
||||
using (ChaosbotContext dbContext = new ChaosbotContext())
|
||||
{
|
||||
@ -94,6 +97,7 @@ namespace ChaosBot.Discord.Modules.Admin
|
||||
await ConfigGet(key, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await ConfigHelp();
|
||||
@ -111,7 +115,7 @@ namespace ChaosBot.Discord.Modules.Admin
|
||||
{
|
||||
try
|
||||
{
|
||||
if (key != null)
|
||||
if ((key != null) && (await RestrictedConfig.IsAllowed(key)))
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
EmbedBuilder embed = new EmbedBuilder();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user