From 3d01c9f798ceac5b58bcbabec721313eb7f1cd99 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 11 Jan 2023 18:27:43 +0100 Subject: [PATCH] Added max_message_xp_per_hour #168 --- kdb-bot/src/bot/config | 2 +- .../src/modules/base/configuration/base_server_settings.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kdb-bot/src/bot/config b/kdb-bot/src/bot/config index 28bd879d..54b1b386 160000 --- a/kdb-bot/src/bot/config +++ b/kdb-bot/src/bot/config @@ -1 +1 @@ -Subproject commit 28bd879dab2e5ea6ca8bb38e44c7786eb67cb7a2 +Subproject commit 54b1b3860cb570d29c8ba2590dd082a1fa744265 diff --git a/kdb-bot/src/modules/base/configuration/base_server_settings.py b/kdb-bot/src/modules/base/configuration/base_server_settings.py index b5838633..2c5acf5f 100644 --- a/kdb-bot/src/modules/base/configuration/base_server_settings.py +++ b/kdb-bot/src/modules/base/configuration/base_server_settings.py @@ -14,6 +14,7 @@ class BaseServerSettings(ConfigurationModelABC): self._max_voice_state_hours: int = 0 self._xp_per_message: int = 0 self._xp_per_reaction: int = 0 + self._max_message_xp_per_hour: int = 0 self._xp_per_ontime_hour: int = 0 self._afk_channel_ids: List[int] = List(int) self._afk_command_channel_id: int = 0 @@ -37,6 +38,10 @@ class BaseServerSettings(ConfigurationModelABC): def xp_per_reaction(self) -> int: return self._xp_per_reaction + @property + def max_message_xp_per_hour(self) -> int: + return self._max_message_xp_per_hour + @property def xp_per_ontime_hour(self) -> int: return self._xp_per_ontime_hour @@ -67,6 +72,7 @@ class BaseServerSettings(ConfigurationModelABC): self._max_voice_state_hours = int(settings['MaxVoiceStateHours']) self._xp_per_message = int(settings['XpPerMessage']) self._xp_per_reaction = int(settings['XpPerReaction']) + self._max_message_xp_per_hour = int(settings['MaxMessageXpPerHour']) self._xp_per_ontime_hour = int(settings['XpPerOntimeHour']) for index in settings['AFKChannelIds']: self._afk_channel_ids.append(int(index))