mirror of
https://github.com/AsgardEternal/DiscordWhitelist.git
synced 2024-12-28 21:19:14 -06:00
fixes
This commit is contained in:
parent
6c120f8782
commit
3b776fc972
@ -27,14 +27,17 @@ class Group(commands.Cog, name="group"):
|
||||
membsup = []
|
||||
for memb in role.members:
|
||||
membsup.append(memb.id)
|
||||
memupcur = self.client.squadjs.cursor(buffered=True)
|
||||
in_params = ','.join(['%s'] * len(membsup))
|
||||
sqlstate = "SELECT * FROM DBLog_SteamUsers WHERE discordID IN (%s)" % in_params
|
||||
memupcur.execute(sqlstate, membsup)
|
||||
if len(membsup) > 0:
|
||||
memupcur = self.client.squadjs.cursor(buffered=True)
|
||||
in_params = ','.join(['%s'] * len(membsup))
|
||||
sqlstate = "SELECT * FROM DBLog_SteamUsers WHERE discordID IN (%s)" % in_params
|
||||
log.info(sqlstate)
|
||||
memupcur.execute(sqlstate, membsup)
|
||||
|
||||
udata = memupcur.fetchall()
|
||||
for data in udata:
|
||||
self.client.whitelistGrps[role.id].addMember(config.WhitelistMember(data[2], data[1], data[0]))
|
||||
|
||||
udata = memupcur.fetchall()
|
||||
for data in udata:
|
||||
self.client.whitelistGrps[role.id].addMember(config.WhitelistMember(data[2], data[1], data[0]))
|
||||
await interaction.response.send_message("Whitelist group successfully added/updated")
|
||||
self.client.squadjs.commit()
|
||||
|
||||
|
@ -75,7 +75,7 @@ class Bot(commands.Bot):
|
||||
rmroles.remove(aftrole.id)
|
||||
log.info(f"roles found to remove from {disusername}: {rmroles}")
|
||||
for rmroleid in rmroles:
|
||||
if not rmroleid in self.whitelistGrps.keys():
|
||||
if not(rmroleid in self.whitelistGrps.keys()):
|
||||
continue
|
||||
self.whitelistGrps[rmroleid].delMember(before.id)
|
||||
|
||||
@ -88,7 +88,7 @@ class Bot(commands.Bot):
|
||||
addroles.remove(befrole.id)
|
||||
log.info(f"roles found to add to {disusername}: {addroles}")
|
||||
for addroleid in addroles:
|
||||
if not addroleid in self.whitelistGrps.keys():
|
||||
if not(addroleid in self.whitelistGrps.keys()):
|
||||
continue
|
||||
self.whitelistGrps[addroleid].addMember(config.WhitelistMember(after.id, disusername, userdata[0]))
|
||||
self.squadjs.commit()
|
||||
|
Loading…
Reference in New Issue
Block a user