EveCogs/wormhole/commands/__init__.py
Viktor AI 0b028e7bb9 refactor: Wormhole v4.0.0 — full modular architecture with hierarchical staff
BREAKING: Complete cog restructure from monolithic wormhole.py into modular architecture.

## Architecture
- models/permissions.py — Role IntEnum (MEMBER→OWNER), requires_role() decorator
- models/config.py — DEFAULT_NETWORK/DEFAULT_GLOBAL with 80+ config keys
- models/message_map.py — MessageMap class (extracted from _MessageMap)
- services/emoji.py — Foreign emoji resolution and relay
- ui/views.py — Reply jump button view
- ui/modals.py — Report modal
- core.py — Main Wormhole class, helpers, background loops, context menus
- commands/ — 13 command modules as mixin classes
- listeners/ — relay pipeline, edit/delete/reaction sync, typing/pin sync

## Staff System (new)
Per-network hierarchical roles replacing flat owner/staff:
  Bot Owner (Red built-in) — global override
  └─ Network Owner → Admin → Moderator → Helper → Member
  Each role assigned per-network. Higher roles can assign lower.
  Legacy staff_ids auto-migrated to ADMIN role.

## Enhanced Moderation
- Server-level ban/mute (not just user-level)
- Allowlist mode (only whitelisted servers can send)
- Mod edit and nuke (delete N messages by user)
- Anti-raid detector with auto-freeze
- Expanded automod: anti-zalgo, anti-emote-spam, anti-newline-spam

## Commands (100+)
network, settings, staff, moderation, filters, social, dm, mentions,
tos, reports, bridge, advanced (polls/afk/auto-responses/scheduled/
analytics/quiet-hours/colours/invites/announcements/blackout/portal),
debug (health/trace/testsend/relaydebug/backup/restore/version)

## Files
- 30 Python files, 5,274 lines total (was 4,782 in monolith)
- Original wormhole.py preserved for reference
- utils.py unchanged (all helpers reused)
2026-05-14 19:07:49 +00:00

31 lines
847 B
Python

"""Command modules — each is a mixin class inherited by the main Wormhole cog."""
from .advanced import AdvancedCommands
from .bridge import BridgeCommands
from .debug import DebugCommands
from .dm import DMCommands
from .filters import FilterCommands
from .mentions import MentionCommands
from .moderation import ModerationCommands
from .network import NetworkCommands
from .reports import ReportCommands
from .settings import SettingsCommands
from .social import SocialCommands
from .staff import StaffCommands
from .tos import ToSCommands
__all__ = [
"AdvancedCommands",
"BridgeCommands",
"DebugCommands",
"DMCommands",
"FilterCommands",
"MentionCommands",
"ModerationCommands",
"NetworkCommands",
"ReportCommands",
"SettingsCommands",
"SocialCommands",
"StaffCommands",
"ToSCommands",
]