diff --git a/bot/src/modules/base/events/base_on_voice_state_update_event.py b/bot/src/modules/base/events/base_on_voice_state_update_event.py index 7d8a2896..32036120 100644 --- a/bot/src/modules/base/events/base_on_voice_state_update_event.py +++ b/bot/src/modules/base/events/base_on_voice_state_update_event.py @@ -58,14 +58,22 @@ class BaseOnVoiceStateUpdateEvent(OnVoiceStateUpdateABC): return try: + settings: ServerConfig = self._config.get_configuration(f"ServerConfig_{server.discord_id}") + if joined: + active_joins = self._user_joins_vc.find_active_user_joined_voice_channels_by_user_id(user.id) + for join in active_joins: + join.leaved_on = datetime.now() + user.xp += round(join.time * settings.xp_per_ontime_hour) + self._user_joins_vc.update_user_joined_voice_channel(join) + self._users.update_user(user) + self._db.save_changes() + join = UserJoinedVoiceChannel(user, channel_id, datetime.now()) self._user_joins_vc.add_user_joined_voice_channel(join) self._db.save_changes() return - settings: ServerConfig = self._config.get_configuration(f"ServerConfig_{server.discord_id}") - join = self._user_joins_vc.get_active_user_joined_voice_channel_by_user_id(user.id) join.leaved_on = datetime.now() diff --git a/web/src/app/modules/view/server/profile/profile.component.html b/web/src/app/modules/view/server/profile/profile.component.html index 43cca8b0..7feb406d 100644 --- a/web/src/app/modules/view/server/profile/profile.component.html +++ b/web/src/app/modules/view/server/profile/profile.component.html @@ -31,7 +31,9 @@
{{'view.server.profile.xp' | translate}}:
{{user.xp}}
-
+
@@ -71,7 +73,8 @@
{{'view.server.profile.level' | translate}}:
{{user.level?.name}}
- +
@@ -100,7 +103,8 @@
- +
@@ -178,10 +182,13 @@
- + - - +
@@ -215,16 +222,22 @@
-
-
+
+
{{'common.id' | translate}}:
+
{{join.id}}
+
+ +
{{'view.server.profile.joined_voice_channel.time' | translate}}:
{{join.time}} {{'general.hours' | translate}}
-
+
{{'view.server.profile.joined_voice_channel.channel' | translate}}:
{{join.channelName}}
@@ -242,7 +255,8 @@
-
diff --git a/web/src/styles.scss b/web/src/styles.scss index 8800861f..8656a5b0 100644 --- a/web/src/styles.scss +++ b/web/src/styles.scss @@ -176,15 +176,16 @@ header { flex-direction: row; flex: 1; margin: 5px 0; + gap: 5px; .content-column { display: flex; flex: 1; + gap: 5px; } .content-data-name { display: flex; - flex: 1; align-items: center; font-size: 18px; @@ -192,7 +193,6 @@ header { .content-data-value { display: flex; - flex: 1; align-items: center; font-size: 18px;