mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
[Utils] Handle empty permissions, more checks (#387)
This commit is contained in:
parent
310e3af009
commit
8b7ba988f4
@ -28,6 +28,8 @@ def is_owner():
|
|||||||
def check_permissions(ctx, perms):
|
def check_permissions(ctx, perms):
|
||||||
if is_owner_check(ctx):
|
if is_owner_check(ctx):
|
||||||
return True
|
return True
|
||||||
|
elif not perms:
|
||||||
|
return False
|
||||||
|
|
||||||
ch = ctx.message.channel
|
ch = ctx.message.channel
|
||||||
author = ctx.message.author
|
author = ctx.message.author
|
||||||
@ -75,3 +77,12 @@ def serverowner_or_permissions(**perms):
|
|||||||
|
|
||||||
return check_permissions(ctx,perms)
|
return check_permissions(ctx,perms)
|
||||||
return commands.check(predicate)
|
return commands.check(predicate)
|
||||||
|
|
||||||
|
def serverowner():
|
||||||
|
return serverowner_or_permissions()
|
||||||
|
|
||||||
|
def admin():
|
||||||
|
return admin_or_permissions()
|
||||||
|
|
||||||
|
def mod():
|
||||||
|
return mod_or_permissions()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user