diff --git a/kdb-bot/docker b/kdb-bot/docker index 48c26839..6b25cc87 160000 --- a/kdb-bot/docker +++ b/kdb-bot/docker @@ -1 +1 @@ -Subproject commit 48c2683965611c9a96ebbb908f8dcb4d0d7d71f2 +Subproject commit 6b25cc87fced30b5846505d95f20285a3e4d7adf diff --git a/kdb-bot/src/bot/config b/kdb-bot/src/bot/config index e6faabbd..28bd879d 160000 --- a/kdb-bot/src/bot/config +++ b/kdb-bot/src/bot/config @@ -1 +1 @@ -Subproject commit e6faabbd8b9fe0dbd00533ea1647e7094ea8b19e +Subproject commit 28bd879dab2e5ea6ca8bb38e44c7786eb67cb7a2 diff --git a/kdb-bot/src/bot/startup_settings_extension.py b/kdb-bot/src/bot/startup_settings_extension.py index 655ccd7b..71896c69 100644 --- a/kdb-bot/src/bot/startup_settings_extension.py +++ b/kdb-bot/src/bot/startup_settings_extension.py @@ -31,6 +31,8 @@ class StartupSettingsExtension(StartupExtensionABC): configuration.add_json_file(f'config/appsettings.{environment.host_name}.json', optional=True) # load feature-flags configuration.add_json_file(f'config/feature-flags.json', optional=False) + configuration.add_json_file(f'config/feature-flags.{environment.environment_name}.json', optional=True) + configuration.add_json_file(f'config/feature-flags.{environment.host_name}.json', optional=True) configuration.add_configuration('Startup_StartTime', str(self._start_time)) self._configure_settings_with_sub_settings(configuration, BotSettings, lambda x: x.servers, lambda x: x.id) diff --git a/kdb-bot/src/modules/base/events/base_on_voice_state_update_event.py b/kdb-bot/src/modules/base/events/base_on_voice_state_update_event.py index 176977a9..83794725 100644 --- a/kdb-bot/src/modules/base/events/base_on_voice_state_update_event.py +++ b/kdb-bot/src/modules/base/events/base_on_voice_state_update_event.py @@ -116,5 +116,7 @@ class BaseOnVoiceStateUpdateEvent(OnVoiceStateUpdateABC): else: self._logger.trace(__name__, f'User {member.id} switched to {after.channel}') + self._update_voice_state(False, member.id, before.channel.id, server) + self._update_voice_state(True, member.id, after.channel.id, server) except Exception as e: self._logger.error(__name__, f'Cannot handle voice state for user {member.id}', e) diff --git a/kdb-bot/src/modules/base/helper/base_reaction_handler.py b/kdb-bot/src/modules/base/helper/base_reaction_handler.py index eb75a54a..a5fd0099 100644 --- a/kdb-bot/src/modules/base/helper/base_reaction_handler.py +++ b/kdb-bot/src/modules/base/helper/base_reaction_handler.py @@ -3,6 +3,7 @@ from cpl_core.logging import LoggerABC from cpl_discord.service import DiscordBotServiceABC from discord import RawReactionActionEvent +from bot_core.helper.log_message_helper import LogMessageHelper from bot_data.abc.server_repository_abc import ServerRepositoryABC from bot_data.abc.user_repository_abc import UserRepositoryABC from modules.base.abc.base_helper_abc import BaseHelperABC @@ -36,6 +37,20 @@ class BaseReactionHandler: self._logger.warn(__name__, f'User {payload.user_id} in {guild.name} not found - skipping') return + try: + log_msg = f'{member.name} reacted' + if payload.emoji.name is not None: + log_msg += f' with {payload.emoji.name}' + try: + channel = guild.get_channel(payload.channel_id) + message = await channel.fetch_message(payload.message_id) + self._logger.info(__name__, f'{log_msg} to message {LogMessageHelper.get_log_string(message)}') + except Exception as e: + self._logger.error(__name__, f'Getting message for reaction logging failed', e) + self._logger.info(__name__, f'{log_msg} to message {payload.message_id}') + except Exception as e: + self._logger.error(__name__, f'Reaction logging failed', e) + if member.bot: return