Message, member, channel, role, guild event or command.
INTERNAL SYSTEM MAP / BUILD 2026.09.19
STATS FOR
NERDS.
A technical view of how BigBrother starts, receives Discord events, evaluates risk, performs actions and stores the result.
HOW IT WORKS / END TO END
The working
parts.
Every Discord input follows a defined route. Handlers collect context, shared services decide what should happen, repositories persist the result, and the correct log records it.
Event listener or prefix/slash command validates the input shape.
Owner, native permissions, hierarchy, roles and whitelist checks.
Moderation, security, reports, cases, invites or logging rules.
Delete, warn, timeout, quarantine, lock, rebuild or notify.
Feature-specific async database access—no raw queries in commands.
SQLite persistence and the correct MODLOG, SERVERLOG, ANLOG or reports route.
Prefix and slash commands call the same service methods. Automatic events use those services too, so enforcement and logging stay consistent across interfaces.
WORKING ORDER / STARTUP
From process start
to active watch.
Database migration and command loading complete before the bot announces readiness. Guild role checks are spaced in the background.
- 01Load configEnvironment, owner IDs, branding and thresholds
- 02Initialize stateConnect database and apply additive migrations
- 03Create clientDiscord intents and dynamic prefix
- 04Load cogsCommands, events and shared services
- 05Sync + loginSlash commands, token and gateway session
- 06ReadyPresence set; blacklisted roles ensured
MESSAGE PIPELINE
Ordered checks.
Early exits.
The order matters: severe content checks run before configurable AutoMod and every matched branch stops further processing.
Bot authors, non-guild messages, owner, admins and whitelisted members exit.
EXITMute 24h, auto-report, notify, log and evaluate ban escalation.
PUNISHApply severe punishment, record and stop.
PUNISHDelete, warn, notify, aggregate and stop.
HANDLEFILESYSTEM / RESPONSIBILITY MAP
Features stay in
their lane.
Commands parse and present. Services own business rules. Repositories own database access. Event modules connect Discord to those layers.
Messages, joins, channel changes, role changes and guild setup.
Slurs, word lists, repeats, character spam, invites and GIF detection.
Anti-Nuke, Anti-Raid, message rate, join rate and ping windows.
Moderation, logs, blacklists, cases, incidents, invites and actions.
Models, additive migrations and one repository per feature domain.
Shared prefix and slash commands backed by the same services.
Channel snapshots, server reconstruction, confirmations and owner recovery.
Purpose-built MODLOG, SERVERLOG and ANLOG embeds.
FULL FILESYSTEM
Where every
part lives.
The deployed no-music build separates Discord entry points, business logic, persistence and presentation into explicit packages.
BigBrother/
├── bot/main.py # startup, cogs, commands
├── bot/config.py # env, owners, thresholds
├── bot/database/
│ ├── models.py # configs, reports, cases, state
│ ├── migrate.py # additive schema updates
│ └── repositories/
│ ├── guild_config_repository.py
│ ├── banword_repository.py
│ ├── report_repository.py
│ ├── case_repository.py
│ ├── warning_repository.py
│ ├── whitelist_repository.py
│ ├── reaction_role_repository.py
│ ├── troll_state_repository.py
│ ├── incident_repository.py
│ ├── temp_action_repository.py
│ ├── mod_note_repository.py
│ └── command_access_repository.py
├── bot/events/
│ ├── messages.py # AutoMod, cache, delete logs
│ ├── members.py # join, autorole, blacklist
│ ├── channels.py # channel event logs
│ ├── roles.py # role event logs
│ └── guild.py # guild setup
├── bot/automod/
│ ├── racial_slurs.py
│ ├── word_filter.py
│ ├── spam.py
│ ├── character_spam.py
│ ├── invite_filter.py
│ └── gif_filter.py
├── bot/security/
│ ├── antinuke.py
│ ├── anti_raid.py
│ ├── spam_detector.py
│ ├── raid_detector.py
│ ├── ping_detector.py
│ └── base.py
├── bot/services/
│ ├── moderation_service.py
│ ├── logging_service.py
│ ├── blacklist_service.py
│ ├── case_service.py
│ ├── incident_service.py
│ ├── automod_aggregator.py
│ ├── permission_service.py
│ ├── invite_tracker.py
│ ├── action_engine.py
│ └── webhook_service.py
├── bot/nuke/
│ ├── server_nuke.py
│ ├── troll_sim.py
│ ├── channel_nuke.py
│ └── confirmation.py
├── bot/botlogging/
│ ├── modlog.py
│ ├── serverlog.py
│ └── anlog.py
├── bot/utils/ # audit, cache, throttle
└── bot/commands/ # prefix + slash cogs
├── moderation.py ├── purge.py
├── warnings.py ├── cases.py
├── notes.py ├── reports.py
├── banword.py ├── absbanword.py
├── antinuke.py ├── security_cmds.py
├── whitelist.py ├── nuke.py
├── blacklist_cmd.py ├── reaction_roles.py
├── autorole.py ├── snipe.py
├── say.py ├── coinflip.py
├── logging_config.py ├── config.py
├── setup.py ├── prefix.py
├── welcome_invites.py ├── channel_lock.py
├── help.py ├── status.py
├── info_cmds.py ├── staff_panel.py
└── member_qol.pyAUTOMATIC
Runs without a command.
- Message filters from severe content to flood detection
- Delete, channel, role and timeout event logs
- Join autorole, welcome and invite attribution
- Blacklisted-role creation and enforcement
- 10+ reports trigger automatic blacklist escalation
- Deleted-message cache powers media-aware snipe
OPERATOR-DRIVEN
Runs with intent.
- Moderation, purge, cases, notes and warnings
- Security status, incident history, lock and unlock
- Log channels, roles, prefix and AutoMod configuration
- Reports, manual blacklist and reaction-role setup
- Confirmed channel or server reconstruction
- Multipage help, status and staff control panel
LOG ROUTING
One event.
Correct destination.
Logging is separated by operational purpose so routine moderation does not create raid-level owner noise.
logging_service and api_throttle.safe_delete cool down after Discord 429 or Cloudflare 1015 responses instead of repeatedly hitting a limited route.
REPORT ESCALATION
Signal becomes
enforcement.
Report identities stay in the staff log, while public count checks reveal only the total.
Missing reason returns a private error.
Database row and reports-channel log.
Evaluate accumulated reports.
Strip roles, apply Blacklisted and DM.
OWNER-ONLY / NOT IN HELP
Contained recovery simulation.
A prefix-only owner safeguard can create a large isolated channel simulation and later remove only the bot-created resources. Protected channel IDs can be skipped. Trigger strings remain intentionally undocumented.
Music / DJ BigBro is not part of this build.
No music package, play commands, voice pipeline, yt-dlp or Wavelink dependency is present.
