From 7bb191dbf42b95299153af0ce6b7ab77d0acfbc3 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Mon, 17 Nov 2025 09:23:10 -0600 Subject: [PATCH] Add app_legal_channel to helpers package (fixes import error) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: Version 1.7.5 added app_legal_channel to helpers.py but production uses the helpers/ package which imports from helpers/main.py. This caused: - NameError: name 'app_legal_channel' is not defined - ImportError: cannot import name 'app_legal_channel' from 'helpers' Result: cogs.economy and cogs.players failed to load, causing all slash commands (including /team, /selldupes, /comeonmanineedthis) to be unavailable. Fix: Add app_legal_channel() function to helpers/main.py so it's exported via the helpers package __init__.py. Bumps version to 1.7.6 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- VERSION | 2 +- helpers/main.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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'):