Conversation
- Database: split into a registry (core/Database.js) of DatabaseHandle instances, one Loki file per module under data/<Module>.db. Adds a one-shot migrate() helper that copies legacy module_X / settings_X collections out of database.db into the new per-module layout. - ErrorHandler: new core/ErrorHandler.js. Hooks process and discord.js error/warning events, dedup-windowed, writes JSONL + log to logs/, optional Discord embed reporting via config.errorReporting. Wraps module event dispatch and command execution so a single failure no longer breaks the chain. exitOnUncaught = true for Docker restarts. - LocalizationManager: rewritten to load module-owned locales from modules/<Mod>/locales/<lang>.yaml and merge under modules.<Mod>. Drops the global /locales/ dir entirely. Auto-syncs missing keys by inserting the dotted path as the value. Discord-style locale fallback (en-US -> en-GB). Adds Intl.DisplayNames-based languageName(). All module strings migrated out of the old global locale files. - Module/SettingsManager/ModuleManager: usesDB removed in favor of the databases option; SettingsManager and ModuleManager go through the registry instead of poking client.database.db directly. - ConfigurationManager: track a mutated flag so newly-added default keys actually persist on rewrite (the key-count check was a no-op for adds). - modules/Utility/commands/ping.js: withResponse: true returns an InteractionCallbackResponse; pull the message off response.resource. - gitignore: add data/ and logs/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Permissions: new core/Permissions.js — per-guild custom level ladder
(member/helper/moderator/admin seeded by default; admins can rename,
reweight, add custom levels, and delete any of them). Roles bind to
levels; a member's effective weight is the max across overlapping
bindings. User-, command-, and setting-level overrides supported.
Resolver short-circuits on bot OWNER, guild owner, and Discord
Administrator. Override-driven by design: modules don't ship gates,
the resolver only enforces when an admin has set an override.
- SettingsManager rewrite: schema-driven, no backward compat. Each key
declares { type, default, description?, validate? }. Built-in types:
string/boolean/number/integer/snowflake (channel/role/user)/array<X>
/enum:a|b|c. String inputs from slash commands are coerced before
validation. Auth via Permissions.check on each mutation when an
actor is supplied.
- /permissions command replaced with an in-Discord GUI panel
(modules/Utility/lib/PermissionsUI.js): single ephemeral message with
StringSelect navigation + RoleSelect/UserSelect pickers + modals for
forms. Custom-id convention `perms:<screen>[:<arg>]` carries state.
Each section has inline documentation explaining what it manages and
how the resolver chain composes.
- /settings rewritten to use the schema, validates per-key, defers to
Permissions for setting overrides.
- Command.requires field removed — was a module-side default that
duplicated Discord's defaultMemberPermissions; admins delegate via
/permissions overrides instead.
- Drop circular `require('../index.js')` in core/Module.js and
core/Database.js (was JSDoc-only but executed index.js side effects,
blocking standalone loading of core files).
- Strip box-drawing section divider comments across core/ and
modules/Utility/lib (44 lines removed).
- CHANGELOG.md: document this change set + the prior ac6e616 commit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Consolidates module manager access under a single property, standardizing interactions across the codebase and replacing scattered references. Simplifies database declaration logic for modules, enforcing explicit string array usage for collection names and providing safer accessor methods. Cleans up code by removing unnecessary comments and improves maintainability with new helper methods for module queries and command publishing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.