Implements full Google Sheets scorecard submission with: - Complete game data extraction (68 play fields, pitching decisions, box score) - Transaction rollback support at 3 states (plays/game/complete) - Duplicate game detection with confirmation dialog - Permission-based submission (GMs only) - Automated results posting to news channel - Automatic standings recalculation - Key plays display with WPA sorting New Components: - Play, Decision, Game models with full validation - SheetsService for Google Sheets integration - GameService, PlayService, DecisionService for data management - ConfirmationView for user confirmations - Discord helper utilities for channel operations Services Enhanced: - StandingsService: Added recalculate_standings() method - CustomCommandsService: Fixed creator endpoint path - Team/Player models: Added helper methods for display Configuration: - Added SHEETS_CREDENTIALS_PATH environment variable - Added SBA_NETWORK_NEWS_CHANNEL and role constants - Enabled pygsheets dependency Documentation: - Comprehensive README updates across all modules - Added command, service, model, and view documentation - Detailed workflow and error handling documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
"""
|
|
Application constants for Discord Bot v2.0
|
|
"""
|
|
|
|
# Discord Limits
|
|
DISCORD_EMBED_LIMIT = 6000
|
|
DISCORD_FIELD_VALUE_LIMIT = 1024
|
|
DISCORD_EMBED_DESCRIPTION_LIMIT = 4096
|
|
|
|
# League Constants
|
|
WEEKS_PER_SEASON = 18
|
|
GAMES_PER_WEEK = 4
|
|
MODERN_STATS_START_SEASON = 8
|
|
|
|
# Current Season Constants
|
|
SBA_CURRENT_SEASON = 12
|
|
PD_CURRENT_SEASON = 9
|
|
|
|
# API Constants
|
|
API_VERSION = "v3"
|
|
DEFAULT_TIMEOUT = 10
|
|
MAX_RETRIES = 3
|
|
|
|
# Baseball Positions
|
|
PITCHER_POSITIONS = {"SP", "RP", "P"}
|
|
POSITION_FIELDERS = {"C", "1B", "2B", "3B", "SS", "LF", "CF", "RF", "OF", "DH"}
|
|
ALL_POSITIONS = PITCHER_POSITIONS | POSITION_FIELDERS
|
|
|
|
# Draft Constants
|
|
DEFAULT_PICK_MINUTES = 10
|
|
DRAFT_ROUNDS = 25
|
|
|
|
# Special Team IDs
|
|
FREE_AGENT_TEAM_ID = 31 # Generic free agent team ID (same per season)
|
|
|
|
# Role Names
|
|
HELP_EDITOR_ROLE_NAME = "Help Editor" # Users with this role can edit help commands
|
|
SBA_PLAYERS_ROLE_NAME = "Season 12 Players" # Current season players
|
|
|
|
# Channel Names
|
|
SBA_NETWORK_NEWS_CHANNEL = "sba-network-news" # Channel for game results
|
|
|
|
# Base URLs
|
|
SBA_BASE_URL = "https://sba.major-domo.app" # Base URL for web links
|
|
|
|
# Note: Google Sheets credentials path is now managed via config.py
|
|
# Access it with: get_config().sheets_credentials_path |