Finish the addrole/removerole commands and surrounding functionality #24

Merged
cswimr merged 22 commits from addrole into main 2024-05-03 21:46:14 -04:00
Showing only changes of commit bcef643349 - Show all commits

View file

@ -117,7 +117,7 @@ class Aurora(commands.Cog):
async def addrole_on_member_join(self, member: discord.Member):
"""This method automatically adds roles to users when they join the server."""
if not await self.bot.cog_disabled_in_guild(self, member.guild):
query = f"""SELECT moderation_id, role_id, reason FROM moderation_{member.guild.id} WHERE target_id = ? AND action = 'ADDROLE' AND expired = 0 AND resolved = 0;"""
query = f"""SELECT moderation_id, role_id, reason FROM moderation_{member.guild.id} WHERE target_id = ? AND moderation_type = 'ADDROLE' AND expired = 0 AND resolved = 0;"""
database = connect()
cursor = database.cursor()
cursor.execute(query, (member.id,))