Add a check in case there are no custom permissions
This commit is contained in:
parent
82a26df045
commit
16b9dc36c7
|
@ -73,9 +73,10 @@ def custom_perms(**perms):
|
||||||
# Loop through and find this server's entry for custom permissions
|
# Loop through and find this server's entry for custom permissions
|
||||||
# Find the command we're using, if it exists, then overwrite
|
# Find the command we're using, if it exists, then overwrite
|
||||||
# The required permissions, based on the value saved
|
# The required permissions, based on the value saved
|
||||||
for x in perm_values:
|
if perm_values:
|
||||||
if x['server_id'] == ctx.message.server.id and x.get(ctx.command.qualified_name):
|
for x in perm_values:
|
||||||
required_perm = discord.Permissions(x[ctx.command.qualified_name])
|
if x['server_id'] == ctx.message.server.id and x.get(ctx.command.qualified_name):
|
||||||
|
required_perm = discord.Permissions(x[ctx.command.qualified_name])
|
||||||
|
|
||||||
# Now just check if the person running the command has these permissions
|
# Now just check if the person running the command has these permissions
|
||||||
return member_perms >= required_perm
|
return member_perms >= required_perm
|
||||||
|
|
Loading…
Reference in a new issue