Made sure connection within connection isn't created

pull/8/head
sgoudham 4 years ago
parent b21f7e9a56
commit da65bf75e0

@ -43,7 +43,8 @@ async def ummute_members(message, targets, reason):
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) await clearRoles(ctx=message, member=target, pool=pool)
await target.edit(roles=roles) await target.edit(roles=roles)
# Send confirmation to the channel that the user is in # Send confirmation to the channel that the user is in

@ -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}") 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""" """Clear the roles when the user has been unmuted"""
# Setup pool
pool = await connection(db.loop)
# Setup up pool connection and cursor # Setup up pool connection and cursor
async with pool.acquire() as conn: async with pool.acquire() as conn:
async with conn.cursor() as cur: async with conn.cursor() as cur:

Loading…
Cancel
Save