Permissions Code altered and fixed for Role usage.
This commit is contained in:
parent
3349c64f37
commit
5ba1da7d09
@ -45,6 +45,13 @@ namespace ChaosBot.Discord.PreConditions
|
||||
// If it's a role, check the configuration for the role otherwise return the permission value
|
||||
requiredGroup = ConfigurationRepository.GetValue<ulong>($"Role:{perm.TargetId}", context.Guild.Id, perm.TargetId);
|
||||
}
|
||||
else if (perm.TargetType == (int) PermissionTarget.User)
|
||||
{
|
||||
if(context.User.Id == perm.TargetId)
|
||||
return Task.FromResult(PreconditionResult.FromSuccess());
|
||||
|
||||
return Task.FromResult(PreconditionResult.FromError($"You do not have access to this command."));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Return the permission value
|
||||
|
||||
Loading…
Reference in New Issue
Block a user