fix logger giving out database error, and announce error as non ephemeral

This commit is contained in:
Philipp 2022-10-06 15:30:02 +02:00 committed by Gitea
parent eb263227fd
commit 64e4572e73
Signed by: Gitea
GPG Key ID: 5A09F9506519E10A
1 changed files with 2 additions and 2 deletions

View File

@ -91,8 +91,8 @@ def main(args):
logger.debug(f"{user.id} with SteamID: {steam_id.steam2(1)} has just claimed a reserved slot.")
except Exception as err:
if str(err) != "Duplicate entrys":
await ctx.send(f"Something failed with the database, please try again later.", ephemeral=True)
logger.warning(f"Error while trying to access database.", err)
await ctx.send(f"Something failed with the database, please try again later.")
logger.warning(f"Error while trying to access database. {err}")
return
await ctx.send(f"You have already claimed a reserved slot!", ephemeral=True)
logger.debug(f"{steam_id.steam2(1)} or User {user.username} ({user.id}) is already in the database.")