mirror of
https://code.lenaisten.de/Lenaisten/lenaverse-bot.git
synced 2024-11-22 15:03:01 +00:00
allow public/persistent posts in DM channels
This commit is contained in:
parent
485168d13f
commit
4be2eaff1f
1 changed files with 9 additions and 1 deletions
|
@ -10,7 +10,15 @@ _logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
def reply_private(interaction: discord.Interaction, name: str) -> bool:
|
def reply_private(interaction: discord.Interaction, name: str) -> bool:
|
||||||
_logger.debug(f"User {interaction.user.name}({interaction.user.id}) used /{name}")
|
_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
|
@functools.singledispatch
|
||||||
|
|
Loading…
Reference in a new issue