How ittzspsv/lilyv2 works
1. Overall shape
- This is a Discord.py multi-module bot organized as a set of optional cogs/modules under src/.
- The architecture is intentionally plugin-like: each major feature area has its own package, commands, components, and sometimes persistence layer.
2. Bot entry and integration boundary
- src/sDiscordIntegration.py appears to be the main integration layer that ties the bot together with Discord.
- From there, the bot loads feature cogs and routes Discord events/commands into the appropriate module.
3. Module-level decomposition
- Core bot capabilities are split into independent domains:
- Moderation
- Management / staff tools
- Logging
- Utility
- Leveling / economy
- Ticketing
- Rulesets / permissions
- Vouching
- Security
- Music
- GTO and Substring utilities
- Blox Fruits game support
- Grow a Garden / algorithms support
- The README explicitly says modules are removable/replaceable, which is important for diagramming the system boundary.
4. Shared configuration and constants
- src/Config/ holds global configuration objects such as bot details and value/config data.
- Root data files like src/ValueData.json, src/nsfw.json, and configs.txt suggest centralized lookup tables and runtime settings used across modules.
- This config layer is a shared dependency for many feature packages.
5. Persistence and storage layer
- The bot uses a mix of SQLite databases and JSON files under storage/.
- Databases are separated by domain:
- storage/configs/Configs.db, ValueData.db, ComboData.db
- storage/levels/Levels.db
- storage/logs/Logs.db
- storage/management/staff_management.db
- storage/music/Music.db
- JSON files are used for smaller or more static view/config state, such as ticket views and automod config.
- aiosqlite in the README indicates async DB access is part of the architecture.
6. Moderation, logging, and security flow
- LilyModeration, LilyLogging, LilySecurity, and LilyRulesets form a policy-and-enforcement layer.
- Moderation has command handlers, UI components, database access, and utilities, so the flow is: Discord action → moderation command/event → DB/logging side effects → response/embeds.
- Logging is a distinct subsystem for error/debug/audit output, likely consuming moderation and management events.
7. Staff management subsystem
- LilyManagement contains a dedicated staff management domain with:
- command layer
- UI components
- database access
- type definitions
- This suggests staff records and profiles are persisted separately from moderation data, with a clear domain boundary.
8. Leveling / economy subsystem
- LilyLeveling includes a core engine, commands, and components, backed by Levels.db.
- The README shows profile cards and leaderboards, so the flow is: activity tracking → level/xp updates → card/image rendering → Discord message output.
- This module is visually oriented but still data-driven through persistent progression state.
9. Ticketing and dashboard-like interaction surfaces
- LilyTicketTool is a self-contained workflow with core logic, thread support, command layer, components, and persisted view/config files.
- LilyDashboard and LilyUtilityComponents indicate reusable UI/interaction components for Discord messages, selects, buttons, and embeds rather than a separate web dashboard.
- The architecture favors Discord-native interaction UIs over external frontends.
10. Blox Fruits game-support subsystem
- This is one of the largest domain-specific areas in the repo.
- It is split into:
- commands for Discord interactions
- components for UI surfaces
- core for calculations, fruit detection, trade formatting, and suggestion logic
- modules/combo for combo management
- a cache layer in sLilyBloxFruitsCache.py
- This module likely processes user-provided trade/inventory data, calculates outcomes, and renders game-specific images and embeds.
11. Blox Fruits data-processing and image pipeline
- src/ui/ contains generators for stock images, fruit values, combos, profile cards, win/loss cards, greeting cards, and background manipulation.
- src/Misc/ contains downloader/fetcher helpers and shared embed/component helpers.
- The key flow here is: domain data → algorithm/calculation layer → image generation layer → Discord embed or attachment.
- Pillow is a major dependency because visuals are part of the module output, not just decoration.
12. Algorithmic sanitization and content analysis
- src/LilyAlgorthims/ contains specialized detection/processing routines such as:
- link scam detection
- NSFW detection
- stock processing
- These appear to be reusable safety/validation helpers consumed by moderation, security, or content-related commands.
- They form a lightweight analytics layer rather than a user-facing module.
13. Utility and identity helpers
- LilyUtility provides general-purpose bot behaviors such as greetings, tags, utility commands, and shared utility components.
- LilyEngagement and LilyVouching cover interaction and reputation-style features.
- These are cross-cutting modules that support presentation and community features rather than core enforcement or domain logic.
14. Important architectural boundary
- The repo is not organized around one monolith service; it is organized around Discord cogs plus shared helper layers.
- The stable boundaries are:
- Discord event/command entry points
- domain modules
- shared algorithms/utilities
- storage/persistence
- image/UI rendering
- That separation is the main thing to preserve in an architecture diagram.
Main entry points: sDiscordIntegration.py Discord bot · sLilyBloxFruitsCore.py Blox Fruits · sLilyModeration.py Moderation · sLilyUtility.py Utility
Components 26
Integration
Bot startup and Discord event boundary
- Discord bot · Main Discord.py integration and module loader
src/sDiscordIntegration.py
Feature Cogs
Optional Discord modules grouped by domain
- Moderation · Command and policy enforcement module
src/LilyModeration/sLilyModeration.py - Staff mgmt · Staff management domain and commands
src/LilyManagement/sLilyStaffManagement.py - Logging · Audit and error logging module
src/LilyLogging/sLilyLogging.py - Utility · General bot utilities and community helpers
src/LilyUtility/sLilyUtility.py - Leveling · XP, profiles, and leaderboard flow
src/LilyLeveling/core/sLilyLevelingCore.py - Tickets · Ticket creation and view workflows
src/LilyTicketTool/LilyTicketToolCore.py - Rulesets · Rules and permissions enforcement
src/LilyRulesets/sLilyRulesets.py - Security · Security and protective checks
src/LilySecurity/sLilySecurity.py - Vouching · Trust and vouching workflows
src/LilyVouching/sLilyVouchCore.py - Music · Music command surface and external runtime config
src/LilyMusic/sLilyMusicCommands.py - Blox Fruits · Large game-support subsystem for calculations, trades, and combos
src/LilyBloxFruits/sLilyBloxFruitsCore.py - GTO · Specialized command module
src/LilyGTO/LilyGTOCommands.py - Substring · Specialized text utility module
src/LilySubstring/sLilySubstring.py - Engagement · Interaction-oriented feature module
src/LilyEngagement/LilyEngagement.py
Shared Layers
Reusable config, algorithms, helpers, and presentation primitives
- Config · Global bot and value configuration
src/Config/sBotDetails.py - Value data · Shared value/config data for modules
src/Config/sValueConfig.py - Algorithms · Reusable detection and processing routines
src/LilyAlgorthims/sNSFWDetectionAlgorthim.py - Embeds & media · Shared embed, component, and downloader helpers
src/Misc/sLilyEmbed.py
Persistence
Databases and JSON state used across modules
- Config store · Shared config and value databases plus automod JSON
storage/configs/Configs.db - Levels DB · Progression persistence
storage/levels/Levels.db - Logs DB · Audit and logging persistence
storage/logs/Logs.db - Staff DB · Staff management persistence
storage/management/staff_management.db - Music DB · Music subsystem persistence
storage/music/Music.db - Views JSON · Persisted ticket view state
storage/view/TicketViews.json
UI Rendering
Image and visual output pipeline
- Image UI · Generators for cards, stock images, greetings, and effects
src/ui/sProfileCardGenerator.py
Connections 33
- Discord bot → Config: loads · Bootstraps shared bot configuration
- Discord bot → Moderation: loads · Registers feature cogs into Discord
- Discord bot → Staff mgmt: loads · Registers staff management module
- Discord bot → Logging: loads · Registers logging module
- Discord bot → Utility: loads · Registers utility commands
- Discord bot → Leveling: loads · Registers progression subsystem
- Discord bot → Tickets: loads · Registers ticket workflows
- Discord bot → Blox Fruits: loads · Registers game-support domain
- Discord bot → Music: loads · Registers music module
- Discord bot → Rulesets: loads · Registers policy enforcement layer
- Discord bot → Security: loads · Registers security checks
- Discord bot → Vouching: loads · Registers reputation features
- Discord bot → GTO: loads · Registers specialized utility module
- Discord bot → Substring: loads · Registers specialized text module
- Discord bot → Engagement: loads · Registers community engagement module
- Moderation → Algorithms: uses · Relies on detection and content analysis helpers
- Moderation → Logs DB: writes · Records moderation activity and audit trail
- Moderation → Config store: reads/writes · Uses automod and shared config state
- Staff mgmt → Staff DB: persists · Stores staff records and profiles
- Logging → Logs DB: persists · Stores log events and diagnostics
- Utility → Embeds & media: uses · Shares embed and interaction helpers
- Utility → Image UI: renders · Produces visual utility outputs
- Leveling → Levels DB: persists · Stores XP and profile progression
- Leveling → Image UI: renders · Builds profile and leaderboard cards
- Tickets → Views JSON: persists · Stores ticket views and selectors
- Tickets → Embeds & media: uses · Uses shared component and embed helpers
- Blox Fruits → Algorithms: uses · Uses fruit detection, trade, and stock processing
- Blox Fruits → Image UI: renders · Generates combo, stock, and trade visuals
- Blox Fruits → Config: reads · Uses shared config and value data
- Blox Fruits → Config store: persists · Uses combo/value/config databases
- Music → Music DB: persists · Stores music state and settings
- Security → Algorithms: uses · Consumes scanning and detection helpers
- Rulesets → Config: reads · Uses shared policy/config values