From c7d85081738d0afa035be0ad2ceb11fb34ca1647 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 30 Dec 2022 11:34:47 +0100 Subject: [PATCH] Fixed user info command #152 --- kdb-bot/src/modules/base/command/user_group.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kdb-bot/src/modules/base/command/user_group.py b/kdb-bot/src/modules/base/command/user_group.py index 66a9eeff..a9c92eac 100644 --- a/kdb-bot/src/modules/base/command/user_group.py +++ b/kdb-bot/src/modules/base/command/user_group.py @@ -96,8 +96,9 @@ class UserGroup(DiscordCommandABC): color=int('ef9d0d', 16) ) - ontime = 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)) + ontime = self._user_joined_voice_channel.get_user_joined_voice_channels_by_user_id(user.user_id)\ + .where(lambda x: x is not None)\ + .sum(lambda join: round((join.leaved_on - join.joined_on).total_seconds() / 3600, 2)) embed.add_field(name=self._t.transform('modules.base.user.atr.id'), value=member.id) embed.add_field(name=self._t.transform('modules.base.user.atr.name'), value=member.name)