Fixed bug in is_moderator and is_admin
This commit is contained in:
parent
a3b5f6bb31
commit
090ba646c9
@ -14,11 +14,10 @@ def is_moderator():
|
||||
async def predicate(ctx):
|
||||
resp = await ctx.bot.aio_session.get(f'{ctx.bot.api_base}/guilds/{ctx.guild.id}/roles/moderator/',
|
||||
headers=ctx.bot.auth_header)
|
||||
checks_logger.info(await resp.json())
|
||||
if resp.status == 200:
|
||||
mod_roles = await resp.json()
|
||||
for role in mod_roles:
|
||||
if discord.utils.get(ctx.author.roles, id=role["id"]):
|
||||
if discord.utils.get(ctx.author.roles, id=int(role["id"])):
|
||||
return True
|
||||
return False
|
||||
return discord.ext.commands.check(predicate)
|
||||
@ -31,7 +30,7 @@ def is_admin():
|
||||
if resp.status == 200:
|
||||
admin_roles = await resp.json()
|
||||
for role in admin_roles:
|
||||
if discord.utils.get(ctx.author.roles, id=role["id"]):
|
||||
if discord.utils.get(ctx.author.roles, id=int(role["id"])):
|
||||
return True
|
||||
return False
|
||||
return discord.ext.commands.check(predicate)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user