From discord.js

Map common discord.js habits to Fluxer.js (login, events, fetch vs get).

Fluxer bots log in, listen for gateway events, and handle prefix commands. If you have not run a client yet, start with Installation.

Login

javascript
import { Client, Events } from '@fluxerjs/core';

const client = new Client();
await client.login(process.env.FLUXER_BOT_TOKEN);

ClientOptions.intents is ignored. To suppress specific dispatches, use ignoredEvents:

javascript
const client = new Client({
  ignoredEvents: ['PRESENCE_UPDATE', 'TYPING_START'],
});

Events

Gateway reaction events emit one DTO instead of positional (reaction, user):

javascript
client.on(Events.MessageReactionAdd, ({ reaction, user, emoji, userId, messageId, channelId }) => {
  // …
});

Collectors still call your filter as (reaction, user) so short awaitReactions code can look familiar.

Commands

Use prefix commands or webhooks.

fetch vs get

MethodMeaning
.get(id)Cache only; undefined if missing
.fetch(id)REST, then update cache (throws FluxerError on not-found)
.resolve(id)get, else fetch (when the manager supports it)
javascript
const cached = client.guilds.get(guildId);
const guild = cached ?? (await client.guilds.fetch(guildId));

Managers are collections (or collection-backed). Prefer guild.members.get / fetch / resolve over inventing a second cache.

Other habit shifts

Instead ofIn Fluxer
Intents bitmaskOmit; use ignoredEvents if needed
Application command / interaction handlersPrefix commands or webhooks
Voice channel with no .sendVoice is text-based: channel.isTextBased(), channel.send()
bulkFetch style history for botsclient.preloadMessages + channel.messages.fetch
message.flags numberMessageFlagsBitField on message.flags
Reaction map on the messagemessage.reactions (MessageReactionManager) with .cache
Invite .guild as a live guildinvite.guildSnapshot metadata; invite.resolveGuild() for cache/REST
role.permissions.has(...) onlyAlso role.has(...) alias
Uncached member remove as full memberPartialGuildMember class (member.partial)
Await collectors without boundsRequire time and/or max (CollectorOptionsRequired)
channel.editPermission / overwrite arraychannel.permissionOverwrites.edit / .cache

Deep upgrade tables: Upgrading to 3.0. Coming from Fluxer 1.x: Migrating to 2.0. Starter path: Installation.

Questions?Join the Fluxer community for help with the SDK.Join Fluxer