diff --git a/cogs/moderation.py b/cogs/moderation.py index 0c6a599a..3a854397 100644 --- a/cogs/moderation.py +++ b/cogs/moderation.py @@ -41,9 +41,10 @@ async def ummute_members(message, targets, reason): result = await cur.fetchone() role_ids = result[4] - roles = [message.guild.get_role(int(id_)) for id_ in role_ids.split(", ") if len(id_)] + roles = [message.guild.get_role(int(id_)) for id_ in role_ids.split(", ") if len(id_)] + + await clearRoles(ctx=message, member=target, pool=pool) - await clearRoles(ctx=message, member=target) await target.edit(roles=roles) # Send confirmation to the channel that the user is in diff --git a/settings.py b/settings.py index fa7f657e..2979e9e3 100644 --- a/settings.py +++ b/settings.py @@ -258,12 +258,9 @@ async def storeRoles(target, ctx, member): print(cur.rowcount, f"{len(role_ids)} Roles Added For User {member} in {ctx.guild.name}") -async def clearRoles(ctx, member): +async def clearRoles(ctx, member, pool): """Clear the roles when the user has been unmuted""" - # Setup pool - pool = await connection(db.loop) - # Setup up pool connection and cursor async with pool.acquire() as conn: async with conn.cursor() as cur: