Getting started
Create a project
pnpm create @confluxjs/create-confluxcd my-botThe scaffolder can write FLUXER_BOT_TOKEN to .env when you paste your token, install dependencies, and run git init. If you skip the token, copy .env.example to .env and fill it in.
TIP
Set FLUXER_BOT_TOKEN in .env using a token from the Fluxer developer portal.
Run the bot
pnpm install
pnpm devUse your package manager’s build script before deploying, then run start in production.
Conflux loads conflux.config.ts, reads your token from .env, imports your entry module, and calls login on the Client you export — you never call client.login() yourself.
CLI commands
| Command | Purpose |
|---|---|
conflux dev | Bundle to .conflux/ (unminified), watch source, and restart on change |
conflux build | Production bundle to outDir (default dist, minified) |
conflux start | Run production (outDir when present, otherwise source entry) |
conflux run | Alias for conflux dev |
Next steps
- Manual installation — add Conflux to an existing project
- Configuration —
defineConfig, paths, and tokens - Commands — prefix commands and groups
- Events — handler folders and ordering
- Middleware — global, directory, and per-command chains
Minimal bot entry
Create a @fluxerjs/core Client in your entry file (default src/index.ts) and export it as client:
import { Client } from "@fluxerjs/core";
const client = new Client();
export { client };Set command prefixes in conflux.config.ts (see Configuration).
INFO
Optional configure(conflux) runs before commands load and can override config (for example setPrefix for dynamic prefixes). Conflux registers handlers and prefix commands before calling login.