Set Server Owner to have permission for all commands.
This commit is contained in:
parent
80f6cf0803
commit
ddce0a9504
@ -16,6 +16,11 @@ public class RequireRole : PreconditionAttribute
|
||||
{
|
||||
if (context.User is SocketGuildUser gUser)
|
||||
{
|
||||
/*
|
||||
* Owner has access to all commands
|
||||
*/
|
||||
if(context.Guild.OwnerId == context.User.Id) return Task.FromResult(PreconditionResult.FromSuccess());
|
||||
|
||||
var requiredGroup = (ConfigurationRepository.GetValue<string>($"Role:{_role}", context.Guild.Id) != null) ? ConfigurationRepository.GetValue<string>($"Role:{_role}", context.Guild.Id) : _role;
|
||||
|
||||
if (gUser.Roles.Any(r => r.Name == requiredGroup))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user