diff --git a/VERSION b/VERSION index 6a126f4..de28578 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.7.5 +1.7.6 diff --git a/helpers/main.py b/helpers/main.py index ef715c3..4fee921 100644 --- a/helpers/main.py +++ b/helpers/main.py @@ -1022,6 +1022,18 @@ async def legal_channel(ctx): return True +def app_legal_channel(): + """Check for slash commands (app_commands). Use as @app_legal_channel()""" + async def predicate(interaction: discord.Interaction) -> bool: + bad_channels = ['paper-dynasty-chat', 'pd-news-ticker', 'pd-network-news'] + if interaction.channel.name in bad_channels: + raise discord.app_commands.CheckFailure( + f'Slide on down to the {get_channel(interaction, "pd-bot-hole").mention} ;)' + ) + return True + return discord.app_commands.check(predicate) + + def is_ephemeral_channel(channel) -> bool: """Check if channel requires ephemeral responses (chat channels).""" if not channel or not hasattr(channel, 'name'):