feat: add centralized configuration for server owners - #11
Conversation
- Added `config.json` with embed colors, footer details, and command category toggles - Updated `src/config.js` to parse `config.json` and merge with default fallbacks - Updated `src/index.js` and `scripts/register-commands.js` to dynamically load and register command categories based on the config - Modified all command files in `src/commands/` to use the dynamic embed colors and footer settings from the config, including a fallback for `iconURL` - Reverted unintentional modifications to test files and `package.json`
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
…mmands.js - Read `botToken` and `clientId` with fallback to `config.js` to ensure the script does not crash in CI where environment variables might not be directly set if they can be sourced via `dotenv` from `config.js`.
- Exit the command registration process gracefully if the dummy CI `clientId` is detected so the pipeline does not fail with a 401 Unauthorized error from the Discord API.
- The workflow will no longer fail if the `DISCORD_WEBHOOK_URL` secret is missing or empty by skipping the cURL step, preventing `Malformed input to a URL function` errors.
This PR introduces a centralized configuration system (
config.json) tailored for server owners to easily customize the bot's visual identity and functionality before deployment.Key changes include:
config.jsonfile in the root directory for defining embed colors, footer text/icons, and toggling specific command categories (e.g., moderation, utility, entertainment).src/config.jsto securely load the JSON file and merge it with sensible default values, ensuring the bot remains functional even if the configuration is missing or incomplete.src/index.jsand the command registry inscripts/register-commands.jsto honor the category toggles, allowing server owners to disable unwanted features globally.src/commands/to replace hardcoded colors and footers with the dynamicbotConfig.customizationsettings, including necessary fallback logic for theiconURLto prevent Discord API errors on empty strings.PR created automatically by Jules for task 5063591214965960950 started by @Lacikika