A fluxer bot for Vane
  • TypeScript 100%
Find a file
2026-06-26 15:43:25 +02:00
src Initial commit 2026-06-26 15:43:25 +02:00
.env.example Initial commit 2026-06-26 15:43:25 +02:00
.gitignore Initial commit 2026-06-26 15:43:25 +02:00
package-lock.json Initial commit 2026-06-26 15:43:25 +02:00
package.json Initial commit 2026-06-26 15:43:25 +02:00
README.md Initial commit 2026-06-26 15:43:25 +02:00
tsconfig.json Initial commit 2026-06-26 15:43:25 +02:00

vane-fluxer 🔍🤖

A Fluxer companion bot for Vane. Type !vane, ask a question, optionally pick a mode (speed / balanced / quality), and the bot replies — pinging you — with a cited answer when Vane is done.

It talks to Vane purely over its public HTTP API (POST /api/search). Vane itself is never modified. This is a port of vane-discord to Fluxer using the official-ish @fluxerjs/core SDK.

How it works

!vane how do magnets work --mode quality
   ↓
bot replies "🔍 Searching Vane… · quality"   ← acks instantly + pings you
   ↓  POST {VANE_API_URL}/api/search  (optimizationMode = quality, stream:false)
   ↓  (the placeholder is edited in place)
🔍 **how do magnets work** · _quality_
Magnets work because of aligned electron spins… [(1)](<https://…>) [(2)](<https://…>)

**Sources**
1. [Title of source one](<https://…>)
2. [Title of source two](<https://…>)
  • Models & sources are gated in .env — users only choose the mode.
  • Citations like [1] are rewritten to masked links [(1)](<url>).
  • Answers over Fluxer's 2000-char limit are split across follow-up messages.

Why a prefix command (and not a slash command)?

Fluxer has no slash commands / interactions, so — like every bot in the Fluxer SDK examples — this one listens for a text prefix command on the gateway (messageCreate). The mode "dropdown" from the Discord version becomes a --mode flag. Because there's no interaction token, there's also no 15-minute follow-up ceiling: the bot posts a placeholder reply and edits it in place whenever Vane finishes.

Prerequisites

  • Node.js ≥ 20 (tested on 24)
  • A running Vane instance reachable from this bot (default http://localhost:3000)
  • A Fluxer application + bot token

Setup

1. Create the Fluxer bot

  1. In the Fluxer developer portal, create an application and add a Bot to it (see https://docs.fluxer.app).
  2. Copy the bot tokenFLUXER_BOT_TOKEN.
  3. Invite/add the bot to your server.

Running against a self-hosted Fluxer instance instead of the hosted one? Set FLUXER_API_URL to your instance's API base URL.

2. Find your Vane model IDs

The bot needs a chat model and an embedding model. List what your Vane instance has configured:

curl http://localhost:3000/api/providers

Take a provider id (a UUID) and a model key (use the key, not the display name) for both a chat model and an embedding model.

3. Configure

cp .env.example .env
# then fill in FLUXER_BOT_TOKEN and the VANE_* model values

4. Install & run

npm install
npm start        # or: npm run dev   (auto-restarts on file changes)

On startup the bot logs in and starts listening for the prefix command.

Usage

In any channel the bot can see:

!vane <your question>
!vane <your question> --mode quality
!vane --speed <your question>

Mode can be set with --mode <m> / -m <m> / --mode=<m>, or the shorthands --speed / --balanced / --quality, anywhere in the message. If you omit it, the bot uses VANE_DEFAULT_MODE from your .env. Change the trigger with FLUXER_PREFIX / FLUXER_COMMAND (e.g. ?ask).

Configuration reference

Variable Required Default Notes
FLUXER_BOT_TOKEN Bot token from the Fluxer developer portal
FLUXER_API_URL https://api.fluxer.app Set only for a self-hosted Fluxer instance
FLUXER_PREFIX ! Command prefix
FLUXER_COMMAND vane Command word (trigger = prefix + command)
VANE_API_URL http://localhost:3000 Base URL of Vane
VANE_CHAT_PROVIDER_ID Provider UUID from /api/providers
VANE_CHAT_MODEL_KEY Chat model key
VANE_EMBEDDING_PROVIDER_ID Provider UUID from /api/providers
VANE_EMBEDDING_MODEL_KEY Embedding model key
VANE_SOURCES web Comma list: web, academic, discussions
VANE_DEFAULT_MODE balanced Used when the user omits --mode
VANE_SYSTEM_INSTRUCTIONS Extra guidance sent on every query
VANE_TIMEOUT_MS 600000 Abort a search after this long
VANE_APPEND_SOURCES true Append a numbered Sources list

Notes & limits

  • No interaction time limit. Unlike Discord's slash commands, Fluxer message edits never expire, so a long quality run won't hit a 15-minute wall. The only ceiling is VANE_TIMEOUT_MS.
  • No auth on Vane's API. Run the bot on the same host/LAN as Vane, or put Vane behind a reverse proxy — don't expose port 3000 publicly.
  • One question per command; conversation history isn't threaded (the API supports it via history if you want to add it later).