Fluxerly.js

From your first reply to the bot of your dreams

A Fluxer-native bot SDK for JavaScript, TypeScript and Effect that starts in one file and gives you full control when you need it

npm install @neontechspace/fluxerly

Your First Reply

This is the whole bot, one file. Send !ping and watch the handler answer

Start a Bot in the Docs
general
  1. Press Send to post the message in this channel

This chat is a preview. The test that fluxerly init writes sends !ping and hello to the SDK's in-memory Fluxer and checks the answers

bot.js
import { runBot } from "@neontechspace/fluxerly"// A failure that stops the bot, such as a rejected token, is logged and sets a failing exit codeawait runBot({    token: process.env.FLUXER_BOT_TOKEN,    events: {        messageCreate: ({ message, reply }) => {            if (message.content !== "!ping") return            // Returning the reply reports a failed send to the log            return reply("Pong!")        },    },})
npx @neontechspace/fluxerly init
node --env-file=.env bot.js

Why Fluxerly Was Built

I write software both as my job and for the love of it. I had wanted to build my own bot SDK for a while, and at some point I stopped playing with the thought and started doing it

Over the years, software I used and libraries I built on kept changing under me. Sooner or later an update lowered the quality or the work slowed down, and I paid for it along with everyone else who used them

I wanted something for myself that I know I can rely on. With the knowledge to build it, it felt like the right moment to start realizing my dreams

Since AI has made code cheap and I strive for quality, I chose to make it usable for everybody. So Fluxerly is a Fluxer-native SDK instead of a Discord-compatible layer. It follows modern developer standards and is made for developers of every size, whether you code with or without AI

A glass water drop holding a star above two waves, the Fluxerly mark
2,944 downloadsAll npm downloads of @neontechspace/fluxerly, added up day by day

npm downloads of @neontechspace/fluxerly by day
DayDownloadsRunning total
Sep 145252
Sep 15052
Sep 16211263
Sep 1719282
Sep 187289
Sep 193292
Sep 209301
Sep 212303
Sep 221304
Sep 23160464
Sep 2424488
Sep 2517505
Sep 2612517
Sep 27380897
Sep 2845942
Sep 291943
Sep 301841,127
Oct 1311,158
Oct 2161,174
Oct 32111,385
Oct 4201,405
Oct 5121,417
Oct 601,417
Oct 7691,486
Oct 8151,501
Oct 91681,669
Oct 10411,710
Oct 11211,731
Oct 1281,739
Oct 1301,739
Oct 1401,739
Oct 1501,739
Oct 1681,747
Oct 17101,757
Oct 184882,245
Oct 1902,245
Oct 2002,245
Oct 2102,245
Oct 22482,293
Oct 232592,552
Oct 242432,795
Oct 25352,830
Oct 26242,854
Oct 27232,877
Oct 28472,924
Oct 29202,944

The Usual Bot Parts, Already Built

Six parts that come with the SDK, each with the guide that explains it

  • Results instead of throws
  • Prefix commands with typed arguments
  • Tests against an in-memory Fluxer
  • Rate limits waited out
  • A clean stop on Ctrl+C
  • Automatic sharding and metrics
A circular arrow on a stand, the Fluxer waves at its center
  1. Failures You Can Read

    Network calls return a Result, a success or a failure, instead of throwing, so your code handles expected errors where they happen. The SDK masks the bot token in everything it logs

    if (sent.isErr()) throw sent.error
    Reliability Guide
  2. Commands with the Plumbing Done

    Prefix commands such as !greet come with typed arguments, guards, cooldowns and groups. Help is generated from the same definitions

    arguments: { name: { type: "text", rest: true } },cooldown: { durationMs: 5_000, per: "user" },
    Commands Guide
  3. Tests Without a Token

    createTestBot runs the bot's own options against an in-memory Fluxer, so tests need no network or account

    const replies = await bot.say("!ping")
    Testing Guide
  4. Rate Limits, Handled

    When Fluxer answers 429, the SDK waits and retries within the request's deadline. A write with an uncertain outcome is never repeated automatically

    WARNratelimit[ratelimit.wait]

    Limits and Retry Rules
  5. Clean Restarts

    Ctrl+C gives running handlers time to finish, then stops cleanly. A bot that saves its sessions at that stop can pick up missed events if it restarts within a minute, and the optional supervisor restarts crashed processes

    INFOlifecycle[lifecycle.shutdownComplete]

    Session Resume Guide
  6. Sharding and Metrics

    Automatic sharding splits the connection to Fluxer, one shard per 2,000 communities. The observe option reports requests and handlers for metrics and traces

    sharding: "auto",
    Sharding Guide

From One File to a Full Application

The same SDK at three sizes. Each step keeps everything from the one before it

A hot-air balloon lifting a small parcel upward

A First Bot

One options object in a plain JavaScript file, which Node.js runs without a build step

bot.js
import { runBot } from "@neontechspace/fluxerly"await runBot({    token: process.env.FLUXER_BOT_TOKEN,    events: {        messageCreate: ({ message, reply }) => {            if (message.content !== "!ping") return            return reply("Pong!")        },    },})

A Real Application

Own the connection and the shutdown when you need to. createClient leaves connecting, running and stopping to your code

app.js
import { createClient } from "@neontechspace/fluxerly"const stop = new AbortController()process.once("SIGINT", () => stop.abort())await using client = createClient({    token: process.env.FLUXER_BOT_TOKEN,})client.on("messageCreate", (message, signal) => {    if (message.author.isBot) return    if (message.content !== "!ping") return    return client.messages.reply(message, "Pong!", { signal })})const result = await client.run({ signal: stop.signal })if (result.isErr() && result.error._tag !== "CancelledError") {    console.error(result.error.message)}

Effect, When You Want It

Effect is a TypeScript library for structured programs. The native entry point has the same features with typed failures and scoped cleanup, and it is never required

app.ts
import { Config, Effect } from "effect"import { FluxerClient } from "@neontechspace/fluxerly/effect"const program = Effect.gen(function* () {    const client = yield* FluxerClient    yield* client.on("messageCreate", (message) =>        message.content === "!ping"            ? client.messages.reply(message, "Pong!")            : Effect.void,    )    yield* client.run()})const client = FluxerClient.layerConfig({    token: Config.Redacted("FLUXER_BOT_TOKEN"),})export const main = program.pipe(    Effect.scoped,    Effect.provide(client),)

JavaScript needs no TypeScript. TypeScript projects add TypeScript and @types/node. ES modules only, on the Node.js versions in the support guide

Meet NeonFlux

The open-source Fluxer bot that answers to you, from source code to server. It runs on Fluxerly.js through the SDK's Effect API, so every command below is this SDK at work

  • 50+Built-In Commands
  • 25+Features to Switch On
  • OpenSource, Run It Yourself
NeonFlux, a small angular robot with a wind-up key

On the Website

  1. Pick one colour

    Claim a role here, and drop it any time

    • Red
    • Blue
    • Green
    • Violet

An optional alternative to reaction roles, which work in chat. Each has its own switch and starts off, so a server can use either or both

general

  1. !profile @Riley
  2. NeonFlux
    Riley

    Draws pixel towns and runs the Friday game night

    Rank
    Level 6, rank #7
    Birthday
    March 3
    Links
    riley.art

showcase

  1. NeonFlux
    Pocket Toolbox

    A little painted toolbox, made over one long weekend

    By
    Riley

general

  1. !pign
  2. NeonFluxThat's close to !ping. Send !help to see what I can do
  3. !ping
  4. NeonFluxPong!

staff

  1. !mod warn @Sam Spamming links
  2. NeonFlux
    Warning for @Sam

    Spamming links

    Case
    #12
    Staff
    @Riley

direct message

  1. NeonFluxWhat do you need help with? Only the team will see this
  2. My role panel stopped working
  3. NeonFluxGot it. Reply send and I'll open your ticket

Examples of what it does

The Bot Runs on Effect

It is written with the SDK's Effect API, the same one as these two samples

Reads That Run Together
import { Effect } from "effect"import type { Client } from "@neontechspace/fluxerly/effect"export function readGuildOverview(client: Client, guildId: string) {    return Effect.all({        guild: client.guilds.fetch(guildId),        channels: client.channels.fetchAll(guildId),    }, { concurrency: 2 })}
Failures as Values
import { Effect } from "effect"import type { Client } from "@neontechspace/fluxerly/effect"export function sendNotice(client: Client, channelId: string) {    return client.messages.send(channelId, "The event starts in ten minutes").pipe(        Effect.match({            onSuccess: message => ({ status: "confirmed" as const, messageId: message.id }),            onFailure: error => ({ status: "failed" as const, error }),        }),    )}

Built to Hold Up

  • Background Work Cleans Up After Itself

    Each worker lives in an Effect scope, so nothing is left running when the bot stops

  • A Failed Job Stays Contained

    A job that fails is logged and the worker waits for the next one, so one bad job never takes the bot down

  • Failures Have Names

    Effect keeps failures in the types, so each one gets its own plain reply instead of a crash

  • Every Answer Is Checked

    Answers from its backend are decoded with Effect Schema before the bot uses them

See the Effect API
  • Community

    Profiles, showcases, levels, events and birthdays

  • Roles

    A role picker or reaction roles, verification, newcomer roles and the member list

  • Moderation

    Cases, automatic rules, raid protection, logs and alerts

  • Messages

    Announcements, greetings, custom replies and message cleanup

  • Support

    Tickets, the help desk and suggestions

  • Voice

    Temporary voice rooms and finding a group

  • Setup

    Check NeonFlux, apply presets, see activity and back up the server

  • Basics

    Ping, help, away status, prefix and reply style

  • A Dashboard That Stays Live

    Forms update as the data changes, a change made elsewhere never overwrites your draft, and the audit log records every setting change

NeonFlux is a real Fluxer bot using Fluxerly.js, and public joining is on hold until it is ready. The source is open today

Quality, Speed and Security You Can Check

Each part comes with the checks and reviews behind it, and the test runs are public on GitHub

  • A way to every route a bot can use
  • Fixes on npm up to twice a day
  • Security reviews with frontier AI
A blue shield with copper bands and an engraved checkmark
  1. Never Blocked by a Missing Method

    If a bot token can do it on Fluxer, you can do it today. Most routes have a named method, and a raw request on the same client reaches the rest, with the same rate limit handling and readable failures. The endpoint map lists every route and how to reach it

  2. Fixes Don't Wait for a Release

    A dependable SDK can move when it needs to. Twice a day, if the SDK changed on the main branch and passed the check, the newest code goes to npm as a nightly build, so you can use a fix without waiting for a release. Another daily check compares Fluxer's API documents with the ones the SDK was built against

    npm install --save-exact @neontechspace/fluxerly@nightly
  3. Security Reviewed with Frontier AI

    Frontier AI models review the code for security flaws, on top of the code scanning that runs on every push. A finding counts only with proof, such as a failing test or a traced path, and the maintainer decides every fix

The Questions That Come Up First

Short answers to common questions, each with a link that goes deeper

More Answers in the FAQWhere Do I…?

A lifebuoy ring with rope

Using Fluxerly

Where Are Slash Commands?

Fluxer does not let bots register slash commands yet. Fluxerly will add them as soon as Fluxer supports them. Until then, Fluxerly commands are prefix commands, messages such as !ping that start with a chosen prefix, with typed arguments, guards, cooldowns, groups and generated help

Commands Guide
Do I Have to Learn Effect?

No. The default entry point uses async and await with Results. The SDK uses Effect inside, and npm, pnpm and Bun install it automatically, while the Effect entry point is there for applications that already use it

First Effect Bot
Do I Have to Enable Intents or Events?

No. Nothing needs to be switched on to receive events. A messageCreate handler gets messages as soon as the bot can read the channel

Events and Handlers
Which Node.js and Module System?

Node.js with ES modules only. JavaScript needs no compiler, and TypeScript projects add TypeScript with @types/node. The supported Node.js and TypeScript versions are listed in the support guide

Support and Compatibility
Can It Join Voice?

Not yet. Voice connections and audio are deferred until after Fluxer's voice update. Voice state updates and member controls such as move, mute, deafen and disconnect work today

Voice Controls
What About Rate Limits?

The SDK handles them. When Fluxer answers with HTTP 429, it waits the required delay and sends again within the request's deadline. Waits of a second or more are logged as warnings with the code ratelimit.wait

Limits and Retry Rules

How It Behaves

Is It Stable?

Yes. Releases follow Epoch Semantic Versioning, so only a new major version or epoch can break existing code. Minor and patch releases are safe to take

Support and Compatibility
Why Do Calls Return a Result Instead of Throwing?

Expected failures such as a missing permission, a network error or a rate limit stay visible in the return type, so they are handled where they happen. Programming mistakes still throw at once, and orThrow is there for code that prefers exceptions

Reliability Guide
How Do I Test Without a Token?

The testing entry point creates a real client connected to an in-memory Fluxer. Tests deliver events, answer requests and check what the bot sent, with no network and no account

Testing Guide
Why Do Messages Have No Methods?

Messages are plain, read-only data, so no network call hides behind a property. A handler receives a reply function, and client.messages.send sends to any channel

Messages Guide

Fluxerly and AI

Is Fluxerly Built with AI?

Yes. AI helps write the code, and the maintainer decides what goes in. Code written with AI goes through the same check as every other change, and nothing is published unless that check passed

Quality, Speed and Security
Can Code Written with AI Be Trusted?

It can, when the person using AI knows what to check. Tests and scanning look at the code itself, whoever typed it. Here the full check runs the whole test suite, and code scanning looks for security flaws

What the Full Check Covers
Is Fluxerly for Me if I Avoid AI?

Yes. Nothing in the SDK needs an AI tool, and every bot can be written by hand. The SDK itself is built with AI, so it suits you best if you see the value in that, or are willing to give it a fair look

Quick Start
Is Code Written by Hand Safer?

Not when the person using AI knows what good code looks like. With that knowledge, AI-assisted code is more secure than code written by hand, because the time AI saves goes into more tests

How Security Is Checked

Tools That Come with the SDK

Editor documentation, test helpers and agent rules all come in the package you install

  • Documentation in the declarations
  • Test helpers included
  • Rules for coding agents
An open toolbox holding a wrench and a small star vial
  • Docs in Your Editor

    The documentation lives in the type declarations, so autocompletion in the editor shows the same text as the API reference

  • Test Helpers Included

    The /testing and /effect/testing entry points come with the SDK. A project from fluxerly init starts with its first test

  • Rules for Coding Agents

    fluxerly agents adds the SDK's rules to the AGENTS.md of a project that has the SDK installed, and the docs publish llms.txt. The rules are plain text a person can read too. Nothing here needs an AI tool

    npx --no fluxerly agents

Install It

Choose your package manager, then add the SDK to a project or start a new one

Package manager
npm install @neontechspace/fluxerly

Adds the SDK to an existing project

npx @neontechspace/fluxerly init

Or start from a generated project with its first test

A parcel tied with a wave-shaped ribbon, resting on the floor