Add app_legal_channel to helpers package (fixes import error)

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 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2025-11-17 09:23:10 -06:00
parent 584a8a95ab
commit 7bb191dbf4
2 changed files with 13 additions and 1 deletions

View File

@ -1 +1 @@
1.7.5 1.7.6

View File

@ -1022,6 +1022,18 @@ async def legal_channel(ctx):
return True 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: def is_ephemeral_channel(channel) -> bool:
"""Check if channel requires ephemeral responses (chat channels).""" """Check if channel requires ephemeral responses (chat channels)."""
if not channel or not hasattr(channel, 'name'): if not channel or not hasattr(channel, 'name'):