Major Features Added: • Admin Management System: Complete admin command suite with user moderation, system control, and bot maintenance tools • Enhanced Player Commands: Added batting/pitching statistics with concurrent API calls and improved embed design • League Standings: Full standings system with division grouping, playoff picture, and wild card visualization • Game Schedules: Comprehensive schedule system with team filtering, series organization, and proper home/away indicators New Admin Commands (12 total): • /admin-status, /admin-help, /admin-reload, /admin-sync, /admin-clear • /admin-announce, /admin-maintenance • /admin-timeout, /admin-untimeout, /admin-kick, /admin-ban, /admin-unban, /admin-userinfo Enhanced Player Display: • Team logo positioned beside player name using embed author • Smart thumbnail priority: fancycard → headshot → team logo fallback • Concurrent batting/pitching stats fetching for performance • Rich statistics display with team colors and comprehensive metrics New Models & Services: • BattingStats, PitchingStats, TeamStandings, Division, Game models • StatsService, StandingsService, ScheduleService for data management • CustomCommand system with CRUD operations and cleanup tasks Bot Architecture Improvements: • Admin commands integrated into bot.py with proper loading • Permission checks and safety guards for moderation commands • Enhanced error handling and comprehensive audit logging • All 227 tests passing with new functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
54 lines
1.6 KiB
Python
54 lines
1.6 KiB
Python
"""
|
|
Random content generation utilities for Discord Bot v2.0
|
|
|
|
Provides fun, random content for bot interactions and responses.
|
|
"""
|
|
import random
|
|
from typing import List, Optional, Union
|
|
from utils.logging import get_contextual_logger
|
|
|
|
logger = get_contextual_logger(__name__)
|
|
|
|
# Content lists
|
|
SILLY_INSULTS = [
|
|
"You absolute walnut!",
|
|
"You're about as useful as a chocolate teapot!",
|
|
"Your brain is running on dial-up speed!",
|
|
"I admire how you never let obstacles like competence get in your way.",
|
|
"I woke up this flawless. Don't get your hopes up - it's not contagious.",
|
|
"Everyone who ever loved you was wrong.",
|
|
"Your summer body is looking like you have a great personality."
|
|
# ... more insults
|
|
]
|
|
|
|
ENCOURAGEMENTS = [
|
|
"You're doing great! 🌟",
|
|
"Keep up the awesome work! 💪",
|
|
"You're a legend! 🏆",
|
|
# ... more encouragements
|
|
]
|
|
|
|
STARTUP_WATCHING = [
|
|
'you little shits',
|
|
'hopes die',
|
|
'records tank',
|
|
'cal suck'
|
|
]
|
|
|
|
def random_insult(mild: bool = True) -> str:
|
|
"""Get a random silly insult."""
|
|
return random.choice(SILLY_INSULTS)
|
|
|
|
def random_from_list(items: List[str]) -> Optional[str]:
|
|
"""Get random item from a list."""
|
|
return random.choice(items) if items else None
|
|
|
|
def weighted_choice(choices: List[tuple[str, float]]) -> str:
|
|
"""Choose randomly with weights."""
|
|
return random.choices([item for item, _ in choices],
|
|
weights=[weight for _, weight in choices])[0]
|
|
|
|
def random_reaction_emoji() -> str:
|
|
"""Get a random reaction emoji."""
|
|
reactions = ["😂", "🤔", "😅", "🙄", "💯", "🔥", "⚡", "🎯"]
|
|
return random.choice(reactions) |