Removing ctx parameter for clearRoles()

pull/8/head
sgoudham 4 years ago
parent 08576fc9e7
commit 2f2c8198ee

@ -95,7 +95,7 @@ async def ummute_members(self, 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_)]
# Clear all the roles of the user # Clear all the roles of the user
await clearRoles(ctx=message, member=target, pool=pool) await clearRoles(member=target, pool=pool)
await target.edit(roles=roles) await target.edit(roles=roles)

@ -246,7 +246,7 @@ async def storeRoles(pool, target, ctx, member):
print(cur.rowcount, f"Roles Added For User {member} in {ctx.guild.name}") print(cur.rowcount, f"Roles Added For User {member} in {ctx.guild.name}")
async def clearRoles(ctx, member, pool): async def clearRoles(member, pool):
"""Clear the roles when the user has been unmuted""" """Clear the roles when the user has been unmuted"""
# Setup up pool connection and cursor # Setup up pool connection and cursor
@ -254,11 +254,11 @@ async def clearRoles(ctx, member, pool):
async with conn.cursor() as cur: async with conn.cursor() as cur:
# Clear the existing roles of the user from the database # Clear the existing roles of the user from the database
update_query = """UPDATE members SET mutedroles = NULL WHERE guildID = (%s) AND discordID = (%s)""" update_query = """UPDATE members SET mutedroles = NULL WHERE guildID = (%s) AND discordID = (%s)"""
update_vals = ctx.guild.id, member.id update_vals = member.guild.id, member.id
# Execute the query # Execute the query
await cur.execute(update_query, update_vals) await cur.execute(update_query, update_vals)
await conn.commit() await conn.commit()
print(cur.rowcount, f"Roles Cleared For User {member} in {ctx.guild.name}") print(cur.rowcount, f"Roles Cleared For User {member} in {member.guild.name}")
# --------------------------------------------!End Cogs/Set Values Section!--------------------------------------------- # --------------------------------------------!End Cogs/Set Values Section!---------------------------------------------

Loading…
Cancel
Save