Ontime berechnung zentralisieren #166 #172

Merged
edraft merged 5 commits from #166 into 0.3.1 2023-01-13 22:14:58 +01:00
Showing only changes of commit 34ebb48c83 - Show all commits

View File

@ -9,7 +9,6 @@ from cpl_translation import TranslatePipe
from discord import app_commands
from discord.ext import commands
from discord.ext.commands import Context
from mysql.connector.errors import DatabaseError
from bot_core.abc.client_utils_service_abc import ClientUtilsServiceABC
from bot_core.abc.message_service_abc import MessageServiceABC
@ -159,11 +158,7 @@ class UserGroup(DiscordCommandABC):
value = str(user.xp)
elif atr == 'ontime':
value = str(round(
self._user_joined_voice_channel.get_user_joined_voice_channels_by_user_id(user.user_id)
.sum(lambda join: (join.leaved_on - join.joined_on).total_seconds() / 3600),
2
))
value = str(self._client_utils.get_ontime_for_user(user))
else:
await self._message_service.send_interaction_msg(