Fixed is_message_xp_count_by_hour_higher_that_max_message_count_per_hour #168

This commit is contained in:
Sven Heidemann 2023-01-13 22:27:05 +01:00
parent 1ff70af72b
commit d91ff392ca

View File

@ -1,6 +1,7 @@
from typing import Callable from typing import Callable
import discord import discord
from bot_data.abc.user_joined_voice_channel_abc import UserJoinedVoiceChannelRepositoryABC
from cpl_core.configuration import ConfigurationABC from cpl_core.configuration import ConfigurationABC
from cpl_core.database.context import DatabaseContextABC from cpl_core.database.context import DatabaseContextABC
from cpl_core.logging import LoggerABC from cpl_core.logging import LoggerABC
@ -20,8 +21,6 @@ from bot_data.abc.user_message_count_per_hour_repository_abc import UserMessageC
from bot_data.model.user import User from bot_data.model.user import User
from bot_data.model.user_message_count_per_hour import UserMessageCountPerHour from bot_data.model.user_message_count_per_hour import UserMessageCountPerHour
from modules.base.configuration.base_server_settings import BaseServerSettings from modules.base.configuration.base_server_settings import BaseServerSettings
from bot_data.abc.user_joined_voice_channel_abc import UserJoinedVoiceChannelRepositoryABC
from bot_data.model.user import User
class ClientUtilsService(ClientUtilsABC): class ClientUtilsService(ClientUtilsABC):
@ -156,7 +155,7 @@ class ClientUtilsService(ClientUtilsABC):
if is_reaction: if is_reaction:
umcph.xp_count += settings.xp_per_reaction umcph.xp_count += settings.xp_per_reaction
else: else:
umcph.xp_count += settings.xp_per_reaction umcph.xp_count += settings.xp_per_message
self._umcphs.update_user_message_count_per_hour(umcph) self._umcphs.update_user_message_count_per_hour(umcph)
self._db.save_changes() self._db.save_changes()