21 symbols from @neontechspace/fluxerly
Interfaces#
AuditedRequestOptions #
Settings for a remote mutation that Fluxer can record in the community audit log: Its deadline, an optional AbortSignal and an optional reason
Aborting cannot roll back a mutation Fluxer already received
interface AuditedRequestOptions extends RequestOptionsinterface AuditedRequestOptions
extends RequestOptionsauditoptional#Reason -
Optional audit-log reason, 1–512 printable ASCII characters after trimming
Sent only as the raw X-Audit-Log-Reason header, without URL escaping, because Fluxer does not decode escapes. Non-ASCII and control characters fail before dispatch. Omission sends no header. Never included in SDK errors or diagnostics. Header delivery does not guarantee that Fluxer stores the reason in an audit entry. Methods name the known paths that do not
string
Inherited from Request: signal, timeout
CanManageOptions #
Settings for members: Whose rank to check, and the shared deadline of its reads
interface CanManageOptions extends RequestOptionsinterface CanManageOptions
extends RequestOptionsAborting the signal cancels only this call and awaits owned cleanup
Inherited from Request: signal, timeout
ClientOptions #
Configure a bot client before connecting or making requests
Creation checks and copies these settings without authenticating the token or opening a connection. Settings belong to this client and cannot be changed after creation
interface ClientOptions<
F extends MessageFields | undefined = undefined
>interface ClientOptions<
F extends
| MessageFields | undefined
= undefined
>cacheoptional#-
Keep bounded, memory-only resource snapshots for local lookups
Omit this setting to retain no snapshots, without disabling REST reads or event delivery. Each category has its own client-wide budget shared across this client's shards, not a budget per shard or community. A lost gateway connection clears affected users, direct messages and messages, even after the session resumes
Community, member, role, emoji, sticker and channel snapshots stay while the shard resumes, because Fluxer replays every missed event on Resume, and are cleared whenever the shard starts a new session, including its first, so snapshots read before connecting do not outlast the first READY
Cached threads are the exception: Fluxer does not replay thread list changes, so a resumed shard's threads are cleared. Resume sends no community snapshots, so a process that resumes a session from
sharding.sessionsrefills the enabled community, role and channel caches through REST once every shard is ready, unlessshardingis false.refill Caches When a snapshot lacks enough community context to identify its shard, the SDK clears it conservatively. Enabled message, member, role, channel and community caches also give update and delete events the snapshot they replaced, as
EventContext .previous channelsoptional-
Cache community channels and threads from explicit reads and channel and thread events, without automatically listing them
A guild create event replaces this community's cached channels and threads with the channels and active threads the bot can view. Once a channel mutation is dispatched, the SDK removes the cached channels it can affect and prevents pending reads from restoring them
That is the written channel, with its threads when the mutation deletes the channel or converts its type, and with the forum posts that apply a tag it removes, as
deleteForumTagand an edit withavailableTagscan, because Fluxer drops removed tags from posts without a thread update, or this community's channels for a category or a community-wide mutation such as create or reorder, or every cached channel when the cache does not hold the written channelAn operation confined to one thread removes only that thread. Bulk ordering events clear this community's cached channels because permission updates may still be in progress. Category updates or deletions also clear this community's channels because children can inherit changed permissions
Visibility loss clears the affected channel, and for a text, announcement, forum or media channel also its threads, because Fluxer deletes them without thread deletion events
A text or announcement channel update clears that channel's cached threads whose type its type cannot hold, because Fluxer retypes a converted channel's threads without thread events for archived ones
A forum or media channel update clears that channel's cached posts that apply a tag missing from the update, because Fluxer removes a tag through the channel update alone. Either update also stops pending reads from storing that channel's threads
Other pending reads by ID, and reads of other communities, still store what they return, while a pending read of the channel's own community stores nothing, as after any channel update
Thread create and update events store the thread, a thread deletion clears it, and a thread list replaces the cached threads of its community or of its listed parent channels. A change to the bot's own membership of a thread clears that thread, because its membership field is then out of date
A full list removes missing channels, never threads, only when no conflicting observation overlaps the read. These snapshots are not a complete copy of the community's channels or threads
boolean | ResourceCacheSettings<GuildChannel>| boolean | ResourceCacheSettings<GuildChannel> directoptionalMessages -
Cache private conversations from explicit reads and complete channel events, without automatically listing them
A local lookup makes the item less likely to be removed for capacity, but does not extend its age limit. Targeted reads, mutations and channel events conflict only for the same conversation. Full-list reads, opening by user ID, account updates, connection gaps, clear and shutdown can prevent older responses from restoring the whole category
boolean | ResourceCacheSettings<DirectMessageChannel>| boolean | ResourceCacheSettings< DirectMessageChannel > emojisoptional-
Cache emoji metadata from REST reads and writes, not image bytes or creator accounts
A guild create event replaces this community's cached emojis with its complete list, and other community expression events clear observations.
Resourcecontrols bounds and expiry, while gaps and shutdown release snapshotsCache Settings boolean | ResourceCacheSettings<GuildEmoji>| boolean | ResourceCacheSettings<GuildEmoji> guildsoptional-
Cache community details from explicit reads and guild create or update events, without preloading members
Community removal or unavailability clears this community's cached resources, including channels
boolean | ResourceCacheSettings<Guild> membersoptional-
Cache individual memberships from explicit reads, REST pages, member add or update events and the members a guild create event lists, which are the bot's own and those in voice channels
The guild create events sent while a session starts list member accounts by ID only, so only the bot's own member, completed from READY's account, is stored from them
The member that Fluxer attaches to message create and update, reaction add and remove, and typing events refreshes it too, because Fluxer reads that member from the community's current state when it dispatches the event. It is stored whatever
messageFieldsselectsA reaction or typing member that arrives without the user's name is completed from the member already cached before it is stored. When the member of such an event does not decode, or the whole event is rejected as malformed, the account's cached member is removed because the cached copy may now be stale
When a rejected event does not identify the account, the community's cached members are removed, and when it does not identify the community either, every cached member is. A member that fails to decode logs
gateway. A voice state's member is never stored, because it can lag behind role edits.member Skipped The cache only receives these when Fluxer sends the events, so enabling it requests no extra dispatches and a bot that receives no such events fills it from reads alone. Member removal clears that membership. Successful or uncertain role assignment clears the target
boolean | ResourceCacheSettings<GuildMember>| boolean | ResourceCacheSettings<GuildMember> messagesoptional-
Cache messages encountered in eligible REST results and gateway events, without automatically requesting history
Omission or false disables this category, while true or an options object enables it. Updates replace snapshots, while deletions and uncertain mutations remove them. A thread deletion removes the thread's messages
Deleting a text, announcement, forum or media channel also deletes its threads without thread events, so it removes the messages of every channel in that community, or without community context, that the channel cache does not hold, and every such message when the channel cache is off
Lost gateway connections clear affected entries even when the session resumes successfully. Overlapping reads and events can cause cache misses. A response that differs from an overlapping event only by lacking its community ID keeps the event snapshot. Shutdown releases this client's references, not messages still held by the application
boolean | MessageCacheOptions<NoInfer<SelectedMessage<F>>>| boolean | MessageCacheOptions< NoInfer<SelectedMessage<F>> > rolesoptional-
Cache role definitions from explicit list, create or edit results and role events
Successful or uncertain creation or reordering clears this community's cached roles. Edits clear their target, or all this community's roles when changing
hoistPosition. Role deletion also clears cached memberships because assignments can change without individual member events. A full list removes missing roles only when no conflicting observation overlaps the readPartial bulk events replace only the roles they supply. A guild create event replaces this community's cached roles with its complete role list. The
roles.getAllmethod returns a community's roles only while that list is known complete, which a full list read establishes only while the community's shard is connectedThe entry limit counts the roles of every community together, so complete lists for many communities need a larger
maxEntries. The cache counts bigint permission fields as decimal strings when measuring bytesboolean | ResourceCacheSettings<GuildRole>| boolean | ResourceCacheSettings<GuildRole> stickersoptional-
Cache sticker metadata, with the same bounds, expiry and invalidation rules as emojis
boolean | ResourceCacheSettings<GuildSticker>| boolean | ResourceCacheSettings<GuildSticker> usersoptional-
Cache public account profiles from explicit reads and complete user events, not partial message authors
A local lookup makes the item less likely to be removed for capacity, but does not extend its age limit. Targeted reads conflict only with later observations of the same account, so unrelated IDs can both populate. Reads without a target ID, lost gateway connections, clear and shutdown can prevent older responses from restoring the whole category
boolean | ResourceCacheSettings<User>
connectionoptional#-
Set the startup deadline and retry limit used by both connect and run, and the recovery timing after readiness
maxoptionalStartup Attempts -
Maximum attempts to start each local shard, including its first attempt, as a positive safe integer
The SDK retries only failures it classifies as transient, and the overall deadline can stop retries sooner. This does not limit recovery attempts after a session has become ready
numberDefault
3 recoveryoptional-
Retry timing for established-session recovery
ConnectionRecoveryOptions startupoptionalTimeout Ms -
Total milliseconds allowed for startup, including instance discovery, retries and every local shard becoming ready
Must be an integer from 1 through 2,147,483,647. When this client owns several shards, the SDK spaces their new-session Identify commands by one second and adds one second to this deadline for each shard after the first, so the spacing alone never causes a timeout
The spacing does not coordinate quotas across processes or an IP address. An identify coordinator replaces it, and the coordinator's waits count against this deadline. Automatic sharding counts the bot's communities under a separate deadline of the same length before the shards start
Expiry stops startup work, while completion still waits for the SDK's owned-resource cleanup
numberDefault
30000
gatewayoptional#-
GatewayOptions instanceoptional#-
Select a self-hosted or other Fluxer instance instead of hosted Fluxer
Creation checks the root URL without a request. The first REST, gateway or
instance.resolveoperation that needs endpoints reads the unauthenticated discovery document. The client keeps those service addresses until shutdown and sends authenticated requests to them. HTTPS and WSS are required unlessallowInsecureexplicitly allows HTTP and WSInstanceOptions loggingoptional#-
Configure this client's log output without changing another client
By default the client prints Info and higher records to the console: Startup, shard readiness, connection loss with its close code and next step, rate-limit waits of at least one second, shutdown, and application errors in full. Raise or lower the level, adjust single categories, enable Debug records or send records to an application sink. Creation copies and checks these settings without printing anything. Records never contain tokens or other credentials. Logging does not consume or replace returned operation failures
LoggingOptionsimport { createClient } from "@neontechspace/fluxerly" export function loggingExample(token) { return createClient({ token, logging: { level: "info", categories: { rest: "debug" }, sink: (record) => console.log(JSON.stringify(record)), }, }) }import { createClient } from "@neontechspace/fluxerly" export function loggingExample(token: string) { return createClient({ token, logging: { level: "info", categories: { rest: "debug" }, sink: (record) => console.log(JSON.stringify(record)), }, }) } messageoptional#Fields -
Choose which optional message fields the application receives
Omit this setting for full Message output. An empty array keeps id,
channelId, content, author, type andguildId, where the last two are kept when the response supplies themFExcluded fields are absent, not undefined or empty arrays, in this client's REST, event, cache and collector results
Selecting a field includes its nested values. For example,
messageSnapshotskeeps its own media even when top-level media fields are excludedThis reduces the objects the SDK builds locally, not network payloads or data stored by Fluxer. The SDK still rejects malformed recognized response fields, even when they are excluded
Unknown field names and non-arrays fail with
ConfigurationErrorwhose field ismessageFields. Including core field names is allowed and does not change the required coreTypeScript knows the exact selection when given a literal tuple. For an array whose contents are unknown, optional fields remain optional. The copied selection lasts for this client's lifetime and does not affect separately created webhook clients or other resource types
import { createClient } from "@neontechspace/fluxerly" export function selectedMessagesExample(token) { return createClient({ token, messageFields: ["attachments", "messageReference"] }) }import { createClient } from "@neontechspace/fluxerly" export function selectedMessagesExample(token: string) { return createClient({ token, messageFields: ["attachments", "messageReference"] }) } observeoptional#-
Receive structured measurements of this client's work to export as metrics or traces to any monitoring system: Each REST request attempt with its route template, status and duration, rate-limit waits, reconnection attempts, resumed sessions, and each handler and command invocation with its duration and outcome
The observer runs synchronously when the measured work finishes and is independent of the logging settings. Observations never contain tokens, payloads or message content. An observer that throws is counted in
diagnostics().counters.sinkFailures without changing SDK work. The native API calls the same observer, in addition to its Effect metrics and spans. A value that is not a function fails creation withConfigurationErrorObserverimport { createClient } from "@neontechspace/fluxerly" export function observerExample(token, record) { return createClient({ token, observe: (observation) => { if (observation.type === "rest" || observation.type === "handler") record(observation) }, }) }import { createClient, type Observation } from "@neontechspace/fluxerly" export function observerExample(token: string, record: (observation: Observation) => void) { return createClient({ token, observe: (observation) => { if (observation.type === "rest" || observation.type === "handler") record(observation) }, }) } onoptional#Error -
Receive every failure that has no returned result: Event handler, command, collector callback and filter, cleanup progress and cache-callback failures, subscriptions stopped by overflow, and failed state observers
The report holds the original error and IDs of the message involved, never message content. A subscription's own
onErrortakes precedence for that subscription. Without a hook the SDK logs each failure at Error with its message, stack and cause chain. A failure only queues its reportReports are delivered one at a time in order. Up to 256 wait while the hook is busy, and later ones are logged instead, with
fields.reportOutcome"queueFull", and counted indiagnostics().counters.reportsDropped. A hook that throws or rejects is logged together with the original failure and is never retriedShutdown does not wait for a pending hook promise. The report it was handling and any queued ones are logged at Error instead, with
fields.reportOutcome"interrupted" for the report being handled and "clientClosed" for queued or later reports(report: FailureReport) => unknown restoptional#-
Tune how many REST requests this client runs and queues, and the default operation deadline
See
RestOptionsfor each limit and its defaultRestOptions shardingoptional#-
Divide community gateway traffic into numbered connections, called shards, and choose which this client owns
Omit this setting for one gateway connection, which moves to automatic sharding when Fluxer requires more shards, as described below. Omit
shardIdsto assign every shard intotalShardsto this client. Explicit IDs are copied in the supplied order and cannot change during this client's lifetimeUse non-overlapping ID lists when another supervisor distributes shards across processes. Shard zero receives direct-message traffic, so a client handling DMs must own ID zero. A total of one uses the single-connection Identify format, without a shard tuple
"auto" | ShardingOptionsThe value "auto", or
totalShards"auto", sizes the plan once, at the first connect, and assigns every shard to this client. The SDK counts the bot's communities by paging GET /users/@me/guilds withinstartupTimeoutMsand uses one shard per 2,000 communities, from 1 through 16,384 shardsIt never uses the shard count from GET /gateway/bot, which Fluxer fixes at 1. Fluxer rejects a new session with close code
4011(sharding required) when that one shard holds more than 2,500 communities (MAX_GUILDS_PER_SHARD influxer_)gateway/ src/ gateway/ gateway_ sharding .erl Community IDs do not split evenly across shards, so the lower target keeps every shard below that ceiling and leaves room to grow. Until that count completes,
client.shardsanddiagnostics().shards are empty and community routing treats every community as unownedA failed count fails startup like a connection failure: A rejected token with
AuthenticationError, an exhausted rate limit withRateLimitError, the deadline withConnectionand other failures withTimeout Error ConnectionErrorwhose phase is discovery, including a community list page that does not move past the previous oneWhen the bot grows and Fluxer closes a shard with
4011while the client runs, the SDK counts the communities again and moves every shard to a larger plan in the same process: The plan for the new count, or one shard more when the count still fits the old totalEvery shard then starts a new session under the new total, so events sent during the switch are missed and community-scoped caches refill from the new sessions. The SDK logs
lifecycle.reshardedat Warn with the old and new totals and keeps runningA failed count during a move ends the client with the same errors as a failed count at startup. After 3 such moves within an hour, or at 16,384 shards, a further 4011 ends the client with a
ConnectionErroras an explicit total does. Automatic sizing suits one process that owns every shardProcesses that split shards need an explicit total
A client without this setting makes the same move from its one shard when Fluxer closes it with
4011, so a bot that outgrows one connection keeps running instead of failing. Once the bot is in more than 2,500 communities, each start first opens a session that Fluxer rejects, which the value "auto" avoids. An explicit total, includingtotalShards1, never moves token#-
Bot token used to authenticate requests and gateway connections, commonly read from the process environment
Undefined is accepted so an environment value can be passed directly. Creation requires a non-blank string and otherwise fails with
ConfigurationError, whose hint names an unset environment variable as the likely cause. Surrounding whitespace and one pair of matching quotes, which .env files often add, are removed. A value that starts with a Bot or Bearer scheme is rejected, since the SDK adds the Bot scheme itself. Only Fluxer can establish whether the token is validstring | undefined transportoptional#-
Replace the HTTP and WebSocket implementations or the User-Agent this client sends
This is an advanced option for proxies, instrumentation and tests. See
TransportOptionsTransportOptions uploadsoptional#-
Bound the attachment transfer bytes reserved by queued and active upload operations
maxoptionalBytes -
Maximum reserved attachment transfer bytes across queued and active operations, as a positive safe integer
Defaults to 104,857,600 (100 MiB), separate from the
restqueued JSON budget (4 MiB by default). The SDK reserves accepted byte-array lengths, file sizes or declared stream sizes before waiting for a request slot. A new operation fails with busy if its reservation would exceed this limit. Reservations remain held across rate-limit retries and release after transport cleanup. This excludes caller buffers, metadata and runtime overhead, so it is not a JavaScript heap or process-memory ceiling.queued Json Max Bytes number
ConnectionRecoveryOptions #
Retry timing for shards that lost an established session
Startup retries keep their own timing within connection. Each recovery wait is a random delay from zero up to a ceiling that starts at minDelayMs and doubles per consecutive failure up to maxDelayMs, and never shorter than a wait Fluxer requires. Recovery never gives up on transient failures unless a native recovery schedule ends it. Creation validates every value and fails with ConfigurationError for other keys or out-of-range values
interface ConnectionRecoveryOptionsattemptoptional#Timeout Ms -
Time allowed for one recovery attempt in milliseconds, covering discovery, the handshake and Identify or Resume, an integer from 1,000 through 2,147,483,647
An attempt that runs out fails and is retried
numberDefault
30000 healthyoptional#Reset Ms -
Continuous connected time in milliseconds after which the next connection loss restarts the backoff sequence from
minDelayMs, an integer from 1,000 through 2,147,483,647Socket cleanup never counts as connected time
numberDefault
60000 maxoptional#Delay Ms -
Largest backoff ceiling in milliseconds, an integer from
minDelayMsthrough 2,147,483,647Defaults to 30,000, or to
minDelayMswhen that is largernumberDefault
30000 minoptional#Delay Ms -
Ceiling for the first recovery retry in milliseconds, an integer from 100 through 2,147,483,647
numberDefault
1000
ExpressionDeleteOptions #
Choose whether deleting a community emoji or sticker also requests removal of its image asset
The inherited timeout and auditReason follow Audited. Removing the image is a separate queued job. Deleting the community entry does not wait for it to finish
interface ExpressionDeleteOptions extends AuditedRequestOptionsinterface ExpressionDeleteOptions
extends AuditedRequestOptionsDeletion starts immediately. Aborting the signal awaits cleanup but cannot undo deletion or queued purging
purgeoptional#-
False/default removes the community entry without asking to purge its image
True additionally requests irreversible queued asset/CDN removal and requires Fluxer's expression-purge feature. HTTP success does not mean the purge job has finished. Failure after dispatch can leave either effect applied
boolean
Inherited from Audited: audit, signal, timeout
GatewayOptions #
Optional gateway settings: Malformed-dispatch handling and the fields sent in each new session's Identify
Creation validates and copies every value
interface GatewayOptionsflagsoptional#-
Identify session flags
Omission sets none. Creation rejects other keys and non-boolean values
debounceoptionalMessage Reactions -
Ask Fluxer to merge runs of reaction additions in direct messages and group direct messages into one
messageevent (MESSAGE_REACTION_ADD_MANY) instead of manyReaction Add Many messageReactionAddeventsCommunity reactions always arrive individually. This is Fluxer's DEBOUNCE_MESSAGE_REACTIONS flag, value 2. Defaults to false
boolean
ignoredoptional#Events -
Dispatch types Fluxer should not send to this client's sessions, to save bandwidth and decoding
Omission suppresses nothing. An array lists upper-case dispatch names such as TYPING_START or PRESENCE_UPDATE: Names may use letters, digits and underscores up to 64 characters, are upper-cased and deduplicated, and the list may hold at most 256 names that encode to at most 2,560 bytes, keeping Identify within Fluxer's 4,096-byte limit
Creation rejects READY, RESUMED and the request replies GUILD_MEMBERS_CHUNK, RATE_LIMITED, GUILD_COUNTS_UPDATE and CHANNEL_MEMBER_COUNTS_UPDATE, and any type an enabled cache category needs to stay current, with
ConfigurationErrorFluxer still delivers MESSAGE_CREATE for a message that directly mentions the bot, @here or @everyone, but not merely for a role mention, a direct message or a message the bot authored. A suppressed dispatch uses no sequence number
MESSAGE_REACTION_ADD_MANY batches are generated from unsuppressed MESSAGE_REACTION_ADD dispatches, so ignoring ADD prevents batches, while ignoring MANY alone does not. The list is fixed for each session, so changing an explicit list needs a new client. Resume retains the session's filtering
Registering an event whose source dispatch types are all suppressed receives nothing, apart from the message mention exceptions, and each new session logs
gatewayat Warn for such registrations.ignored Event Registered readonly string[] | "auto"The value "auto" computes the list at each new-session Identify from the events registered at that moment, through on, subscribe,
waitFor, collectors and command routers: Every dispatch type that delivers no registered event is suppressed, except those enabled cache categories, presence member selection (GUILD_CREATE) and cache clearing (GUILD_DELETE) need, READY, RESUMED, request replies and types this SDK version does not decodeMESSAGE_REACTION_ADD and MESSAGE_REACTION_REMOVE are always kept, because reaction pages started after Identify read clicks from them, so bots in busy guilds save less than the registrations alone suggest. A raw subscriber disables suppression entirely
The tradeoff: A handler registered after a session started does not receive suppressed types until that shard's next new session, which a Resume does not start, so register handlers before connecting. A
messageregistration keeps MESSAGE_REACTION_ADD for Fluxer's batch generatorReaction Add Many Cache categories keep their dispatch types whether or not an event is registered, so enabled caches reduce the savings
onoptional#Malformed Dispatch -
What to do when Fluxer sends a known dispatch that fails validation
The default, skip, drops that event, logs
gatewayat Warn with the dispatch type and failing field path, clears cache entries it could have changed and keeps the session running. When the dispatch lacks a usable channel or community ID, the entries it could have changed are found by message ID or cleared more widely. The value terminate ends the shard with a protocol.dispatch Rejected ConnectionErrorinstead, without the new-session retry that other invalid gateway data gets"skip" | "terminate" presenceoptional#-
Initial presence: The status each new session's Identify carries, and the first presence intent, as if
presence.setwere called with it before connectingA later
presence.setreplaces it, and later new sessions then Identify with the latest accepted presence. Because Fluxer may prefer the account's saved status to an Identify presence, the SDK also publishes the intent with a presence update after READY or RESUMED, as forpresence.set. Creation validates it likepresence.setand fails withConfigurationErrorfor invalid input. Omission sends no Identify presence, so Fluxer uses the account's saved statusPresenceInput
InstanceOptions #
Connect a client to a selected Fluxer server instead of the hosted default
Omit the whole option to use hosted Fluxer. When an operation first needs service addresses, the SDK reads /.well-known/fluxer from that server without credentials. It retains the resolved endpoints for this client's lifetime without background refresh
interface InstanceOptionsSelect only a trusted instance, since its advertised API and gateway origins can receive this client's credential. Discovery follows at most three validated unauthenticated redirects. Requests that send credentials do not follow redirects
allowoptional#Insecure -
Permit HTTP and WS endpoints only for an explicitly selected local or self-hosted instance
Defaults to false
boolean url#-
Absolute HTTPS root URL that publishes
/.well-known/fluxer, such as https://fluxer.exampleA path beyond /, query, fragment or embedded credentials is invalid. HTTP requires
allowInsecure, and omitting the whole instance option selects hosted Fluxerstring
OperationOptions #
Add cancellation to a default-API operation with an AbortController's signal
Aborting affects this operation's owned work, not unrelated calls
interface OperationOptionssignaloptional#-
Pass an AbortController's signal to cancel this operation and await its required cleanup
An already-aborted signal cancels before the operation takes ownership. For connect it controls startup only, so aborting after READY does not close the established connection. For an accepted run it controls the full client lifetime, but
waitForClosecancels only that observerCancellation cannot undo a dispatched server mutation, and a later abort cannot undo completed work. A malformed signal returns
ConfigurationErrorwith field signal before work starts, or on a lazy iterator's first nextThrowing signal accessors or listener methods are application faults rather than typed input failures, rejected as
SdkDefectwith codeapplication.defectand the thrown value as its cause. Shutdown does not accept a signalOperationSignal
OperationSignal #
The AbortSignal members used by default-API operations
A standard AbortController provides this shape without requiring DOM types in the TypeScript project
interface OperationSignalaborted#-
Whether cancellation has already been requested
boolean
addEventListener #
Register the callback that requests operation cancellation when the signal aborts
addEventListener(
type: "abort",
listener: () => void,
options?: { once?: boolean }
): voidaddEventListener(
type: "abort",
listener: () => void,
options?: { once?: boolean }
): voidParameters
type-
"abort" listener-
() => void optionsoptional-
onceoptional-
Remove this listener automatically after its first abort event
boolean
removeEventListener #
Remove the operation's callback when its observation ends
removeEventListener(type: "abort", listener: () => void): voidremoveEventListener(
type: "abort",
listener: () => void
): voidParameters
type-
"abort" listener-
() => void
OwnMessageDeletionOptions #
Required confirmation and deadline for deleting this bot's entire authored history in a channel or community
The confirm field must be the literal true, so an accidental call without it fails before any request with reason input and inputValidation path options.confirm
interface OwnMessageDeletionOptions extends RequestOptionsinterface OwnMessageDeletionOptions
extends RequestOptionsAborting the signal cannot undo a dispatched deletion
confirm#-
Must be true to acknowledge that the deletion is irreversible and cannot be rolled back
true
Inherited from Request: signal, timeout
PaginationQuery #
Read a Fluxer list one page at a time through an iterator or Effect Stream
Set item and page limits. Set maxItems to limit the number of delivered items. The SDK requests the next page only after the current one is consumed
interface PaginationQueryEach consumption of the iterator or Stream starts independently and copies the inputs then, not at creation
Early exit, failure, interruption and client shutdown release that consumption's buffered page and tracking state. Already-delivered items remain with the caller
The SDK does not fetch ahead, persist results or remove duplicates across separate consumptions
Each page uses its own request deadline. The item and page caps do not provide a total elapsed-time deadline. Changes on Fluxer during traversal can cause the pages to differ from a single complete snapshot
max#Items -
Maximum items to deliver, a required positive safe integer
Reaching this cap finishes normally, without proving remote exhaustion
number maxoptional#Pages -
Maximum page requests, a positive safe integer
Defaults to the pages
maxItemsneeds atpageSizeplus 100 spare pages for short pages and skipped duplicates, so a caller who sets onlymaxItemsis not stopped by the page count when pages are full. The default stays finite, so a server that returns far less than asked still ends withpageLimitSet a lower value to cap requests. Retrying a request for the same page does not use another page allowance. Duplicate-only pin pages do count. Needing a further page after this allowance fails with
PaginationErrorreasonpageLimit, preserving already-delivered itemsnumber pageoptional#Size -
Maximum items to request per page, reduced when fewer items remain under
maxItemsHistory defaults to 50 with a range of 1 through 100, members to 100 with 1 through 1,000. Community memberships default to 200 with 1 through 200, reaction users to 25 with 1 through 100. Pins default to 50 with 1 through 50, audit logs to 50 with 1 through 100. Member search defaults to 100 with 1 through 100, message search to 25 with 1 through 25
number
PermissionFetchOptions #
Settings for permissions.fetch: The shared deadline of its reads, and whether enabled caches may replace them
interface PermissionFetchOptions extends RequestOptionsinterface PermissionFetchOptions
extends RequestOptionsAborting the signal cancels only this call and awaits owned cleanup
preferoptional#Cache -
Read each observation from an enabled cache before fetching it, such as to decide for every command without a request
Default false, which fetches every observation fresh. The guild, member and channel come from their caches when present, and the roles when the everyone role and every member role are all cached, otherwise one list read replaces all of them
A cached channel without its overwrite list is fetched, and a thread's parent channel is read the same way. Only fetches count toward the deadline. Cached observations reflect the last applied gateway events, so they can differ from Fluxer, and their snapshots can come from different moments
Cached entries stay while a shard can resume and are cleared when a new session starts, after which they are fetched. Use the default right before an action where a stale grant matters. With the caches disabled, the call behaves as it does by default
A value that is not a boolean fails with reason input
boolean
Inherited from Request: signal, timeout
RequestOptions #
Settings for one remote operation: Its deadline and an optional AbortSignal
Methods document what their deadline and cancellation cover beyond these rules
interface RequestOptions extends OperationOptionsinterface RequestOptions
extends OperationOptionstimeoutoptional#Ms -
Total milliseconds for this call, an integer from 1 through 2,147,483,647
For a bot client's REST calls it covers local queueing, rate-limit waits, retries and HTTP, and defaults to the client's
rest, 30,000 unless configured. Calls outside a bot client's REST settings, such as standalone webhook clients, OAuth, instance discovery and gateway counts, default to 30,000. Owned cleanup is awaited afterward, so the call can finish later than this deadline.default Timeout Ms number
Inherited from Operation: signal
RestOptions #
Tune how many REST requests one client runs and queues, and the deadline an operation gets when it omits timeoutMs
Every limit is local to the client: Clients, processes and webhook or OAuth clients sharing a credential do not share these slots. Invalid values throw ConfigurationError from default createClient, naming the field, and are defects in the Effect createClient. Diagnostics report the configured capacities under rest
interface RestOptionsimport { createClient } from "@neontechspace/fluxerly"
export const client = createClient({
token: "fixture-only-not-a-credential",
rest: { concurrency: 8, maxQueued: 512, defaultTimeoutMs: 15_000 },
})
import { createClient } from "@neontechspace/fluxerly"
export const client = createClient({
token: "fixture-only-not-a-credential",
rest: { concurrency: 8, maxQueued: 512, defaultTimeoutMs: 15_000 },
})
concurrencyoptional#-
Fluxer API requests, including signed attachment upload parts, that may run at once
An integer from 1 through 64. The default is 4 for each shard this client runs, up to 64, and follows the plan when automatic sharding sizes or enlarges it. A set value is used as given, whatever the shard count. Raising it does not raise Fluxer's rate limits, which still apply per route
numberDefault
4 per local shard, at most 64 defaultoptional#Timeout Ms -
Deadline in milliseconds for a REST operation or attachment download that omits
timeoutMsIt covers local queueing, rate-limit waits, retries and HTTP. An integer from 1 through 2,147,483,647, default 30,000
number maxoptional#Queued -
Requests of both kinds that may wait for a slot or a rate-limit window
A request that finds the queue full fails immediately with reason busy and outcome
notDispatched, and the first such failure in a minute logsrest.busyat Warn. An integer from 1 through 65,536, default 256number mediaoptional#Concurrency -
Attachment downloads that may run at once, in slots separate from API requests so a lazy upload source can still read its own attachment
An integer from 1 through 64, default 4
number queuedoptional#Json Max Bytes -
JSON request-body bytes that waiting requests may hold together, excluding attachment transfers
A request whose JSON does not fit fails immediately with reason busy, so this also caps the largest single JSON body. An integer from 65,536 (64 KiB) through 268,435,456 (256 MiB), default 4,194,304 (4 MiB)
number
RunBotOptions #
Configure how runBot stops
Importing the SDK does not register process signal handlers, only a running bot does
interface RunBotOptionsdrainoptional#Ms -
Milliseconds that a requested stop lets running work finish before cancelling it, default 5,000
A stop is requested by the signal option or, with
processSignalsenabled, by SIGINT or SIGTERM. The bot then accepts no new events, while running handlers and commands, events already waiting for them and REST requests continue until they finish or the time runs out. Then the bot shuts down as usualThe default fits within the 10 seconds that common process managers, such as Docker, wait before force-stopping a process. Pass a larger value when the platform waits longer, or 0 to cancel running handlers at once. A stop caused by a failure does not drain. See
ShutdownOptionsfor the details of a drainAccepts an integer from 0 through 2,147,483,647, and another value throws
ConfigurationErrornumber processoptional#Signals -
Handle SIGINT and SIGTERM for this run only, as a requested stop that drains for
drainMsThe handlers are added when the run starts and removed once its cleanup finishes, and the runner never exits the process. The default API enables this unless the option is false. The Effect API enables it only when the option is true, because a launcher such as
NodeRuntime.runMainalready interrupts the program on these signalsEach signal is handled once, so sending the same signal again, such as a second Ctrl+C, ends the process at once with Node.js's default behavior instead of waiting for the drain
boolean reportoptional#Failure -
Report a failed run for the process, enabled by default
When the bot stops because of a failure,
runBotlogs that failure once as an Error record with codelifecycle.botFailed, unless the client already logged the same error, and setsprocess.exitCodeto 1 so the process exits with a failure status. The failure is still returned as wellReports before client creation use the configured logging settings and mask the token after removing surrounding whitespace and one pair of matching quotes. Unusable logging settings fall back to the entry point's default output. In the native API, a throwing option getter does not discard readable token, logging or
reportFailuresettingsAn unreadable
reportFailuresetting keeps reporting enabled. Default API misuse and option-getter failures throw synchronously without a runner report or exit-status change. A normal stop and an interruption report nothing. Set false when the application handles the returned failure and owns the exit status itselfboolean signaloptional#-
Stop and close the bot when this signal aborts, as a normal stop
If already aborted, the configuration is still checked and misuse is still reported, but no client is created and the run succeeds at once
OperationSignal
TimeoutOptions #
Timeout-only request settings
A timeoutReason is provider audit metadata, not a stored GuildMember field
interface TimeoutOptions extends AuditedRequestOptionsinterface TimeoutOptions
extends AuditedRequestOptionsTimeout changes begin immediately. Aborting the signal waits for owned cleanup but cannot roll back a dispatched timeout change
timeoutoptional#Reason -
Optional timeout audit metadata
Null or omission sends no meaningful reason. A string must contain 1–512 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming. The original string is sent unchanged
string | null
Inherited from Audited: audit, signal, timeout
TimeoutStateOptions #
Settings for members.timeoutState
interface TimeoutStateOptionsnowoptional#-
Moment to evaluate the timeout at, such as to test a snapshot or a future time
Default the wall time of the Clock that the client was created with
Date
TransportOptions #
Replace the HTTP and WebSocket implementations one client uses, or the User-Agent it sends
This is an advanced option for proxies, instrumentation and tests, and most bots omit it. Replacements receive every request the client makes, including instance discovery, REST, signed attachment upload parts, attachment downloads and gateway connections, so they see the bot token in Authorization headers and must protect it. The SDK keeps its own redirect, deadline, cancellation, size and rate-limit policies around them. Invalid values throw ConfigurationError from default createClient, naming the field, and are defects in the Effect createClient
interface TransportOptionsimport { createClient } from "@neontechspace/fluxerly"
export const client = createClient({
token: "fixture-only-not-a-credential",
transport: { userAgent: "ExampleBot/1.0 (+https://example.test/bot)" },
})
import { createClient } from "@neontechspace/fluxerly"
export const client = createClient({
token: "fixture-only-not-a-credential",
transport: { userAgent: "ExampleBot/1.0 (+https://example.test/bot)" },
})
fetchoptional#-
Fetch-compatible function for every HTTP request, called without a this value
It must honour
init.signalandinit.redirectas the platform fetch does, and settle with a Response or reject. A rejection or synchronous throw is a network failure of that request. Defaults to the platform fetch(url: string, init: RequestInit) => Promise<Response>(url: string, init: RequestInit) => Promise<Response> useroptional#Agent -
User-Agent header sent with every HTTP request and gateway handshake, replacing the default
Fluxerly.js/<version> ( +<SDK homepage>) From 1 through 512 printable ASCII characters without leading or trailing spaces
string weboptional#Socket -
Open one gateway WebSocket for the URL, applying every
WebSocketOptionssettingIt must return a
WebSocketLikesynchronously and report connection failures as error or close events. A synchronous throw or an unusable return value is an SDK defect. Defaults to the ws library(url: string, options: WebSocketOptions) => WebSocketLike( url: string, options: WebSocketOptions ) => WebSocketLike
WebSocketLike #
The subset of a ws WebSocket that the gateway uses
A custom WebSocket factory returns this shape. Connection failures must arrive as error or close events, never as synchronous throws from send or the factory
interface WebSocketLikeready#State -
Ready state in the ws and WHATWG numbering: 0 connecting, 1 open, 2 closing, 3 closed
number
close#
Start a close handshake with the given WebSocket close code
The close event follows
close(code: number): voidParameters
code-
number
off#
Remove a message listener added with on
off(
event: "message",
listener: (
data:
| string
| ArrayBuffer
| Uint8Array<ArrayBufferLike>
| readonly Uint8Array<ArrayBufferLike>[],
binary: boolean
) => void
): unknownoff(
event: "message",
listener: (
data:
| string
| ArrayBuffer
| Uint8Array<ArrayBufferLike>
| readonly Uint8Array<
ArrayBufferLike
>[],
binary: boolean
) => void
): unknownParameters
event-
"message" listener-
( data: | string | ArrayBuffer | Uint8Array<ArrayBufferLike> | readonly Uint8Array<ArrayBufferLike>[], binary: boolean ) => void( data: | string | ArrayBuffer | Uint8Array<ArrayBufferLike> | readonly Uint8Array< ArrayBufferLike >[], binary: boolean ) => void
- Returns
unknown
Remove an error listener added with on
off(
event: "error",
listener: (error: Error & { code?: string }) => void
): unknownoff(
event: "error",
listener: (
error:
& Error
& { code?: string }
) => void
): unknownParameters
event-
"error" listener-
(error: Error & { code?: string }) => void(error: Error & { code?: string }) => void
- Returns
unknown
Remove a close listener added with on or once
off(
event: "close",
listener: (() => void) | ((code: number) => void)
): unknownoff(
event: "close",
listener:
| (() => void)
| ((code: number) => void)
): unknownParameters
event-
"close" listener-
(() => void) | ((code: number) => void)| (() => void) | ((code: number) => void)
- Returns
unknown
on#
Receive each message with binary true for binary frames
Text arrives as bytes, as ws delivers it (a Buffer is a Uint8Array), or as a string
on(
event: "message",
listener: (
data:
| string
| ArrayBuffer
| Uint8Array<ArrayBufferLike>
| readonly Uint8Array<ArrayBufferLike>[],
binary: boolean
) => void
): unknownon(
event: "message",
listener: (
data:
| string
| ArrayBuffer
| Uint8Array<ArrayBufferLike>
| readonly Uint8Array<
ArrayBufferLike
>[],
binary: boolean
) => void
): unknownParameters
event-
"message" listener-
( data: | string | ArrayBuffer | Uint8Array<ArrayBufferLike> | readonly Uint8Array<ArrayBufferLike>[], binary: boolean ) => void( data: | string | ArrayBuffer | Uint8Array<ArrayBufferLike> | readonly Uint8Array< ArrayBufferLike >[], binary: boolean ) => void
- Returns
unknown
Receive transport failures
An optional code identifies local receive rejections such as oversized messages
on(
event: "error",
listener: (error: Error & { code?: string }) => void
): unknownon(
event: "error",
listener: (
error:
& Error
& { code?: string }
) => void
): unknownParameters
event-
"error" listener-
(error: Error & { code?: string }) => void(error: Error & { code?: string }) => void
- Returns
unknown
Receive the close code once the connection has closed
on(event: "close", listener: (code: number) => void): unknownon(
event: "close",
listener: (code: number) => void
): unknownParameters
event-
"close" listener-
(code: number) => void
- Returns
unknown
once#
Receive the next close once, used while waiting for a close handshake to finish
once(event: "close", listener: () => void): unknownonce(
event: "close",
listener: () => void
): unknownParameters
event-
"close" listener-
() => void
- Returns
unknown
send#
Send one text frame, then call callback once, with an error when the frame could not be written
send(data: string, callback: (error?: Error) => void): voidsend(
data: string,
callback: (error?: Error) => void
): voidParameters
data-
string callback-
(error?: Error) => void
terminate#
Drop the connection immediately without a close handshake
The close event follows
terminate(): voidWebSocketOptions #
Options the gateway passes to a custom WebSocket factory for each connection it opens
A factory that uses the ws library can pass them to its constructor unchanged
interface WebSocketOptionsfollow#Redirects -
Always false: The gateway URL is used as given and a redirect fails the connection attempt
false headers#-
Handshake headers to send
Contains the client's User-Agent
Readonly<Record<string, string>> max#Payload -
Largest accepted message in bytes
The socket must reject a larger message, including fragments, before decoding it
number per#Message Deflate -
Always false: Compression is never negotiated, so received sizes are wire sizes
false
WebhookMessageOperationOptions #
Request settings for fetching, editing or deleting a message that a webhook client sent
interface WebhookMessageOperationOptions extends RequestOptionsinterface WebhookMessageOperationOptions
extends RequestOptionsAborting the signal cancels this request, not the webhook client
Inherited from Request: signal, timeout