From 304fffa29c723a588c2f6d4a26a217d0cd0d96fc Mon Sep 17 00:00:00 2001 From: jenz Date: Sun, 22 May 2022 14:41:29 +0200 Subject: [PATCH] updates so the verification goes through once 200 hours reached --- discord_verificiation/python/discord_verification.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/discord_verificiation/python/discord_verification.py b/discord_verificiation/python/discord_verification.py index 41924e2c..a6fcf3c4 100644 --- a/discord_verificiation/python/discord_verification.py +++ b/discord_verificiation/python/discord_verification.py @@ -137,16 +137,21 @@ async def check_person_to_allow(): jb_time = (jb_time / 60) / 60 total_time = ze_time + mg_time + zr_time + jb_time if total_time > 200.0: + print('member over 200 hours: ', member.name) sql_statement = """ update unloze_playtimestats.player_time set discord_allowed = 1 where steam_id = %s """ - cur.execute(sql_statement, [steam_id2]) + cur2.execute(sql_statement, [steam_id2]) for channel1 in d.get_all_channels(): if channel1.name == 'logs-discord-allowed': await channel1.send(f"Allowed SteamID {steam_id2} into the discord server using the discord ID: {discord_id} and name {member.name}. Descriminator ID: {member.discriminator}") - member.remove_roles("new-comer") + try: + await member.remove_roles("new-comer") + except Exception: + pass break + conn2.commit() #manual comitting should really not be needed. the context manager should handle that if this mysql package was properly made xd def main(): check_person_to_allow.start()