{"id":10628,"library":"chrxmaticc-framework","title":"Chrxmaticc Framework","description":"Chrxmaticc Framework is a feature-rich, 'batteries-included' framework for developing Discord bots using `discord.js v14`. As of version 1.4.0, it provides out-of-the-box support for music via Lavalink, AI integration, a user experience (XP) system, and PostgreSQL database persistence, designed to streamline bot development with minimal boilerplate. The framework emphasizes a quick setup, allowing developers to create functional bots with core features in roughly ten lines of code. A significant major release, v2.0.0, is planned or recently released, which introduces a new `ChrxCommandBuilder` for simplified command creation, replacing some of the standard `discord.js` boilerplate. This framework aims for a steady release cadence, providing new features and improvements primarily focused on simplifying common Discord bot functionalities, targeting developers who prefer an opinionated, all-in-one solution rather than assembling individual packages.","status":"active","version":"1.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/Chrxmee-Bits/Chrxmaticc-Framework","tags":["javascript","discord","discord.js","lavalink","music","bot","framework","ai","xp"],"install":[{"cmd":"npm install chrxmaticc-framework","lang":"bash","label":"npm"},{"cmd":"yarn add chrxmaticc-framework","lang":"bash","label":"yarn"},{"cmd":"pnpm add chrxmaticc-framework","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core library for interacting with the Discord API. This package is a peer dependency.","package":"discord.js","optional":false}],"imports":[{"note":"While CommonJS `require` is shown in v1.x documentation, ESM `import` is the modern and recommended approach for new projects, especially with Node.js v16+.","wrong":"const { ChrxClient } = require('chrxmaticc-framework');","symbol":"ChrxClient","correct":"import { ChrxClient } from 'chrxmaticc-framework';"},{"note":"Introduced in v2.0.0 to simplify command creation, replacing the need for explicit `SlashCommandBuilder` from `discord.js`. Ensure you are on v2.0.0 or higher to use this.","wrong":"const { ChrxCommandBuilder } = require('chrxmaticc-framework');","symbol":"ChrxCommandBuilder","correct":"import { ChrxCommandBuilder } from 'chrxmaticc-framework';"}],"quickstart":{"code":"require(\"dotenv\").config();\nconst { ChrxClient } = require(\"chrxmaticc-framework\");\n\nconst bot = new ChrxClient({\n  token: process.env.BOT_TOKEN ?? '',\n\n  lavalink: {\n    host: process.env.LAVA_HOST ?? 'localhost',\n    port: parseInt(process.env.LAVA_PORT ?? '2333'),\n    password: process.env.LAVA_PASS ?? 'youshallnotpass',\n    secure: process.env.LAVA_SECURE === 'true',\n  },\n\n  modules: {\n    music: true,\n    xp: true,\n    database: process.env.DATABASE_URL ?? '',\n    ai: {\n      apiKey: process.env.AI_KEY ?? '',\n      model: \"gpt-3.5-turbo\",\n      provider: \"openai\", // or \"anthropic\"\n    },\n  },\n});\n\nbot.start();","lang":"javascript","description":"This setup initializes a ChrxClient instance with full capabilities, including Lavalink music, XP system, PostgreSQL database, and AI integration, all configured via environment variables."},"warnings":[{"fix":"Migrate your command files to use `new ChrxCommandBuilder({...})` syntax as detailed in the v2.0.0 documentation. This involves defining `name`, `description`, `options`, `cooldown`, and the `run` method directly within the builder.","message":"Version 2.0.0 introduces ChrxCommandBuilder, a new API for defining commands which significantly reduces boilerplate compared to discord.js SlashCommandBuilder. Existing v1.x command files using SlashCommandBuilder will need refactoring.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Ensure `LAVA_HOST`, `LAVA_PORT`, `LAVA_PASS` are correctly set in your `.env` file and match your Lavalink server's configuration. Use port 443 with `secure: true` for SSL/TLS connections, otherwise use 2333 (default) with `secure: false`.","message":"Correct Lavalink configuration is crucial for the music module. Common issues include incorrect host/port, mismatched passwords, or secure flag misconfiguration (e.g., using `secure: true` with a non-SSL port).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always use a `.env` file and `require('dotenv').config();` at the very top of your main bot file. Double-check all required environment variables are present and correctly formatted, especially API keys and URLs.","message":"The framework relies heavily on environment variables (e.g., BOT_TOKEN, LAVA_HOST, AI_KEY, DATABASE_URL). Incorrectly set or missing environment variables will lead to runtime errors or module failures.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always install both packages: `npm install chrxmaticc-framework discord.js`.","message":"`discord.js` is a peer dependency, meaning it must be installed separately by the user alongside `chrxmaticc-framework`. Forgetting to install it will result in a 'Cannot find module' error.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.4.0':24 'ai':37,147 'aim':105 'all-in-on':130 'allow':62 'assembl':137 'batteri':11 'batteries-includ':10 'boilerpl':55,102 'bot':17,51,67,122,145 'box':31 'cadenc':110 'chrxcommandbuild':91 'chrxmaticc':1,3 'code':76 'command':94 'common':120 'core':69 'creat':65 'creation':95 'databas':46 'design':48 'develop':15,52,63,125 'discord':16,121,141 'discord.js':19,101,142 'emphas':58 'experi':41 'featur':8,70,113 'feature-rich':7 'focus':117 'framework':2,4,13,57,104,146 'function':66,123 'improv':115 'includ':12 'individu':138 'integr':38 'introduc':88 'javascript':140 'lavalink':36,143 'line':74 'major':79 'minim':54 'music':34,144 'new':90,112 'one':133 'opinion':129 'out-of-the-box':27 'packag':139 'persist':47 'plan':83 'postgresql':45 'prefer':127 'primarili':116 'provid':26,111 'quick':60 'rather':135 'recent':85 'releas':80,86,109 'replac':96 'rich':9 'rough':72 'setup':61 'signific':78 'simplifi':93,119 'solut':134 'standard':100 'steadi':108 'streamlin':50 'support':32 'system':43 'target':124 'ten':73 'use':18 'user':40 'v14':20 'v2.0.0':81 'version':23 'via':35 'xp':42,148","created_at":"2026-04-19T13:33:48.030683+00:00","updated_at":"2026-04-19T13:33:48.030683+00:00","problems":[{"fix":"Ensure your `.env` file has `BOT_TOKEN=YOUR_DISCORD_BOT_TOKEN` and that `YOUR_DISCORD_BOT_TOKEN` is the correct token from the Discord Developer Portal.","cause":"The `BOT_TOKEN` environment variable is either missing or contains an incorrect Discord bot token.","error":"Error: Invalid token provided."},{"fix":"Verify that your Lavalink server is running and accessible. Check `LAVA_HOST`, `LAVA_PORT`, `LAVA_PASS`, and `LAVA_SECURE` in your `.env` file. Ensure firewall rules allow connection.","cause":"The bot could not establish a connection to the configured Lavalink server.","error":"Lavalink connection failed!"},{"fix":"Run `npm install discord.js` in your project directory.","cause":"The `discord.js` peer dependency has not been installed.","error":"Cannot find module 'discord.js'"},{"fix":"Add `require(\"dotenv\").config();` at the very top of your main bot file (e.g., `index.js` or `bot.js`) to load variables from your `.env` file into `process.env`.","cause":"The `dotenv` package (or equivalent) has not been configured to load environment variables, or the script is running in an environment where `process` is unavailable (e.g., browser without polyfill).","error":"ReferenceError: process is not defined"},{"fix":"Ensure `modules: { ai: { apiKey: process.env.AI_KEY, ... } }` is present in your ChrxClient options and `AI_KEY` is correctly set in your `.env` file.","cause":"The AI module was not enabled in the ChrxClient configuration or the `AI_KEY` environment variable is missing.","error":"TypeError: interaction.client.ai.ask is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/Chrxmee-Bits/Chrxmaticc-Framework","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/chrxmaticc-framework","openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}