From 31464df3f606fe600df3180fd0e084a097cd9074 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 11 Dec 2022 19:26:48 +0100 Subject: [PATCH] Fixed ontime rounding #21 --- kdb-bot/src/modules/base/command/user_group.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kdb-bot/src/modules/base/command/user_group.py b/kdb-bot/src/modules/base/command/user_group.py index b3866bf5..077a32d3 100644 --- a/kdb-bot/src/modules/base/command/user_group.py +++ b/kdb-bot/src/modules/base/command/user_group.py @@ -148,10 +148,11 @@ class UserGroup(DiscordCommandABC): value = str(user.xp) case 'ontime': - value = str( + value = str(round( self._user_joined_voice_channel.get_user_joined_voice_channels_by_user_id(user.user_id) - .sum(lambda join: round((join.leaved_on - join.joined_on).total_seconds() / 3600, 2)) - ) + .sum(lambda join: (join.leaved_on - join.joined_on).total_seconds() / 3600), + 2 + )) case other: await self._message_service.send_interaction_msg(ctx.interaction, self._t.transform('modules.base.user.get.atr_not_found').format(atr))