Problem: If bot crashes or shuts down ungracefully, context menus stay registered in Discord's command tree. On restart, add_command() fails with 'already loaded' error. Solution: Remove existing context menus before registering new ones. This makes registration idempotent (safe to run multiple times). Changes: - _register_context_menus() now removes existing menus first - Wrapped in try/except to handle 'not found' gracefully - Ensures clean reload even after ungraceful shutdown Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| commands | ||
| listeners | ||
| models | ||
| services | ||
| ui | ||
| __init__.py | ||
| ARCHITECTURE.md | ||
| core.py | ||
| info.json | ||
| MODULE_MAP.md | ||
| utils.py | ||