diff --git a/.nicegui/storage-user-83ffc178-0f94-4ada-8ca6-1c51b99b4b9c.json b/.nicegui/storage-user-83ffc178-0f94-4ada-8ca6-1c51b99b4b9c.json index 8c7f079..567972a 100644 --- a/.nicegui/storage-user-83ffc178-0f94-4ada-8ca6-1c51b99b4b9c.json +++ b/.nicegui/storage-user-83ffc178-0f94-4ada-8ca6-1c51b99b4b9c.json @@ -1 +1 @@ -{"authenticated":true,"discord_id":"277898241750859776","discord_name":"mrteels","db_id":2,"display_name":"Zorniger Grot","discord_avatar_url":"https://cdn.discordapp.com/avatars/277898241750859776/7c3446bb51fafd72b1b4c21124b4994f.png"} \ No newline at end of file +{"authenticated":true,"discord_id":"277898241750859776","discord_name":"mrteels","db_id":2,"display_name":"Zornir Grot","discord_avatar_url":"https://cdn.discordapp.com/avatars/277898241750859776/7c3446bb51fafd72b1b4c21124b4994f.png"} \ No newline at end of file diff --git a/gui/main_gui.py b/gui/main_gui.py index 9c2be64..0617e93 100644 --- a/gui/main_gui.py +++ b/gui/main_gui.py @@ -45,10 +45,12 @@ def setup_routes(): edit_row.visible = False # Am Anfang verstecken def save_new_name(): + new_name = name_input.value # Nur speichern, wenn ein Name drinsteht und er anders ist als vorher if new_name and new_name != display_name: - data_api.change_display_name(db_id, new_name) # Deine DB Funktion + print("save") + data_api.change_display_name(player_id, new_name) # Deine DB Funktion app.storage.user['display_name'] = new_name ui.notify('Name gespeichert!', color='positive') ui.navigate.reload() diff --git a/main.py b/main.py index 2f7002a..8f489fd 100644 --- a/main.py +++ b/main.py @@ -11,8 +11,7 @@ from data import database load_dotenv() database.check_db() -# ----------------------- - +# ---------------------- # 2. Variablen abrufen client_id = os.getenv("DISCORD_CLIENT_ID")