Fixed ontime rounding #21

This commit is contained in:
Sven Heidemann 2022-12-11 19:26:48 +01:00
parent fdd8357729
commit 31464df3f6

View File

@ -148,10 +148,11 @@ class UserGroup(DiscordCommandABC):
value = str(user.xp) value = str(user.xp)
case 'ontime': case 'ontime':
value = str( value = str(round(
self._user_joined_voice_channel.get_user_joined_voice_channels_by_user_id(user.user_id) 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: case other:
await self._message_service.send_interaction_msg(ctx.interaction, self._t.transform('modules.base.user.get.atr_not_found').format(atr)) await self._message_service.send_interaction_msg(ctx.interaction, self._t.transform('modules.base.user.get.atr_not_found').format(atr))