Quick updates:

- Set default language for admins when running the db patch
    - Updating addaccess command.
    - Update levels for some commands in mod_command.
This commit is contained in:
adator
2025-08-30 23:09:03 +02:00
parent b306968115
commit e79c15188e
5 changed files with 78 additions and 54 deletions

View File

@@ -201,3 +201,22 @@ class Admin:
return True
return False
def db_is_admin_exist(self, admin_nickname: str) -> bool:
"""Verify if the admin exist in the database!
Args:
admin_nickname (str): The nickname admin to check.
Returns:
bool: True if the admin exist otherwise False.
"""
mes_donnees = {'admin': admin_nickname}
query_search_user = f"SELECT id FROM {self.Config.TABLE_ADMIN} WHERE user = :admin"
r = self.Base.db_execute_query(query_search_user, mes_donnees)
exist_user = r.fetchone()
if exist_user:
return True
else:
return False