1
0
Fork 0
mirror of https://code.lenaisten.de/Lenaisten/lenaverse-bot.git synced 2024-11-22 06:53:00 +00:00

allow public/persistent posts in DM channels

This commit is contained in:
Jörn-Michael Miehe 2023-12-02 18:18:35 +01:00
parent 485168d13f
commit 4be2eaff1f

View file

@ -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