Skip to content

Getting started ​

Create a project ​

pnpm create @confluxjs/create-conflux
bash
cd my-bot

The 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 dev

Use 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 ​

CommandPurpose
conflux devBundle to .conflux/ (unminified), watch source, and restart on change
conflux buildProduction bundle to outDir (default dist, minified)
conflux startRun production (outDir when present, otherwise source entry)
conflux runAlias for conflux dev

Next steps ​

Minimal bot entry ​

Create a @fluxerjs/core Client in your entry file (default src/index.ts) and export it as client:

ts
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.