diff --git a/lenaverse_bot/core/verein.py b/lenaverse_bot/core/verein.py index 6a6f282..d750eaf 100644 --- a/lenaverse_bot/core/verein.py +++ b/lenaverse_bot/core/verein.py @@ -10,7 +10,15 @@ _logger = logging.getLogger(__name__) def reply_private(interaction: discord.Interaction, name: str) -> bool: _logger.debug(f"User {interaction.user.name}({interaction.user.id}) used /{name}") - return interaction.channel_id not in CONFIG.ev_info.channels + + # öffentliche Antwort in DM channels und in "allowed" channels + in_dm_channel = interaction.channel is not None and isinstance( + interaction.channel, discord.DMChannel + ) + in_allowed_channel = interaction.channel_id in CONFIG.ev_info.channels + + # private Antwort sonst + return not (in_dm_channel or in_allowed_channel) @functools.singledispatch