Merge branch '0.3.1' into #164

This commit is contained in:
Sven Heidemann 2023-01-12 07:12:04 +01:00
commit 053c190c78
5 changed files with 21 additions and 2 deletions

@ -1 +1 @@
Subproject commit 48c2683965611c9a96ebbb908f8dcb4d0d7d71f2 Subproject commit 6b25cc87fced30b5846505d95f20285a3e4d7adf

@ -1 +1 @@
Subproject commit e6faabbd8b9fe0dbd00533ea1647e7094ea8b19e Subproject commit 28bd879dab2e5ea6ca8bb38e44c7786eb67cb7a2

View File

@ -31,6 +31,8 @@ class StartupSettingsExtension(StartupExtensionABC):
configuration.add_json_file(f'config/appsettings.{environment.host_name}.json', optional=True) configuration.add_json_file(f'config/appsettings.{environment.host_name}.json', optional=True)
# load feature-flags # load feature-flags
configuration.add_json_file(f'config/feature-flags.json', optional=False) 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)) 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) self._configure_settings_with_sub_settings(configuration, BotSettings, lambda x: x.servers, lambda x: x.id)

View File

@ -116,5 +116,7 @@ class BaseOnVoiceStateUpdateEvent(OnVoiceStateUpdateABC):
else: else:
self._logger.trace(__name__, f'User {member.id} switched to {after.channel}') 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: except Exception as e:
self._logger.error(__name__, f'Cannot handle voice state for user {member.id}', e) self._logger.error(__name__, f'Cannot handle voice state for user {member.id}', e)

View File

@ -3,6 +3,7 @@ from cpl_core.logging import LoggerABC
from cpl_discord.service import DiscordBotServiceABC from cpl_discord.service import DiscordBotServiceABC
from discord import RawReactionActionEvent 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.server_repository_abc import ServerRepositoryABC
from bot_data.abc.user_repository_abc import UserRepositoryABC from bot_data.abc.user_repository_abc import UserRepositoryABC
from modules.base.abc.base_helper_abc import BaseHelperABC 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') self._logger.warn(__name__, f'User {payload.user_id} in {guild.name} not found - skipping')
return 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: if member.bot:
return return