fixed removing the new comer role

This commit is contained in:
jenz 2022-06-15 18:24:47 +02:00
parent 6aae70c0c9
commit 0270ffc1e3

View File

@ -286,9 +286,15 @@ async def verify_player(res_all_, steam_id2_, steam_account, member, discord_id,
if channel1.name == 'logs-discord-allowed':
await channel1.send(f"{steam_account}Was allowed into the discord server. Discord account ({discord_id}) is associated to an unloze forum account: https://unloze.com/members/.{res_user_id[0]}/\nName {member.name}. Descriminator ID: {member.discriminator}")
try:
await member.remove_roles("new-comer")
for role in member.roles:
if role.name == "new-comer":
await member.remove_roles(role)
break
except Exception:
pass
import traceback
error_msg = traceback.format_exc()
print("member name: ", member.name)
print("traceback happened: ", error_msg)
break
conn2.commit() #manual comitting should really not be needed. the context manager should handle that if this mysql package was properly made xd