Configuration
Everything you need to know about the bot's configuration file.
π Switching Between Engines
Switching between engines (package manager and runtime) is a key feature of the framework's flexibility. This section explains why it's crucial to use the CLI for this process, the issues you might face if you bypass it, and how to perform the switch seamlessly with the bot config engine
command.
β Why Use the CLI for Switching?
The CLI ensures that all necessary configurations are applied consistently across your project:
Updates the
package.json
ScriptsThe CLI modifies the scripts to match the requirements of the selected engine.
For example, it adjusts commands for
bun
ordeno
versusnpm
orpnpm
.
Synchronizes
.env
VariablesSpecific engines may require additional environment variables or tweaks.
The CLI automatically updates
.env
to reflect these changes.
Prevents Compatibility Issues
Skipping the CLI might leave residual configurations for an old engine, leading to runtime errors or build failures.
The CLI ensures all settings are aligned with the current engine.
β οΈ What Happens If You Donβt Use the CLI?
If you manually switch engines without the CLI, you risk the following issues:
Broken Scripts: Package manager commands may not work as expected, causing builds, installs, or runs to fail.
Environment Misconfiguration: Missing or incorrect
.env
values might break compatibility with your engine.Inconsistent Dependencies: Certain engines manage dependencies differently, potentially causing version conflicts.
Lost Features: Some CLI-enabled features might not function correctly due to missing configurations.
π How to Switch Engines
Switching engines with the CLI is straightforward and interactive:
Run the command:
Follow the prompts step-by-step:
The CLI will guide you through selecting a package manager (e.g.,
npm
,pnpm
,bun
).It will then prompt you to choose a runtime (e.g.,
node
,bun
,deno
).
Confirm the selections:
Once you've completed the prompts, the CLI will apply the changes automatically.
You're done!
Your
package.json
scripts and.env
are now updated for the selected engine.
β¨ Example Interaction
Here's an example of what using the command might look like:
CLI Prompt:
CLI Prompt:
CLI Response:
By following these steps, you ensure that your project is always aligned with the chosen engine, avoiding potential pitfalls and maximizing compatibility.
βοΈ Custom system message
You can create your own system message template from the configuration file.
For example, if you want to force embedding all messages and to replace all embed titles by author properties to add the bot's avatar on header, add the following code to your configuration file:
Last updated