EveCogs/wormhole/__init__.py

16 lines
517 B
Python
Raw Permalink Normal View History

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
"""Wormhole v4.0.0 — the ultimate cross-server relay cog for Red-DiscordBot."""
v3.2.0 — Phase 3: DM relay, starboard, karma, auto-mod, highlights, search & more Complete ground-up rewrite (2,762 lines across 3 files): Phase 3 features: - Bidirectional DM relay (subscribe, send, receive, 3 formats) - Cross-network starboard with configurable threshold - Reputation/karma system with leaderboard - Keyword highlight notifications (DM alerts) - Anti-raid detection with auto-freeze - Attachment filters (blocked extensions, max filesize) - Pin sync across channels - Typing indicator relay - Network discovery (public flag + tags) - Message search across network - Scheduled messages (timed broadcasts) - Network-wide slowmode - Relay delay (configurable) - Vanity invite codes - Per-channel setting overrides - Purge command (mass delete relayed) - Audit log (500 entries, full trail) - MOTD and rules - Comprehensive README with full command reference Phase 2 features (carried forward): - Auto-moderation engine (spam, caps, invites, links, zalgo, spoiler, emote/newline spam) - Invite system with expiry and max uses - Staff announcements and portal messages - Welcome messages and mention control - User profiles and network stats - Backup/restore (JSON export/import) - Blackout scheduling - Global blocklist (bot owner) - Embed and compact relay modes Phase 1 features (carried forward): - Named networks with webhook relay - Edit/delete/reply/reaction/sticker sync - Staff system with ownership transfer - Word and regex content filters - Rate limiting and NSFW gate - Server nicknames, custom identity - Logging channel
2026-05-07 22:19:09 +00:00
from .core import WormholeV4
v3.2.0 — Phase 3: DM relay, starboard, karma, auto-mod, highlights, search & more Complete ground-up rewrite (2,762 lines across 3 files): Phase 3 features: - Bidirectional DM relay (subscribe, send, receive, 3 formats) - Cross-network starboard with configurable threshold - Reputation/karma system with leaderboard - Keyword highlight notifications (DM alerts) - Anti-raid detection with auto-freeze - Attachment filters (blocked extensions, max filesize) - Pin sync across channels - Typing indicator relay - Network discovery (public flag + tags) - Message search across network - Scheduled messages (timed broadcasts) - Network-wide slowmode - Relay delay (configurable) - Vanity invite codes - Per-channel setting overrides - Purge command (mass delete relayed) - Audit log (500 entries, full trail) - MOTD and rules - Comprehensive README with full command reference Phase 2 features (carried forward): - Auto-moderation engine (spam, caps, invites, links, zalgo, spoiler, emote/newline spam) - Invite system with expiry and max uses - Staff announcements and portal messages - Welcome messages and mention control - User profiles and network stats - Backup/restore (JSON export/import) - Blackout scheduling - Global blocklist (bot owner) - Embed and compact relay modes Phase 1 features (carried forward): - Named networks with webhook relay - Edit/delete/reply/reaction/sticker sync - Staff system with ownership transfer - Word and regex content filters - Rate limiting and NSFW gate - Server nicknames, custom identity - Logging channel
2026-05-07 22:19:09 +00:00
__red_end_user_data_statement__ = (
"This cog stores Discord user IDs, guild IDs, and channel IDs for relay functionality. "
"Per-user data includes message counts, karma scores, keyword highlights, and DM relay subscriptions. "
"Users may request deletion of their data via the bot owner."
)
async def setup(bot):
cog = WormholeV4(bot)
await bot.add_cog(cog)
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
await cog._init()